-
Notifications
You must be signed in to change notification settings - Fork 35
Add github mirror for users in China #94
base: master
Are you sure you want to change the base?
Conversation
Users have reported that downloads from https://releases.bazel.build became inaccessible from China: bazelbuild/bazel#11403 Verified using https://www.websitepulse.com/tools/china-firewall-test that downloads from github should work (and downloads from releases.bazel.build don't).
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.
@philwo Are we keeping this, or migrating to the centralized homebrew package?
@@ -16,6 +16,8 @@ class Bazel < Formula | |||
desc "Fast, scalable, multi-language and extensible build system" | |||
homepage "https://bazel.build/" | |||
url "https://releases.bazel.build/3.1.0/release/bazel-3.1.0-installer-darwin-x86_64.sh", :using => :nounzip | |||
# Mirror for users in China | |||
mirror "https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-installer-darwin-x86_64.sh" |
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.
Does the .rb file format allow for variables? It'd be nice to only need to update one place when the version increments.
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.
I haven't tested it, but according to the docs this should work:
version = "3.1.0"
url "https://releases.baze.build/#{version}/release/bazel-#{version}-installer-darwin-x86_64.sh", :using => :nounzip
mirror "..."
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.
Oh, wait. This is inside a Ruby class - then I'm not sure how it would work :/
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.
I believe you can use ALL_CAPS for global variables.
Actually here I think you can just do something like:
bazel_version = 3.1.0
url "https://releases.baze.build/#{bazel_version}/release/bazel-#{bazel_version}-installer-darwin-x86_64.sh", :using => :nounzip
mirror "https://github.com/bazelbuild/bazel/releases/download/#{bazel_version}/bazel-#{bazel_version}-installer-darwin-x86_64.sh"
version bazel_version # or version(bazel_version)
The centralized package builds from source as a matter of policy ( https://github.com/Homebrew/brew/blob/master/docs/Acceptable-Formulae.md#we-dont-like-binary-formulae) and uses Homebrew's openjdk install at runtime. I assumed we wanted to keep the bazelbuild/tap package around because of that (e.g. given https://blog.bazel.build/2018/08/22/bazel-homebrew.html) |
Users have reported that downloads from https://releases.bazel.build became
inaccessible from China: bazelbuild/bazel#11403
Verified using https://www.websitepulse.com/tools/china-firewall-test that
downloads from github should work (and downloads from releases.bazel.build
don't).