You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Description
Fixes#4510 by using `BTreeMap` instead of a `HashMap` so we have stable
ordering of the package entries.
### Testing Instructions
Setup a monorepo using NPM as a package manager. Run `turbo prune
--scope=web --out-dir=a && turbo prune --scope=web --out-dir=b && diff
a/package-lock.json b/package-lock.json` and expect a zero exit code.
What version of Turborepo are you using?
1.8.8
What package manager are you using / does the bug impact?
npm
What operating system are you using?
Mac, Windows, docker
Describe the Bug
Running
turbo prune --scope=<workspace> --docker
multiple times always generates a different package-lock.json.This causes the docker build to never use the cache to install dependencies.
The keys in the generated JSON have a different order, see for example this screenshot:
This occurs on MacOS, Windows (WSL) and inside the docker build.
Expected Behavior
The generated package-lock.json should be stable to allow docker to cache the build step.
To Reproduce
npx turbo prune --scope=worker --docker
to create pruned outputout/package-lock.json
somewhere…npx turbo prune --scope=worker --docker
againThe reproduction repo is kinda large, maybe I will create a smaller repro in the coming days.
Reproduction Repo
https://github.com/GW2Treasures/gw2treasures.com/tree/9c86b97ea829b25ee89cc2b28a07ec36b1cd8a0d
The text was updated successfully, but these errors were encountered: