Skip to content

Commit

Permalink
check_binary_arches(): skip checking formula.share
Browse files Browse the repository at this point in the history
This is needed by Lima, which installs
non-native binaries for supporting ARM-on-Intel / Intel-on-ARM emulation.

See Homebrew/homebrew-core PR 82723

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
  • Loading branch information
AkihiroSuda committed Aug 6, 2021
1 parent 6bb3699 commit 438ca35
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Library/Homebrew/formula_cellar_checks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,11 @@ def check_binary_arches(formula)
farch = file.arch
mismatches[file] = farch unless farch == Hardware::CPU.arch
end
# We ignore `share` because some formulae (e.g. `lima`) intentionally install non-native binaries into `share`.
# f is like Pathname('/home/foo/brew/Cellar/lima/0.6.0/share/lima/lima-guestagent.Linux-aarch64')
# Note that formula.share is like '/home/foo/brew/opt/lima/share', so we just check `include? "/share/"` rather
# than checking `start_with? formula.share` .
mismatches.reject! { |f| f.to_s.include? "/share/" }
return if mismatches.empty?

compatible_universal_binaries, mismatches = mismatches.partition do |file, arch|
Expand Down

0 comments on commit 438ca35

Please sign in to comment.