fix(core): preserve sibling dependency inputs in native hashing#35071
Conversation
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit 6bb8ade
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Nx Cloud has identified a flaky task in your failed CI:
🔂 Since the failure was identified as flaky, we triggered a CI rerun by adding an empty commit to this branch.
🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.
🎓 Learn more about Self-Healing CI on nx.dev
move the dependency tsconfig glob after ^production in inferred playwright targets now that the native hashing order bug is fixed
reuse project and fileset hash results per invocation in the native task hasher and hash plan inspector.
The `tsconfig.lib.json` `include: ["**/*.ts"]` glob was picking up `project-graph/publish-maven.ts`, which belongs to the separate `:gradle-project-graph` Nx project. This caused a mismatch where tsc compiled the file but Nx didn't track it as an input.
|
Failed to publish a PR release of this pull request, triggered by @AgentEnder. |
(cherry picked from commit 77a119a)
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
When a target combines multiple dependency inputs such as
^{projectRoot}/tsconfig*.jsonand^production, the native hash planner shares one visited set across sibling dependency inputs. The first dependency input that reaches a dependency suppresses later ones, so Playwright-generated E2E targets can miss the actual^productionfiles from dependencies and incorrectly reuse cache results.Separately, native project file hashing can re-evaluate the same shared dependency fileset multiple times during a single hashing pass. That inefficiency already existed, but it becomes more visible once sibling dependency inputs are handled correctly, especially in large monorepos where many projects depend on the same project.
Additionally, the gradle package's
tsconfig.lib.jsonincludes**/*.tswithout excluding the nested:gradle-project-graphproject directory, causing tsc to compile files it doesn't need to (e.g. a standalone Maven publishing script).Expected Behavior
Sibling dependency inputs should be unioned for the same dependency regardless of order.
^productionshould continue excluding dependencytsconfig.spec.jsonfiles, while an explicit^{projectRoot}/tsconfig*.jsondependency input should still include them.The native task hasher and hash plan inspector should also reuse a given
project + fileset comboonce per invocation instead of re-globbing the same shared dependency repeatedly.Nested Nx projects within a package should be excluded from the parent's tsconfig so tsc only compiles files that are part of the library.
Related Issue(s)
Fixes #35008