bun manager: use --lockfile-only instead of a full install
#44629
rg-lesmills
started this conversation in
Suggest an Idea
Replies: 1 comment
|
Nice write-up, and thanks for doing the verification up front, it saved both ours time. On your open question: I'd version-gate it rather than assume A couple of implementation notes for the PR:
Happy to review the PR. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Tell us more.
Happy to open a PR for this if my approach seems good.
Disclaimer: this discussion was drafted with AI assistance (Claude Sonnet 5), but reviewed and edited by me before posting.
Every other npm-ecosystem manager Renovate supports has a lockfile-only mode wired
up for artifact updates:
npm install --package-lock-only --no-audityarn install --mode=update-lockfilepnpm install --lockfile-onlybun install [--ignore-scripts]: full installbun installhas supported--lockfile-onlysince v1.1.43 (https://bun.com/docs/pm/cli/install#param-lockfile-only). The bun manager (https://github.com/renovatebot/renovate/blob/main/lib/modules/manager/bun/artifacts.ts#L62) never passes it, so every dependency bump on a bun-managed repo downloads and extracts the fullnode_modulestree, even though only the lockfile is committed.I couldn't find any prior issue/PR/discussion about this, and the deno manager has
the identical gap called out as a TODO (https://github.com/renovatebot/renovate/blob/main/lib/modules/manager/deno/artifacts.ts#L134:
// TODO: appending --lockfile-only is better to reduce disk usage), so thislooks like an oversight rather than something already considered and rejected.
Proposed change
Minimal, mirrors the existing pnpm implementation:
Testing done
Before proposing this I checked whether
--lockfile-onlyactually producesequivalent output to a full install, since that's the load-bearing assumption.
Built local fixtures and ran real bun (1.3.14, plus 1.1.42 for the legacy binary
lockfile case) across the scenarios this manager needs to handle:
bun.lock— byte-identical lockfile, nonode_moduleswritten.package.json— identicallockfile, passes
--frozen-lockfile.artifacts.tsdoes before invoking the command) — identical lockfile, passes--frozen-lockfile.bun.lockbformat (this manager still supports it) — byte-identicaloutput, stays binary (no silent migration to
bun.lock), passes--frozen-lockfile.The one caveat I found (oven-sh/bun#18906 : a workspace package's own
versionfield isn't reflected in the lockfile unless a dependency also changed) reproduces
identically with a full install, so
--lockfile-onlydoesn't introduce any newdivergence there.
Open question for maintainers
--lockfile-onlyrequires bun ≥1.1.43 (Dec 2024).execOptions.toolConstraintsalready threads a bun version constraint through for containerbase-managed
installs, so most users will have a recent bun. But
binarySource=globalself-hosted users could still have an older system bun, where this flag would
error. Worth version-gating (similar to how npm's dedupe path checks for
--prefer-dedupesupport before using it,lib/modules/manager/npm/post-update/npm.ts), or is 1.1.43 old enough to assumeunconditionally? Happy to add gating if that's the preferred approach.
All reactions