mirror of
https://github.com/gosticks/brew.git
synced 2026-10-04 22:46:55 +00:00
extend/ENV/super: allow bottles with custom architectures
Currently, Homebrew recognises only the architectures listed in `hardware.rb`. [1] Attempting to pass an unrecognised architecture to `--bottle-arch` while building a bottle returns an error. Let's change that by passing unrecognised bottle arches to the compiler instead of immediately failing with a `CannotInstallFormulaError`. Partially resolves #5815. [1] https://github.com/Homebrew/brew/blob/64b6846d6078525b8569834718f7b093a7dd05e1/Library/Homebrew/hardware.rb#L28-L42
This commit is contained in:
@@ -261,6 +261,9 @@ module Superenv
|
||||
sig { returns(String) }
|
||||
def determine_optflags
|
||||
Hardware::CPU.optimization_flags.fetch(effective_arch)
|
||||
rescue KeyError
|
||||
odebug "Building a bottle for custom architecture (#{effective_arch})..."
|
||||
Hardware::CPU.arch_flag(effective_arch)
|
||||
end
|
||||
|
||||
sig { returns(String) }
|
||||
|
||||
@@ -395,10 +395,6 @@ class FormulaInstaller
|
||||
|
||||
return if only_deps?
|
||||
|
||||
if build_bottle? && (arch = @bottle_arch) && Hardware::CPU.optimization_flags.exclude?(arch.to_sym)
|
||||
raise CannotInstallFormulaError, "Unrecognized architecture for --bottle-arch: #{arch}"
|
||||
end
|
||||
|
||||
formula.deprecated_flags.each do |deprecated_option|
|
||||
old_flag = deprecated_option.old_flag
|
||||
new_flag = deprecated_option.current_flag
|
||||
|
||||
Reference in New Issue
Block a user