ENV/super: add Python's libexec/"bin" directory when applicable
When Homebrew/homebrew-core#107517 is merged, builds will no longer be able to find `python@3.9` as `python3`. This is also what is likely to happen to `python@3.10` when we add a `python@3.11`. This is likely to break many builds, so let's make sure they can keep finding a `python3` for formulae that don't have a dependency on the latest Python3. This is arguably something we should've done earlier: it also means that builds that go looking for an unversioned `python` end up finding our Python3 (whenever present in the build environment) instead of, say, `/usr/bin/python` which is typically Python2.
This commit is contained in:
parent
7fcc30c56b
commit
999623b45d
@ -125,8 +125,10 @@ module Superenv
|
||||
|
||||
sig { returns(T::Array[Pathname]) }
|
||||
def homebrew_extra_paths
|
||||
[]
|
||||
deps.select { |d| d.name.match? Version.formula_optionally_versioned_regex(:python) }
|
||||
.map { |d| d.opt_libexec/"bin" }
|
||||
end
|
||||
alias generic_homebrew_extra_paths homebrew_extra_paths
|
||||
|
||||
sig { returns(T.nilable(PATH)) }
|
||||
def determine_path
|
||||
|
||||
@ -27,7 +27,7 @@ module Superenv
|
||||
end
|
||||
|
||||
def homebrew_extra_paths
|
||||
paths = []
|
||||
paths = generic_homebrew_extra_paths
|
||||
paths += %w[binutils make].map do |f|
|
||||
bin = Formulary.factory(f).opt_bin
|
||||
bin if bin.directory?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user