Skip to content

Commit c70cdd8

Browse files
committed
Do not correct RPATH, it doesn't work when doing a venv
When doing a venv, it's going to copy the `python` binary, but not the `libpython.so` library. If the RPATH is relative to the binary, it's not going to find the library at `$ORIGIN/../lib` and it will fail to start. Instead, keep the RPATH absolute. Also manually add the python -> pythonX.Y and pip -> pipX.Y symlinks, projects depend on them.
1 parent 07e4b55 commit c70cdd8

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

.github/workflows/build-python.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
run: |
9696
mkdir -p output
9797
pushd src
98-
./configure --with-ensurepip=install --enable-shared
98+
./configure --prefix=/opt/hostedtoolcache/Python/${NORMALISED}/riscv64 --with-ensurepip=install --enable-shared
9999
make -j"$(nproc)" 2>&1 | tee ../build_output.txt
100100
make install DESTDIR="$PWD/../staging-std"
101101
popd
@@ -106,7 +106,8 @@ jobs:
106106
cp -a staging-std/usr/local/lib "$ARCHIVE_BASE/"
107107
cp -a staging-std/usr/local/share "$ARCHIVE_BASE/"
108108
109-
patchelf --set-rpath '$ORIGIN/../lib' "$ARCHIVE_BASE/bin/python${MINOR}"
109+
ln -srf "$ARCHIVE_BASE/bin/python${MINOR}" "$ARCHIVE_BASE/bin/python"
110+
ln -srf "$ARCHIVE_BASE/bin/pip${MINOR}" "$ARCHIVE_BASE/bin/pip"
110111
111112
sed -e "s|{{__VERSION_FULL__}}|${NORMALISED}|g" \
112113
-e "s|{{__ARCH__}}|riscv64|g" \
@@ -130,7 +131,7 @@ jobs:
130131
run: |
131132
pushd src
132133
git clean -fdx
133-
./configure --with-ensurepip=install --enable-shared --disable-gil
134+
./configure --prefix=/opt/hostedtoolcache/Python/${NORMALISED}/riscv64-freethreaded --with-ensurepip=install --enable-shared --disable-gil
134135
make -j"$(nproc)" 2>&1 | tee ../build_output.txt
135136
make install DESTDIR="$PWD/../staging-ft"
136137
popd
@@ -141,7 +142,8 @@ jobs:
141142
cp -a staging-ft/usr/local/lib "$ARCHIVE_BASE/"
142143
cp -a staging-ft/usr/local/share "$ARCHIVE_BASE/"
143144
144-
patchelf --set-rpath '$ORIGIN/../lib' "$ARCHIVE_BASE/bin/python${MINOR}"
145+
ln -srf "$ARCHIVE_BASE/bin/python${MINOR}" "$ARCHIVE_BASE/bin/python"
146+
ln -srf "$ARCHIVE_BASE/bin/pip${MINOR}" "$ARCHIVE_BASE/bin/pip"
145147
146148
sed -e "s|{{__VERSION_FULL__}}|${NORMALISED}|g" \
147149
-e "s|{{__ARCH__}}|riscv64-freethreaded|g" \

0 commit comments

Comments
 (0)