Skip to content
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

Negated globs in input property not working when task depends on a same package relationship #9218

Open
1 task done
breadadams opened this issue Oct 3, 2024 · 0 comments
Labels
kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage

Comments

@breadadams
Copy link
Contributor

breadadams commented Oct 3, 2024

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/breadadams/turborepo-input-negate-bug

What package manager are you using / does the bug impact?

npm

What operating system are you using?

Mac

Which canary version will you have in your reproduction?

2.1.4-canary.1

Describe the Bug

When a task's dependsOn includes a "same package relationship", negated globs in the inputs property don't work - resulting in a cache miss when the negated files are touched.

Expected Behavior

If a negated file is touched I'd expect to get a cache hit.

To Reproduce

  1. Run turbo build, result: 3 successful | 0 cached.
  2. Run turbo build, result: 3 successful | 3 cached | FULL TURBO.
  3. Make a change in apps/apps-a/src/foo/bar.test.js, for example increment the number on L2.
  4. Run turbo build, result: 3 successful | 1 cached.
  5. Run turbo build, result: 3 successful | 3 cached | FULL TURBO.

In step 4 I'd expect to get 2 cached (pkg-a's build and app-a's build tasks) instead of just 1 (pkg-a's build task).


I can "solve" it by copying the same inputs property from the build task to the prebuild task (or removing the prebuild task from build's dependsOn property). Although that doesn't seem correct, as it could be that this prebuild task depends on the negated files.

If the result of prebuild were to have changed, then build should be a cache miss, however that isn't the case.

Additional context

No response

@breadadams breadadams added kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage labels Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage
Projects
None yet
Development

No branches or pull requests

1 participant