Repository navigation
fix(config): treat non-Windows platforms as Unix in default_store_dir - #14863
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? |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe configuration code now resolves a Unix store directory for FreeBSD and other non-Windows operating systems instead of panicking. Tests cover Unix-like and macOS paths, and a patch changeset documents the fix. ChangesStore directory fallback
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Assessment against linked issues
Suggested labels: Merge Risk: ⚪ Minimal · up to FreeBSD and other non-macOS Unix platforms now receive a valid default store location instead of being rejected. No actionable merge risk remains. ✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14863 +/- ##
=======================================
Coverage 90.92% 90.92%
=======================================
Files 1266 1266
Lines 169931 169933 +2
=======================================
+ Hits 154511 154518 +7
+ Misses 15420 15415 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.34853774572,
"stddev": 0.0793778430702699,
"median": 2.35357241062,
"user": 1.50952646,
"system": 1.45163388,
"min": 2.24644407412,
"max": 2.4581010641199996
},
{
"command": "pacquet@main",
"mean": 2.4180337374199996,
"stddev": 0.12519669739330586,
"median": 2.40052462762,
"user": 1.66632556,
"system": 1.6872510799999998,
"min": 2.24692387012,
"max": 2.57820373512
},
{
"command": "pnpr@HEAD",
"mean": 1.43065784392,
"stddev": 0.10934892660029287,
"median": 1.39362443512,
"user": 1.53441756,
"system": 1.49158148,
"min": 1.30764191412,
"max": 1.61282321512
},
{
"command": "pnpr@main",
"mean": 1.4099468447199999,
"stddev": 0.1209805033494213,
"median": 1.3955819956200002,
"user": 1.3774715600000003,
"system": 1.37136098,
"min": 1.28373587012,
"max": 1.6987747261200001
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.22000636978000002,
"stddev": 0.014452131303112011,
"median": 0.21814035298,
"user": 0.23760831999999996,
"system": 0.5381856199999999,
"min": 0.19968724148,
"max": 0.24042479548
},
{
"command": "pacquet@main",
"mean": 0.21650295077999998,
"stddev": 0.009103887866970828,
"median": 0.21426318298000002,
"user": 0.23144462,
"system": 0.54187012,
"min": 0.20448699748000002,
"max": 0.23207316348
},
{
"command": "pnpr@HEAD",
"mean": 0.22699347207999998,
"stddev": 0.0132121051117144,
"median": 0.22316859348,
"user": 0.24133591999999998,
"system": 0.5220652199999999,
"min": 0.21171423948,
"max": 0.25586634148000004
},
{
"command": "pnpr@main",
"mean": 0.24462931368000004,
"stddev": 0.0137632774520718,
"median": 0.24276273848000002,
"user": 0.24616501999999998,
"system": 0.5486830199999998,
"min": 0.23260311748,
"max": 0.27903801848000004
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.008768641523846162,
"stddev": 0.0013632025718072125,
"median": 0.00852386852,
"user": 0.004931421538461537,
"system": 0.004330611769230771,
"min": 0.00621331302,
"max": 0.016171209020000004
},
{
"command": "pacquet@main",
"mean": 0.010087796229374998,
"stddev": 0.0015510219219986012,
"median": 0.00987580652,
"user": 0.005857847500000001,
"system": 0.004822888187500001,
"min": 0.007628930020000001,
"max": 0.016611014020000002
},
{
"command": "pnpr@HEAD",
"mean": 0.00836899231906543,
"stddev": 0.0021547519792791212,
"median": 0.00821102402,
"user": 0.004954391775700934,
"system": 0.00374238012461059,
"min": 0.00669710002,
"max": 0.04362216202
},
{
"command": "pnpr@main",
"mean": 0.008354355739626172,
"stddev": 0.0008956578248950648,
"median": 0.00824389602,
"user": 0.004896827912772584,
"system": 0.0038897531464174447,
"min": 0.00659363702,
"max": 0.01154185802
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.008152005872755911,
"stddev": 0.0006350379022442011,
"median": 0.008024789420000001,
"user": 0.004592244251968506,
"system": 0.00420717850393701,
"min": 0.006842663420000001,
"max": 0.01076883942
},
{
"command": "pacquet@main",
"mean": 0.008592788087844526,
"stddev": 0.0009120408297114217,
"median": 0.00843711642,
"user": 0.004952998515901061,
"system": 0.0043127778798586576,
"min": 0.0067886534200000005,
"max": 0.01158427542
},
{
"command": "pnpr@HEAD",
"mean": 0.008439520273754948,
"stddev": 0.0005851207221594964,
"median": 0.00832077742,
"user": 0.004998841027667986,
"system": 0.00412091067193676,
"min": 0.0073501014199999996,
"max": 0.011328007420000001
},
{
"command": "pnpr@main",
"mean": 0.00798542553724138,
"stddev": 0.0006156669997834938,
"median": 0.00790462942,
"user": 0.004282963448275862,
"system": 0.004317001862068963,
"min": 0.00681810442,
"max": 0.01087665942
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.4863737527,
"stddev": 0.06479683268090129,
"median": 2.4643320989,
"user": 1.7850478000000003,
"system": 1.6557515999999999,
"min": 2.4130367674,
"max": 2.5852627064000004
},
{
"command": "pacquet@main",
"mean": 2.4801758953,
"stddev": 0.05700361678344803,
"median": 2.4581977034,
"user": 1.7290964000000002,
"system": 1.5932112999999999,
"min": 2.4164783734,
"max": 2.6010378924000004
},
{
"command": "pnpr@HEAD",
"mean": 1.5581806935,
"stddev": 0.13455416269209314,
"median": 1.5619347514,
"user": 1.0024653999999997,
"system": 1.1785284,
"min": 1.3582400034,
"max": 1.7075967453999998
},
{
"command": "pnpr@main",
"mean": 1.5168493013,
"stddev": 0.096425476216883,
"median": 1.5155024219,
"user": 1.0435629000000002,
"system": 1.2789853999999998,
"min": 1.3722065544,
"max": 1.6510032804
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.36154715430000006,
"stddev": 0.01697213415299323,
"median": 0.3585944607,
"user": 0.58520968,
"system": 0.80540852,
"min": 0.33592544620000003,
"max": 0.39132316320000005
},
{
"command": "pacquet@main",
"mean": 0.3511053143000001,
"stddev": 0.014106684355182036,
"median": 0.34318615620000004,
"user": 0.5519303799999999,
"system": 0.8026075199999999,
"min": 0.33847745720000005,
"max": 0.37419934120000004
},
{
"command": "pnpr@HEAD",
"mean": 0.27350711070000006,
"stddev": 0.012107765398295651,
"median": 0.27348053020000007,
"user": 0.21976548,
"system": 0.51275242,
"min": 0.25645288620000006,
"max": 0.29605405320000006
},
{
"command": "pnpr@main",
"mean": 0.27583016250000003,
"stddev": 0.01117672369292875,
"median": 0.2757027127,
"user": 0.22301638000000001,
"system": 0.51763372,
"min": 0.25967628420000005,
"max": 0.29422786120000005
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.5802170348,
"stddev": 0.022306287590982462,
"median": 1.5870929963,
"user": 0.8628375599999998,
"system": 0.9643357800000001,
"min": 1.5312239913,
"max": 1.6006975993
},
{
"command": "pacquet@main",
"mean": 1.6817479680000003,
"stddev": 0.16080302769131888,
"median": 1.6065162128000001,
"user": 1.06379516,
"system": 1.08301968,
"min": 1.5447493353,
"max": 1.9635637613
},
{
"command": "pnpr@HEAD",
"mean": 0.2869308147000001,
"stddev": 0.01313778060216174,
"median": 0.28766356830000006,
"user": 0.23550246000000002,
"system": 0.5382797800000001,
"min": 0.26771048030000005,
"max": 0.3132632873
},
{
"command": "pnpr@main",
"mean": 0.27747131640000006,
"stddev": 0.019114670740098975,
"median": 0.27846495830000006,
"user": 0.21834376,
"system": 0.50942528,
"min": 0.2493948533,
"max": 0.30453668330000006
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.20402683046333336,
"stddev": 0.018915944957588804,
"median": 0.20575221788,
"user": 0.20959334999999993,
"system": 0.08507513999999998,
"min": 0.17130199738000002,
"max": 0.23385614538000002
},
{
"command": "pacquet@main",
"mean": 0.1959157558175,
"stddev": 0.020746069040465144,
"median": 0.19004521888,
"user": 0.17962341249999997,
"system": 0.07402339,
"min": 0.17133983138,
"max": 0.23498880538
},
{
"command": "pnpr@HEAD",
"mean": 0.09044825381750002,
"stddev": 0.003438707053794231,
"median": 0.09010107787999999,
"user": 0.032665599999999996,
"system": 0.013255881249999997,
"min": 0.08660360538,
"max": 0.10127162038000001
},
{
"command": "pnpr@main",
"mean": 0.08934715447677422,
"stddev": 0.0021045568993305675,
"median": 0.09000335438,
"user": 0.031094454838709675,
"system": 0.014234446451612906,
"min": 0.08638346638,
"max": 0.09265027838
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6186510474155557,
"stddev": 0.12272119656874748,
"median": 0.6416256868600001,
"user": 0.6392712399999999,
"system": 0.15456217777777775,
"min": 0.33275638286000003,
"max": 0.7872755988600001
},
{
"command": "pacquet@main",
"mean": 0.7107683720822222,
"stddev": 0.08410917075734665,
"median": 0.73449108886,
"user": 0.7474584622222221,
"system": 0.14504362222222222,
"min": 0.5682096628600001,
"max": 0.8391854968600001
},
{
"command": "pnpm@HEAD",
"mean": 3.0991893037488887,
"stddev": 0.26761380507034943,
"median": 3.0036405298599997,
"user": 4.8866715733333335,
"system": 0.19975573333333335,
"min": 2.91567115186,
"max": 3.7620284048599997
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.3195499671599995,
"stddev": 0.08116866216682539,
"median": 4.29999533216,
"user": 1.4218217999999998,
"system": 1.47745522,
"min": 4.2528512221599994,
"max": 4.53584647616
},
{
"command": "pacquet@main",
"mean": 4.35920777736,
"stddev": 0.07436445776523372,
"median": 4.349971851159999,
"user": 1.4881124,
"system": 1.4596920199999999,
"min": 4.26475006116,
"max": 4.50515712216
},
{
"command": "pnpr@HEAD",
"mean": 3.42034183556,
"stddev": 0.07832054468572398,
"median": 3.38950335516,
"user": 1.3587636,
"system": 1.36607722,
"min": 3.34405554716,
"max": 3.55127740416
},
{
"command": "pnpr@main",
"mean": 3.49144917776,
"stddev": 0.15058063101846028,
"median": 3.45253801816,
"user": 1.4228141,
"system": 1.42130962,
"min": 3.34349053616,
"max": 3.74051623016
}
]
}Scenario: GVS linker: fresh restore, hot cache + hot storeSame install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.12045198668631578,
"stddev": 0.0224164136552661,
"median": 0.11020371616,
"user": 0.1458116652631579,
"system": 0.13244107894736842,
"min": 0.10099336616,
"max": 0.18054732416000002
},
{
"command": "pacquet@main",
"mean": 0.17849793699333336,
"stddev": 0.017092929495575702,
"median": 0.17264497416000002,
"user": 0.21739789333333337,
"system": 0.18229358333333331,
"min": 0.16038378916,
"max": 0.21284632916000001
},
{
"command": "pnpr@HEAD",
"mean": 0.18531011076000004,
"stddev": 0.01946966927860839,
"median": 0.18293889316000003,
"user": 0.19155916000000003,
"system": 0.1958087666666667,
"min": 0.15288249116000002,
"max": 0.22493532016000004
},
{
"command": "pnpr@main",
"mean": 0.15632382899333336,
"stddev": 0.03044643727399605,
"median": 0.15011178116,
"user": 0.18511539333333335,
"system": 0.1483573333333333,
"min": 0.12271830516,
"max": 0.20600425316
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/14863 |
| 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) |
|---|---|---|
| gvs-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 152.88 ms |
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,358.24 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 267.71 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 256.45 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 86.60 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,307.64 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,344.06 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 211.71 ms |
| isolated-linker.repeat-install.cold-cache.hot-store | 📈 view plot | 7.35 ms |
| isolated-linker.repeat-install.hot-cache.hot-store | 📈 view plot | 6.70 ms |
Every pnpm command aborted with SIGABRT on FreeBSD because default_store_dir panicked on any OS string other than linux or macos, while its siblings default_pnpm_home_dir and default_cache_dir already fall through to a Unix layout for every non-Windows platform. The Rust config crate made the panic fatal on startup, even for --version. Route the OS-dependent tail of default_store_dir through a small store_dir_for_os helper so the fallback is unit-testable on hosts no CI runner builds on, and add tests pinning the Unix fallback for freebsd and netbsd plus the unchanged macOS arm. Fixes #14859 Signed-off-by: devtechedge <[email protected]>
`test_default_store_dir_falls_back_to_home_dir` aborted on any OS string other than linux or macos, so `cargo test` still failed on the very platform this branch unblocks. Give it the same macos / fallback split the implementation has. Drop the copy of the platform policy from `store_dir_for_os`. It already stands on `default_store_dir`; the helper's doc only needs what its caller cannot say, namely why the OS is a parameter and that Windows returns before reaching it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_016t59BAY3Bahmv96psDYxEZ
652ae0e to
216ea7a
Compare
Code Review by Qodo
1. FreeBSD default stays undocumented
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
`store_dir_for_os` opened by restating what it is and where its contract lives, and the macOS test's doc repeated its own name. Keep only what a reader cannot get from the code: why the OS is a parameter, and that Windows returns before reaching the match. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_016t59BAY3Bahmv96psDYxEZ
|
Code review by qodo was updated up to the latest commit 3708a11 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Record pnpm/pnpm#14863 and recharts/recharts#7805 as merged, add publications.json plus the Sync merged OSS workflow so README, resume, LinkedIn, profile fragment, About, and resume artifacts stay in lockstep.
|
Thanks for the review and merge, @zkochan!
Aligning it with Dropping the store-dir comments was the right call. The helper names already carry that. |
…pnpm#14863) Running any pnpm command on FreeBSD aborts with the panic reported in pnpm#14859: the Rust config crate panics at `crates/config/src/defaults.rs:107` with "unsupported operating system: freebsd", so even `pnpm --version` dies with SIGABRT after upgrading to pnpm 12.4.1. This PR makes `default_store_dir` treat every non-Windows platform as Unix, so the default store directory on FreeBSD resolves to `~/.local/share/pnpm/store`. The macOS arm is unchanged. The file's other resolvers already follow this exact convention. `default_pnpm_home_dir` falls through to `~/.local/share/pnpm` for all non-Windows platforms with an explicit comment stating that policy, and `default_cache_dir` falls through to `~/.cache/pnpm`. `default_store_dir` was the only resolver that panicked instead of using that fallback. The shared config-dir and state-dir resolvers in `pnpm-config-dir` already fall back gracefully, so no other startup path panics on unknown OS strings. The change follows the FreeBSD install fix in pnpm#14597, where the same non-Windows platforms were brought closer to working. The OS-dependent tail is factored into a small `store_dir_for_os` helper taking the home dir and OS string, mirroring the crate's existing `EnvVar`/`GetHomeDir` test seams, so the new branch is unit-tested without a FreeBSD runner. Tests added: the Unix fallback for `freebsd` and `netbsd`, the unchanged `macos` arm, and a `linux` case. A changeset with a patch bump is included. Fixes pnpm#14859 --------- Signed-off-by: devtechedge <[email protected]> Co-authored-by: Zoltan Kochan <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…pnpm#14863) Running any pnpm command on FreeBSD aborts with the panic reported in pnpm#14859: the Rust config crate panics at `crates/config/src/defaults.rs:107` with "unsupported operating system: freebsd", so even `pnpm --version` dies with SIGABRT after upgrading to pnpm 12.4.1. This PR makes `default_store_dir` treat every non-Windows platform as Unix, so the default store directory on FreeBSD resolves to `~/.local/share/pnpm/store`. The macOS arm is unchanged. The file's other resolvers already follow this exact convention. `default_pnpm_home_dir` falls through to `~/.local/share/pnpm` for all non-Windows platforms with an explicit comment stating that policy, and `default_cache_dir` falls through to `~/.cache/pnpm`. `default_store_dir` was the only resolver that panicked instead of using that fallback. The shared config-dir and state-dir resolvers in `pnpm-config-dir` already fall back gracefully, so no other startup path panics on unknown OS strings. The change follows the FreeBSD install fix in pnpm#14597, where the same non-Windows platforms were brought closer to working. The OS-dependent tail is factored into a small `store_dir_for_os` helper taking the home dir and OS string, mirroring the crate's existing `EnvVar`/`GetHomeDir` test seams, so the new branch is unit-tested without a FreeBSD runner. Tests added: the Unix fallback for `freebsd` and `netbsd`, the unchanged `macos` arm, and a `linux` case. A changeset with a patch bump is included. Fixes pnpm#14859 --------- Signed-off-by: devtechedge <[email protected]> Co-authored-by: Zoltan Kochan <[email protected]>
Running any pnpm command on FreeBSD aborts with the panic reported in #14859: the Rust config crate panics at
crates/config/src/defaults.rs:107with "unsupported operating system: freebsd", so evenpnpm --versiondies with SIGABRT after upgrading to pnpm 12.4.1.This PR makes
default_store_dirtreat every non-Windows platform as Unix, so the default store directory on FreeBSD resolves to~/.local/share/pnpm/store. The macOS arm is unchanged.The file's other resolvers already follow this exact convention.
default_pnpm_home_dirfalls through to~/.local/share/pnpmfor all non-Windows platforms with an explicit comment stating that policy, anddefault_cache_dirfalls through to~/.cache/pnpm.default_store_dirwas the only resolver that panicked instead of using that fallback. The shared config-dir and state-dir resolvers inpnpm-config-diralready fall back gracefully, so no other startup path panics on unknown OS strings.The change follows the FreeBSD install fix in #14597, where the same non-Windows platforms were brought closer to working.
The OS-dependent tail is factored into a small
store_dir_for_oshelper taking the home dir and OS string, mirroring the crate's existingEnvVar/GetHomeDirtest seams, so the new branch is unit-tested without a FreeBSD runner. Tests added: the Unix fallback forfreebsdandnetbsd, the unchangedmacosarm, and alinuxcase. A changeset with a patch bump is included.Fixes #14859
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
~/Library/pnpm/storelocation.~/.local/share/pnpm/storewhen no platform-specific location is defined.