Skip to content

Commit

Permalink
chore: differentiate rust changes from building turbo (#8001)
Browse files Browse the repository at this point in the history
### Description

This PR adds a new dummy task that will be invalidated whenever
turborepo related Rust code changes.

I noticed we were building the `turbo` binary when running our [JS
tests](https://github.com/vercel/turbo/actions/runs/8724966454/job/23936836212#step:6:993).
This is due to `turborepo-repository` depending on `cli#build`, but I
believe that we really just want it invalidate on any Rust code changes.

### Testing Instructions

Verify that updating a Rust file causes a cache miss for both `turbo
build --filter=cli` and `turbo build --filter=turborepo-repository`.


Closes TURBO-2837
  • Loading branch information
chris-olszewski committed Apr 30, 2024
1 parent ca175f1 commit 14bb523
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
19 changes: 11 additions & 8 deletions cli/turbo.json
Expand Up @@ -2,15 +2,9 @@
"$schema": "../docs/public/schema.json",
"extends": ["//"],
"pipeline": {
"build": {
// A task that is used for detecting if any turborepo Rust sources change
"rust-src": {
"env": ["RUNNER_OS"],
"outputs": [
"../target/debug/turbo",
"../target/debug/turbo.exe",
"../target/release/turbo",
"../target/release/turbo.exe"
],

"inputs": [
"../version.txt",
"../crates/turborepo*/**/*.rs", // Rust crates
Expand All @@ -19,6 +13,15 @@
"../Cargo.lock",
"!../crates/**/target"
]
},
"build": {
"outputs": [
"../target/debug/turbo",
"../target/debug/turbo.exe",
"../target/release/turbo",
"../target/release/turbo.exe"
],
"dependsOn": ["rust-src"]
}
}
}
2 changes: 1 addition & 1 deletion packages/turbo-repository/turbo.json
Expand Up @@ -6,7 +6,7 @@
"pipeline": {
"build": {
"dependsOn": [
"cli#build"
"cli#rust-src"
]
},
"test": {
Expand Down

0 comments on commit 14bb523

Please sign in to comment.