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

ci: Work around npm behavior changes to fix CI on main #206

Merged
merged 2 commits into from Jun 21, 2022

Conversation

btmills
Copy link
Member

@btmills btmills commented Jun 19, 2022

These commits address two behavior changes in npm that changed between Node 16.15.0, which bundles npm 8.5.5, and Node 16.15.1, which bundles npm 8.11.0:

  1. npm 8.10.0 started running the main package's prepare script recursively as part of the examples' sub-installs. This broke CI when the install step launched a fork bomb and got killed after several minutes on recent versions of Node that ship npm >= 8.10.0. I've left a comment on [BUG] npm install on Mac - Out of Memory npm/cli#4895, which appears to be related.
  2. npm 8.6.0 changed something about peer dependencies that causes CI to fail linking the main package under Node 16 and ESLint 6.

These changes should fix builds on main.

A change between npm 8.9 and 8.10 started running the main package's
`prepare` script as part of the examples' installs. This broke CI when
the install step launched a fork bomb and got killed after several
minutes.

This change should fix builds on `main`.
@btmills
Copy link
Member Author

btmills commented Jun 19, 2022

Looks like there are two behavior changes in npm since 8.5 that are breaking our CI. I'm not yet confident enough that our usage is intended to be supported to call them regressions or breaking changes, so I'm sticking with behavior changes for now.

I have a workaround for the second change that is still causing CI to fail on this branch. (Spoiler alert: peer deps, or course.) I needed to step away for a bit but will push the fix later.

Something about peer dependencies changed between npm 8.5.5 and 8.6.0
that is causing CI to fail on `main` with ESLint 6 on the test matrix.

This works around the issue.
@btmills btmills changed the title ci: Prevent recursive prepare script invocations ci: Work around npm behavior changes to fix CI on main Jun 20, 2022
This was referenced Jun 20, 2022
@@ -82,7 +82,7 @@ describe("recommended config", () => {
// eslint-disable-next-line no-invalid-this
this.timeout(30000);

execSync("npm link && npm link eslint-plugin-markdown");
execSync("npm link && npm link eslint-plugin-markdown --legacy-peer-deps");
Copy link
Member Author

Choose a reason for hiding this comment

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

We have to use --legacy-peer-deps because there is no version of eslint-plugin-jsdoc that supports ESLint 6, 7, and 8. --legacy-peer-deps disables additional peer dependency checks that were added in npm 8.6.0 and caused our CI to begin failing.

Copy link
Contributor

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

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

LGTM.

@nzakas nzakas merged commit 6570c82 into main Jun 21, 2022
@nzakas nzakas deleted the recursive-prepare branch June 21, 2022 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants