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 broken build script --unsafe-partial mode #22317

Closed
wants to merge 3 commits into from

Conversation

bvaughn
Copy link
Contributor

@bvaughn bvaughn commented Sep 14, 2021

Resolves #22323 by replacing ncp with the recursively-copy library.

Brian Vaughn added 3 commits September 14, 2021 16:03
The 'ncp' package hasn't been undated for ~7 years and seems buggy based on my own testing of the Rollup build scripts. (There is a race condition that I can repro 3 out of 4 times where copying a JSON file resolves the ncp() callback while the file's contents are still empty. This breaks scripts like ours which have subsequence calls to read/parse the copied JSON.

Based on my testing, the 'recursive-copy' package does not have this problem.

This commit contains only package.json and yarn.lock changes. The next commit will update build scripts.
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Sep 14, 2021
@bvaughn bvaughn changed the title Replaced 'ncp' package with 'recursive-copy' package Fix broken build script --unsafe-partial mode Sep 14, 2021
Copy link
Contributor

@jstejada jstejada left a comment

Choose a reason for hiding this comment

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

okay! why does the change in the library fixes the issue? also looks like ci is failing

@bvaughn
Copy link
Contributor Author

bvaughn commented Sep 14, 2021

Looks like CI is pretty unhappy with this. Not sure if that's more false positives (which we get pretty often these days) or if that indicates a problem.

@bvaughn
Copy link
Contributor Author

bvaughn commented Sep 14, 2021

why does the change in the library fixes the issue?

An explanation is in the commit message for 88f72b4:

The 'ncp' package hasn't been undated for ~7 years and seems buggy based on my own testing of the Rollup build scripts. (There is a race condition that I can repro 3 out of 4 times where copying a JSON file resolves the ncp() callback while the file's contents are still empty. This breaks scripts like ours which have subsequence calls to read/parse the copied JSON.

Based on my testing, the 'recursive-copy' package does not have this problem.

@jstejada
Copy link
Contributor

oh, thanks! sorry i missed that explanation in the commit message, will make sure to look there as well in the future

@bvaughn
Copy link
Contributor Author

bvaughn commented Sep 15, 2021

LOL no it's my fault. I should have put it in the description. My bad. I remembered writing it but forgot it wasn't in the PR.

@bvaughn
Copy link
Contributor Author

bvaughn commented Sep 15, 2021

I might have to give up on this for now b'c I have other stuff to do. I'll file a bug for follow up instead!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rollup build script --unsafe-partial flag is broken
3 participants