mirror of
https://github.com/pyenv/pyenv.git
synced 2026-09-10 07:36:16 -04:00
pyenv-binary: check patchelf before installing archive
This commit is contained in:
parent
b7e7adf4ec
commit
2c1f405180
|
|
@ -185,6 +185,11 @@ elif [ -n "$DEPS" ]; then
|
|||
echo "pyenv-binary: cannot check required system libraries (ldconfig cache unavailable)" >&2
|
||||
fi
|
||||
|
||||
if ! command -v patchelf >/dev/null 2>&1; then
|
||||
echo "pyenv-binary: need patchelf to relocate the binary" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build_package_relocate() {
|
||||
pyenv binary relocate "$PREFIX_PATH"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,6 +106,17 @@ create_meta() {
|
|||
assert_failure "pyenv-binary: missing required system libraries: libmissing.so.1"
|
||||
}
|
||||
|
||||
@test "checks for patchelf before installing the archive" {
|
||||
local out="${BATS_TEST_TMPDIR}/definition"
|
||||
pyenv-binary-generate-installer "$(create_meta)" \
|
||||
--archive-url http://example.com/a.tar.gz -o "$out"
|
||||
create_stub uname 'case "$1" in -s) echo Linux;; -m) echo x86_64;; esac'
|
||||
create_stub getconf 'echo "glibc 2.31"'
|
||||
|
||||
PATH="$(path_without patchelf)" run bash "$out"
|
||||
assert_failure "pyenv-binary: need patchelf to relocate the binary"
|
||||
}
|
||||
|
||||
@test "fails when the archive is not beside the metadata" {
|
||||
local meta="$(create_meta)"
|
||||
rm "${BATS_TEST_TMPDIR}/3.12.7.tar.gz"
|
||||
|
|
@ -125,6 +136,7 @@ create_meta() {
|
|||
mkdir -p "$cache"
|
||||
cp "$archive" "${cache}/Python-3.12.7-binary.tar.gz"
|
||||
create_stub pyenv 'echo "pyenv $*"'
|
||||
create_path_executable patchelf "exit 0"
|
||||
create_stub uname 'case "$1" in -s) echo Linux;; -m) echo x86_64;; esac'
|
||||
|
||||
PYTHON_BUILD_CACHE_PATH="$cache" run \
|
||||
|
|
|
|||
Loading…
Reference in a new issue