这是indexloc提供的服务,不要输入任何密码
Skip to content

remoteCache enabled option set to true bypasses --force flag #9681

@leoperria

Description

@leoperria

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/stelltec/turborepo-reproduce1

Which canary version will you have in your reproduction?

turbo 2.3.4-canary.6

Enviroment information

turbo 2.3.4-canary.6

CLI:
   Version: 2.3.4-canary.6
   Path to executable: /home/leonardo/repos/turbo-bug/my-turborepo/node_modules/.pnpm/turbo-linux-64@2.3.4-canary.6/node_modules/turbo-linux-64/bin/turbo
   Daemon status: Running
   Package manager: pnpm

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

Environment:
   CI: None
   Terminal (TERM): xterm-256color
   Terminal program (TERM_PROGRAM): unknown
   Terminal program version (TERM_PROGRAM_VERSION): unknown
   Shell (SHELL): /usr/bin/zsh
   stdin: false

Expected behavior

If I enable remoteCache in root turbo.json

{

    "remoteCache": {
       "enabled": true
  }
}

I should be able to bypass caching and force rebuild using the --force flag

Actual behavior

Not sure if it's an expected behaviour but the --force flag is bypassed and there is no way to force rebuild:

$ turbo build --force                                                                                                                                                                                                                                                   ✔ 
turbo 2.3.4-canary.6

• Packages in scope: app-a, app-b, pkg-a, pkg-b, tooling-config
• Running build in 5 packages
• Remote caching enabled
pkg-b:prebuild: cache hit (outputs already on disk), replaying logs 5cbb619b78fa381a
pkg-b:prebuild: 
pkg-b:prebuild: 
pkg-b:prebuild: > pkg-b@ prebuild /home/leonardo/repos/turbo-bug/my-turborepo/packages/pkg-b
pkg-b:prebuild: > echo "Executing pre-build step..."
pkg-b:prebuild: 
pkg-b:prebuild: Executing pre-build step...
app-b:build: cache hit (outputs already on disk), replaying logs 1242af90bedccc6c
app-b:build: 
app-b:build: 
app-b:build: > app-b@ build /home/leonardo/repos/turbo-bug/my-turborepo/apps/app-b
app-b:build: > mkdir -p dist && echo "Your application output!" > dist/app-output.txt && echo "Application B is built!"
app-b:build: 
app-b:build: Application B is built!
pkg-a:build: cache hit (outputs already on disk), replaying logs 1ccc2498ba66d1b1
pkg-a:build: 
pkg-a:build: 
pkg-a:build: > pkg-a@ build /home/leonardo/repos/turbo-bug/my-turborepo/packages/pkg-a
pkg-a:build: > echo "Building at the speed of Turbo." > output-file.txt && cat output-file.txt
pkg-a:build: 
pkg-a:build: Building at the speed of Turbo.
pkg-b:build: cache hit (outputs already on disk), replaying logs 21609796f74b5216
pkg-b:build: 
pkg-b:build: 
pkg-b:build: > pkg-b@ prebuild /home/leonardo/repos/turbo-bug/my-turborepo/packages/pkg-b
pkg-b:build: > echo "Executing pre-build step..."
pkg-b:build: 
pkg-b:build: Executing pre-build step...
pkg-b:build: 
pkg-b:build: > pkg-b@ build /home/leonardo/repos/turbo-bug/my-turborepo/packages/pkg-b
pkg-b:build: > echo "Welcome to the Turboverse." > output-file.txt && cat output-file.txt
pkg-b:build: 
pkg-b:build: Welcome to the Turboverse.
app-a:build: cache hit (outputs already on disk), replaying logs de52d0fccb16d6cc
app-a:build: 
app-a:build: 
app-a:build: > app-a@ build /home/leonardo/repos/turbo-bug/my-turborepo/apps/app-a
app-a:build: > mkdir -p dist && echo "Your application output!" > dist/app-output.txt && echo "Application A is built!"
app-a:build: 
app-a:build: Application A is built!

 Tasks:    5 successful, 5 total
Cached:    5 cached, 5 total
  Time:    35ms >>> FULL TURBO

To Reproduce

  1. Start test remote cache with docker-compose:
$ docker-compose up
  1. Configure test remote cache env vars
export TURBO_API=http://localhost:3333
export TURBO_TEAM="test"
export TURBO_TOKEN="test"
  1. Build with --force flag
$ turbo build --force  

Additional context

As per docs, enabled:true is the default. So I've found that this config:

{
   "remoteCache": {
   }
}

actually works:

$ turbo build --force                                                                                                                                                                                                                                                   ✔ 
turbo 2.3.4-canary.6

• Packages in scope: app-a, app-b, pkg-a, pkg-b, tooling-config
• Running build in 5 packages
• Remote caching enabled
pkg-b:prebuild: cache bypass, force executing 5cbb619b78fa381a
pkg-b:prebuild: 
app-b:build: cache bypass, force executing 1242af90bedccc6c
app-b:build: 
pkg-a:build: cache bypass, force executing 1ccc2498ba66d1b1
pkg-a:build: 
pkg-a:build: 
pkg-a:build: > pkg-a@ build /home/leonardo/repos/turbo-bug/my-turborepo/packages/pkg-a
pkg-a:build: > echo "Building at the speed of Turbo." > output-file.txt && cat output-file.txt
pkg-a:build: 
pkg-b:prebuild: 
pkg-b:prebuild: > pkg-b@ prebuild /home/leonardo/repos/turbo-bug/my-turborepo/packages/pkg-b
pkg-b:prebuild: > echo "Executing pre-build step..."
pkg-b:prebuild: 
app-b:build: 
app-b:build: > app-b@ build /home/leonardo/repos/turbo-bug/my-turborepo/apps/app-b
app-b:build: > mkdir -p dist && echo "Your application output!" > dist/app-output.txt && echo "Application B is built!"
app-b:build: 
pkg-a:build: Building at the speed of Turbo.
pkg-b:prebuild: Executing pre-build step...
app-b:build: Application B is built!
pkg-b:build: cache bypass, force executing 21609796f74b5216
pkg-b:build: 
app-a:build: cache bypass, force executing de52d0fccb16d6cc
app-a:build: 
pkg-b:build: 
pkg-b:build: > pkg-b@ prebuild /home/leonardo/repos/turbo-bug/my-turborepo/packages/pkg-b
pkg-b:build: > echo "Executing pre-build step..."
pkg-b:build: 
app-a:build: 
app-a:build: > app-a@ build /home/leonardo/repos/turbo-bug/my-turborepo/apps/app-a
app-a:build: > mkdir -p dist && echo "Your application output!" > dist/app-output.txt && echo "Application A is built!"
app-a:build: 
pkg-b:build: Executing pre-build step...
pkg-b:build: 
pkg-b:build: > pkg-b@ build /home/leonardo/repos/turbo-bug/my-turborepo/packages/pkg-b
pkg-b:build: > echo "Welcome to the Turboverse." > output-file.txt && cat output-file.txt
pkg-b:build: 
app-a:build: Application A is built!
pkg-b:build: Welcome to the Turboverse.

 Tasks:    5 successful, 5 total
Cached:    0 cached, 5 total
  Time:    829ms 

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: triageNew issues get this label. Remove it after triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions