Homebrew / homebrew-cask

🍻 A CLI workflow for the administration of macOS applications distributed as binaries
https://brew.sh
BSD 2-Clause "Simplified" License
20.9k stars 10.7k forks source link

firefox@developer-edition doesn't upgrade #178002

Closed otaconix closed 3 months ago

otaconix commented 3 months ago

Verification

Description of issue

I'm not exactly sure what's happening here, but the firefox@developer-edition cask refuses to upgrade. There's definitely a new version available (I'm on 128.0b7, and 128.0b8 is available).

To make sure this is actually the case, I ran the upgrade command with debug output, and manually ran the curl invocation to see what the cask's download URL redirects to:

$ curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.3.7-24-g6d49157\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 14.5\)\ curl/8.6.0 --header Accept-Language:\ en --retry
3 --fail --location --silent --head https://download.mozilla.org/\?product=firefox-devedition-latest-ssl\&os=osx\&lang=en-US
HTTP/1.1 302 Found                                                                                                                                                                                         Cache-Control: max-age=60
Content-Length: 129
Content-Type: text/html; charset=utf-8
Date: Thu, 27 Jun 2024 21:16:10 GMT
Location: https://download-installer.cdn.mozilla.net/pub/devedition/releases/128.0b8/mac/en-US/Firefox%20128.0b8.dmg
Connection: keep-alive

HTTP/2 200
server: nginx
x-goog-generation: 1719418786230165
x-goog-metageneration: 1
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 164633524
x-goog-hash: crc32c=URZkog==
x-goog-hash: md5=M0PHpR4X8op4MbZiC/Sr5w==
x-goog-storage-class: STANDARD
accept-ranges: bytes
x-guploader-uploadid: ACJd0No9zPj6Lxgb1BC4drFOdjlYBF3sOJT7gNq5JHbSOZiksEV5Ve-KNF0mBI6KNJxLKiv7f-hMYpxcHg
strict-transport-security: max-age=31536000
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
alt-svc: clear
via: 1.1 google, 1.1 google
date: Wed, 26 Jun 2024 19:04:19 GMT
expires: Mon, 01 Jul 2024 19:04:19 GMT
cache-control: max-age=432000
last-modified: Wed, 26 Jun 2024 16:19:46 GMT
etag: "3343c7a51e17f28a7831b6620bf4abe7"
content-type: application/x-iso9660-image
vary: Origin
content-length: 164633524
age: 94311

Command that failed

brew upgrade -fg firefox@developer-edition

Output of command with --verbose --debug

/opt/homebrew/Library/Homebrew/brew.rb (Formulary::NullLoader): loading firefox@developer-edition
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::NullLoader): loading firefox@developer-edition
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::NullLoader): loading firefox@developer-edition
/opt/homebrew/Library/Homebrew/brew.rb (Cask::CaskLoader::FromAPILoader): loading firefox@developer-edition
/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.3.7-24-g6d49157\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 14.5\)\ curl/8.6.0 --header Accept-Language:\ en --retry 3 --fail --location --silent --head https://download.mozilla.org/\?product=firefox-devedition-latest-ssl\&os=osx\&lang=en-US
/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.3.7-24-g6d49157\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 14.5\)\ curl/8.6.0 --header Accept-Language:\ en --retry 3 --fail --location --silent --head --request GET https://download.mozilla.org/\?product=firefox-devedition-latest-ssl\&os=osx\&lang=en-US
==> Checking quarantine support
/usr/bin/env /usr/bin/xattr -h
/usr/bin/env /Library/Developer/CommandLineTools/usr/bin/swift -target arm64-apple-macosx14 /opt/homebrew/Library/Homebrew/cask/utils/quarantine.swift
==> Quarantine is available.
==> Verifying Gatekeeper status of /Users/zwans01/Library/Caches/Homebrew/downloads/382608000536d61f64e4a147e764c559ce144c3f04dd0f05209549d3bf118f1a--Firefox 128.0b7.dmg
/usr/bin/env /usr/bin/xattr -p com.apple.quarantine /Users/zwans01/Library/Caches/Homebrew/downloads/382608000536d61f64e4a147e764c559ce144c3f04dd0f05209549d3bf118f1a--Firefox\ 128.0b7.dmg
==> /Users/zwans01/Library/Caches/Homebrew/downloads/382608000536d61f64e4a147e764c559ce144c3f04dd0f05209549d3bf118f1a--Firefox 128.0b7.dmg is quarantined
Warning: Not upgrading firefox@developer-edition, the downloaded artifact has not changed

Output of brew doctor and brew config

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed casks are deprecated or disabled.
You should find replacements for the following casks:
  meld

Warning: Some installed kegs have no formulae!
This means they were either deleted or installed manually.
You should find replacements for the following formulae:
  pijul

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  dog

---

HOMEBREW_VERSION: 4.3.7-24-g6d49157
ORIGIN: https://github.com/Homebrew/brew
HEAD: 6d491570564d2a1c9bcede8cb353cb24814cea52
Last commit: 3 hours ago
Core tap HEAD: 03cf5d39d8bf27dfabfc90d62c9a3fe19205dc2a
Core tap last commit: 85 minutes ago
Core tap JSON: 27 Jun 21:10 UTC
Core cask tap JSON: 27 Jun 21:10 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: nvim
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.3.3 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
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: N/A
Rosetta 2: false

Output of brew tap

homebrew/core
homebrew/services
netbirdio/tap
krehel commented 3 months ago

It looks like both 128.0b7 and 128.0b8 could be the same. If you sha256 your downloaded file, do you get the same as I have?

> brew fetch firefox@developer-edition
==> Downloading https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=osx&lang=en-US
==> Downloading from https://download-installer.cdn.mozilla.net/pub/devedition/releases/128.0b8/mac/en-US/Firefox%20128.0
################################################################################################################## 100.0%
Downloaded to: .../Library/Caches/Homebrew/downloads/382608000536d61f64e4a147e764c559ce144c3f04dd0f05209549d3bf118f1a--Firefox 128.0b8.dmg
SHA256: 96346ba3be8c82faf159b75424d598c64de492327d043b3c079854799567ced9
otaconix commented 3 months ago

Doesn't look that way to me:

$ openssl sha256 ~/Library/Caches/Homebrew/downloads/382608000536d61f64e4a147e764c559ce144c3f04dd0f05209549d3bf118f1a--Firefox\ 128.0b7.dmg
SHA2-256(/Users/redacted/Library/Caches/Homebrew/downloads/382608000536d61f64e4a147e764c559ce144c3f04dd0f05209549d3bf118f1a--Firefox 128.0b7.dmg)= 0952f0529c44eea0b306c068503acd48d6b99ff0c439802a7763b9efb8b945c5

$ wget 'https://download-installer.cdn.mozilla.net/pub/devedition/releases/128.0b8/mac/en-US/Firefox%20128.0b8.dmg'
--2024-06-28 18:45:56--  https://download-installer.cdn.mozilla.net/pub/devedition/releases/128.0b8/mac/en-US/Firefox%20128.0b8.dmg
Resolving download-installer.cdn.mozilla.net (download-installer.cdn.mozilla.net)... 34.117.35.28
Connecting to download-installer.cdn.mozilla.net (download-installer.cdn.mozilla.net)|34.117.35.28|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 164633524 (157M) [application/x-iso9660-image]
Saving to: ‘Firefox 128.0b8.dmg’

Firefox 128.0b8.dmg                                                            100%[===================================================================================================================================================================================================>] 157.01M  61.4MB/s    in 2.6s

2024-06-28 18:45:59 (61.4 MB/s) - ‘Firefox 128.0b8.dmg’ saved [164633524/164633524]

$ openssl sha256 Firefox\ 128.0b8.dmg
SHA2-256(Firefox 128.0b8.dmg)= 96346ba3be8c82faf159b75424d598c64de492327d043b3c079854799567ced9
krehel commented 3 months ago

You may be able to get around whatever is happening by removing your downloaded files from the cache and then running an upgrade. I suspect that will pull the latest version and get you unblocked.

otaconix commented 3 months ago

Oh, yeah, that definitely does it! But I've done it before, expecting the issue to go away with the next version, which it didn't 🙂. Which is why I opened this issue.

Firefox Developer Edition releases pretty frequently (I think I got the update notification for b8 yesterday, and today I got it for b9), so I'm hoping someone else can reproduce the issue and debug it better than my feeble attempt (I tried stepping through some of brew's code using brew irb, but I'm too unfamiliar with both ruby and brew's code to get very far).

If there's anything else I can do to pinpoint what the issue actually is, let me know!

PS: I was kinda surprised to see brew attempt both a curl --head and curl --head --request GET, as if the first one didn't yield useful information. Maybe there's something there?

krehel commented 3 months ago

Should be good here. I made updates that now version this cask.

Thanks for reporting!