-
Notifications
You must be signed in to change notification settings - Fork 80
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
Restore mirror capability #210
Conversation
@dochang Here's the restoration of the original mirror feature. If you are able, we need to first get the tests passing in this branch. I'm 99% sure the code is correct and that it's the tests that aren't correct. PRs welcome (opened against this branch) to fix the tests so that they pass. Once the tests are green, we'll change functionality so that it doesn't rely on ruby's mirror_host/checksum format. Cool? |
tests green! time to fix formulation of mirror URL |
b1e3b83
to
9c6d847
Compare
This reverts commit 22c52e0.
This reverts commit 08b8507.
Some changes were made to the mirror tests in upstream during the time that node-build didn't have mirror support, thus those upstream changes were missed. This replays those changes manually to the mirror tests.
An rbenv mirror has a customized repository layout: ruby tarball's url format is like ``` $RUBY_BUILD_MIRROR_URL/$checksum ``` not like ``` $RUBY_BUILD_MIRROR_URL/2.3/ruby-2.3.1.tar.bz2 ``` Common node mirrors just use the same URL structure as nodejs.org (though typically with the /dist path segment removed). Subsequent PRs will need to make the mirror url formulation more robust. see #208 (comment)
Not all mirrors will use the identical scheme of matching the nodejs.org url structure with `/dist` omitted. Now users may specify `NODE_BUILD_MIRROR_CMD` to be the name of a command or function which constructs the full mirrored package URL when given the original package URL and checksum as arguments. If omitted, the default scheme is used wherein NODE_BUILD_MIRROR_URL is substituted for `https://nodejs.org/dist/` The presence of *either* NODE_BUILD_MIRROR_URL or NODE_BUILD_MIRROR_CMD is sufficient to trigger a mirror attempt.
f46f7e2
to
c73fbe2
Compare
@dochang would you be able to verify whether this PR works for you? Also, could you share all of the nodejs mirrors (and their respective URL structures) that you're aware of? |
It works here, Thank you! Please merge it! Here are all mirrors I found: |
Because nodenv supports NODE_BUILD_MIRROR_URL now [1], [2]. [1]: nodenv/node-build#208 [2]: nodenv/node-build#210
node-build will not provide a default mirror, but this PR at least restores the ability to select a mirror from which to download packages.
closes #208