Has brew install --force <formula raw path> been taken out?

My team maintains brew packages with DMG image and some of the brew dependencies are fixed to certain bottles with commit hash of the formula files defined in Homebrew/homebrew-core.

2 days ago I tried to update some dependencies and found that brew install with commit hash is disabled.

Error: Calling Installation of libxml2 from a GitHub commit URL is disabled! Use 'brew extract libxml2' to stable tap on GitHub instead.

or

Error: Calling Non-checksummed download of libxml2 formula file from an arbitrary URL is disabled! Use 'brew extract' or 'brew create' and 'brew tap-new' to create a formula file in a tap on GitHub instead.

Is there any way to install the specified version of modules via brew?

Thank you in advance

You can use this suggestion that it provides. https://docs.brew.sh/Manpage#extract-options-formula-tap

Thanks for the reply, but as you see in the log, the problem pops up from the libxml2 and libxml repository is not including Formula ruby file now. Should I fork the repo in case of libxml to make new formula and make it brew tap-able?

You need to make a seperate tap for all the formula you want to get a specific dependency of. This has nothing to do with the libxml repository.

I got you. Thanks for the quick response.

I’m trying to use brew extract according to the instructions, but the ‘formula’ and ‘tap’ language is confusing.

I want to install Hugo 0.68.3. brew extract hugo isn’t helpful because that command generates an error (Calling Installation of hugo from a GitHub commit URL is disabled! Use 'brew extract hugo' to stable tap on GitHub instead. – ‘stable’ reads like a verb here to me because I’m bewildered, I guess.) I think wants a ‘tap’ (maybe?) but what is that?

I’ve tried:

brew extract --version 0.68.3 hugo hugo
brew extract --version 0.68.3 hugo https://raw.githubusercontent.com/Homebrew/homebrew-core/c8e17ae408f76c6c1a8eeeaf5bcc8fb982a8f905/Formula/hugo.rb
brew extract hugo https://raw.githubusercontent.com/Homebrew/homebrew-core/c8e17ae408f76c6c1a8eeeaf5bcc8fb982a8f905/Formula/hugo.rb
brew extract https://raw.githubusercontent.com/Homebrew/homebrew-core/c8e17ae408f76c6c1a8eeeaf5bcc8fb982a8f905/Formula/hugo.rb hugo
brew extract --version 0.68.3 hugo /usr/local/Cellar/hugo/0.68.3

But none of these work.

I’ve also tried the above with this URL too: https://github.com/Homebrew/homebrew-core/blob/c15e8abbfe66bc462c20e84ab08927c3e7266fa7/Formula/hugo.rb

https://twitter.com/SketchingDev/status/1299460385523863555?s=20 here’s a friendly drawing clarifying the terms. Taps are the location where you want to save your copy in this command.

For example if I want to extract the php formula to a tap under my username I’d make a github repo called homebrew-php (can be any name you want). Add it to my install using brew tap smillerdev/php (you can omit the homebrew- part). And then I’d extract php using brew extract php smillerdev/php. After this I can maintain my own copy of the php formula using the git repository located at whatever brew --repo smillerdev/php returns.

Thanks for the reply.

I’m preparing this for my team, and I don’t think we want to maintain a repository for this. I was able to finally understand enough to get it working, but I wonder if it seems sustainable. I made a local tap and extracted to that, then installed it.

Basically I did:

brew tap-new company/team; brew extract --version 0.68.3 hugo company/team; brew install company/team/hugo@0.68.3

Good to hear you got it working.

Unfortunately these steps are not sufficient if I must extract a formula that is bottled. What would be the equivalent with extract of

brew install --force-bottle
https://raw.githubusercontent.com/Homebrew/homebrew-core/e12c3d678a6e10a922928eeefcca2824dd56ae2f/Formula/ninja.rb

@SMillerDev, can you provide an example?

You can’t use the homebrew-core bottles if you don’t want to use the homebrew-core version of the software. You’ll have to maintain your own bottles for this case.

Well, I would use homebrew-core bottles if I could pick the version I need.

That sounds like you need a language package manager, those generally provide every version that you could need of a package. Homebrew’s aim is to be evergreen so it’ll only ever support the latest version of the software.

Can you suggest one? I need replicable environment with known working and tested versions of tools. If those bottles are already built and available, I see no reason not to provide them in an easy way.

Can you suggest one?

That heavily depends on the language.

I need replicable environment with known working and tested versions of tools.

The only known working and tested configuration in homebrew is the latest version of any tool since CI runs only on the latest version of every formula.

If those bottles are already built and available, I see no reason not to provide them in an easy way.

Because we don’t have the capacity to support them and we want to discourage people from using old unsuported and probably insecure software.

I’m not sure what you mean by language. I’m not talking about one single software implemented in some language, I need a dozen of different tools (e.g. python3.8, cmake, ninja, git… etc.) for which I know the exact versions I must use. These should preferably be the available and the same between Linux, Windows and macOS.
So back to the bottles, is this even possible with brew?

No, if you need an exact snapshot of specific tool versions I’d recommend docker. Homebrew isn’t meant for these situation and any support for it was accidental.

If you want to have bottles for specific versions of your entire stack your only option is to use the above method, make bottles once using brew install --build-bottle and then hosting them somewhere manually.