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
dependentTasksOutputFiles : different behavior with NX_NATIVE_TASK_HASHER=false #22253
Comments
Either I’m drunk or some magic happened, but the instant I pressed "send issue", the bug disappeared, both in my reproduction repository and in my original one. |
I’m getting crazy, the issue is back. Where is the native hasher implementation, so I can try to troubleshoot it ? |
Added some debug traces to
I’m confused, shouldn’t that glob ( |
I finally found the issue and why it seemed to come and go. In my example repository, Since this is not resolved relative to workspace root, if I run As a check, I can confirm that replacing .filter_map(hash_file) with .filter_map(|file| hash_file(Path::new(workspace_root).join(file).to_str().expect("path contains invalid utf-8").to_owned())) fixes the issue. |
Great debugging! It seems like you have a fix. Would you like to submit a PR with the fix? |
Current Behavior
Overall setup : in my monorepo, I have a code-generator tool (let’s call it codegen). Some other projects use it to generate some code. Obviously, I want changes in codegen to result in the "codegen" task in the projects to be re-run. To achieve that behavior, I’m defining this in targetDefaults :
(build is standard, takes
src/**/*.ts
as input, output isdist/**/*.js
)If I run
nx run project:codegen
, then do some chage to codegen, then re-runnx run project:codegen
, the behavior depends on the value of NX_NATIVE_TASK_HASHER :Expected Behavior
Unless I did a mistake, it should not reuse cache in both cases. Even if I made a mistake somewhere, the two behaviors should match.
GitHub Repo
https://github.com/sloonz/nx-hasher-issue-repo
Steps to Reproduce
In the example repository, run
nx run project:codegen
, then do some change tocodegen/src/main.ts
(just increment the counter), the re-runnx run project:codegen
.Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: