Skip to content

Commit 9a7b9ed

Browse files
committed
Patch auditwheel to fix libstem.so rpath issue
pypa/auditwheel#136 results in pure C++ libraries not getting patched by auditwheel. This is a problem for us, since our pure C++ library, libstem.so, needs its rpath patched for hdf5. pypa/auditwheel#283 fixes this issue, but is not yet merged. Until it gets merged and added to quay.io/pypa/manylinux2010_x86_64, we will patch auditwheel inside quay.io/pypa/manylinux2010_x86_64 to include this fix. Signed-off-by: Patrick Avery <[email protected]>
1 parent eae8e49 commit 9a7b9ed

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

.github/workflows/build_wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ env:
77
CIBW_SKIP: "cp27-* pp* *-manylinux_i686 *-win32"
88

99
# This has some of the software we need pre-installed on it
10-
CIBW_MANYLINUX_X86_64_IMAGE: openchemistry/stempy_manylinux2010_x86_64
10+
CIBW_MANYLINUX_X86_64_IMAGE: openchemistry/stempy_wheel_builder
1111

1212
# Need to do some setup before repairing the wheel on linux...
1313
CIBW_REPAIR_WHEEL_COMMAND_LINUX: bash scripts/github-actions/repair_command_linux.sh

scripts/github-actions/docker/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,13 @@ RUN VERSION=3.19.4 && \
1212
wget -q https://github.com/Kitware/CMake/releases/download/v$VERSION/cmake-$VERSION-Linux-x86_64.sh && \
1313
bash cmake-$VERSION-Linux-x86_64.sh --skip-license --prefix=/usr/local && \
1414
rm cmake-$VERSION-Linux-x86_64.sh
15+
16+
# Apply the code patch from https://github.com/pypa/auditwheel/pull/283
17+
# This allows for non-python dependencies to get their RPATHs patched, which
18+
# we need so that libstem.so can get patched for HDF5
19+
# FIXME: when https://github.com/pypa/auditwheel/pull/283 is merged and
20+
# a part of quay.io/pypa/manylinux2010_x86_64, we can remove these lines.
21+
COPY auditwheel_pr_283.patch /
22+
RUN cd /opt/_internal/tools/lib/python3.7/site-packages && \
23+
patch -p1 < /auditwheel_pr_283.patch && \
24+
rm /auditwheel_pr_283.patch
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
diff --git a/auditwheel/wheel_abi.py b/auditwheel/wheel_abi.py
2+
index 69f83ce..7875f6e 100644
3+
--- a/auditwheel/wheel_abi.py
4+
+++ b/auditwheel/wheel_abi.py
5+
@@ -118,10 +118,16 @@ def get_wheel_elfdata(wheel_fn: str):
6+
# we should walk its elftree.
7+
if basename(fn) not in needed_libs:
8+
full_elftree[fn] = nonpy_elftree[fn]
9+
- full_external_refs[fn] = lddtree_external_references(
10+
- nonpy_elftree[fn], ctx.path)
11+
12+
- log.debug(json.dumps(full_elftree, indent=4))
13+
+ # Even if a non-pyextension ELF file is not needed, we
14+
+ # should include it as an external references, because
15+
+ # they might also require external libraries.
16+
+ full_external_refs[fn] = lddtree_external_references(
17+
+ nonpy_elftree[fn], ctx.path)
18+
+
19+
+ log.debug('full_elftree:\n%s', json.dumps(full_elftree, indent=4))
20+
+ log.debug('full_external_refs (will be repaired):\n%s',
21+
+ json.dumps(full_external_refs, indent=4))
22+
23+
return (full_elftree, full_external_refs, versioned_symbols,
24+
uses_ucs2_symbols, uses_PyFPE_jbuf)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
image_base=quay.io/pypa/manylinux2010_x86_64
4-
tag=openchemistry/stempy_manylinux2010_x86_64
4+
tag=openchemistry/stempy_wheel_builder
55

66
docker build . -t $tag --build-arg BASE_IMAGE=$image_base
77
docker push $tag

0 commit comments

Comments
 (0)