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] 64b6846d60/Library/Homebrew/hardware.rb (L28-L42)
			
			
This commit is contained in:
		
							parent
							
								
									64b6846d60
								
							
						
					
					
						commit
						e893f16727
					
				@ -261,6 +261,9 @@ module Superenv
 | 
				
			|||||||
  sig { returns(String) }
 | 
					  sig { returns(String) }
 | 
				
			||||||
  def determine_optflags
 | 
					  def determine_optflags
 | 
				
			||||||
    Hardware::CPU.optimization_flags.fetch(effective_arch)
 | 
					    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
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  sig { returns(String) }
 | 
					  sig { returns(String) }
 | 
				
			||||||
 | 
				
			|||||||
@ -395,10 +395,6 @@ class FormulaInstaller
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    return if only_deps?
 | 
					    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|
 | 
					    formula.deprecated_flags.each do |deprecated_option|
 | 
				
			||||||
      old_flag = deprecated_option.old_flag
 | 
					      old_flag = deprecated_option.old_flag
 | 
				
			||||||
      new_flag = deprecated_option.current_flag
 | 
					      new_flag = deprecated_option.current_flag
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user