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): ensure output paths returned are unique #18207

Merged

Conversation

agdimech
Copy link
Contributor

@agdimech agdimech commented Jul 20, 2023

It is possible for users to define multiple duplicate outputs in their project.json. This is leading to fs related issues like ENOTEMPTY: directory not empty, rmdir. The reason this occurs is that the src will tried to be copied to the cached directory in parallel for all output paths (even duplicated ones) and is the reason why these errors are seen sporadically. By ensuring output paths are unique, we only ever copy one path which resolves this issue.

Note: There may still be an issue present if there is a glob that is overlapping another directory i.e: cdk.out/* and cdk.out, however have not been able to reproduce a fs error while testing.

fixes #17277, #16337

Current Behavior

If you have a project.json which has duplicate output entires, it is possible to receive fs related errors when the cache is being written to disk.

Expected Behavior

each output should only be copied once into the caches directory.

Related Issue(s)

#17277, #16337

Fixes #17277, #16337

@agdimech agdimech requested a review from a team as a code owner July 20, 2023 04:18
@agdimech agdimech requested a review from vsavkin July 20, 2023 04:18
@vercel
Copy link

vercel bot commented Jul 20, 2023

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview 💬 Add feedback Jul 24, 2024 2:53pm

@AgentEnder AgentEnder force-pushed the fix/caching_issue_with_multiple_outputs branch 3 times, most recently from 4ff189a to b5230bb Compare June 4, 2024 21:04
@AgentEnder AgentEnder force-pushed the fix/caching_issue_with_multiple_outputs branch 3 times, most recently from 3f7d9b7 to 3c8245a Compare July 23, 2024 16:48
It is possible for users to define multiple duplicate outputs. This is leading to fs related issues like `ENOTEMPTY: directory not empty, rmdir`. The reason this occurs is that the src will tried to be copied to the cached directory in parallel for all output paths and is the reason why these errors are seen sporadically. By ensuring output paths are unique, we only ever copy one path which resolves this issue.

fixes nrwl#17277, #nrwl#16337
@AgentEnder AgentEnder force-pushed the fix/caching_issue_with_multiple_outputs branch from 3c8245a to f490119 Compare July 24, 2024 14:48
@AgentEnder AgentEnder merged commit 918b8fb into nrwl:master Jul 24, 2024
6 checks passed
FrozenPandaz pushed a commit that referenced this pull request Jul 24, 2024
It is possible for users to define multiple duplicate outputs in their
project.json. This is leading to fs related issues like `ENOTEMPTY:
directory not empty, rmdir`. The reason this occurs is that the src will
tried to be copied to the cached directory in parallel for all output
paths (even duplicated ones) and is the reason why these errors are seen
sporadically. By ensuring output paths are unique, we only ever copy one
path which resolves this issue.

Note: There may still be an issue present if there is a glob that is
overlapping another directory i.e: `cdk.out/*` and `cdk.out`, however
have not been able to reproduce a fs error while testing.

fixes #17277, #16337

## Current Behavior
If you have a project.json which has duplicate output entires, it is
possible to receive fs related errors when the cache is being written to
disk.

## Expected Behavior
each output should only be copied once into the caches directory.

## Related Issue(s)
#17277, #16337

Fixes #17277, #16337

(cherry picked from commit 918b8fb)
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 Jul 30, 2024
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.

Nestjs fails on code change in sublibs, NX ENOTEMPTY: directory not empty in random lib
2 participants