While upgrading Hugo (the static site generator I use to make this blog), I noticed a few errors surfacing:
WARNING: calling IsSet with unsupported type "invalid" (<nil>) will always return false.
After looking around for this I got a hit:
Amusingly, a coworker had asked this question a few weeks earlier and discovered the error was related to deprecated functionality in a new version of Hugo that my current theme still relied on.
While frustrating, I probably should have expected I would be running into errors by blindly upgrading. So the new problem was that I had to downgrade my version of Hugo, which I had just installed with brew.
Hugo doesn’t currently use semantic versioning with a major.minor.patch structure because the maintainers say it is still not ready for version 1 given frequent changes.
They’re somewhat adamant on this front when asked if they’ll consider changing to it.
So I had to figure out how to get an older release for my theme that was incompatible with Initially I tried searching for older released versions of hugo within brew with brew search hugo
:
No luck.
Then I tried to see if there was an official way to downgrade my version. There are release tags on GitHub for the official Hugo repo which I downloaded but wasn’t sure how to install these properly as I had previously installed Hugo with brew.
So after a little digging I found out you can install with brew from older versions of homebrew-core package urls. You can track down the version you want and install it yourself by doing the following:
-
Search for the package you want in homebrew-core. In my case Hugo
-
Then click the ‘history’ button
-
Scroll down to find the version you want
-
Press the angle brackets button to view the file at that point in time.
< >
-
View the raw file
-
Copy that url and use it with
brew install
For example, this is what I’m currently using to brew install version v0.18.1 of Hugo:
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/d3c4aadfd067534a723f9cf2e5c5bec444d0579d/Formula/hugo.rb
After that you’ll need to be careful not to accidentally upgrade your version when doing brew updates. Assuming you’ve switched to the version you want, the easiest way to do this is to pin that version with brew pin hugo
.
Hopefully other folks using Hugo or other outdated brews will find this useful!