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

How to downgrade / "brew install bazel@<version>" fails. #39

Closed
drscotthawley opened this issue Feb 5, 2019 · 14 comments
Closed

How to downgrade / "brew install bazel@<version>" fails. #39

drscotthawley opened this issue Feb 5, 2019 · 14 comments

Comments

@drscotthawley
Copy link

drscotthawley commented Feb 5, 2019

Hi , thanks for preparing this. I'm a bit stuck, and I'm wondering if the README could include information about not only how to upgrade, but also how to downgrade.
I landed here from Tensorflow issue tensorflow/tensorflow#25490
in which downgrading bazel to 0.15.0 was suggested. So...

$ brew install bazel@0.15.0
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/cask-versions, homebrew/core and homebrew/cask).
==> Updated Formulae
bazel ✔ ffmpeg ✔ apache-opennlp conjure-up crystal mpd ngircd streamlink

Error: No available formula with the name "bazel@0.15.0"
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

Let's see what versions are available.

$ brew search bazel
==> Formulae
bazel ✔ bazelbuild/tap/bazel ✔ bazelbuild/tap/ibazel

? No version numbers listed?

Ok, finally let's try brew switch:

$ brew switch bazel 0.15.0
Error: bazel does not have a version "0.15.0" in the Cellar.
bazel installed versions: 0.22.0

? Would appreciate any help.

@cre8ivejp
Copy link

Same issue here.
There is any update on this?

@jamiesnape
Copy link
Contributor

In general downgrading a homebrew formula is not supported. brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/bab70bd0f3bad4dbd755ec4e5357d8fd782f89d6/Formula/bazel.rb may work (you would need to uninstall any other versions of bazel formulae first). You cannot add an arbitrary @{version} after a formula name, since each “version” is actually a separate formulae that must be explicitly created. IIRCbrew switch will only work if you previously installed that version and have not cleaned it up.

@SystemErrorWang
Copy link

@jamiesnape would you please tell me what should i do if i want to install bazel0.21.0? Failed to compose the correct url myself.

@jamiesnape
Copy link
Contributor

Look at https://github.com/bazelbuild/homebrew-tap/commits/master/Formula/bazel.rb for the 0.21.0 release and you will see it was commit 42a4bf1 on December 20th, 2018.

Hence:

brew install https://github.com/bazelbuild/homebrew-tap/blob/42a4bf1f4411084321e95f89c0653fe62f74ae10/Formula/bazel.rb

@Imranmkt
Copy link

How to install bazel 0.24.1 on Mac ? #jamiensnape

@jamiesnape
Copy link
Contributor

Use the same process as the previous comment explains. I am afraid I cannot give instructions for reverting arbitrary versions of bazel.

@katre @philwo Can you close this issue? It is not this tap's problem at all.

@katre
Copy link
Member

katre commented Jun 27, 2019

Closing this since it's not something Bazel's homebrew-tap can fix.

Thanks @jamiesnape for help answering.

@katre katre closed this as completed Jun 27, 2019
@farazBhatti
Copy link

@Imranmkt try:
brew install https://github.com/bazelbuild/homebrew-tap/blob/b515f2b67ce6bc8c3c23e63de6235f130f868acf/Formula/bazel.rb

@Imranmkt
Copy link

@farazBhatti Thank you for your comment. I tried the link to install bazel but it's showing unexpected syntax error.

Error: bazel: /Users/imran/Library/Caches/Homebrew/Formula/bazel.rb:7: syntax error, unexpected '<'

@plucury
Copy link

plucury commented Jun 29, 2019

@Imranmkt Have try with brew install https://raw.githubusercontent.com/bazelbuild/homebrew-tap/b515f2b67ce6bc8c3c23e63de6235f130f868acf/Formula/bazel.rb

@farazBhatti
Copy link

@Imranmkt , i think a new thread should be opened for your problem so that other people facing problem same as your's can also be benefited. we can discuss this issue on the new thread

@powderluv
Copy link

The URL has changed. I have been able to install .26.1 to build tensorflow 2.0 with
brew install https://raw.githubusercontent.com/bazelbuild/homebrew-tap/c8a0ccc2a8b442d9887d88c6380f835f533ffd47/Formula/bazel.rb

@envil
Copy link

envil commented Dec 23, 2019

To get install URL for your desired version, get the raw link of the bazel.rb, for example:
https://raw.githubusercontent.com/bazelbuild/homebrew-tap/42a4bf1f4411084321e95f89c0653fe62f74ae10/Formula/bazel.rb

then

brew install <YOUR_URL HERE>

@jvmncs
Copy link

jvmncs commented May 7, 2020

a better solution to this problem:

brew tap bazelbuild/tap
brew extract bazel bazelbuild/tap --version X.X.X

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

No branches or pull requests