Merge pull request #10040 from maxim-belkin/glibc-central

brew.sh: define minimum required Glibc version
This commit is contained in:
Mike McQuaid 2020-12-24 16:17:52 +00:00 committed by GitHub
commit d89a2c1a16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 11 deletions

View File

@ -410,6 +410,7 @@ Your Git executable: $(unset git && type -p $HOMEBREW_GIT)"
fi
fi
HOMEBREW_LINUX_MINIMUM_GLIBC_VERSION="2.13"
unset HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH
fi
@ -447,6 +448,7 @@ export HOMEBREW_SYSTEM_CURL_TOO_OLD
export HOMEBREW_GIT
export HOMEBREW_GIT_WARNING
export HOMEBREW_MINIMUM_GIT_VERSION
export HOMEBREW_LINUX_MINIMUM_GLIBC_VERSION
export HOMEBREW_PROCESSOR
export HOMEBREW_PRODUCT
export HOMEBREW_OS_VERSION

View File

@ -32,19 +32,27 @@ then
esac
fi
check_ldd_version() {
local ldd_version
local ldd_version_major
local ldd_version_minor
check_linux_glibc_version() {
if [[ -z $HOMEBREW_LINUX || -z $HOMEBREW_LINUX_MINIMUM_GLIBC_VERSION ]]
then
return 0
fi
local glibc_version
local glibc_version_major
local glibc_version_minor
local minimum_required_major=${HOMEBREW_LINUX_MINIMUM_GLIBC_VERSION%.*}
local minimum_required_minor=${HOMEBREW_LINUX_MINIMUM_GLIBC_VERSION#*.}
if [[ $(/usr/bin/ldd --version) =~ \ [0-9]\.[0-9]+ ]]
then
ldd_version=${BASH_REMATCH[0]// /}
ldd_version_major=${ldd_version%.*}
ldd_version_minor=${ldd_version#*.}
if (( ldd_version_major < 2 || ldd_version_minor < 13 ))
glibc_version=${BASH_REMATCH[0]// /}
glibc_version_major=${glibc_version%.*}
glibc_version_minor=${glibc_version#*.}
if (( glibc_version_major < minimum_required_major || glibc_version_minor < minimum_required_minor ))
then
odie "Vendored tools require system Glibc 2.13 or later."
odie "Vendored tools require system Glibc $HOMEBREW_LINUX_MINIMUM_GLIBC_VERSION or later (yours is $glibc_version)."
fi
else
odie "Failed to detect system Glibc version."
@ -239,7 +247,7 @@ homebrew-vendor-install() {
[[ -z "$VENDOR_NAME" ]] && odie "This command requires a vendor target!"
[[ -n "$HOMEBREW_DEBUG" ]] && set -x
[[ -n "$HOMEBREW_LINUX" ]] && check_ldd_version
check_linux_glibc_version
url_var="${VENDOR_NAME}_URL"
url2_var="${VENDOR_NAME}_URL2"

View File

@ -22,7 +22,7 @@ module OS
sig { returns(Version) }
def minimum_version
Version.new "2.13"
Version.new ENV["HOMEBREW_LINUX_MINIMUM_GLIBC_VERSION"]
end
def below_minimum_version?