Skip to content

Commit

Permalink
Do not set PROFILE_TASK environment variable
Browse files Browse the repository at this point in the history
When this is set, the `--enable-optimizations` option becomes ineffective, as
the profile task step is bypassed.

For 3.13, have to edit the Makefile to revert the original behavior because xml
tests fail on older distros because of expat issues.

closes docker-library#979
  • Loading branch information
RobertDeRose committed Oct 16, 2024
1 parent 7666104 commit 9285fd8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Dockerfile-linux.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
def is_slim:
env.variant | startswith("slim-")
;
def is_bullseye:
env.variant | contains("bullseye")
;
def rcVersion:
env.version | rtrimstr("-rc")
-}}
Expand Down Expand Up @@ -185,19 +188,24 @@ RUN set -eux; \
{{ ) end -}}
{{ if is_slim or is_alpine then ( -}}
LDFLAGS="${LDFLAGS:--Wl},--strip-all"; \
{{ ) else "" end -}}
{{ if ([ "3.13" ] | index(rcVersion)) and (is_alpine or is_bullseye) then ( -}}
# Workaround https://github.com/python/cpython/issues/125067
sed -i -E \
-e 's:(\$\(LLVM_PROF_FILE\) \$\(RUNSHARED\) ./\$\(BUILDPYTHON\) \$\(PROFILE_TASK\)):\1 || true:' \
-e 's:TESTTIMEOUT=$:TESTTIMEOUT= 1200:' Makefile \
; \
{{ ) else "" end -}}
make -j "$nproc" \
"EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \
"LDFLAGS=${LDFLAGS:-}" \
"PROFILE_TASK=${PROFILE_TASK:-}" \
; \
# https://github.com/docker-library/python/issues/784
# prevent accidental usage of a system installed libpython of the same version
rm python; \
make -j "$nproc" \
"EXTRA_CFLAGS=${EXTRA_CFLAGS:-}" \
"LDFLAGS=${LDFLAGS:--Wl},-rpath='\$\$ORIGIN/../lib'" \
"PROFILE_TASK=${PROFILE_TASK:-}" \
python \
; \
make install; \
Expand Down

0 comments on commit 9285fd8

Please sign in to comment.