Repository navigation
fix(injected-deps-syncer): skip inodes that cannot be hardlinked - #13663
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR changes injected dependency syncing to skip unsupported inode types instead of failing. It adds FIFO regression tests, blocker-replacement handling, test dependencies, and patch release metadata. ChangesInjected dependency inode handling
Estimated code review effort: 3 (Moderate) | ~20 minutes
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the prior misleading cleanup description was corrected, and the target inode collision is handled for both file and directory replacements with ordering that preserves newly linked contents. Reviews (6): Last reviewed commit: "fix(injected-deps-syncer): put a replace..." | Re-trigger Greptile |
Integrated-Benchmark Report (Linux)Commit: Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time). Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.67935348866,
"stddev": 0.22098134758419916,
"median": 2.64511665866,
"user": 2.15440724,
"system": 1.7664053,
"min": 2.41007996666,
"max": 3.02573005966,
"times": [
2.4803027706600003,
3.02573005966,
2.55499102366,
2.9217094926600002,
2.49751255366,
2.88342953166,
2.80443966066,
2.48009753366,
2.73524229366,
2.41007996666
]
},
{
"command": "pacquet@main",
"mean": 2.63221471296,
"stddev": 0.14590663783978955,
"median": 2.6799355371600004,
"user": 1.88413544,
"system": 1.5351960999999998,
"min": 2.38480888766,
"max": 2.7808885396600003,
"times": [
2.43962081866,
2.38480888766,
2.6876462396600003,
2.66013688566,
2.7309820996600003,
2.76451422866,
2.46558753066,
2.67222483466,
2.7808885396600003,
2.7357370646600003
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5116878654600001,
"stddev": 0.11899471968196912,
"median": 1.4906139836599999,
"user": 1.35244324,
"system": 1.4102627999999997,
"min": 1.37721111966,
"max": 1.7150039116600002,
"times": [
1.6327013776600001,
1.50091868666,
1.42452391866,
1.48030928066,
1.56294567666,
1.6332269076600001,
1.4000914956600001,
1.3899462796600002,
1.37721111966,
1.7150039116600002
]
},
{
"command": "pnpr@main",
"mean": 1.54877834206,
"stddev": 0.139538965558543,
"median": 1.59884474466,
"user": 1.15544774,
"system": 1.1886622999999998,
"min": 1.36303212866,
"max": 1.76536629066,
"times": [
1.76536629066,
1.36976916066,
1.4211003776600002,
1.5837476916600002,
1.6139417976600001,
1.6633749766600001,
1.4397562426600001,
1.61770207366,
1.36303212866,
1.64999268066
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2646076696,
"stddev": 0.00622392526780559,
"median": 0.2643326803,
"user": 0.22696462,
"system": 0.5419289599999998,
"min": 0.2547871933,
"max": 0.2766581153,
"times": [
0.2646964053,
0.2629282743,
0.26423287230000003,
0.2652545373,
0.2547871933,
0.2611308873,
0.2644324883,
0.2766581153,
0.25935531230000003,
0.2726006103
]
},
{
"command": "pacquet@main",
"mean": 0.2623747181,
"stddev": 0.005995427983694522,
"median": 0.26126540080000005,
"user": 0.21985092,
"system": 0.55074036,
"min": 0.2560425793,
"max": 0.27618099630000004,
"times": [
0.2643717343,
0.2601203333,
0.2567669643,
0.26715388630000003,
0.2560425793,
0.2594481563,
0.2633424243,
0.26241046830000003,
0.27618099630000004,
0.2579096383
]
},
{
"command": "pnpr@HEAD",
"mean": 0.27293369479999996,
"stddev": 0.003726979321268765,
"median": 0.2715287053,
"user": 0.24738951999999997,
"system": 0.51990186,
"min": 0.26955243630000003,
"max": 0.28080703430000004,
"times": [
0.2720439813,
0.2705340563,
0.28080703430000004,
0.26955243630000003,
0.2725934063,
0.2705871763,
0.2710134293,
0.26961555530000003,
0.2752639583,
0.27732591430000003
]
},
{
"command": "pnpr@main",
"mean": 0.27874874149999995,
"stddev": 0.006119810859770374,
"median": 0.27818376580000004,
"user": 0.24444881999999998,
"system": 0.53673056,
"min": 0.2666796833,
"max": 0.2884413393,
"times": [
0.2784405453,
0.2873944773,
0.2774063463,
0.2792005473,
0.27713085730000003,
0.2884413393,
0.2748011363,
0.2779269863,
0.2800654963,
0.2666796833
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.5990647418000004,
"stddev": 0.017654385579895435,
"median": 2.5960515669,
"user": 1.6045213,
"system": 1.34013294,
"min": 2.5789555974,
"max": 2.6239728984,
"times": [
2.6002601394,
2.5930200714,
2.5831947634,
2.5990830623999996,
2.5789555974,
2.6239728984,
2.5877594613999997,
2.5809471694,
2.6236317554,
2.6198224994
]
},
{
"command": "pacquet@main",
"mean": 2.6018947403999997,
"stddev": 0.019258303021069414,
"median": 2.6077052033999997,
"user": 1.5807556,
"system": 1.3586391399999997,
"min": 2.5535617524,
"max": 2.6197396133999997,
"times": [
2.6008149144,
2.6134710454,
2.5921887353999997,
2.6118209564,
2.6079961313999998,
2.6172527683999998,
2.6074142753999996,
2.5946872113999997,
2.6197396133999997,
2.5535617524
]
},
{
"command": "pnpr@HEAD",
"mean": 1.7151052607999997,
"stddev": 0.13426924057648087,
"median": 1.7227605954,
"user": 1.1273353,
"system": 1.1376074399999998,
"min": 1.4942613034,
"max": 1.8609019554000001,
"times": [
1.8283767014,
1.7033688444000001,
1.8387841684000001,
1.6774828484000002,
1.4942613034,
1.5279587234,
1.7421523464,
1.6256151874,
1.8609019554000001,
1.8521505294
]
},
{
"command": "pnpr@main",
"mean": 1.6013524800000003,
"stddev": 0.15463213124222142,
"median": 1.5516047604,
"user": 1.0912197000000001,
"system": 1.17459104,
"min": 1.4300118764,
"max": 1.8654645014000002,
"times": [
1.4300118764,
1.4532303964000002,
1.4622259734,
1.7639348234,
1.5839526494000002,
1.5011258054,
1.7643134354,
1.6700084674,
1.8654645014000002,
1.5192568714
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.41640172518000007,
"stddev": 0.012847560043695982,
"median": 0.41603208968000005,
"user": 0.55002546,
"system": 0.71803586,
"min": 0.40257719218000004,
"max": 0.44066708718000003,
"times": [
0.40326774418,
0.40257719218000004,
0.42040110118,
0.42878972418,
0.44066708718000003,
0.41729315918000004,
0.42611031518000003,
0.40293394618,
0.41477102018,
0.40720596218000005
]
},
{
"command": "pacquet@main",
"mean": 0.41587829917999997,
"stddev": 0.012567893518604106,
"median": 0.41091541218000005,
"user": 0.5470487599999999,
"system": 0.7093228599999999,
"min": 0.40266490818,
"max": 0.44079846018,
"times": [
0.43022226118,
0.40266490818,
0.41130232618,
0.40726192718000004,
0.40969047118,
0.42609893518,
0.41052849818000003,
0.44079846018,
0.41670517318,
0.40351003118
]
},
{
"command": "pnpr@HEAD",
"mean": 0.31286231978000006,
"stddev": 0.005902402599832733,
"median": 0.31388812668,
"user": 0.22566936,
"system": 0.54005306,
"min": 0.30575990818000004,
"max": 0.32032232418,
"times": [
0.30767636818,
0.31904034018,
0.30575990818000004,
0.31330654118,
0.32016624118000003,
0.30588147718,
0.30708917218000004,
0.31491111318000004,
0.32032232418,
0.31446971218
]
},
{
"command": "pnpr@main",
"mean": 0.31291046728,
"stddev": 0.005626295834186469,
"median": 0.31125933068,
"user": 0.22328946,
"system": 0.5379255600000001,
"min": 0.30531616318000004,
"max": 0.32064225718,
"times": [
0.31258956118000003,
0.32064225718,
0.31773912918,
0.30885212218,
0.30717534318,
0.30925390818000004,
0.30992910018000003,
0.32001729018,
0.31758979818,
0.30531616318000004
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.72431372458,
"stddev": 0.005376511558379493,
"median": 1.72444398938,
"user": 0.77712874,
"system": 0.76636472,
"min": 1.7112568888800002,
"max": 1.7308566928800002,
"times": [
1.7256226048800003,
1.7246126618800002,
1.7233052398800002,
1.72427531688,
1.7272172888800001,
1.7299850408800002,
1.7308566928800002,
1.7112568888800002,
1.7229088038800002,
1.7230967068800003
]
},
{
"command": "pacquet@main",
"mean": 1.7185459163800005,
"stddev": 0.009569973595779279,
"median": 1.71709781538,
"user": 0.7699382400000001,
"system": 0.76847702,
"min": 1.69742655188,
"max": 1.7317502878800002,
"times": [
1.72426285388,
1.71371976088,
1.69742655188,
1.71710401788,
1.7317502878800002,
1.71685109088,
1.71709161288,
1.73012704988,
1.7203948638800002,
1.7167310738800001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30869814258000006,
"stddev": 0.007966378195285732,
"median": 0.31298817438000004,
"user": 0.21425904,
"system": 0.53775292,
"min": 0.29405394888,
"max": 0.31561916788,
"times": [
0.30601908088,
0.29405394888,
0.31503140188,
0.29788070488,
0.31561916788,
0.31307701188000003,
0.31551812788,
0.31396592588,
0.31289933688000005,
0.30291671888
]
},
{
"command": "pnpr@main",
"mean": 0.30800848548000004,
"stddev": 0.006885914941537356,
"median": 0.30622642538,
"user": 0.20798723999999996,
"system": 0.5533441199999999,
"min": 0.30177099988,
"max": 0.32419110088,
"times": [
0.30388167488,
0.30291803088,
0.30690461788,
0.30554823288,
0.30177099988,
0.31398910788,
0.30234497188000004,
0.30773049388,
0.32419110088,
0.31080562388
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.21094518310285718,
"stddev": 0.017660964334529287,
"median": 0.20583719746,
"user": 0.17007632,
"system": 0.06332544571428571,
"min": 0.18299370596,
"max": 0.25260109496,
"times": [
0.20606124396,
0.22795790896,
0.19475750796,
0.20389310196,
0.22135398296,
0.23437867996,
0.25260109496,
0.20561315096,
0.20062335296,
0.20551477596,
0.20658697496,
0.20788934696,
0.18299370596,
0.20300773496
]
},
{
"command": "pacquet@main",
"mean": 0.2075821688266667,
"stddev": 0.01364958917526728,
"median": 0.20340250796,
"user": 0.16671731999999997,
"system": 0.060143093333333335,
"min": 0.18898357496,
"max": 0.22832992996,
"times": [
0.19397025596,
0.20793549396,
0.20280518296,
0.22723810296,
0.22724600896,
0.21932638496,
0.19617172096,
0.21950233596000002,
0.20340250796,
0.19136549096,
0.20340029396,
0.20838648396,
0.18898357496,
0.19566876396,
0.22832992996
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08775675327249999,
"stddev": 0.0017468308558969779,
"median": 0.08750585946,
"user": 0.022314445,
"system": 0.008532066249999996,
"min": 0.08548514496000001,
"max": 0.09237120196000001,
"times": [
0.08935634396000001,
0.08880720996000001,
0.08792104096000002,
0.08612872596000001,
0.08796414296,
0.08683541696000001,
0.08677370196,
0.08810981696,
0.08718241096000001,
0.08906577796000001,
0.08621957796000002,
0.08548514496000001,
0.08992367296,
0.08916721896,
0.08908057496,
0.08607255996,
0.08756810696,
0.08580445596000001,
0.08665524796000001,
0.09053032396,
0.09237120196000001,
0.08623793096000001,
0.08567181496000001,
0.08877382696000001,
0.08591585496000001,
0.08948847296000001,
0.09105929096000001,
0.08666231096,
0.08645374796000001,
0.08748183396,
0.08591845996000001,
0.08752988496000001
]
},
{
"command": "pnpr@main",
"mean": 0.08738070283878788,
"stddev": 0.0014726732688774221,
"median": 0.08717046796000001,
"user": 0.022036319999999998,
"system": 0.00891664,
"min": 0.08490286796,
"max": 0.09289337396000001,
"times": [
0.08676158796000001,
0.08663960896,
0.08772147596,
0.08740644196000001,
0.08865989296000001,
0.08549789796000001,
0.08779472296000002,
0.08577020096000001,
0.08655279496000001,
0.08677713696000001,
0.08703879996000001,
0.08693176796,
0.08694166696000001,
0.08737838896000001,
0.08681187296000001,
0.09029436096000001,
0.08491208496000001,
0.08723251496000001,
0.08767714196000001,
0.08659435296000001,
0.08690258296,
0.08801081996000001,
0.08818104096000001,
0.09289337396000001,
0.08866481196,
0.08713218596000001,
0.08717046796000001,
0.08918430996000001,
0.08490286796,
0.08720827896000001,
0.08750093996000001,
0.08681993796000001,
0.08759686096000001
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.9080762133911112,
"stddev": 0.25612832297467264,
"median": 0.77716678228,
"user": 0.8820417511111112,
"system": 0.14754713333333333,
"min": 0.65108668828,
"max": 1.40116337828,
"times": [
0.65108668828,
1.21434371228,
0.77716678228,
0.73674632628,
0.72968771428,
0.93400943828,
1.40116337828,
0.72458756028,
1.00389432028
]
},
{
"command": "pacquet@main",
"mean": 0.8398702119466668,
"stddev": 0.17373370805160213,
"median": 0.81470481228,
"user": 0.8199193066666667,
"system": 0.13449602222222223,
"min": 0.62578118528,
"max": 1.07480784928,
"times": [
0.62578118528,
1.05086456128,
0.83090407828,
0.81470481228,
1.03730758128,
0.65598874028,
1.07480784928,
0.72737179228,
0.74110130728
]
},
{
"command": "pnpm@HEAD",
"mean": 2.935948456835556,
"stddev": 0.05743625451830371,
"median": 2.9400577132800003,
"user": 4.465164973333334,
"system": 0.2507309111111111,
"min": 2.86255282928,
"max": 3.04738852028,
"times": [
2.90304825928,
3.04738852028,
2.9400577132800003,
2.8946803512800003,
2.96191772928,
2.8805027532800005,
2.9751796122800003,
2.86255282928,
2.9582083432800004
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.55881569934,
"stddev": 0.12519389320773638,
"median": 4.51203078414,
"user": 1.7993822600000002,
"system": 1.4137455199999998,
"min": 4.44130378064,
"max": 4.77750192164,
"times": [
4.53794518264,
4.48611638564,
4.44259984164,
4.45932562064,
4.57344550964,
4.756282651639999,
4.44130378064,
4.77750192164,
4.63127778164,
4.48235831764
]
},
{
"command": "pacquet@main",
"mean": 4.503889677239999,
"stddev": 0.07374412690026935,
"median": 4.48817281714,
"user": 1.8738051600000003,
"system": 1.45668732,
"min": 4.42924604364,
"max": 4.64151596464,
"times": [
4.48286224664,
4.42924604364,
4.44472543564,
4.45744938764,
4.64151596464,
4.4934833876399995,
4.61445799664,
4.43192257464,
4.53137452864,
4.51185920664
]
},
{
"command": "pnpr@HEAD",
"mean": 3.6845675962399995,
"stddev": 0.16109055687370527,
"median": 3.63264466214,
"user": 1.41392246,
"system": 1.4383302199999999,
"min": 3.50176312264,
"max": 3.91834266064,
"times": [
3.91834266064,
3.62774026764,
3.53623886464,
3.55753740764,
3.91100506464,
3.50176312264,
3.83554109764,
3.7753676386399997,
3.5445907816399997,
3.63754905664
]
},
{
"command": "pnpr@main",
"mean": 3.5866405229399994,
"stddev": 0.08692992352685466,
"median": 3.5714775981399995,
"user": 1.4985693599999999,
"system": 1.43607122,
"min": 3.48767348264,
"max": 3.77521632064,
"times": [
3.48767348264,
3.67342173064,
3.5527465446399997,
3.54997218164,
3.59020865164,
3.5270782016399997,
3.49770587964,
3.62028769364,
3.77521632064,
3.59209454264
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13663 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,494.26 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 294.05 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 305.76 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 85.49 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,377.21 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,501.76 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 269.55 ms |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm11/workspace/injected-deps-syncer/src/DirPatcher.ts`:
- Around line 85-89: Synchronize blocker handling per target path in the
addition flow around retryOverBlockingInode, ensuring the initial directory
creation or hardlink, blocker removal, and retry execute under one per-path
single-flight lock. Prevent concurrent entries in optimizedDirPatch.added from
deleting directories or hardlinks created by another entry, while preserving
safe handling of FIFO and other blockers without aborting synchronization. Add a
regression covering a target FIFO with at least two source children under the
same directory.
In `@pnpm11/workspace/injected-deps-syncer/test/extendFilesMap.test.ts`:
- Line 206: Strengthen the replacement assertions in the relevant DirPatcher
test by comparing the target lstat result with the source entry’s inode type
rather than only checking isFIFO(). For directory replacements, also verify the
expected inner.txt entry so the test covers source/target replacement behavior
and confirms the target is not merely another non-FIFO inode.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 80373737-1fa1-4d43-9dfc-e1d23823b891
📒 Files selected for processing (2)
pnpm11/workspace/injected-deps-syncer/src/DirPatcher.tspnpm11/workspace/injected-deps-syncer/test/extendFilesMap.test.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm11/workspace/injected-deps-syncer/src/DirPatcher.ts`:
- Around line 87-88: Update the modified/added processing flow around the
directory replacement logic to handle file-to-directory transitions before
descendant additions: remove or replace conflicting modified paths, create
replacement directories before processing nested additions, and use awaited
asynchronous filesystem APIs for setup. Ensure the `fs.promises.link` call in
the directory-addition path no longer attempts `mkdirSync` on an existing file
and that all required filesystem operations complete before descendants are
added.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 55381096-a293-43d5-a2c3-ccc3bf14e055
📒 Files selected for processing (2)
pnpm11/workspace/injected-deps-syncer/src/DirPatcher.tspnpm11/workspace/injected-deps-syncer/test/extendFilesMap.test.ts
extendFilesMap threw ERR_PNPM_UNSUPPORTED_INODE_TYPE for any inode that is neither a file nor a directory. DirPatcher.fromMultipleTargets walks the whole package directory, not just its declared files, so a FIFO anywhere in the package — 1Password's environments create one for .env — aborted syncInjectedDepsAfterScripts and left the injected dependency stale. Leave such an inode out of the inode map instead. It is then absent from the diff as well, so it is neither hardlinked into the target nor removed from it, and the rest of the package syncs. pacquet needs no matching change: it has no injected-deps syncer (the setting is only recognized as config), and its directory walker already skips non-files. Fixes pnpm#13550
The comment claimed a skipped inode is never removed from the target, which only holds when the target is the side that skips it. When the source skips a path the diff treats it as absent, so an entry the target holds there is removed. Correct the comment and pin both directions.
Skipping an inode keeps it out of both maps, so when the source has a regular file or a directory at a path where the target holds a FIFO, the diff schedules an add that the existing inode blocks: fs.link and mkdir both fail with EEXIST, aborting the sync after other entries were already written. Clear the blocking path and retry the add once. The normal path keeps its single syscall — the removal only runs when the add actually collides — and the parent-directory creation goes through the same retry because a skipped inode can block that too.
Clearing a blocking inode and linking into its replacement ran concurrently: every file whose parent was blocked cleared that parent itself, so a removal that landed after a sibling had linked took those files with it. With a 30 ms delay on the first removal, a directory of 200 files synced down to 0. Create the added directories first, shallowest first, then link the files. Clearing a blocker can then only ever hit an empty directory, and a file's parent is already in place, so the parent no longer needs a retry of its own.
…er.test.ts Three of the cases covering a skipped inode drive DirPatcher.apply() rather than extendFilesMap, so they belong beside the other patcher tests, where createDir and createFile already exist. A createFifo helper joins them. extendFilesMap.test.ts keeps the two that assert the shape of the inode map.
…ests pin What the diff does with a path either side skipped is asserted by the patcher tests, and the target side is already documented on retryOverBlockingInode. Only the why the inode is skipped at all stays.
…e its files When a workspace package replaced a file with a directory of the same name, that path landed in `modified` while its contents landed in `added`. The addition pass ran `mkdirSync` on the parent before the modification pass had replaced it, so `syncInjectedDepsAfterScripts` died with EEXIST and left the injected dependency stale. Feed `added` and `modified` through one pass instead: every directory first, shallowest first, then the files in parallel. A directory is then always empty when it displaces whatever the target held at its path, so a removal landing late cannot take out files a sibling had already linked. Fixes a failure that predates the skipping of unsupported inodes, but shares its shape: the target holds something the source wants to put a directory over.
f6368e0 to
0085fec
Compare
Code Review by Qodo
1. Comment says used to
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Summary
Fixes #13550.
extendFilesMapthrewERR_PNPM_UNSUPPORTED_INODE_TYPEfor any inode that is neither a file nor a directory, andDirPatcher.fromMultipleTargetswalks the whole package directory rather than its declaredfiles. A FIFO anywhere in a workspace package therefore abortedsyncInjectedDepsAfterScriptsand left the injected dependency stale. The reporter's case is 1Password's environments, which make.enva FIFO — a permanent fixture of that setup, not a transient state.Reproduced against the current tree before changing anything, with a package declaring
"files": ["distribution"]and amkfifo'd.env:Such an inode is now left out of the inode map instead. That also keeps it out of the diff, so it is neither hardlinked into the target nor removed from it, and the rest of the package syncs. Verified end-to-end on the built package with a real FIFO: the sync completes, the target contains
distribution/index.jsandpackage.json, and.envis not copied.The skip is silent. A warning would fire on every install for a setup where the FIFO is a permanent fixture, which is noise rather than information; the issue asks for the path to be "safely skipped".
A second failure in the same function
Review surfaced a crash that predates this PR but shares its shape — the target holds something the source wants to put a directory over. When a workspace package replaces a file with a directory of the same name, that path lands in
modifiedwhile its contents land inadded; the addition pass reachedfs.mkdirSync(path.dirname(targetPath))before the modification pass had replaced the file, so the sync died withEEXIST: mkdir. It reproduces onmainunchanged.applyPatchnow feedsaddedandmodifiedthrough one pass: every directory first, shallowest first, then the files in parallel. A directory is therefore always in place before anything is linked into it, and always empty when it displaces whatever the target held. Covered byreplaces a target entry whose inode type changed in the source, which fails against the pre-fixapplyPatch.Rust: no matching change. pacquet has no injected-deps syncer —
sync-injected-deps-after-scriptsappears only as a recognized config key — and its directory walker already skips non-files (if !meta.is_file() { continue; }inadd_files_from_dir.rs).Tests:
extendFilesMap.test.tskeeps two cases for the shape of the inode map — one drives the branch through injected stats so it runs on every platform, including Windows; the other creates a real FIFO withmkfifoand is skipped on Windows, which has no equivalent.DirPatcher.test.tsholds four cases for what a patcher then does: what a skipped inode leaves in a target, what replaces one, that a directory displacing one keeps its files, and the inode-type transition above. Reverting either source change alone fails its tests.Squash Commit Body
Checklist
already linked to it solves it.
pnpm/port, or the description notes what still needs porting.pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
Bug Fixes
Tests