Skip to content
This repository has been archived by the owner on Apr 7, 2024. It is now read-only.

Add github mirror for users in China #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tetromino
Copy link
Contributor

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).

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).
Copy link
Member

@katre katre left a 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"
Copy link
Member

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.

Copy link
Member

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 "..."

Copy link
Member

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 :/

Copy link
Contributor

@gibfahn gibfahn May 22, 2020

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)

@tetromino
Copy link
Contributor Author

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)

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

Successfully merging this pull request may close these issues.

4 participants