Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent bun.lock when doing lockfile maintenance #16527

Open
kevinmarrec opened this issue Jan 19, 2025 · 1 comment · May be fixed by #16267
Open

Inconsistent bun.lock when doing lockfile maintenance #16527

kevinmarrec opened this issue Jan 19, 2025 · 1 comment · May be fixed by #16267
Assignees
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client

Comments

@kevinmarrec
Copy link

kevinmarrec commented Jan 19, 2025

What version of Bun is running?

1.1.45+196621f25

What platform is your computer?

Linux 5.15.167.4-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

  • Have multiple sub dependencies using different versions of a sub-sub dependency.
  • Do a lockfile maintenance : rm -rf bun.lock && bun install

What is the expected behavior?

Consistent bun.lock

What do you see instead?

I don't know how to explain the bug, but I've 3 sub-dependencies using theirselves a subdependency named xml-name-validator.

  • 2 of them use v5.0
  • 1 of them uses v4.0

And when I do a lockfile maintenance rm -rf bun.lock && bun install, I'm randomly having bun switching the versions, this is probably due to some parallelism or cache.

So sometimes it hoists v5.0 at top level bun.lock and hoists v4.0 to the sub dependency that is using a downgraded version compared to its siblings using v5.0.

Image

Image

Image

Sometimes it hoists v4.0 at top level bun.lock and hoists v5.0 to the 2 sub dependencies that is using an upgraded version compared to its sibling using v4.0

Image

Image

Image

Image

Maybe I'm skewed by not using --no-cache option and that it sometimes read different caches, or skipping it because some package updates, then when redoing lock file maintenance it uses old cache (not saving new cache after package update?).

Still, with the --no-cache --force, i'm still having inconsistent updates, so it must be caused by random factor such as parallelism.

@kevinmarrec kevinmarrec added bug Something isn't working needs triage labels Jan 19, 2025
@kevinmarrec kevinmarrec changed the title Inconsistent Inconsistent bun.lock when doing lockfile maintenance Jan 19, 2025
@RiskyMH RiskyMH added bun install Something that relates to the npm-compatible client and removed needs triage labels Jan 20, 2025
@dylan-conway
Copy link
Member

Thanks for the bug report. This issue will likely be fixed when #16267 is merged. The pr isn't finished yet, but you can give it a try with bunx bun-pr 16267.

@dylan-conway dylan-conway self-assigned this Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants