Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove npm run prepublishOnly from pretest. #542

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

Merged
merged 2 commits into from
Aug 16, 2021

Conversation

ekpyron
Copy link
Member

@ekpyron ekpyron commented Aug 16, 2021

Leftover in ethereum/solidity#11750 and my guess what currently breaks the solidity tests.

@ekpyron ekpyron requested a review from chriseth August 16, 2021 11:53
@ekpyron ekpyron changed the title Remove npm run prepublishOnly from pretext. Remove npm run prepublishOnly from pretest. Aug 16, 2021
@ekpyron
Copy link
Member Author

ekpyron commented Aug 16, 2021

Wrong fix.

@ekpyron ekpyron closed this Aug 16, 2021
@cameel cameel reopened this Aug 16, 2021
@cameel cameel force-pushed the removePrepublishOnlyFromPretest branch from 2c3e19b to d3473fc Compare August 16, 2021 14:34
@coveralls
Copy link

Coverage Status

Coverage remained the same at 85.828% when pulling d3473fc on removePrepublishOnlyFromPretest into fb7a98d on master.

@cameel
Copy link
Member

cameel commented Aug 16, 2021

I think it's actually a good fix, you just needed to update the CI config to download the binary.

Another solution would be to replace prepublishOnly with prepare, which provides the old functionality:

Deprecation Note: prepublish

Since [email protected], the npm CLI has run the prepublish script for both npm publish and npm install, because it's a convenient way to prepare a package for use (some common use cases are described in the section below). It has also turned out to be, in practice, very confusing. As of [email protected], a new event has been introduced, prepare, that preserves this existing behavior. A new event, prepublishOnly has been added as a transitional strategy to allow users to avoid the confusing behavior of existing npm versions and only run on npm publish (for instance, running the tests one last time to ensure they're in good shape).

See npm/npm#10074 for a much lengthier justification, with further reading, for this change.

I checked and, unlike prepublishOnly, prepare can be disabled in npm config so it would just require tweaking the name in ethereum/solidity#11805.

But I'd rather keep prepublishOnly. Overwriting the binary on npm run test is not a very friendly behavior. I'd expect tests to run against what I have in the repo, and not replace it with something completely different. It should not be the default behavior, especially given that it's so hard to disable.

I pushed a change that runs the download in the CI. I also created a new command - npm run updateBinary to make it more explicit.

@ekpyron
Copy link
Member Author

ekpyron commented Aug 16, 2021

I'd approve, but I can't, since I authored.

@cameel
Copy link
Member

cameel commented Aug 16, 2021

Oh :)

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

Successfully merging this pull request may close these issues.

3 participants