-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
brew upgrade for HEAD formulas fails with error: already installed #13197
Comments
The error has changed since specs landed, but it's actually odder now:
But:
Which of course it isn't. Ping @jacknagel |
You can't upgrade a HEAD installation; it takes precedence over the stable version. This error is generated in formula_installer.rb. |
(But the error is misleading now that all specs are on a level playing field, yes.) |
The issue with the error is that Formula#version is called, but the stable spec is active because --HEAD was not passed. I'm a little confused why this used to return HEAD in the first place without passing --HEAD, but I'm sure I'm missing something. The correct way to get the installed version would be something like f.linked_keg.version, which doesn't exist in core yet, but does in my versions overhaul. |
I have a fix for the error message at the tip of my specs branch: https://github.com/jacknagel/homebrew/tree/specs It depends on the other work in that branch. It doesn't address the original issue here, but at least the weirdness that Misty reported should be resolved. |
Working my way towards a resolution on this one; (hopefully) fixed a couple other bugs in |
Any news on this? There is still no good way to update --HEAD builds. |
Any progress? It's kind of surprising that homebrew cannot upgrade HEAD formula |
We'll tell you when there's any progress here. We'd welcome patches from anyone else who wants to try though. |
In the meantime, to upgrade a |
As a workaround hack, could |
Are you planing to give brew the ability to mark --HEAD versions outdated if there are new versions in the repository the code came from? |
@FloFra not planned as far as I know, because we would need to record the "normal" version that was present when a |
@samueljohn That is not what I meant. I want a way to not only update specific head formulas, I also want to be able to easily check if there is a new head version available (so if a head version can be updated). |
@FloFra Here's my solution: I keep a local directory called I'm not convinced it'd be useful for Homebrew to do all of this for us. |
If the version number of the installed formula were the git hash rather than simply |
There are multiple problems with that, the biggest being that the hashes do not sort like regular version strings, and the second biggest being that not all HEAD builds are from git or even from a VCS. I've considered something like
We would have to query the remote to detect this. That means special code for every download strategy (all of the VCS strategies plus regular tarball downloads, because HEAD can point to anything), plus potential per-site code to handle edge cases. I don't think it's worth that much added complexity (not to mention how slow it would make |
What if brew outdated just gets a --HEAD flag? This flag would then check for updates for head installs depending on download strategy (e.g. |
The desire for this feature is known, but it requires nontrivial architectural changes to Homebrew, which is why it is not available at this time. |
Closing this out as not doable for the time being, but would welcome a PR over at homebrew/brew in the future. |
brew upgrade formula on a formula that was initially installed with the --HEAD option fails with:
There is no clear way to upgrade a formula installed with --HEAD other than uninstalling and re-installing. Example:
Max Howell suggested that this should either be fixed or the error message improved and requested I open this ticket.
The text was updated successfully, but these errors were encountered: