Skip to content

Conversation

@MylesBorins
Copy link
Contributor

Another attempt after #19560 broke master. Because npm removed node-gyp we now need to vendor it. I've added it to tools/node_modules similar to our other vendored dependencies. I've also gone ahead and make a script to update the dep, update the license builder, update the license, and update the Makefile.

I'm going to run CITGM on this... I'm curious if this will have any effect on native modules at all.

/cc @iarna why did y'all remove node-gyp, and are there any edge cases we should expect?

@nodejs-github-botnodejs-github-bot added build Issues and PRs related to build files or the CI. meta Issues and PRs related to the general management of the project. npm Issues and PRs related to the npm client dependency or the npm registry. labels Apr 5, 2018
@MylesBorins
Copy link
ContributorAuthor

Also, it would be possible to move the node-gyp folder out of the npm directory before updating npm. This may make the diff a bit smaller when updating gyp via the script... although I'm not sure if this really makes a difference for git internals... just wanted to make an offer to do so

FallenRiteMonkand others added 2 commits April 5, 2018 18:38
Currently npm explicitly doesn't support 10.x and will fail on master. This patch manually adds support for 10.x so that we can keep an up to date version of npm on master. refs: nodejs#17535 PR-URL: nodejs#17777 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
@MylesBorins
Copy link
ContributorAuthor

@MylesBorins
Copy link
ContributorAuthor

/cc @nodejs/build and @nodejs/tsc as this change has gotten a bit bigger in scope

@jasnell
Copy link
Member

Wait... 5.8 removed node-gyp in a minor release? Ugh.

@addaleax
Copy link
Member

@jasnell No, the files just moved around in-tree

@jasnell
Copy link
Member

No, the files just moved around in-tree

Phew... ok good.... :-) gave me a slight mini heart attack there.

@rvagg
Copy link
Member

rvagg commented Apr 5, 2018

so wait, was it removed or moved? did @MylesBorinsadd it to node_modules or .. what is going on? is there a reference for what this is all about?

@addaleax
Copy link
Member

$ grep version tools/node_modules/node-gyp/package.json "version": "3.6.2" $ grep version deps/npm/node_modules/npm-lifecycle/node_modules/node-gyp/package.json "version": "3.6.2" 

This PR is adding a second copy.

I think we could just hoist node-gyp back to its old location in the npm tree manually

@MylesBorins
Copy link
ContributorAuthor

MylesBorins commented Apr 6, 2018 via email

node-gyp has been moved in the tree of npm. This update fixes references to the location in the Makefile
@MylesBorins
Copy link
ContributorAuthor

rolled back the node-gyp stuff and simply updated the Makefile to reference the new location in the npm node_modules tree.

CI: https://ci.nodejs.org/job/node-test-pull-request/14084/
CI for master: https://ci.nodejs.org/job/node-test-commit/17479/ (there were weird failures in last CI)

Copy link
Member

@richardlaurichardlau left a comment

Choose a reason for hiding this comment

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

vcbuild.bat will also need to be updated with the new node-gyp location.

@richardlau
Copy link
Member

The AIX failure is real. node-gyp's lib/find-node-directory.js assumes it lives in npm/node_modules/node-gyp/lib.

Cc @nodejs/platform-aix

@rvagg
Copy link
Member

rvagg commented Apr 6, 2018

The AIX failure is real. node-gyp's lib/find-node-directory.js assumes it lives in npm/node_modules/node-gyp/lib.

I've seen a lot of code (and maybe I've written some ...) that makes this assumption, moving it could cause some yelping. +1 to hoisting it although we should probably have this discussion with npm folks.

@ChALkeR
Copy link
Member

ChALkeR commented Apr 6, 2018

I just observed Atom text editor failing to install or update any plugins because of this with system-wide [email protected] install.

https://github.com/npm/npm/blob/master/bin/node-gyp-bin/node-gyp — npm itself fails on 5.8.0 when executing this file.

Related: npm/npm#20163, mapbox/node-pre-gyp#362

@zkat
Copy link
Contributor

zkat commented Apr 6, 2018

As pointed out: we didn't remove node-gyp, but instead moved it so it lives under npm-lifecycle now, as part of refactoring these bits into separate pieces.

@MylesBorins
Copy link
ContributorAuthor

@zkat I think the issue is that node-gyp itself has code internally expecting to live at that location... And there is a non trivial amount of code in the ecosystem making similar assumption

@zkat
Copy link
Contributor

zkat commented Apr 6, 2018

@MylesBorinsnpm/npm#20276

If this works, it should be pretty easy to backport as well.

@MylesBorins
Copy link
ContributorAuthor

@zkat 🎉

@ChALkeR
Copy link
Member

ChALkeR commented Apr 6, 2018

Yes, npm/npm#20276 looks like an ideal solution (especially the tests part). Thanks, @zkat!

@MylesBorinsMylesBorins mentioned this pull request Apr 11, 2018
This was referenced Apr 15, 2018
@BridgeAR
Copy link
Member

Should this stay open due to #20190?

@MylesBorins
Copy link
ContributorAuthor

MylesBorins commented Apr 22, 2018 via email

@p0psicles
Copy link

@MylesBorins does this mean there is a chance that npm 5.8.x get's released (packaged) with a node 8.x.x version?

@BridgeAR
Copy link
Member

Ping @MylesBorins about retargeting this PR

@MylesBorins
Copy link
ContributorAuthor

@BridgeAR I'm going to go ahead and close this for now. We would need a different 5.x version to fix the node-gyp issue. If 6.x lands on master in a timely fashion we can backport in an 8.x minor, which is coming in the next month

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

buildIssues and PRs related to build files or the CI.metaIssues and PRs related to the general management of the project.npmIssues and PRs related to the npm client dependency or the npm registry.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

11 participants

@MylesBorins@jasnell@addaleax@rvagg@richardlau@ChALkeR@zkat@BridgeAR@p0psicles@nodejs-github-bot@FallenRiteMonk