Merge pull request #3651 from macayu17/fix/binary-find-misc

python-build: miscellaneous fixes
This commit is contained in:
native-api authored and GitHub committed 2026-11-27 01:36:07 +03:00
commit aa6882a15c
3 files changed
+16 -1

No files matched your search

+1
View File
@@ -91,6 +91,7 @@ platform() {
@test "records the platform in the metadata" {
create_version "3.12.7"
create_stub readelf true
local out="${BATS_TEST_TMPDIR}/dist"
pyenv-binary-save "3.12.7" "$out" >/dev/null
+2 -1
View File
@@ -65,7 +65,8 @@ lib() {
( -z ${_PYTHON_BUILD_SKIP_OS_RELEASE-} && -r /etc/os-release ) ]]; then
distro=$(. "${_PYTHON_BUILD_FAKE_OS_RELEASE:-/etc/os-release}" && printf '%s %s' "${ID:-}" "${VERSION_ID:-}") || return
elif type -p lsb_release >/dev/null; then
distro="$(lsb_release -si) $(lsb_release -sr)" || return
distro="$(lsb_release -si)" || return
distro="$distro $(lsb_release -sr)" || return
else
distro="$os $(uname -r)" || return
fi
+13
View File
@@ -77,6 +77,19 @@ ubuntu 24.04
unstub lsb_release
}
@test "platform detection propagates lsb_release ID query failures" {
export _PYTHON_BUILD_SKIP_OS_RELEASE=1
stub uname '-s : echo Linux' '-m : echo x86_64'
stub lsb_release '-si : echo "distro query failed" >&2; exit 9'
run read_platform
assert_failure "distro query failed"
assert_equal 9 "$status"
unstub uname
unstub lsb_release
}
@test "platform detection falls back to uname -r" {
export _PYTHON_BUILD_SKIP_OS_RELEASE=1
stub uname '-s : echo Linux' '-m : echo x86_64' '-r : echo 99.99-whatever'