From 6f7e7b05fde4f95b7f259c680ba665665bd5f529 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sat, 5 Nov 2016 11:24:32 -0400 Subject: [PATCH 1/3] common.docker: Fix CMake https download building it against openssl 1.0.2j See #63 --- common.docker | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/common.docker b/common.docker index 1fbe521..8597c9f 100644 --- a/common.docker +++ b/common.docker @@ -5,7 +5,13 @@ RUN git clone "https://github.com/nojhan/liquidprompt.git" && \ COPY imagefiles/.bashrc /root/ WORKDIR /usr/src -RUN git clone git://cmake.org/cmake.git CMake && \ +RUN wget https://www.openssl.org/source/openssl-1.0.2j.tar.gz && \ + tar -xzvf openssl-1.0.2j.tar.gz && \ + cd openssl-1.0.2j && \ + ./config && \ + make && \ + cd .. && \ + git clone git://cmake.org/cmake.git CMake && \ cd CMake && \ git checkout ab2ae4823c3b60347825da4b851cd4e676f8bed1 && \ mkdir /usr/src/CMake-build && \ @@ -16,11 +22,13 @@ RUN git clone git://cmake.org/cmake.git CMake && \ make -j$(grep -c processor /proc/cpuinfo) && \ ./bin/cmake \ -DCMAKE_BUILD_TYPE:STRING=Release \ - -DCMAKE_USE_OPENSSL:BOOL=ON . && \ + -DCMAKE_USE_OPENSSL:BOOL=ON \ + -DOPENSSL_ROOT_DIR:PATH=/usr/src/openssl-1.0.2j \ + . && \ make install && \ - cd .. && rm -rf CMake* + cd .. && rm -rf CMake* && rm -rf /usr/src/openssl-1.0.2j -RUN git clone "https://github.com/martine/ninja.git" && \ +RUN git clone "https://github.com/ninja-build/ninja.git" && \ cd ninja && \ git checkout v1.7.1 && \ ([ -e /opt/python/cp35-cp35m/bin/python ] && /opt/python/cp35-cp35m/bin/python ./configure.py --bootstrap) || python ./configure.py --bootstrap && \ From 3b6e09b520e5e28e0e101305294eac5f4fce06d6 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sat, 5 Nov 2016 17:55:58 -0400 Subject: [PATCH 2/3] manylinux-x86: Fix build of Openssl and CMake This commit fixes the error reported below by ensuring openssl and CMake are configured and build as x86 binaries. It also removes the download of CMake binaries that was introduced by mistake in 1354fe2 (manylinux-x86: Initial addition). Error: ``` Configured for linux-x86_64. making all in crypto... make[1]: Entering directory `/usr/src/openssl-1.0.2j/crypto' /usr/bin/perl ../util/mkbuildinf.pl "gcc -I. -I.. -I../include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM" "linux-x86_64" >buildinf.h gcc -I. -I.. -I../include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -c -o cryptlib.o cryptlib.c cryptlib.c:1:0: sorry, unimplemented: 64-bit mode not compiled in /* crypto/cryptlib.c */ ^ make[1]: *** [cryptlib.o] Error 1 ``` --- common.docker | 14 ++++++++------ manylinux-x64/Dockerfile.in | 3 ++- manylinux-x86/Dockerfile.in | 8 ++------ 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/common.docker b/common.docker index 8597c9f..3bb565b 100644 --- a/common.docker +++ b/common.docker @@ -8,24 +8,26 @@ WORKDIR /usr/src RUN wget https://www.openssl.org/source/openssl-1.0.2j.tar.gz && \ tar -xzvf openssl-1.0.2j.tar.gz && \ cd openssl-1.0.2j && \ - ./config && \ - make && \ + WRAPPER=$([[ $DEFAULT_DOCKCROSS_IMAGE == "dockcross/manylinux-x86" ]] && echo "linux32") && \ + CONFIG_FLAG=$([[ $DEFAULT_DOCKCROSS_IMAGE == "dockcross/manylinux-x86" ]] && echo "-m32") && \ + ${WRAPPER} ./config $CONFIG_FLAG && \ + ${WRAPPER} make && \ cd .. && \ git clone git://cmake.org/cmake.git CMake && \ cd CMake && \ git checkout ab2ae4823c3b60347825da4b851cd4e676f8bed1 && \ mkdir /usr/src/CMake-build && \ cd /usr/src/CMake-build && \ - /usr/src/CMake/bootstrap \ + ${WRAPPER} /usr/src/CMake/bootstrap \ --parallel=$(grep -c processor /proc/cpuinfo) \ --prefix=/usr && \ - make -j$(grep -c processor /proc/cpuinfo) && \ - ./bin/cmake \ + ${WRAPPER} make -j$(grep -c processor /proc/cpuinfo) && \ + ${WRAPPER} ./bin/cmake \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_USE_OPENSSL:BOOL=ON \ -DOPENSSL_ROOT_DIR:PATH=/usr/src/openssl-1.0.2j \ . && \ - make install && \ + ${WRAPPER} make install && \ cd .. && rm -rf CMake* && rm -rf /usr/src/openssl-1.0.2j RUN git clone "https://github.com/ninja-build/ninja.git" && \ diff --git a/manylinux-x64/Dockerfile.in b/manylinux-x64/Dockerfile.in index 2f24c81..27db997 100644 --- a/manylinux-x64/Dockerfile.in +++ b/manylinux-x64/Dockerfile.in @@ -1,6 +1,8 @@ FROM quay.io/pypa/manylinux1_x86_64:latest MAINTAINER Matt McCormick "matt.mccormick@kitware.com" +ENV DEFAULT_DOCKCROSS_IMAGE dockcross/manylinux-x64 + #include "common.docker" #include "common.manylinux" @@ -18,7 +20,6 @@ COPY linux-x64/${CROSS_TRIPLE}-noop.sh /usr/bin/${CROSS_TRIPLE}-noop COPY manylinux-x64/Toolchain.cmake ${CROSS_ROOT}/../lib/ ENV CMAKE_TOOLCHAIN_FILE ${CROSS_ROOT}/../lib/Toolchain.cmake -ENV DEFAULT_DOCKCROSS_IMAGE dockcross/manylinux-x64 # Build-time metadata as defined at http://label-schema.org ARG BUILD_DATE diff --git a/manylinux-x86/Dockerfile.in b/manylinux-x86/Dockerfile.in index 0cc12e5..6a587db 100644 --- a/manylinux-x86/Dockerfile.in +++ b/manylinux-x86/Dockerfile.in @@ -1,6 +1,8 @@ FROM quay.io/pypa/manylinux1_i686:latest MAINTAINER Matt McCormick "matt.mccormick@kitware.com" +ENV DEFAULT_DOCKCROSS_IMAGE dockcross/manylinux-x86 + #include "common.docker" #include "common.manylinux" @@ -18,12 +20,6 @@ COPY linux-x86/${CROSS_TRIPLE}-noop.sh /usr/bin/${CROSS_TRIPLE}-noop COPY manylinux-x86/Toolchain.cmake ${CROSS_ROOT}/../lib/ ENV CMAKE_TOOLCHAIN_FILE ${CROSS_ROOT}/../lib/Toolchain.cmake -ENV DEFAULT_DOCKCROSS_IMAGE dockcross/manylinux-x86 - -RUN curl -O https://cmake.org/files/v3.6/cmake-3.6.2-Linux-i386.tar.gz && \ - tar xzf cmake-3.6.2-Linux-i386.tar.gz && \ - cp -a cmake-3.6.2-Linux-i386/* /usr/ && \ - rm -rf cmake-3.6.2-Linux-i386 COPY linux-x86/linux32-entrypoint.sh /dockcross/ ENTRYPOINT ["/dockcross/linux32-entrypoint.sh"] From b54dbfd9cf0bd722b02e466c3761b66e2f1dde79 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sun, 6 Nov 2016 10:13:08 -0500 Subject: [PATCH 3/3] base: Improve openssl build for i686 Avoid bash-isms. Also return true from the sub-shell. --- common.docker | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common.docker b/common.docker index 3bb565b..4aae6ed 100644 --- a/common.docker +++ b/common.docker @@ -8,8 +8,8 @@ WORKDIR /usr/src RUN wget https://www.openssl.org/source/openssl-1.0.2j.tar.gz && \ tar -xzvf openssl-1.0.2j.tar.gz && \ cd openssl-1.0.2j && \ - WRAPPER=$([[ $DEFAULT_DOCKCROSS_IMAGE == "dockcross/manylinux-x86" ]] && echo "linux32") && \ - CONFIG_FLAG=$([[ $DEFAULT_DOCKCROSS_IMAGE == "dockcross/manylinux-x86" ]] && echo "-m32") && \ + WRAPPER=$( [ $DEFAULT_DOCKCROSS_IMAGE = "dockcross/manylinux-x86" ] && echo "linux32" || echo "") && \ + CONFIG_FLAG=$( [ $DEFAULT_DOCKCROSS_IMAGE = "dockcross/manylinux-x86" ] && echo "-m32" || echo "") && \ ${WRAPPER} ./config $CONFIG_FLAG && \ ${WRAPPER} make && \ cd .. && \