-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Avoid outputting Rosetta 2 caveats on Intel machines #18365
Comments
It looks like there is already a check that should ensure that this only gets displayed on arm machines. brew/Library/Homebrew/cask/dsl/caveats.rb Lines 143 to 152 in 29c22e0
Could you run the following diagnostic commands locally and post the output here? brew doctor brew config brew ruby -e 'p Homebrew::SimulateSystem.current_arch' |
Actually, I figured this out. It's based on pre-computing the caveats when serializing From the JSON API: $ brew info Sleipnir
==> sleipnir: 4.6.6
https://www.fenrir-inc.com/jp/sleipnir/
Not installed
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/s/sleipnir.rb
==> Name
Sleipnir
==> Description
Web browser
==> Artifacts
Sleipnir.app (App)
==> Caveats
sleipnir is built for Intel macOS and so requires Rosetta 2 to be installed.
You can install Rosetta 2 with:
softwareupdate --install-rosetta --agree-to-license
Note that it is very difficult to remove Rosetta 2 once it is installed. From the Ruby cask: $ HOMEBREW_NO_INSTALL_FROM_API=true brew info Sleipnir
==> sleipnir: 4.6.6
https://www.fenrir-inc.com/jp/sleipnir/
Not installed
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/s/sleipnir.rb
==> Name
Sleipnir
==> Description
Web browser
==> Artifacts
Sleipnir.app (App) It seems like this issue is already covered by #17288 so maybe we can close this one. |
Yeah Ruby logic in caveats is not supported, and even if it theoretically were we would still avoid them wherever possible for speed reasons. If it were just a few casks then maybe. But not 1.1k casks. The proper fix here instead of #17288 would be for us to provide better serialisation of "built-in caveats" or alternatively get rid of the Rosetta caveat in favour of a Formulae already have a similar notion of |
Above point still applies but reading this again:
Why does it not differ in |
My bad I wrote formula above but this is a cask-only issue. brew/Library/Homebrew/cask/cask.rb Line 458 in 9160445
What's happening here is that we only calculate variations if the cask has on system blocks which isn't the case here. It looks like there are 1227 casks in the main cask repo that have |
Making Rosetta a requirement for installing these casks on arm machines makes sense to me too assuming it's a straightforward change. |
Thanks everyone for taking the time to check this. I'm guessing from the discusssion that I don't need to run the diagnostic commands anymore. What you're discussing is absolutely out of my knowledge, but don't hesitate to tag me if in need of testers for this. Thanks a lot again. (Hopefuly I didn't open a pandora's box :P) |
@garvamel all good, thanks for the helpful issue! |
We should prioritise correctness over JSON size. I think having something like |
Casks do as well, for example amd-power-gadget. One solution might be to add |
Are there any instances of |
Probably only casks that tap directly into the hardware like amd-power-gadget, cuda-z, turbo-boost-switcher, and their ilk. (They might be rare enough to not worry about special-casing them.) |
@EricFromCanada in those cases if we did what Carlo said: would we be printing the warning unnecessarily or not printing it when we should? |
If |
I think checking for specific hardware for apps is outside of the scope of what brew needs to check and warn for. This is because as a user you don't come to know of a formula or cask you are choosing to install, by searching in brew first instead of a search engine. If there are any doubts users The only edge case I can imagine is that one of these apps that need actual hardware were a dependency not obvious to the user. |
Verification
brew install wget
. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.Provide a detailed description of the proposed feature
Check for system type (Intel or Silicon) to filter which Caveats are shown. I'm on an Intel mac and I get the following Caveat:
"{cask} is built for Intel macOS and so requires Rosetta 2 to be installed.
You can install Rosetta 2 with:
softwareupdate --install-rosetta --agree-to-license
Note that it is very difficult to remove Rosetta 2 once it is installed."
This particular time it was for the "session" cask, but I have gotten it for other installs too.
What is the motivation for the feature?
This caveat is a warning that is simply unnecessary for Intel systems.
How will the feature be relevant to at least 90% of Homebrew users?
Less visual clutter and cleaner user experience. The first time I got it I had to investigate a little bit as to why I was getting this warning since I am on an Intel system and I had no clue what "Rosetta 2" was, nor did it imply anything about the warning being only for Silicon systems. My first though was that something in my system was misconfigured since the warning showed up.
What alternatives to the feature have been considered?
An alternative is to modify the caveat text to:
"For Apple Silicon systems:
{cask} is built for Intel macOS and so requires Rosetta 2 to be installed.
You can install Rosetta 2 with:
softwareupdate --install-rosetta --agree-to-license
Note that it is very difficult to remove Rosetta 2 once it is installed."
The text was updated successfully, but these errors were encountered: