-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Tasks should run dependsOn
before hashing inputs
#8051
Comments
Here's an example of 3 sequential
Here are the 3 summary files: 1.json does not include |
Yeah, I think I might have a similar problem but for the {
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"pipeline": {
"generate": {
"outputMode": "new-only",
"inputs": [
"src/**/*.yml"
],
"outputs": ["src/**/*", "!src/**/*.yml"],
"cache": true
},
"build": {
"outputMode": "new-only",
"inputs": [
"!src/**/*.yml"
],
"outputs": ["lib/**"],
"dependsOn": ["generate"],
"cache": true
}
}
} |
I also ran into this issue and made a repro of my own before I found yours: https://github.com/mattico/turborepo-repro I can verify this issue still exists with version 2.0.15-canary.4. |
Just met this issue. Confirming that |
Verify canary release
Link to code that reproduces this issue
https://github.com/JavaScriptBach/turbo-caching-bug
What package manager are you using / does the bug impact?
Yarn v2/v3/v4 (node_modules linker only)
What operating system are you using?
Linux
Which canary version will you have in your reproduction?
1.13.3-canary.4
Describe the Bug
If I have a task A whose input is a generated file produced by another task B, I have to Turbo task A twice before it gets cached.
What I think is happening
I think it's because on the first invocation:
On second invocation:
Why I think it's a bug
In order to obtain correct caching behavior, I currently have to exclude all generated files from the input. This is non-intuitive because the generated files are conceptually inputs to my task. Furthermore, I've already told Turbo that it depends on my codegen task.
It would be nice for Turbo to handle this, perhaps by running all dependsOn tasks before hashing the inputs to the original task?
Expected Behavior
Everything is cached after running Turbo once.
To Reproduce
See the linked repo.
Additional context
No response
The text was updated successfully, but these errors were encountered: