Update npm and node-gyp, for macOS signing fix #94
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reason for bumping node-gyp again (purpose of this PR)
There is an issue with code-signing apps built with node-gyp 9.1.0 or newer. (This is due to unforeseen consequences of a change I authored in node-gyp, unfortunately. The change in question: nodejs/node-gyp@b9ddcd5.)
So, this PR bumps node-gyp to the latest commit from node-gyp repo's
main
branch, currently nodejs/node-gyp@d3615c6.This includes a fix for better compatibility with app signing on macOS (nodejs/node-gyp@0f1f667).
Said commit with the fix isn't a part of any tagged or published-to-npm-package-registry releases yet, so we have to grab it from the node-gyp repo, rather than, say, as a version from the npm registry like we usually would.
How to do this (how to bump node-gyp in our fork of npm --> how to bump node-gyp in ppm:
npm-lifecycle
,libnpm
,libcipm
, andnpm
(this last one has a custom repo namenpm-cli
for our fork. Because the upstreamcli
repo name is rather ambiguous otherwise.)node-gyp
innpm-lifecycle
'spackage.json
. (Recommended to bump the version number ofnpm-lifecycle
as well, to make it easier to track changes.) Publish these changes to Pulsar's fork ofnpm-lifecycle
.npm-lifecycle
inlibnpm
andlibcipm
's respectivepackage.json
s. (Bump versions of both packages.) Publish these changes to Pulsar's fork of each respective package.npm-lifecycle
,libnpm
,libcipm
andnode-gyp
innpm
'spackage.json
. (Bumpnpm
's version.) Publish these changes to Pulsar's fork ofnpm
package.node_modules
. Unlike most NodeJS packages, thenode_modules
dir has some of its content checked in and changes tracked in git. This is so, when you clone thenpm
repo, it has a functional basic set of dependencies already, and can bootstrap itself.npx npm@6 install --ignore-scripts
, the files on-disk for any of the packages under node_modules have changed, AND only ifgit status
shows any of the package's files asmodified
, rather than all of them beingnew file
or all of the package's files being listed underUntracked files:
, then you should check in all the changes to files directly belonging to said package, but not any files under said package's own nestednode_modules
subfolder, unless those are already checked in and tracked as well.(Put more concisely: If a package has
modified
files undergit status
, update its checked-in files. Stage (git add
) them and commit (git commit
) them. And don'tgit add
brand-new sub-dependencies that aren't already tracked in git -- ones that don't themselves show asmodified
ingit status
.node_modules
, unless they are genuinely part of the changed files in that package. Can confirm by checking the changed files at that package's git repo between the version you started with and the version you bumped to. Or alternatively, you can confirm by checking that the files in question are there if you download the package version in question withnpm pack [package_name]@[version]
, extracting the resulting tarball and inspecting the files -- you want to see that they match what you're going to commit, before committing them innpm
repo. Add new files only for a package that was tracked in git at the npm repo before you started.node . install
in the repo without errors, and have a large amount of the tests pass if you runnode . test
in the repo. I'm not aware of a way to avoid 100% of errors in the test suite, however. So, if most tests pass, that's what you're looking for.npm
package is in good shape, runnpm pack
to package thenpm
package properly as a tarball. Publish this tarball as a release asset on Pulsar's fork of npm. (Without this, npm's sub-dependencies install wrong and are broken when you try to install it as a dependency ofppm
).ppm
repo, and bumpnpm
andnode-gyp
inppm
'spackage.json
. Runyarn install
and update theyarn.lock
lockfile as well. Publish the branch where you made these changes, and post a pull request.Note: highly recommended to use npm 6 above, whenever running npm commands, since all the lockfiles for these packages are meant to be lockfile v1 format, which is the npm 6-era lockfile format.
Context/tech debt notes
This is how we get newer node-gyp in ppm at the moment. Not easy, but this is the cost of tech debt and being indebted to npm 6-era technology (especially the "
require('npm')
", AKA "use npm all at once as a single library" thing that got significantly changed in npm 7 and then dropped altogether in npm 8).(It's also the consequence of npm tending to require node-gyp all over the place in multiple, roundabout ways, given the way they split up slightly related modules that handle all this stuff on the npm side of things.)
Ideally, from a technical implementation stand-point, I feel we should find some way to use the underlying libraries that make up npm as and where we need them. This has been discussed a bit on the Discord. Easier said than done.
For now, we have a fork on
npm
, one that hopefully we don't need to update all that often. (And especially we hopefully don't need to bumpnode-gyp
very often, as it is one of the more painful/complicated dependencies to bump. For above-mentioned reasons.)Verification process
yarn install
runs cleanly without updatingyarn.lock
, indicating dependencies are stable.yarn check
is mostly without errors.npm/node_modules/tar
allegedly being the wrong minor versions, but when I check on the version actually installed, they are the correct versionsyarn check
said it wanted to see??!?!).error "npm#tar#minipass" is wrong version: expected "2.9.0", got "2.3.3"
<-- I checked, 2.9.0 is installed on my machine???error "npm#tar#yallist" is wrong version: expected "3.1.1", got "3.0.3"
<-- I checked, 3.1.1 is installed on my machine???yarn upgrade
andyarn upgrade-interactive
... Not as urgent as having working dependencies, IMO. But could save some disk space and install time, ToDo later I guess, maybe, but low low priority.)