@@ -86,10 +86,6 @@ hash -r
86
86
curl --version
87
87
curl-config --features
88
88
89
- # Install a git we link against OpenSSL so that we can use TLS 1.2
90
- build_git $GIT_ROOT $GIT_HASH
91
- git version
92
-
93
89
# Install newest autoconf
94
90
build_autoconf $AUTOCONF_ROOT $AUTOCONF_HASH
95
91
autoconf --version
@@ -102,6 +98,45 @@ automake --version
102
98
build_libtool $LIBTOOL_ROOT $LIBTOOL_HASH
103
99
libtool --version
104
100
101
+ # Install patchelf (latest with unreleased bug fixes)
102
+ curl -fsSL -o patchelf.tar.gz https://github.com/NixOS/patchelf/archive/$PATCHELF_VERSION .tar.gz
103
+ check_sha256sum patchelf.tar.gz $PATCHELF_HASH
104
+ tar -xzf patchelf.tar.gz
105
+ (cd patchelf-$PATCHELF_VERSION && ./bootstrap.sh && do_standard_install)
106
+ rm -rf patchelf.tar.gz patchelf-$PATCHELF_VERSION
107
+
108
+ # We strip curl now because stripping after patchelf breaks it
109
+ strip --strip-unneeded /opt/_internal/_vendor/lib/libcurl.so.4
110
+ strip --strip-unneeded /usr/local/bin/curl
111
+
112
+ # Let's patch curl & openssl:
113
+ CHECKSUM=$( sha256sum /opt/_internal/_vendor/lib/libcrypto.so.1.0.0)
114
+ CHECKSUM=${CHECKSUM: 0: 8}
115
+ patchelf --set-soname /opt/_internal/_vendor/lib/libcrypto.so.1.0.0-${CHECKSUM} /opt/_internal/_vendor/lib/libcrypto.so.1.0.0
116
+ mv /opt/_internal/_vendor/lib/libcrypto.so.1.0.0 /opt/_internal/_vendor/lib/libcrypto.so.1.0.0-${CHECKSUM}
117
+ ln -sf libcrypto.so.1.0.0-${CHECKSUM} /opt/_internal/_vendor/lib/libcrypto.so
118
+ patchelf --replace-needed libcrypto.so.1.0.0 /opt/_internal/_vendor/lib/libcrypto.so.1.0.0-${CHECKSUM} /opt/_internal/_vendor/lib/libssl.so.1.0.0
119
+ patchelf --replace-needed libcrypto.so.1.0.0 /opt/_internal/_vendor/lib/libcrypto.so.1.0.0-${CHECKSUM} /opt/_internal/_vendor/lib/libcurl.so.4
120
+ patchelf --replace-needed libcrypto.so.1.0.0 /opt/_internal/_vendor/lib/libcrypto.so.1.0.0-${CHECKSUM} /usr/local/bin/curl
121
+
122
+ CHECKSUM=$( sha256sum /opt/_internal/_vendor/lib/libssl.so.1.0.0)
123
+ CHECKSUM=${CHECKSUM: 0: 8}
124
+ patchelf --set-soname /opt/_internal/_vendor/lib/libssl.so.1.0.0-${CHECKSUM} /opt/_internal/_vendor/lib/libssl.so.1.0.0
125
+ mv /opt/_internal/_vendor/lib/libssl.so.1.0.0 /opt/_internal/_vendor/lib/libssl.so.1.0.0-${CHECKSUM}
126
+ ln -sf libssl.so.1.0.0-${CHECKSUM} /opt/_internal/_vendor/lib/libssl.so
127
+ patchelf --replace-needed libssl.so.1.0.0 /opt/_internal/_vendor/lib/libssl.so.1.0.0-${CHECKSUM} /opt/_internal/_vendor/lib/libcurl.so.4
128
+ patchelf --replace-needed libssl.so.1.0.0 /opt/_internal/_vendor/lib/libssl.so.1.0.0-${CHECKSUM} /usr/local/bin/curl
129
+
130
+ CHECKSUM=$( sha256sum /opt/_internal/_vendor/lib/libcurl.so.4)
131
+ CHECKSUM=${CHECKSUM: 0: 8}
132
+ patchelf --set-soname /opt/_internal/_vendor/lib/libcurl.so.4-${CHECKSUM} /opt/_internal/_vendor/lib/libcurl.so.4
133
+ mv /opt/_internal/_vendor/lib/libcurl.so.4 /opt/_internal/_vendor/lib/libcurl.so.4-${CHECKSUM}
134
+ patchelf --replace-needed libcurl.so.4 /opt/_internal/_vendor/lib/libcurl.so.4-${CHECKSUM} /usr/local/bin/curl
135
+
136
+ # Install a git we link against OpenSSL so that we can use TLS 1.2
137
+ build_git $GIT_ROOT $GIT_HASH
138
+ git version
139
+
105
140
# Install a more recent SQLite3
106
141
curl -fsSLO $SQLITE_AUTOCONF_DOWNLOAD_URL /$SQLITE_AUTOCONF_VERSION .tar.gz
107
142
check_sha256sum $SQLITE_AUTOCONF_VERSION .tar.gz $SQLITE_AUTOCONF_HASH
@@ -110,11 +145,14 @@ cd $SQLITE_AUTOCONF_VERSION
110
145
do_standard_install
111
146
cd ..
112
147
rm -rf $SQLITE_AUTOCONF_VERSION *
148
+ rm -f /usr/local/lib/libsqlite3.a
149
+
150
+ # Create a symbolic link for python to find openssl
151
+ ln -s /opt/_internal/_vendor /usr/local/ssl
113
152
114
153
# Compile the latest Python releases.
115
154
# (In order to have a proper SSL module, Python is compiled
116
- # against a recent openssl [see env vars above], which is linked
117
- # statically.
155
+ # against a recent openssl [see env vars above])
118
156
mkdir -p /opt/python
119
157
build_cpythons $CPYTHON_VERSIONS
120
158
@@ -134,14 +172,8 @@ ln -s $($PY36_BIN/python -c 'import certifi; print(certifi.where())') \
134
172
export SSL_CERT_FILE=/opt/_internal/certs.pem
135
173
136
174
# Now we can delete our built OpenSSL headers/static libs since we've linked everything we need
137
- rm -rf /usr/local/ssl
138
-
139
- # Install patchelf (latest with unreleased bug fixes)
140
- curl -fsSL -o patchelf.tar.gz https://github.com/NixOS/patchelf/archive/$PATCHELF_VERSION .tar.gz
141
- check_sha256sum patchelf.tar.gz $PATCHELF_HASH
142
- tar -xzf patchelf.tar.gz
143
- (cd patchelf-$PATCHELF_VERSION && ./bootstrap.sh && do_standard_install)
144
- rm -rf patchelf.tar.gz patchelf-$PATCHELF_VERSION
175
+ unlink /usr/local/ssl
176
+ find /opt/_internal/_vendor -mindepth 1 -maxdepth 1 -not -path ' /opt/_internal/_vendor/lib*' | xargs rm -rf
145
177
146
178
ln -s $PY36_BIN /auditwheel /usr/local/bin/auditwheel
147
179
@@ -164,10 +196,18 @@ yum list installed
164
196
find /opt/_internal -name ' *.a' -print0 | xargs -0 rm -f
165
197
166
198
# Strip what we can -- and ignore errors, because this just attempts to strip
167
- # *everything*, including non-ELF files:
168
- find /opt/_internal -type f -print0 \
199
+ # *everything*, including non-ELF files.
200
+ # We ignore curl which was stripped before patching it with patchelf
201
+ find /opt/_internal -type f -not -name ' libcurl.so*' -print0 \
202
+ | xargs -0 -n1 strip --strip-unneeded 2> /dev/null || true
203
+ find /usr/local -type f -not -name ' curl' -print0 \
169
204
| xargs -0 -n1 strip --strip-unneeded 2> /dev/null || true
170
205
206
+ # Make sure curl is still working after stripping, patchelf can break things
207
+ # libcurl is in exceptions for stripping and this will help catch errors if openssl gets broken after an update
208
+ curl -fsSLO $GET_PIP_URL
209
+ rm -f get-pip.py
210
+
171
211
for PYTHON in /opt/python/* /bin/python; do
172
212
# Smoke test to make sure that our Pythons work, and do indeed detect as
173
213
# being manylinux compatible:
0 commit comments