Skip to content

Commit cb9fd5b

Browse files
authored
chore: use PyPI patchelf rather than rebuilding from source (pypa#1236)
patchelf 0.14+ requires c++17 c++17 is not available on all manylinux images, use a prebuilt patchelf wheel for installation.
1 parent a4d7f5a commit cb9fd5b

File tree

5 files changed

+17
-47
lines changed

5 files changed

+17
-47
lines changed

docker/Dockerfile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ RUN export LIBTOOL_ROOT=libtool-2.4.6 && \
6060
export LIBTOOL_DOWNLOAD_URL=http://ftp.gnu.org/gnu/libtool && \
6161
manylinux-entrypoint /build_scripts/install-libtool.sh
6262

63-
COPY build_scripts/install-patchelf.sh /build_scripts/
64-
RUN export PATCHELF_VERSION=0.13.1 && \
65-
export PATCHELF_HASH=f6d5ecdb51ad78e963233cfde15020f9eebc9d9c7c747aaed54ce39c284ad019 && \
66-
export PATCHELF_DOWNLOAD_URL=https://github.com/NixOS/patchelf/archive && \
67-
manylinux-entrypoint /build_scripts/install-patchelf.sh
68-
6963
COPY build_scripts/install-libxcrypt.sh /build_scripts/
7064
RUN export LIBXCRYPT_VERSION=4.4.27 && \
7165
export LIBXCRYPT_HASH=e4ff47b7fa5370fa08e27258f8a0de5cb7e9b09c297ec7ab56a8a82e229a1c84 && \

docker/build_scripts/install-patchelf.sh

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# This file is autogenerated by pip-compile with python 3.9
3+
# To update, run:
4+
#
5+
# pip-compile --generate-hashes --output-file=docker/build_scripts/requirements-tools/patchelf .nox/update_python_tools/tmp/patchelf.in
6+
#
7+
patchelf==0.14.3.0 \
8+
--hash=sha256:04cdeea7b24d8daca78e885a113791cedb278eb164a1760c509702d6ed155a46 \
9+
--hash=sha256:09ad55d9dff020ecab75d02ae592b6ff7997fc0428ce7ffb35213b3fdd79dad7 \
10+
--hash=sha256:0c778f7af59bd781d187ea27556a1ad3e0dd044d85c77536a7c9d2cc027ff0fc \
11+
--hash=sha256:4b3ee96c6ac9b2059f038db2838bc0be4d119d3b5b8b0cc252e5cadd832a5ae5 \
12+
--hash=sha256:a8dd89901f32f0ce93a5c995a8f9eb79908d43e3a70eaf6b8efe8643976e6a8c \
13+
--hash=sha256:fa208aee4b0e6b3f4dbd1bb2be82b1d2635e045e7dfe227b2095bb2e3db67811
14+
# via -r .nox/update_python_tools/tmp/patchelf.in

requirements-tools.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
auditwheel
22
cmake
3+
patchelf

update_native_dependencies.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,8 @@ def _update_sqlite(dry_run):
117117

118118
def _update_with_gh(tool, dry_run):
119119
repo = {
120-
"patchelf": "NixOS/patchelf",
121120
"libxcrypt": "besser82/libxcrypt",
122121
}
123-
major = {
124-
"patchelf": "0.13"
125-
}
126122
dockerfile = Path(__file__).parent / "docker" / "Dockerfile"
127123
lines = dockerfile.read_text().splitlines()
128124
re_ = re.compile(f"^RUN export {tool.upper()}_VERSION=(?P<version>\\S+) && \\\\$")
@@ -131,7 +127,7 @@ def _update_with_gh(tool, dry_run):
131127
if match is None:
132128
continue
133129
current_version = Version(match["version"])
134-
latest_tag = latest(repo[tool], output_format="tag", major=major.get(tool, None))
130+
latest_tag = latest(repo[tool], output_format="tag")
135131
latest_version = Version(latest_tag)
136132
if latest_version > current_version:
137133
url = re.match(f"^ export {tool.upper()}_DOWNLOAD_URL=(?P<url>\\S+) && \\\\$", lines[i + 2])["url"]
@@ -154,7 +150,7 @@ def main():
154150
_update_sqlite(args.dry_run)
155151
for tool in ["autoconf", "automake", "libtool", "git", "swig", "openssl"]:
156152
_update_with_root(tool, args.dry_run)
157-
for tool in ["patchelf", "libxcrypt"]:
153+
for tool in ["libxcrypt"]:
158154
_update_with_gh(tool, args.dry_run)
159155

160156

0 commit comments

Comments
 (0)