Repository navigation
install: accept installConfig.hoistingLimits "none" without a warning - #41240
Conversation
"none" is the default value of installConfig.hoistingLimits in Yarn. It means that the workspace has no hoisting limit, which is how bun hoists every workspace. bun install printed "is not supported" for each workspace that has this value. It now treats "none" like a missing key. The warning stays for "dependencies", which bun does not support.
|
Status: fixed in this PR. CI runs next. Reproduction: the canary build Proof: the 2 new cases in |
|
Warning Review limit reached
On-demand reviews are free for the next 18 days. After that, they cost $0.25 per reviewed file. Or wait 32 minutes for your next included review. View limit detailsLimit details: You’ve used all 10 included reviews currently available. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Essentials Run ID: 📒 Files selected for processing (4)
Comment |
|
Updated 8:57 PM PT - Sep 2nd, 2026
✅ @robobun, your commit daa9d15edc55252829a1ccf2f38c04eea7eb2eaf passed in 🧪 To try this PR locally: bunx bun-pr 41240That installs a local version of the PR into your bun-41240 --bun |
There was a problem hiding this comment.
LGTM — small, well-scoped fix that stops warning on Yarn's default hoistingLimits: "none".
What was reviewed:
WorkspaceMap.rs:hoisting_limitsbool staysfalsefor"none"(only"workspaces"sets it), and"none"is now excluded fromunsupported_hoisting_limits— so it's a true no-op, matching Yarn's default semantics.- Warning text in
Package.rsand the docs wording update are consistent with the new behavior. - New tests cover
"none"alone (hoists normally, no warning, nothing in lockfile) and"none"+ rootselfContained(root list still wins, no warning); the existing warning assertion is tightened to also assert absence of the warning for non-"dependencies"cases.
Extended reasoning...
Overview
This PR touches four files: a one-line guard change in src/install/lockfile/Package/WorkspaceMap.rs to treat installConfig.hoistingLimits: "none" as a recognized no-op (excluding it from unsupported_hoisting_limits alongside "workspaces"), a warning-message text update in src/install/lockfile/Package.rs, a one-word docs wording tweak in docs/pm/workspaces.mdx, and two new test cases plus a tightened assertion in test/cli/install/bun-workspaces-self-contained.test.ts. The core logic change is a single matches! pattern.
Security risks
None. This only affects whether a diagnostic warning is emitted for a specific string value read from a workspace's own package.json. No path handling, no network, no allocation sizing, no privilege boundaries are touched.
Level of scrutiny
Low. The semantic question is narrow: does "none" correctly become a no-op? I verified that hoisting_limits: bool (line 202) is still computed as == Some(b"workspaces"), so "none" does not mark the workspace self-contained — it only suppresses the warning, which is exactly what the PR claims. The root selfContained list behavior is unchanged since it's driven by the separate hoisting_limits bool and root config, and the new describe.each row exercises that interaction.
Other factors
Tests are added to the existing feature test file (per repo convention), use the existing writeProject/install harness, assert stderr before exit code, and add a negative assertion (not.toContain("hoistingLimits")) to the else branch so the non-warning cases are actively checked rather than vacuous. No CODEOWNERS entries cover these paths. The bug hunt exited on dry_streak with no findings and no ruled-out candidates. The PR timeline shows no prior reviews or outstanding objections.
Problem
bun installwarns for each workspace whosepackage.jsonhas"installConfig": { "hoistingLimits": "none" }:warn: workspace "app": installConfig.hoistingLimits "none" is not supported (only "workspaces" is); ignoringBun 1.4.0 prints nothing. install: self-contained workspaces for the hoisted linker (
workspaces.selfContained/installConfig.hoistingLimits) #40014 added the warning, and no release has it yet.process_workspace_name(src/install/lockfile/Package/WorkspaceMap.rs:203) flags every value other than"workspaces". But"none"is the default value in Yarn. It sets no hoisting limit, and that is how bun hoists every workspace.Fix
"none"like a missing key. It prints no warning, and the workspace is not self-contained. The rootworkspaces.selfContainedlist still applies, as it does for a missing key."dependencies"keeps the warning, because bun does not support it. The warning text now names both accepted values.installConfig?.hoistingLimits ?? nmHoistingLimits, and the default ofnmHoistingLimitsisnone. Onlyworkspacesanddependenciesmake a hoisting border (buildNodeModulesTree.tsin@yarnpkg/nm).test/cli/install/bun-workspaces-self-contained.test.ts(2 new cases, both fail on main) andtest/cli/install/bun-workspaces.test.ts. Self-reviewed: 2 concerns raised, 1 addressed. The notes explain the other.Background
installConfig.hoistingLimitsis a Yarn berry setting in thepackage.jsonof a workspace. Its values areworkspaces,dependenciesandnone.workspaces.selfContained/installConfig.hoistingLimits) #40014 mapsworkspacesto a self-contained workspace for the hoisted linker. Nothing that the workspace depends on is hoisted above its ownnode_modules.Notes
Repro (canary
1.4.1-canary.1+a6c4cc276, then a build of this branch):Before: the warning above, exit 0. After: no warning, exit 0. With
"dependencies", the warning stays:Tests
hoistingLimits "none" hoists the workspace normally and does not warn: no warning, noapps/desktop/node_modules, andbun.lockrecords nohoistingLimits.describe.eachrow,"none"plus the rootselfContainedlist: no warning, and the workspace is self-contained across a frozen install and a reinstall.Self-review
"workspaces"changes the layout.selfContainedlist wins over a manifest"none". In Yarn, a manifest value wins over the project-widenmHoistingLimits. The bun list is not a project-wide default. It names each workspace by its exact path or name. The list already wins over"dependencies"and over a missing key.Other PRs
git merge-treemerges the two branches with no conflict.no test proof · iteration 0 · platform-specific test(s) that do not run on this machine, deferring to CI, which covers all platforms: test/cli/install/bun-workspaces-self-contained.test.ts