-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Unexpected cache behavior (unexpected hits and unexpected outputs) after renaming file #23106
Comments
Same for me here, I have GQL files that we generate TS file from. the task to generate the files id dependant on **/*.gql files. |
We're experiencing this with nx 17.2.8, so I think the regression happened somewhere after 17.0.6 and either in or before 17.2.8 |
Same experience with version If I'm reading it right, I see from the commit where the rust version was introduced that the previous js-based version did factor in the file name. nx/packages/nx/src/hasher/task-hasher.ts Lines 798 to 803 in 476e13d
@Cammisuli @AgentEnder am I following that correctly? If so, would the fix be as simple as adding the filename to the hash here or would it require deeper changes? This seems like an important fix. I'd be happy to open a PR if it's a reasonably straight forward change. |
…uting the hash closed nrwl#23106
…uting the hash closed nrwl#23106
…uting the hash closed nrwl#23106
…uting the hash closed nrwl#23106
…uting the hash closed nrwl#23106
…uting the hash closed nrwl#23106
I see the fix made it into 19.8.0 (thank you @iAmNathanJ !!!) - I just verified on my repro repo using the steps mentioned above that the issue is indeed fixed using 19.8.2, so closing this issue out. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
In the repro repo, the "build" command has caching enabled. Running it (
pnpm build
at root) does the correct thing in response to modifying file contents, but renaming the file exhibits a couple strange behaviors. The repro steps walk through a series of actions to encounter several unexpected symptoms, annotated with ❌. I believe this is a regression, since I repro on nx 18.3.4 but not 17.0.6.Expected Behavior
Renaming the file should have similar impact on determining cache hits as modifications to file contents.
GitHub Repo
https://github.com/ChumpChief/nx-repro
Steps to Reproduce
Prereq: pnpm globally installed
pnpm i
at repo rootpnpm build
at repo rootpackages/testPackage/built
contains the expectedfoo.js
✅mv packages/testPackage/foo.ts packages/testPackage/bar.ts
at repo rootpnpm build
at repo rootpackages/testPackage/built
contains the expectedbar.js
(and still hasfoo.js
which is expected since we didn't do anything to delete it). ✅mv packages/testPackage/bar.ts packages/testPackage/woz.ts
pnpm build
at repo rootpackages/testPackage/built
is missing the expectedwoz.js
(but still has thefoo.js
andbar.js
files as expected since we didn't do anything to delete them). ❌pnpm clean
at repo root (which will delete thebuilt
output)mv packages/testPackage/woz.ts packages/testPackage/foo.ts
(returning the file name back to the original state)pnpm build
at repo rootfoo.ts
in step 3 ✅packages/testPackage/built
has the expectedfoo.js
, but surprisingly also hasbar.js
(which was not part of the output from step 3). ❌Nx Report
Failure Logs
Package Manager Version
9.0.6
Operating System
Additional Information
tsc --init
.The text was updated successfully, but these errors were encountered: