Skip to content

Commit abb5b51

Browse files
committed
Adjust "libncurses5"-keeping code to keep things differently (turns out the requirement is not IBM arches specific)
1 parent b3ee440 commit abb5b51

File tree

5 files changed

+40
-14
lines changed

5 files changed

+40
-14
lines changed

2.7/slim/Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ RUN set -ex; \
3737
apt-get install -y --no-install-recommends \
3838
bzip2 \
3939
wget \
40+
# sometimes "pypy" itself is linked against libncurses5, sometimes it's a ".so" file in "/usr/local/lib_pypy"
41+
libncurses5 \
4042
; \
4143
\
4244
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/pypy2.7-v${PYPY_VERSION}-${pypyArch}.tar.bz2" --progress=dot:giga; \
@@ -70,6 +72,14 @@ RUN set -ex; \
7072
\
7173
apt-mark auto '.*' > /dev/null; \
7274
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \
75+
find /usr/local -type f -executable -exec ldd '{}' ';' \
76+
| awk '/=>/ { print $(NF-1) }' \
77+
| sort -u \
78+
| xargs -r dpkg-query --search \
79+
| cut -d: -f1 \
80+
| sort -u \
81+
| xargs -r apt-mark manual \
82+
; \
7383
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
7484
# smoke test again, to be sure
7585
rm -rf /var/lib/apt/lists/*; \

3.5/slim/Dockerfile

+10-2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ RUN set -ex; \
4141
apt-get install -y --no-install-recommends \
4242
bzip2 \
4343
wget \
44+
# sometimes "pypy3" itself is linked against libncurses5, sometimes it's a ".so" file in "/usr/local/lib_pypy"
45+
libncurses5 \
4446
; \
4547
\
4648
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/pypy3.5-v${PYPY_VERSION}-${pypyArch}.tar.bz2" --progress=dot:giga; \
@@ -49,8 +51,6 @@ RUN set -ex; \
4951
find /usr/local/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
5052
rm pypy.tar.bz2; \
5153
\
52-
# ppc64le and s390x link against libncurses.so.5 (https://bitbucket.org/pypy/pypy/issues/2646)
53-
if ldd /usr/local/bin/pypy3 2>&1 | grep -q 'libncurses.so.5 => not found'; then apt-get install -y --no-install-recommends libncurses5; savedAptMark="$savedAptMark libncurses5"; fi; \
5454
# smoke test
5555
pypy3 --version; \
5656
\
@@ -76,6 +76,14 @@ RUN set -ex; \
7676
\
7777
apt-mark auto '.*' > /dev/null; \
7878
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \
79+
find /usr/local -type f -executable -exec ldd '{}' ';' \
80+
| awk '/=>/ { print $(NF-1) }' \
81+
| sort -u \
82+
| xargs -r dpkg-query --search \
83+
| cut -d: -f1 \
84+
| sort -u \
85+
| xargs -r apt-mark manual \
86+
; \
7987
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
8088
# smoke test again, to be sure
8189
rm -rf /var/lib/apt/lists/*; \

3.6/slim/Dockerfile

+10-2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ RUN set -ex; \
3939
apt-get install -y --no-install-recommends \
4040
bzip2 \
4141
wget \
42+
# sometimes "pypy3" itself is linked against libncurses5, sometimes it's a ".so" file in "/usr/local/lib_pypy"
43+
libncurses5 \
4244
; \
4345
\
4446
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/pypy3.6-v${PYPY_VERSION}-${pypyArch}.tar.bz2" --progress=dot:giga; \
@@ -47,8 +49,6 @@ RUN set -ex; \
4749
find /usr/local/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
4850
rm pypy.tar.bz2; \
4951
\
50-
# ppc64le and s390x link against libncurses.so.5 (https://bitbucket.org/pypy/pypy/issues/2646)
51-
if ldd /usr/local/bin/pypy3 2>&1 | grep -q 'libncurses.so.5 => not found'; then apt-get install -y --no-install-recommends libncurses5; savedAptMark="$savedAptMark libncurses5"; fi; \
5252
# smoke test
5353
pypy3 --version; \
5454
\
@@ -74,6 +74,14 @@ RUN set -ex; \
7474
\
7575
apt-mark auto '.*' > /dev/null; \
7676
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \
77+
find /usr/local -type f -executable -exec ldd '{}' ';' \
78+
| awk '/=>/ { print $(NF-1) }' \
79+
| sort -u \
80+
| xargs -r dpkg-query --search \
81+
| cut -d: -f1 \
82+
| sort -u \
83+
| xargs -r apt-mark manual \
84+
; \
7785
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
7886
# smoke test again, to be sure
7987
rm -rf /var/lib/apt/lists/*; \

Dockerfile-slim.template

+10-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ RUN set -ex; \
3030
apt-get install -y --no-install-recommends \
3131
bzip2 \
3232
wget \
33+
# sometimes "%%CMD%%" itself is linked against libncurses5, sometimes it's a ".so" file in "/usr/local/lib_pypy"
34+
libncurses5 \
3335
; \
3436
\
3537
wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/%%TAR%%-v${PYPY_VERSION}-${pypyArch}.tar.bz2" --progress=dot:giga; \
@@ -38,8 +40,6 @@ RUN set -ex; \
3840
find /usr/local/lib-python -depth -type d -a \( -name test -o -name tests \) -exec rm -rf '{}' +; \
3941
rm pypy.tar.bz2; \
4042
\
41-
# ppc64le and s390x link against libncurses.so.5 (https://bitbucket.org/pypy/pypy/issues/2646)
42-
if ldd /usr/local/bin/%%CMD%% 2>&1 | grep -q 'libncurses.so.5 => not found'; then apt-get install -y --no-install-recommends libncurses5; savedAptMark="$savedAptMark libncurses5"; fi; \
4343
# smoke test
4444
%%CMD%% --version; \
4545
\
@@ -65,6 +65,14 @@ RUN set -ex; \
6565
\
6666
apt-mark auto '.*' > /dev/null; \
6767
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \
68+
find /usr/local -type f -executable -exec ldd '{}' ';' \
69+
| awk '/=>/ { print $(NF-1) }' \
70+
| sort -u \
71+
| xargs -r dpkg-query --search \
72+
| cut -d: -f1 \
73+
| sort -u \
74+
| xargs -r apt-mark manual \
75+
; \
6876
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
6977
# smoke test again, to be sure
7078
rm -rf /var/lib/apt/lists/*; \

update.sh

-8
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,13 @@ for version in "${versions[@]}"; do
7474

7575
linuxArchCase='dpkgArch="$(dpkg --print-architecture)"; '$'\\\n'
7676
linuxArchCase+=$'\t''case "${dpkgArch##*-}" in '$'\\\n'
77-
haveIBM=
7877
for dpkgArch in $(dpkgArches); do
7978
bashbrewArch="$(dpkgToBashbrewArch "$dpkgArch")"
8079
case "$base/$bashbrewArch" in
8180
jessie/s390x | jessie/ppc64le)
8281
echo >&2 "warning: skipping $pypy on $bashbrewArch; https://bitbucket.org/pypy/pypy/issues/2646"
8382
continue
8483
;;
85-
86-
*/s390x | */ppc64le) haveIBM=1 ;;
8784
esac
8885
pypyArch="$(dpkgToPyPyArch "$dpkgArch")"
8986
sha256="$(scrapeSha256 "$pypy" "$fullVersion" "$pypyArch")" || :
@@ -108,11 +105,6 @@ for version in "${versions[@]}"; do
108105
"Dockerfile${variant:+-$variant}.template" > "$version/$variant/Dockerfile"
109106
travisEnv='\n - VERSION='"$version VARIANT=$variant$travisEnv"
110107
done
111-
112-
if [ -z "$haveIBM" ]; then
113-
# no need for s390x/ppc64le libncurses hax
114-
sed -i '/libncurses/d' "$version/slim/Dockerfile"
115-
fi
116108
done
117109

118110
travis="$(awk -v 'RS=\n\n' '$1 == "env:" { $0 = "env:'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)"

0 commit comments

Comments
 (0)