How to upgrade bazel?

匿名 (未验证) 提交于 2019-12-03 01:38:01

问题:

I built bazel-0.4.0 successfully.
Then I tried upgrading it to the latest version bazel-0.5.1 using

$ ./compile.sh compile ../bazel-0.4.0/output/bazel.exe 

It's giving me an error, bazel-0.5.0, bazel-0.4.5 gave me same error

ERROR LOG:

bazel-0.4.4 gave me different error

ERROR LOG:

回答1:

If you already have bazel installed, you can upgrade by running bazel build //src:bazel on a fresh clone of the git repository. Or just download distribution archive and run ./compile. Details: https://bazel.build/versions/master/docs/install-compile-source.html.

Now I'm not sure you can build bazel 0.5.0 with bazel 0.4.0, there were some incompatible changes around 0.4.3. We test building bazel from scratch, and building bazel with last released bazel, but not building bazel with old releases. That will be supported only after we reach 1.0.0.



回答2:

In addition to what mhlopko wrote, you generally don't need to build bazel yourself. Feel free to download the binary installer and just use that.



回答3:

  • To install latest bazel: just run "brew upgrade bazel"

  • Problem I had: I wanted 0.5.4 version of bazel for tensorflow 0.8.

  • Failed attempt to install specific version: brew install bazel@0.5.1

  • Final approach that worked to setup specific version of bazel:

    1. Download bazel-0.5.4-without-jdk-installer-darwin-x86_64.sh from https://github.com/bazelbuild/bazel/releases location
    2. chmod +x ./bazel-0.5.4-without-jdk-installer-darwin-x86_64.sh
    3. ./bazel-0.5.4-without-jdk-installer-darwin-x86_64.sh

That's it!! check bazel version in your terminal. It should give 0.5.4

This approach works for any version of bazel that you want to install..brew way to install specific version didnt work for me. Hope this saves you from wasting hours trying alternative ways to set this up!



文章来源: How to upgrade bazel?
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!