Add github mirror for users in China#94
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).
| 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.
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.
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.
Oh, wait. This is inside a Ruby class - then I'm not sure how it would work :/
There was a problem hiding this comment.
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).