-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
Different build version for arm64 #99397
Conversation
Hi, I've got this strange problem, when arm64 build (2.6.4-2) have different version then intel (2.6.4). I'm not sure if my approach for downloading is rock solid, but actually downloads proper package. Unfortunately the livecheck does not work, since the latest GitHub version is the on without patch version. I would appreciate any advice to write a proper livecheck here. |
BTW it seems that the pull request CI job is performed only from an intel arch perspective https://github.com/Homebrew/homebrew-cask/pull/99397/checks?check_run_id=1842834224
But on my m1 Mac:
|
Casks/keepassxc.rb
Outdated
url "https://github.com/keepassxreboot/keepassxc/releases/download/#{version}/KeePassXC-#{version}-x86_64.dmg", | ||
verified: "github.com/keepassxreboot/keepassxc/" | ||
sha256 "639fdfe0379dc3f00f1bd6a72c974cfddae0d4c8ddb66f7297d0b01b1a582ede" | ||
else | ||
url "https://github.com/keepassxreboot/keepassxc/releases/download/#{version}/KeePassXC-#{version}-arm64.dmg", | ||
version "2.6.4-2" | ||
url "https://github.com/keepassxreboot/keepassxc/releases/download/#{version.sub(/-\d+/, "")}/KeePassXC-#{version}-arm64.dmg", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than version.sub(/-\d+/, "")
, version.split('-').first
is clearer.
But do we expect that hyphen to be a regular thing, or was it a one-off?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard to say, probably a one-off, since that was their first build for a m1 .
Buy this also introduced the problem with livecheck and I'm thinking that the proper version for the arm build could be taken with regex.
Would something like this work?
if Hardware::CPU.intel?
version "2.6.4"
url "https://github.com/keepassxreboot/keepassxc/releases/download/#{version}/KeePassXC-#{version}-x86_64.dmg",
verified: "github.com/keepassxreboot/keepassxc/"
sha256 "639fdfe0379dc3f00f1bd6a72c974cfddae0d4c8ddb66f7297d0b01b1a582ede"
livecheck do
url :url
strategy :github_latest
end
else
version "2.6.4-2"
url "https://github.com/keepassxreboot/keepassxc/releases/download/#{version.split("-").first}/KeePassXC-#{version}-arm64.dmg",
verified: "github.com/keepassxreboot/keepassxc/"
sha256 "49c28e3f6341710b24d4415186ec0a52f6c0af5e72c0fc7548ddd7999d2eaa4d"
livecheck do
url "https://keepassxc.org/download/"
regex(/href=.*?KeePassXC[._-]v?(\d+(?:[.\-]\d+)+)-arm64.dmg/i)
end
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s assume it’s a one-off, share the version, add the -2
in the URL, and skip the livecheck check in CI. On the next update, we’ll revisit.
Unify version, and modify url with hardcoded arm64 build version as suggested by maintainer.
Thank you @pszypowicz. |
Important: Do not tick a checkbox if you haven’t performed its action. Honesty is indispensable for a smooth review process.
After making all changes to a cask, verify:
brew audit --cask {{cask_file}}
is error-free.brew style --fix {{cask_file}}
reports no offenses.Additionally, if adding a new cask:
brew audit --new-cask {{cask_file}}
worked successfully.brew install --cask {{cask_file}}
worked successfully.brew uninstall --cask {{cask_file}}
worked successfully.