Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brew upgrade can actually downgrade casks in some configurations #17427

Closed
3 tasks done
Frizlab opened this issue Jun 4, 2024 · 6 comments
Closed
3 tasks done

brew upgrade can actually downgrade casks in some configurations #17427

Frizlab opened this issue Jun 4, 2024 · 6 comments
Labels
bug Reproducible Homebrew/brew bug help wanted We want help addressing this

Comments

@Frizlab
Copy link
Contributor

Frizlab commented Jun 4, 2024

brew doctor output

Your system is ready to brew.

Verification

  • My "brew doctor output" above says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update twice and am still able to reproduce my issue.
  • This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

brew config output

HOMEBREW_VERSION: 4.3.3
ORIGIN: https://github.com/Homebrew/brew
HEAD: e130e47f23b8b806096f9ec4f2c193213b8ec908
Last commit: 2 days ago
Core tap JSON: 04 Jun 19:20 UTC
Core cask tap JSON: 04 Jun 19:20 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: ["--skip-cask-deps", "--no-binaries", "--appdir=/Applications", "--colorpickerdir=/Library/ColorPickers", "--prefpanedir=/Library/PreferencePanes", "--qlplugindir=/Library/QuickLook", "--mdimporterdir=/Library/Spotlight", "--dictionarydir=/Library/Dictionaries", "--fontdir=/Library/Fonts", "--servicedir=/Library/Services", "--input_methoddir=/Library/Input Methods", "--internet_plugindir=/Library/Internet Plug-Ins", "--audio_unit_plugindir=/Library/Audio/Plug-Ins/Components", "--vst_plugindir=/Library/Audio/Plug-Ins/VST", "--vst3_plugindir=/Library/Audio/Plug-Ins/VST3", "--screen_saverdir=/Library/Screen Savers"]
HOMEBREW_DISPLAY_INSTALL_TIMES: set
HOMEBREW_EDITOR: vi
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_NO_ANALYTICS: set
HOMEBREW_NO_AUTO_UPDATE: set
HOMEBREW_NO_INSTALL_CLEANUP: set
Homebrew Ruby: 3.3.2 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.2/bin/ruby
CPU: octa-core 64-bit dunno
Clang: 15.0.0 build 1500
Git: 2.39.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 8.6.0 => /usr/bin/curl
macOS: 14.5-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: 15.4 => /Applications/Xcode-15.4.0.app/Contents/Developer
Rosetta 2: false

What were you trying to do (and why)?

I’m trying to upgrade a cask which has been release in two of the taps on my system and have different versions on the two taps.

What happened (include all command output)?

42sh$ brew upgrade
==> Casks with 'auto_updates true' or 'version :latest' will not be upgraded; pass `--greedy` to upgrade them.
==> Upgrading 1 outdated package:
happn-app/public/locmapper-app 1.4.0 -> 1.3.7
==> Upgrading locmapper-app
==> Downloading https://github.com/happn-app/LocMapper/releases/download/LocMapper%2Frelease%2F1.3.7/LocMapperApp.zip
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/86438845/30808848-e72c-4872-ab47-3aed127ecaed?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20240604%2Fus-east-1%2F
########################################################################################################################################################################################################################################### 100.0%
==> Backing App 'LocMapper.app' up to '/opt/homebrew/Caskroom/locmapper-app/1.4.0/LocMapper.app'
==> Removing App '/Applications/LocMapper.app'
Warning: Your terminal does not have App Management permissions, so Homebrew will delete and reinstall the app.
This may result in some configurations (like notification settings or location in the Dock/Launchpad) being lost.
To fix this, go to System Settings > Privacy & Security > App Management and add or enable your terminal.
==> Moving App 'LocMapper.app' to '/Applications/LocMapper.app'
==> Purging files for version 1.4.0 of Cask locmapper-app
🍺  locmapper-app was successfully upgraded!
==> Installation times
locmapper-app             1.764 s

Note we can see the cask happn-app/public/locmapper-app is being upgraded but I initially installed frizlab/perso/locmapper-app.

What did you expect to happen?

I expected the cask to stay at the same version.

Step-by-step reproduction instructions (by running brew commands)

brew install frizlab/perso/locmapper-app
brew tap happn-app/public
brew upgrade
@Frizlab Frizlab added the bug Reproducible Homebrew/brew bug label Jun 4, 2024
@Bo98
Copy link
Member

Bo98 commented Jun 4, 2024

Casks don't really track what tap they came from at the moment. I agree this should be fixed, though will likely require addressing #17013.

@MikeMcQuaid MikeMcQuaid added the help wanted We want help addressing this label Jun 5, 2024
@Frizlab
Copy link
Contributor Author

Frizlab commented Jun 5, 2024

At the very least would it be possible to actually compare the version number before happily downgrading an app?

@Bo98
Copy link
Member

Bo98 commented Jun 5, 2024

Casks also don't do semver comparisons. It's a simple not-equals comparison.

@Frizlab
Copy link
Contributor Author

Frizlab commented Jun 5, 2024

Unfortunate, but ok.

@apainintheneck
Copy link
Contributor

@Rylan12 I assume this can be closed now that #17823 has been merged in, right?

@Rylan12
Copy link
Member

Rylan12 commented Oct 15, 2024

Yes, I think this should be good now!

Note: you might need to reinstall any problematic casks as a one-time fix (simply brew reinstall should be enough), but moving forward this should not be a problem.

@Rylan12 Rylan12 closed this as completed Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible Homebrew/brew bug help wanted We want help addressing this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants