Skip to content

turbo prune --docker generates invalid Bun lockfile; bun install --frozen-lockfile fails in pruned Docker stage #12653

@RedEagle-dh

Description

@RedEagle-dh

Verify canary release

  • I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

https://github.com/RedEagle-dh/turbo-bun-prune-frozen-repro

Which canary version will you have in your reproduction?

v2.9.7-canary.13

Environment information

CLI:
   Version: 2.9.7-canary.13
   Path to executable: /home/dave/developer/projects/turbo-bun-prune-frozen-repro/node_modules/@turbo/linux-64/bin/turbo
   Daemon status: Not running
   Package manager: bun

Platform:
   Architecture: x86_64
   Operating system: linux
   WSL: false
   Available memory (MB): 16806
   Available CPU cores: 16

Environment:
   CI: None
   AI agent: None
   Terminal (TERM): foot
   Terminal program (TERM_PROGRAM): unknown
   Terminal program version (TERM_PROGRAM_VERSION): unknown
   Shell (SHELL): /bin/fish
   stdin: false
   Node.js version: v25.9.0

Expected behavior

turbo prune @eventmate/migrations --docker should generate a pruned Bun lockfile that remains valid for the pruned workspace.

Running this in the Docker installer stage should succeed without modifying the lockfile:
bun install --frozen-lockfile --ignore-scripts

Actual behavior

The root bun.lock is valid, but the lockfile generated in out/json/bun.lock by turbo prune --docker is invalid for Bun’s frozen install.

The Docker build fails at:

RUN bun install --frozen-lockfile --ignore-scripts

with:

error: lockfile had changes, but lockfile is frozen

To Reproduce

git clone https://github.com/RedEagle-dh/turbo-bun-prune-frozen-repro.git 
cd turbo-bun-prune-frozen-repro 
docker build --no-cache -t turbo-bun-prune-frozen-repro -f apps/migrations/ Dockerfile .

The Dockerfile uses:

COPY --from=pruner /app/out/json/ .
RUN bun install --frozen-lockfile --ignore-scripts

Control check: the root lockfile itself installs correctly with frozen lockfile enabled:

docker run --rm -v "$PWD:/work" -w /work oven/bun:1.3.13-alpine bun install --frozen-lockfile --ignore-scripts

So the failure appears only after turbo prune --docker generates the pruned out/json/bun.lock.

Additional context

This reproduces locally in Docker with oven/bun:1.3.13-alpine.

This looks related to #11171, but this repro uses a public minimal repository and verifies the behavior against the current canary 2.9.7-canary.13.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions