Skip to content

fix(core): preserve sibling dependency inputs in native hashing#35071

Merged
AgentEnder merged 5 commits into
masterfrom
gh-35008
Mar 31, 2026
Merged

fix(core): preserve sibling dependency inputs in native hashing#35071
AgentEnder merged 5 commits into
masterfrom
gh-35008

Conversation

@leosvelperez

@leosvelperez leosvelperez commented Mar 30, 2026

Copy link
Copy Markdown
Member

Current Behavior

When a target combines multiple dependency inputs such as ^{projectRoot}/tsconfig*.json and ^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 ^production files 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.json includes **/*.ts without excluding the nested :gradle-project-graph project 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. ^production should continue excluding dependency tsconfig.spec.json files, while an explicit ^{projectRoot}/tsconfig*.json dependency input should still include them.

The native task hasher and hash plan inspector should also reuse a given project + fileset combo once 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

@leosvelperez leosvelperez self-assigned this Mar 30, 2026
@netlify

netlify Bot commented Mar 30, 2026

Copy link
Copy Markdown

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 6bb8ade
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69cba8accf1ea60008f17808
😎 Deploy Preview https://deploy-preview-35071--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Mar 30, 2026

Copy link
Copy Markdown

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 6bb8ade
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69cba8ac25290c00087ae548
😎 Deploy Preview https://deploy-preview-35071--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud

nx-cloud Bot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 6bb8ade

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 11m 59s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 7s View ↗
nx-cloud record -- pnpm nx conformance:check ✅ Succeeded 7s View ↗
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-31 11:53:37 UTC

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Nx Cloud View detailed reasoning in Nx Cloud ↗

🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.


🎓 Learn more about Self-Healing CI on nx.dev

@leosvelperez leosvelperez marked this pull request as ready for review March 30, 2026 15:13
@leosvelperez leosvelperez requested a review from a team as a code owner March 30, 2026 15:13
@leosvelperez leosvelperez requested a review from MaxKless March 30, 2026 15:13
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.
@AgentEnder AgentEnder added PR status: do not merge This will block a PR from being merged until this tag is removed. and removed PR status: do not merge This will block a PR from being merged until this tag is removed. labels Mar 31, 2026
@AgentEnder AgentEnder merged commit 77a119a into master Mar 31, 2026
28 of 31 checks passed
@AgentEnder AgentEnder deleted the gh-35008 branch March 31, 2026 14:20
@github-actions

Copy link
Copy Markdown
Contributor

Failed to publish a PR release of this pull request, triggered by @AgentEnder.
See the failed workflow run at: https://github.com/nrwl/nx/actions/runs/23801278889

FrozenPandaz pushed a commit that referenced this pull request Mar 31, 2026
@github-actions

github-actions Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Playwright Generated E2E Targets gets cached when it shouldn't

3 participants