Skip to content

Commit b8e65f5

Browse files
committed
Merge remote-tracking branch 'origin/main' into perf/simd_borrowed
2 parents ae3f85d + 0c268e1 commit b8e65f5

File tree

7 files changed

+29
-1
lines changed

7 files changed

+29
-1
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ jobs:
5151
- name: Build cache by Cargo Check and Cargo Test
5252
if: ${{ github.ref_name == 'main' }}
5353
run: cargo test --all-features --no-run
54+
env:
55+
RUST_MIN_STACK: 8388608
5456
- name: Prettier Check
5557
if: ${{ matrix.os != 'windows-latest' }}
5658
run: |
@@ -201,6 +203,8 @@ jobs:
201203
cache-key: warm
202204
- run: cargo test --doc
203205
- run: cargo test --all-features
206+
env:
207+
RUST_MIN_STACK: 8388608
204208
- name: Test Node Bindings
205209
run: |
206210
npm run build:binding:debug

.github/workflows/codecov.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
components: llvm-tools-preview
3535

3636
- run: cargo llvm-cov --lcov --output-path lcov.info
37+
env:
38+
RUST_MIN_STACK: 8388608
3739

3840
- name: Upload Artifact
3941
uses: actions/upload-artifact@v4

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ package_json_raw_json_api = []
118118
## [Yarn Plug'n'Play](https://yarnpkg.com/features/pnp)
119119
yarn_pnp = ["pnp"]
120120
# For codspeed benchmark
121-
codspeed = ["criterion2/codspeed"]
121+
codspeed = ["criterion2/codspeed" ]
122+
# For remove tracing calls in release build
123+
enable_instrument=[]
122124

123125
[package.metadata.docs.rs]
124126
all-features = true

src/cache.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ impl CachedPathImpl {
268268
/// # Errors
269269
///
270270
/// * [ResolveError::JSON]
271+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, skip_all, fields(path = %self.path.display())))]
271272
pub async fn find_package_json<Fs: FileSystem + Send + Sync>(
272273
&self,
273274
fs: &Fs,
@@ -298,6 +299,7 @@ impl CachedPathImpl {
298299
/// # Errors
299300
///
300301
/// * [ResolveError::JSON]
302+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, skip_all, fields(path = %self.path.display())))]
301303
pub async fn package_json<Fs: FileSystem + Send + Sync>(
302304
&self,
303305
fs: &Fs,

src/lib.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
233233
}
234234

235235
/// Wrap `resolve_impl` with `tracing` information
236+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, skip_all, fields(path = %directory.to_string_lossy(), specifier = specifier)))]
236237
async fn resolve_tracing(
237238
&self,
238239
directory: &Path,
@@ -429,6 +430,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
429430
}
430431

431432
// 3. If X begins with './' or '/' or '../'
433+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, skip_all, fields(specifier = specifier, path = %cached_path.path().to_string_lossy())))]
432434
async fn require_relative(
433435
&self,
434436
cached_path: &CachedPath,
@@ -476,6 +478,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
476478
.await
477479
}
478480

481+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, skip_all, fields(specifier = specifier)))]
479482
async fn require_bare(
480483
&self,
481484
cached_path: &CachedPath,
@@ -527,6 +530,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
527530
Ok((parsed, None))
528531
}
529532

533+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, skip_all, fields(specifier = specifier, path = %cached_path.path().to_string_lossy())))]
530534
async fn load_package_self_or_node_modules(
531535
&self,
532536
cached_path: &CachedPath,
@@ -576,6 +580,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
576580
Ok(None)
577581
}
578582

583+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, skip_all, fields(path = %cached_path.path().to_string_lossy())))]
579584
async fn load_as_file(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult {
580585
// enhanced-resolve feature: extension_alias
581586
if let Some(path) = self.load_extension_alias(cached_path, ctx).await? {
@@ -638,6 +643,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
638643
self.load_index(cached_path, ctx).await
639644
}
640645

646+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, skip_all, fields(specifier = specifier, path = %cached_path.path().to_string_lossy())))]
641647
async fn load_as_file_or_directory(
642648
&self,
643649
cached_path: &CachedPath,
@@ -665,6 +671,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
665671
Ok(None)
666672
}
667673

674+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, skip_all, fields(path = %path.path().to_string_lossy())))]
668675
async fn load_extensions(
669676
&self,
670677
path: &CachedPath,
@@ -687,6 +694,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
687694
Ok(None)
688695
}
689696

697+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, skip_all, fields(path = %cached_path.path().to_string_lossy())))]
690698
async fn load_realpath(
691699
&self,
692700
cached_path: &CachedPath,
@@ -736,6 +744,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
736744
true
737745
}
738746

747+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, skip_all, fields(path = %cached_path.path().to_string_lossy())))]
739748
async fn load_index(&self, cached_path: &CachedPath, ctx: &mut Ctx) -> ResolveResult {
740749
for main_file in &self.options.main_files {
741750
let main_path = cached_path.path().normalize_with(main_file);
@@ -789,6 +798,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
789798
Ok(None)
790799
}
791800

801+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, skip_all, fields(specifier = specifier, path = %cached_path.path().to_string_lossy())))]
792802
async fn load_node_modules(
793803
&self,
794804
cached_path: &CachedPath,
@@ -870,6 +880,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
870880
}
871881

872882
#[cfg(feature = "yarn_pnp")]
883+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, skip_all, fields(path = %cached_path.path().to_string_lossy())))]
873884
fn find_pnp_manifest(
874885
&self,
875886
cached_path: &CachedPath,
@@ -896,6 +907,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
896907
}
897908

898909
#[cfg(feature = "yarn_pnp")]
910+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, skip_all, fields(specifier = specifier, path = %cached_path.path().to_string_lossy())))]
899911
async fn load_pnp(
900912
&self,
901913
cached_path: &CachedPath,
@@ -999,6 +1011,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
9991011
Ok(None)
10001012
}
10011013

1014+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, skip_all, fields(specifier = specifier, path = %cached_path.path().to_string_lossy())))]
10021015
async fn load_package_self(
10031016
&self,
10041017
cached_path: &CachedPath,
@@ -1042,6 +1055,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
10421055
}
10431056

10441057
/// RESOLVE_ESM_MATCH(MATCH)
1058+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, skip_all, fields(specifier = specifier, path = %cached_path.path().to_string_lossy())))]
10451059
async fn resolve_esm_match(
10461060
&self,
10471061
specifier: &str,
@@ -1081,6 +1095,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
10811095
}
10821096

10831097
/// enhanced-resolve: AliasFieldPlugin for [ResolveOptions::alias_fields]
1098+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, skip_all, fields(specifier = module_specifier, path = %cached_path.path().to_string_lossy())))]
10841099
async fn load_browser_field(
10851100
&self,
10861101
cached_path: &CachedPath,
@@ -1345,6 +1360,7 @@ impl<Fs: FileSystem + Send + Sync> ResolverGeneric<Fs> {
13451360
Ok(None)
13461361
}
13471362

1363+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, skip(self), fields(path = path.display().to_string())))]
13481364
fn load_tsconfig<'a>(
13491365
&'a self,
13501366
root: bool,

src/package_json/seder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ pub struct PackageJson {
4040
impl PackageJson {
4141
/// # Panics
4242
/// # Errors
43+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, name="pkgjson_parse", skip_all, fields(path = %realpath.display())))]
4344
pub(crate) fn parse(
4445
path: PathBuf,
4546
realpath: PathBuf,

src/tsconfig.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ pub struct ProjectReference {
7575
}
7676

7777
impl TsConfig {
78+
#[cfg_attr(feature="enable_instrument", tracing::instrument(level=tracing::Level::DEBUG, skip_all, fields(path = %path.to_string_lossy())))]
7879
pub fn parse(root: bool, path: &Path, json: &mut str) -> Result<Self, serde_json::Error> {
7980
_ = json_strip_comments::strip(json);
8081
if json.trim().is_empty() {

0 commit comments

Comments
 (0)