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

Add github mirror for users in China#94

Open
tetromino wants to merge 1 commit into
bazelbuild:masterfrom
tetromino:patch-3
Open

Add github mirror for users in China#94
tetromino wants to merge 1 commit into
bazelbuild:masterfrom
tetromino:patch-3

Conversation

@tetromino

Copy link
Copy Markdown
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).
@tetromino tetromino requested review from katre and philwo as code owners May 15, 2020 16:16

@katre katre left a comment

Copy link
Copy Markdown
Contributor

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?

Comment thread Formula/bazel.rb
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
Copy Markdown
Contributor

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

@gibfahn gibfahn May 22, 2020

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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