-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
win,install: only download target_arch node.lib #2857
win,install: only download target_arch node.lib #2857
Conversation
@@ -12,7 +12,7 @@ | |||
"gyp" | |||
], | |||
"version": "9.3.1", | |||
"installVersion": 10, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A question for people with more experience in node-gyp
: Since a PR that changed installVersion
from 9 to 10 landed yesterday in aaa117c do I need to increase it to 11 now, or not, because there was no release with installVersion: 10
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A question for people with more experience in
node-gyp
I'm not more experienced, but my 2 cents: it's probably unnecessary for end users (since as you stated, no release went out), but AFAIK there's no harm in bumping it again, and it will prevent a situation where anyone who tested main
(so folks working on node-gyp
like you and I, or maybe even someone some where consuming node-gyp@main
for whatever reason) and got their cache populated for installVersion: 10
won't end up in a broken situation.
So to me bumping it to 11 seems reasonable to prevent any problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without going too deep on it, seems reasonable.
For more context, what's the main motivation for this change? Saving disk space, overall efficiency, fixing a corner case?
This does create a small behavior change - while before you could do node-gyp install
to "pre-warm" the cache and then do subsequent builds using that cache, say offline, now a build with a specific --target
value might require a download which would fail without network connection. Not sure that's necessarily a problem, just noting the change in behavior for end users.
The main goal is to minimize the number of requests made to the download server, thus decreasing the network traffic. There are some random issues that occur (eg. #2847) that we'd like to get rid of.
This is a good point. Thanks for bringing it up. I agree this changes the way |
Can someone from @nodejs/node-gyp please take a look? Please note that the failed GitHub Actions are not caused by this change, it's a general problem that |
Instead of downloading node.lib for all architectures, just download the one that will be needed. Install.js changed to enable downloading just node.lib for node versions that already have tarball downloaded and extracted. Not fetching lib now fails the installation. Increased installVersion because of the changes. Refs: nodejs#2847
406635b
to
af4b3a9
Compare
After rebasing to the latest main (with the fix for GitHub Actions), all the tests are passing. @nodejs/node-gyp Is there something else I should do here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, although I have not tested it locally. Also AFAIK my check mark is not green here but happy to give it anyway. 😄
@@ -12,7 +12,7 @@ | |||
"gyp" | |||
], | |||
"version": "9.3.1", | |||
"installVersion": 10, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A question for people with more experience in
node-gyp
I'm not more experienced, but my 2 cents: it's probably unnecessary for end users (since as you stated, no release went out), but AFAIK there's no harm in bumping it again, and it will prevent a situation where anyone who tested main
(so folks working on node-gyp
like you and I, or maybe even someone some where consuming node-gyp@main
for whatever reason) and got their cache populated for installVersion: 10
won't end up in a broken situation.
So to me bumping it to 11 seems reasonable to prevent any problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSLGTM
Instead of downloading node.lib for all architectures, just download the one that will be needed. Install.js changed to enable downloading just node.lib for node versions that already have tarball downloaded and extracted. Not fetching lib now fails the installation. Increased installVersion because of the changes. Refs: nodejs#2847
@StefanStojanovic, just realized this could cause problems due to this Line 90 in 33391db
If a user were to do something like Seems like the check I've linked above should be Although that does mean that you could get fighting versions since |
Checklist
npm install && npm test
passesDescription of change
Instead of downloading node.lib for all architectures, just download the one that will be needed.
install.js
changed to enable downloading just node.lib for node versions that already have tarball downloaded and extracted. Not fetching lib now fails the installation. Increased installVersion because of the changes.A note to reviewers - although it seems there are many changes, most of them are just indentation. Also @dsanders11 I'd like to ask you for a review, since your change for
install.js
landed a few days ago, and I worked on those parts of the code too.Refs: #2847