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

Supporting alternative mirror url schemes #1032

Closed
jasonkarns opened this issue Dec 6, 2016 · 2 comments · Fixed by #1457
Closed

Supporting alternative mirror url schemes #1032

jasonkarns opened this issue Dec 6, 2016 · 2 comments · Fixed by #1457

Comments

@jasonkarns
Copy link
Member

jasonkarns commented Dec 6, 2016

At present, ruby-build only supports the mirrorUrl/checksum format for mirrored package URLs. (

mirror_url="${RUBY_BUILD_MIRROR_URL}/$checksum"
) For node-build, we had need to support a different default mirrored URL scheme. In doing so, we have extended the mirror support to not only accept a *_MIRROR_URL environment variable, but also to accept a *_MIRROR_CMD variable with the name of a function or command which can construct a full mirrored package URL (given the original package URL and checksum as arguments). In this manner, node-build can default to a common mirror scheme for node mirrors, but also be flexible enough to allow users to construct URLs as necessary for their specific mirror sites.

The core of this feature is in nodenv/node-build@c73fbe2 as part of nodenv/node-build#210

We haven't yet merged this feature into node-build. If everything goes as planned and it is merged to node-build, I intend to also submit this feature here to ruby-build. In hopes of gathering feedback ahead of time, I would love some comments on this feature.

@mislav
Copy link
Member

mislav commented Dec 7, 2016

What would be the use-case for ruby-build?

@dochang
Copy link

dochang commented Dec 10, 2016

Currently, the mirror supported by rbenv and ruby-build has a customized directory structure.

The mirror url format is

$RUBY_BUILD_MIRROR_URL/$checksum

but not like

$RUBY_BUILD_MIRROR_URL/2.3/ruby-2.3.1.tar.bz2

It means that I can't download ruby from any existing "plain mirror". I have to make my own "custom mirror" for ruby-build. For example, there are some ruby mirrors (ruby-china & ustc) in mainland China, but Chinese users cannot use ruby-build to download ruby from there.

A Chinese developer has written an rbenv plugin called rbenv-china-mirror to solve this problem. But I think it's just a hack. This problem should be solved by ruby-build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants