Skip to content

Commit 47698b6

Browse files
committed
chore: reproduce global cache issue
1 parent 21b071a commit 47698b6

File tree

9 files changed

+237
-5
lines changed

9 files changed

+237
-5
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,24 @@ jobs:
2222
with:
2323
save-cache: ${{ github.ref_name == 'main' }}
2424

25-
- run: cargo check
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: lts/*
28+
29+
- name: Prepare fixtures
30+
run: |
31+
corepack enable
32+
cd fixtures/global-cache
33+
yarn install
34+
35+
- name: Build
36+
run: cargo build
37+
38+
- name: Check
39+
run: cargo check
2640

27-
- run: cargo test
41+
- name: Run tests
42+
run: cargo test
2843

2944
clippy:
3045
runs-on: ubuntu-latest

Cargo.lock

Lines changed: 141 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ thiserror = "2"
2323
rustc-hash = "2"
2424

2525
[dev-dependencies]
26+
dirs = "6.0.0"
2627
rstest = "0.25.0"
2728

2829
[features]

fixtures/global-cache/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.yarn/*
2+
.pnp.*

fixtures/global-cache/.yarnrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
enableGlobalCache: true
2+
3+
nodeLinker: pnp

fixtures/global-cache/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "global-cache",
3+
"dependencies": {
4+
"source-map-support": "^0.5.21"
5+
},
6+
"packageManager": "[email protected]"
7+
}

fixtures/global-cache/yarn.lock

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This file is generated by running "yarn install" inside your project.
2+
# Manual changes might be lost - proceed with caution!
3+
4+
__metadata:
5+
version: 8
6+
cacheKey: 10c0
7+
8+
"buffer-from@npm:^1.0.0":
9+
version: 1.1.2
10+
resolution: "buffer-from@npm:1.1.2"
11+
checksum: 10c0/124fff9d66d691a86d3b062eff4663fe437a9d9ee4b47b1b9e97f5a5d14f6d5399345db80f796827be7c95e70a8e765dd404b7c3ff3b3324f98e9b0c8826cc34
12+
languageName: node
13+
linkType: hard
14+
15+
"global-cache@workspace:.":
16+
version: 0.0.0-use.local
17+
resolution: "global-cache@workspace:."
18+
dependencies:
19+
source-map-support: "npm:^0.5.21"
20+
languageName: unknown
21+
linkType: soft
22+
23+
"source-map-support@npm:^0.5.21":
24+
version: 0.5.21
25+
resolution: "source-map-support@npm:0.5.21"
26+
dependencies:
27+
buffer-from: "npm:^1.0.0"
28+
source-map: "npm:^0.6.0"
29+
checksum: 10c0/9ee09942f415e0f721d6daad3917ec1516af746a8120bba7bb56278707a37f1eb8642bde456e98454b8a885023af81a16e646869975f06afc1a711fb90484e7d
30+
languageName: node
31+
linkType: hard
32+
33+
"source-map@npm:^0.6.0":
34+
version: 0.6.1
35+
resolution: "source-map@npm:0.6.1"
36+
checksum: 10c0/ab55398007c5e5532957cb0beee2368529618ac0ab372d789806f5718123cc4367d57de3904b4e6a4170eb5a0b0f41373066d02ca0735a0c4d75c7d328d3e011
37+
languageName: node
38+
linkType: hard

src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,10 @@ pub fn resolve_to_unqualified_via_manifest<P: AsRef<Path>>(
341341
}
342342
}?;
343343

344-
Ok(Resolution::Resolved(dependency_pkg.package_location.clone(), module_path))
344+
Ok(Resolution::Resolved(
345+
dependency_pkg.package_location.clone(),
346+
module_path,
347+
))
345348
} else {
346349
let broken_ancestors = find_broken_peer_dependencies(specifier, parent_locator);
347350

0 commit comments

Comments
 (0)