How to install a specific release of a Homebrew formula on GitHub

homebrewinstall

I am trying to install a specific version of Buck using Homebrew. Facebook provide a formula on GitHub.

I have added the tap:

brew tap facebook/fb

I can then install Buck using:

brew install --HEAD facebook/fb/buck

However, I would like to install a specific release, for example v2017.05.02.01.

What is the syntax for installing a specific release from GitHub?

I am looking for something like:

# This does not work! 
brew install --v2017.05.02.01 facebook/fb/buck

Note: other questions do not seem to be about releases on GitHub.

Best Answer

Not sure whether this is a good idea or not, but it does seem like you can install from an older commit.

So for example the following command seems to work to download, build and install version 2017.05.02.01 of buck. Note that it will try to download and compile from source because the binaries have been deleted from the repo.

brew install https://raw.githubusercontent.com/facebook/homebrew-fb/7511722fd58e999e5d8c3a415d4e8cd1deee8f21/buck.rb

I got to this by:

  1. Going into the commit history of homebrew-fb
  2. Clicking on the <> button for the "Update buck.rb to v2017.05.02.01" commit to take me into the repository as it existed with that commit
  3. Selecting the buck.rb file
  4. And lastly clicking the "Raw" button to get the url directly to that specific version of the buck.rb