From 1b6bc0cc0b1e627965feff9c838cf551d68dab28 Mon Sep 17 00:00:00 2001 From: Roman Podoliaka Date: Mon, 7 Feb 2022 19:29:19 +0000 Subject: [PATCH] Don't strip debugging symbols in the regular Debian images Since #687, the regular Debian images no longer ship DWARF symbols, which heavily limits the ability to use gdb and lldb for debugging. Stripping debugging symbols makes perfect sense to reduce the size of Docker images, but when this optimization was first introduced in #483, the idea was to restrict its use to the slim and Alpine images. That was (unintentionally?) changed in #483, and now debugging symbols are also stripped in the regular Debian images. Undo that change. --- 3.10/bullseye/Dockerfile | 1 - 3.10/buster/Dockerfile | 1 - 3.11-rc/bullseye/Dockerfile | 1 - 3.11-rc/buster/Dockerfile | 1 - 3.7/bullseye/Dockerfile | 1 - 3.7/buster/Dockerfile | 1 - 3.8/bullseye/Dockerfile | 1 - 3.8/buster/Dockerfile | 1 - 3.9/bullseye/Dockerfile | 1 - 3.9/buster/Dockerfile | 1 - Dockerfile-linux.template | 2 ++ 11 files changed, 2 insertions(+), 10 deletions(-) diff --git a/3.10/bullseye/Dockerfile b/3.10/bullseye/Dockerfile index 9ebf62473..331d9e488 100644 --- a/3.10/bullseye/Dockerfile +++ b/3.10/bullseye/Dockerfile @@ -54,7 +54,6 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ ; \ make install; \ cd /; \ diff --git a/3.10/buster/Dockerfile b/3.10/buster/Dockerfile index 5e200cfa5..1854da855 100644 --- a/3.10/buster/Dockerfile +++ b/3.10/buster/Dockerfile @@ -54,7 +54,6 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ ; \ make install; \ cd /; \ diff --git a/3.11-rc/bullseye/Dockerfile b/3.11-rc/bullseye/Dockerfile index bf7d88c7c..05348e501 100644 --- a/3.11-rc/bullseye/Dockerfile +++ b/3.11-rc/bullseye/Dockerfile @@ -54,7 +54,6 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ ; \ make install; \ cd /; \ diff --git a/3.11-rc/buster/Dockerfile b/3.11-rc/buster/Dockerfile index 3fce4115b..6adac4d57 100644 --- a/3.11-rc/buster/Dockerfile +++ b/3.11-rc/buster/Dockerfile @@ -54,7 +54,6 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ ; \ make install; \ cd /; \ diff --git a/3.7/bullseye/Dockerfile b/3.7/bullseye/Dockerfile index 6370c9591..08d0fada3 100644 --- a/3.7/bullseye/Dockerfile +++ b/3.7/bullseye/Dockerfile @@ -53,7 +53,6 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ # setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916 PROFILE_TASK='-m test.regrtest --pgo \ test_array \ diff --git a/3.7/buster/Dockerfile b/3.7/buster/Dockerfile index f3a13363a..8a5159625 100644 --- a/3.7/buster/Dockerfile +++ b/3.7/buster/Dockerfile @@ -53,7 +53,6 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ # setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916 PROFILE_TASK='-m test.regrtest --pgo \ test_array \ diff --git a/3.8/bullseye/Dockerfile b/3.8/bullseye/Dockerfile index b5b6ab7b6..eda4387c3 100644 --- a/3.8/bullseye/Dockerfile +++ b/3.8/bullseye/Dockerfile @@ -53,7 +53,6 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ ; \ make install; \ cd /; \ diff --git a/3.8/buster/Dockerfile b/3.8/buster/Dockerfile index fa5a647ef..4792cdaa0 100644 --- a/3.8/buster/Dockerfile +++ b/3.8/buster/Dockerfile @@ -53,7 +53,6 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ ; \ make install; \ cd /; \ diff --git a/3.9/bullseye/Dockerfile b/3.9/bullseye/Dockerfile index 65a0cfd00..d2fb4dde0 100644 --- a/3.9/bullseye/Dockerfile +++ b/3.9/bullseye/Dockerfile @@ -53,7 +53,6 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ ; \ make install; \ cd /; \ diff --git a/3.9/buster/Dockerfile b/3.9/buster/Dockerfile index 5d2083359..0fa56c72d 100644 --- a/3.9/buster/Dockerfile +++ b/3.9/buster/Dockerfile @@ -53,7 +53,6 @@ RUN set -eux; \ ; \ nproc="$(nproc)"; \ make -j "$nproc" \ - LDFLAGS="-Wl,--strip-all" \ ; \ make install; \ cd /; \ diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template index e5d2529f0..f2e445a6d 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -170,7 +170,9 @@ RUN set -eux; \ # https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ {{ ) else "" end -}} +{{ if is_slim or is_alpine then ( -}} LDFLAGS="-Wl,--strip-all" \ +{{ ) else "" end -}} {{ if env.version == "3.7" then ( -}} # setting PROFILE_TASK makes "--enable-optimizations" reasonable: https://bugs.python.org/issue36044 / https://github.com/docker-library/python/issues/160#issuecomment-509426916 PROFILE_TASK='-m test.regrtest --pgo \