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

Remove / Rename prepare script #1082

Closed
TikiTDO opened this issue May 22, 2019 · 3 comments
Closed

Remove / Rename prepare script #1082

TikiTDO opened this issue May 22, 2019 · 3 comments
Labels

Comments

@TikiTDO
Copy link

TikiTDO commented May 22, 2019

Environment

Any version.

Description

When managing running yarn, the package manager will automatically run several specifically named scripts.

This in turn can cause a lot of weird issues when running in yarn workspaces due to this script running outside of the expected order. While this is strictly a yarn bug, the direct cause is using the fact that this lib uses a script with a special meaning.

Given that all the script seems to do is generate a build artifact used by a particular babel gem a simple fix would be to rename the script to some other name, and then to run it once whenever releasing a new version. This would both speed up the build, and prevent any weird out-of-order issues.

Reproducible Demo

The bug is intermittent, but I have some more details here:

yarnpkg/yarn#7212 (comment)

@satya164
Copy link
Member

the direct cause is using the fact that this lib uses a script with a special meaning
rename the script to some other name, and then to run it once whenever releasing a new version

the whole point of using prepare is to do less work when publishing by automatically running the script. we don't want to run an extra script manually before publishing. the script also needs to be run on git installs etc. automatically so the lib can be consumed from GitHub.

This would both speed up the build

we don't have any issues with build speed, the babel plugin is pretty fast.

and prevent any weird out-of-order issues

what kind of out of order issues?

@TikiTDO
Copy link
Author

TikiTDO commented May 22, 2019

The issue is an intermittent failure when installing yarn libraries in a CI environment.

Yarn tries to give the prepare script it's own environment, which can conflict with the parent instance of yarn. This can cause one of the instances of yarn to extract an archive that does not exist, or is still being downloaded by the other, which causes the an error akin to this one:

error https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz: Extracting tar content of "/home/adys/.cache/yarn/v4/npm-glob-7.1.3-3960832d3f1574108342dafd3a67b332c0969df1/node_modules/glob/.yarn-tarball.tgz" failed, the file appears to be corrupt: "ENOENT: no such file or directory, open '/home/adys/.cache/yarn/v4/npm-glob-7.1.3-3960832d3f1574108342dafd3a67b332c0969df1/node_modules/glob/changelog.md'"

The worst part is that the failing library can differ arbitrarily based on how fast any given lib is fetched, so debugging is is particularly difficult.

There's a lot more info in the link at the bottom of my post.

I have my own fork of rn-paper with the prepare script removed, and it does not affect my ability to run the lib from github. As I mentioned before this command seems to be specific to a babel plugin which does not appear to be a included in the default RN install.

@github-actions
Copy link

Hello 👋, this issue has been open for more than 2 months with no activity on it. If the issue is still present in the latest version, please leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution on workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants