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

fix(core): set consistent working directory when calculating runtime hash inputs #18643

Merged

Conversation

AgentEnder
Copy link
Member

@AgentEnder AgentEnder commented Aug 15, 2023

Current Behavior

Runtime hash inputs inherit the parent process's current working directory. This can cause them to fail if they utilize any relative paths.

Consider for instance, a runtime input that consists of node ./tools/calculate-local-env.js

If you are cd'd into a project's root instead of the workspace root, this would fail since the path is meant to be relative to the workspace root.

Here's an example in this repo, if adding a runtime input of cat README.md to the lint target and running in the packages directory:
image

It's also worth noting that this behavior also is inconsistent between if the daemon is enabled or disabled, since when hashing on the daemon the cwd is already workspaceRoot, since the daemon's cwd is workspaceRoot

Expected Behavior

Runtime inputs behave in a consistent manner

Related Issue(s)

Fixes #

@AgentEnder AgentEnder requested a review from a team as a code owner August 15, 2023 17:56
@vercel
Copy link

vercel bot commented Aug 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 15, 2023 6:42pm

@AgentEnder AgentEnder enabled auto-merge (squash) August 15, 2023 19:15
@AgentEnder AgentEnder merged commit e2ac4e3 into nrwl:master Aug 15, 2023
15 checks passed
FrozenPandaz pushed a commit that referenced this pull request Aug 16, 2023
@github-actions
Copy link

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 Aug 21, 2023
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.

None yet

2 participants