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

Fix fetch for Intel Sequoia #19079

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

muneebmahmed
Copy link
Contributor

@muneebmahmed muneebmahmed commented Jan 11, 2025

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Fixes #19060. On Intel Sequoia, brew install install from Sonoma bottles as expected, but brew fetch gives errors due to lack of a sequoia: bottle. I'm not sure how exactly the formula installer resolves the bottle tag, but I just took a look at the function that's called and copied it over to the fetch command, and it worked:

bottle = formula.bottle_for_tag(Utils::Bottles.tag)

@apainintheneck
Copy link
Contributor

Thanks for taking a look at this. I don't think the current solution of using Utils::Bottles.tag will work here since it relies on HOMEBREW_PROCESSOR and HOMEBREW_SYSTEM which are both set once at start up time. This means that you'd only be able to use this to download bottles for your current system and arch and not for the system and arch specified by the user which is an existing feature.

It sounds like ideally we'd have some way to realize that an intel-sequoia bottle doesn't exist and that the sonoma bottle would be used instead. Then, maybe we could display that as a warning to the user.

@MikeMcQuaid
Copy link
Member

It sounds like ideally we'd have some way to realize that an intel-sequoia bottle doesn't exist and that the sonoma bottle would be used instead.

Agreed. The logic in find_matching_tag is the relevant ones here; looking at those call-sites should help narrow this down. If you're lost: shout and I'll help more!

Then, maybe we could display that as a warning to the user.

No need to warn for this given we don't warn for brew install either.

@cho-m
Copy link
Member

cho-m commented Jan 13, 2025

One thing is that fallback would occur if arch were aligned since BottleSpecification#tag? and other methods default to no_older_versions=false

Currently, brew fetch uses :arm and :intel as input and passes these on as arguments. Bottle tag use :arm64 and :x86_64 so some parts of code consider these different architectures, e.g.

brew(main):001> Formula["qt"].bottled?(Utils::Bottles::Tag.new(system: :sequoia, arch: :arm))
=> false
brew(main):002> Formula["qt"].bottled?(Utils::Bottles::Tag.new(system: :sequoia, arch: :arm64))
=> true
brew(main):003> Formula["qt"].bottle_for_tag(Utils::Bottles::Tag.new(system: :sequoia, arch: :arm64)).tag
=> #<Utils::Bottles::Tag:0x000000012a8db8c0 @arch=:arm64, @system=:sonoma, @to_macos_version=#<MacOSVersion: "14">>

tags.find do |candidate|
next if candidate.arch != tag.arch
candidate.to_macos_version <= tag_version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

brew fetch --formula fails on Intel Sequoia
4 participants