简体   繁体   English

如何使用 Homebrew 安装旧版本的 Bazel?

[英]How to Install an Older Version of Bazel using Homebrew?

I tried to install an older version of Bazel using homebrew by specifying the commit I need ( https://raw.githubusercontent.com/bazelbuild/homebrew-tap/c8a0ccc2a8b442d9887d88c6380f835f533ffd47/Formula/bazel.rb ).我尝试通过指定我需要的提交( https://raw.githubusercontent.com/bazelbuild/homebrew-tap/c8a0ccc2a8b442d9887d88c6380f835f533ffd47/Formula/bazel.rb )来使用自制软件安装旧版本的 Bazel。

I used the command brew install https://raw.githubusercontent.com/bazelbuild/homebrew-tap/c8a0ccc2a8b442d9887d88c6380f835f533ffd47/Formula/bazel.rb .我使用了命令brew install https://raw.githubusercontent.com/bazelbuild/homebrew-tap/c8a0ccc2a8b442d9887d88c6380f835f533ffd47/Formula/bazel.rb However, it points to the Homebrew core instead of the Bazel tap.但是,它指向 Homebrew 核心而不是 Bazel Tap。

Has anyone used brew to manage Bazel version?有没有人用过 brew 来管理 Bazel 版本? Any suggestions are highly appreciated.任何建议都非常感谢。

brew tap bazelbuild/tap
brew extract bazel bazelbuild/tap --version 3.1.0
brew install bazel@3.1.0

That should do.那应该做。

For ex: to install bazel 1.1.0例如:安装 bazel 1.1.0

$ wget https://github.com/bazelbuild/bazel/releases/download/1.1.0/bazel-1.1.0-installer-darwin-x86_64.sh
$ chmod +x bazel-1.1.0-installer-darwin-x86_64.sh
$ ./bazel-1.1.0-installer-darwin-x86_64.sh --user

我们可以试试这个命令来安装 bazel 3.7.2:

cd "/usr/local/lib/bazel/bin" && curl -fLO https://releases.bazel.build/3.7.2/release/bazel-3.7.2-darwin-x86_64 && chmod +x bazel-3.7.2-darwin-x86_64

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM