From ab7e80732c4e392a506cade758f845b5372e002d Mon Sep 17 00:00:00 2001 From: Sebastian Vetter Date: Fri, 21 Apr 2017 09:30:22 -0700 Subject: [PATCH] Fix segmentation fault when building Python 3.6 image This fixes the issues reported in #160 for the Alpine build. For Python 3.6, the build succeeds but test illustrate that `ctypes` related test fail with segmentation faults. This also prevents optimized builds because they rely on a full run of the test suite. The fix is based on the release candidate build of Python 3.6.1 in Alpine Edge. It switches to system libraries for `libffi` and `expat` in the same way it's used in [the Alpine build file](https://git.alpinelinux.org/cgit/aports/tree/main/python3/APKBUILD). --- 3.6/alpine/Dockerfile | 8 ++++++++ Dockerfile-alpine.template | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/3.6/alpine/Dockerfile b/3.6/alpine/Dockerfile index b16146e7d..5c9c26f84 100644 --- a/3.6/alpine/Dockerfile +++ b/3.6/alpine/Dockerfile @@ -58,11 +58,19 @@ RUN set -ex \ tk-dev \ xz-dev \ zlib-dev \ + libffi-dev \ + expat-dev \ # add build deps before removing fetch deps in case there's overlap && apk del .fetch-deps \ \ && cd /usr/src/python \ + && rm -r Modules/expat \ + Modules/zlib \ + Modules/_ctypes/darwin* \ + Modules/_ctypes/libffi* \ && ./configure \ + --with-system-ffi \ + --with-system-expat \ --enable-loadable-sqlite-extensions \ --enable-shared \ && make -j$(getconf _NPROCESSORS_ONLN) \ diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 79e1cd2e5..65c49c4c8 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -52,11 +52,19 @@ RUN set -ex \ tk-dev \ xz-dev \ zlib-dev \ + libffi-dev \ + expat-dev \ # add build deps before removing fetch deps in case there's overlap && apk del .fetch-deps \ \ && cd /usr/src/python \ + && rm -r Modules/expat \ + Modules/zlib \ + Modules/_ctypes/darwin* \ + Modules/_ctypes/libffi* \ && ./configure \ + --with-system-ffi \ + --with-system-expat \ --enable-loadable-sqlite-extensions \ --enable-shared \ && make -j$(getconf _NPROCESSORS_ONLN) \