-
Notifications
You must be signed in to change notification settings - Fork 779
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
Support specifying the complete mirror URL #1457
Conversation
Signed-off-by: Mingxiang Xue <mingxiangxue@gmail.com>
Fwiw, node-build had this same limitation and we solved it by adding a new env var "NODE-BUILD-MIRROR-CMD" which defines a user-provided command that will generate a mirror url when given the package name and checksum. This allows users full control over how mirror urls are constructed. It may be a feature worth up streaming into ruby-build. |
@jasonkarns I considered the
So I think a simple variable is enough to satisfy all the cases. Anyway, if you or other members prefer |
Yep, I agree it's not super simple. The downside with a variable containing the full URL is that users would need to construct that URL for each ruby they install. The _CMD approach allows a one-time setup that works for future ruby installs as well. I'd say the using a full URL env var would be easy, but not necessarily "simple". It's also worth noting that the _CMD approach and the "full URL" approach are not mutually exclusive. We could support both so users have a choice for whichever suits their needs. I'd like some other maintainers to weigh in before proceeding with a PR. |
Totally agree.
Thanks. Waiting for your and other maintainers' further feedbacks. |
@hsbt Sorry to ping you. Can you help to make progress on this issue? Really want to have another strategy to specify the mirror. @jasonkarns I found another fix for this similar issue in python-build, which was merged several days ago. It uses |
@uzxmx Sorry, too late response. I knew the situation of Ruby in China. I believe this option helps Ruby users in China. |
When using a mirror,
ruby-build
requires the package is located at$RUBY_BUILD_MIRROR_URL/<SHA2>
, which is not a generic case.Here list all mirror sites of ruby source, and most of them provide the tarball with name format like
http://host/pub/ruby/2.7/2.7.1.tar.bz2
. To benefit from more mirror sites, and also keep compatibility, I propose adding another variable (which can be named asRUBY_BUILD_MIRROR_PACKAGE_URL
) to specify the complete mirror URL. So a user can use it like this:Fix #1032. As this comment said, the download speed in China is too slow when installing a new version from official ruby CDN, so at least this feature will be especially useful for users living in China.