Merge pull request #20312 from Homebrew/development_tools_env

linux/development_tools: add undocumented environment variables.
This commit is contained in:
Mike McQuaid 2025-07-25 16:29:33 +00:00 committed by GitHub
commit bd3461d4b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,8 +34,12 @@ module OS
def needs_libc_formula? def needs_libc_formula?
return @needs_libc_formula unless @needs_libc_formula.nil? return @needs_libc_formula unless @needs_libc_formula.nil?
@needs_libc_formula = T.let(OS::Linux::Glibc.below_ci_version?, T.nilable(T::Boolean)) @needs_libc_formula = T.let(nil, T.nilable(T::Boolean))
@needs_libc_formula = !!@needs_libc_formula
# Undocumented environment variable to make it easier to test libc
# formula automatic installation.
@needs_libc_formula = true if ENV["HOMEBREW_FORCE_LIBC_FORMULA"]
@needs_libc_formula ||= OS::Linux::Glibc.below_ci_version?
end end
# Keep this method around for now to make it easier to add this functionality later. # Keep this method around for now to make it easier to add this functionality later.
@ -52,7 +56,12 @@ module OS
return @needs_compiler_formula unless @needs_compiler_formula.nil? return @needs_compiler_formula unless @needs_compiler_formula.nil?
@needs_compiler_formula = T.let(nil, T.nilable(T::Boolean)) @needs_compiler_formula = T.let(nil, T.nilable(T::Boolean))
@needs_compiler_formula = if host_gcc_path.exist?
# Undocumented environment variable to make it easier to test compiler
# formula automatic installation.
@needs_compiler_formula = true if ENV["HOMEBREW_FORCE_COMPILER_FORMULA"]
@needs_compiler_formula ||= if host_gcc_path.exist?
::DevelopmentTools.gcc_version(host_gcc_path.to_s) < OS::LINUX_GCC_CI_VERSION ::DevelopmentTools.gcc_version(host_gcc_path.to_s) < OS::LINUX_GCC_CI_VERSION
else else
true true