-
Notifications
You must be signed in to change notification settings - Fork 893
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: avoid chmod on read stream close #2096
fix: avoid chmod on read stream close #2096
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! We also hit this flakiness within our own fs-based tests
Thank you, we also hit this issue a lot on react-native-builder-bob's CI |
Hi, |
@Productivix if you won't mind using a release candidate version, you could try: npx create-react-native-library@latest myLib --react-native-version 0.73.0-rc.2 |
Ported this to 11.3.9, which the core team can pick for 0.72 point release (as requested in babel/babel#16024 (comment)) |
Summary:
Recently the Babel react-native e2e test is breaking:
https://github.com/babel/babel/actions/runs/6345671251/job/17316512072#step:10:82
The exact ENOENT file seems random, e.g. it could also be
/tmp/rnbabel/App.tsx
in another CI job result. It occurs in other projects unrelated to Babel as well: akveo/react-native-ui-kitten#1630The issue is likely due to a race condition in
cli/packages/cli/src/tools/copyFiles.ts
Lines 79 to 82 in 0e0801e
When the read stream is closed, the write stream might not have been closed yet so
chmod
is racing with the write stream.Here we avoid the
chmodSync
call and instead provide the desired mode upfront to the write stream so that the copied file will inherit the source file's mode.Test Plan:
Manual test.
Create a file named
./test.js
Run the following commands in shell
Expect: The
./bar
should be created with0400
mode with the content "foo"Checklist