From 6fb4121ea9ebf3673574b343712e1f7d21a5316f Mon Sep 17 00:00:00 2001 From: "Nadav.Ruskin" Date: Thu, 15 Mar 2018 08:36:06 +0100 Subject: [PATCH 01/29] Android: Use clang --- android-arm/Dockerfile | 1 + android-arm/Toolchain.cmake | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/android-arm/Dockerfile b/android-arm/Dockerfile index 8c7791af..badcfa17 100644 --- a/android-arm/Dockerfile +++ b/android-arm/Dockerfile @@ -25,6 +25,7 @@ RUN mkdir -p /build && \ ./build/tools/make_standalone_toolchain.py \ --arch arm \ --api 16 \ + --stl=libc++ \ --install-dir=${CROSS_ROOT} && \ cd / && \ rm -rf /build && \ diff --git a/android-arm/Toolchain.cmake b/android-arm/Toolchain.cmake index 713fffa8..1399fee4 100644 --- a/android-arm/Toolchain.cmake +++ b/android-arm/Toolchain.cmake @@ -6,8 +6,8 @@ set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN /usr/${cross_triple}/) set(CMAKE_ANDROID_ARM_MODE 1) set(CMAKE_ANDROID_ARM_NEON 1) -set(CMAKE_C_COMPILER /usr/${cross_triple}/bin/${cross_triple}-gcc) -set(CMAKE_CXX_COMPILER /usr/${cross_triple}/bin/${cross_triple}-g++) +set(CMAKE_C_COMPILER /usr/${cross_triple}/bin/${cross_triple}-clang) +set(CMAKE_CXX_COMPILER /usr/${cross_triple}/bin/${cross_triple}-clang++) set(CMAKE_FIND_ROOT_PATH /usr/${cross_triple}) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) From f8cabb2edbd6281e7f9b61ab5df24c7e585dcdff Mon Sep 17 00:00:00 2001 From: "Nadav.Ruskin" Date: Thu, 15 Mar 2018 08:46:43 +0100 Subject: [PATCH 02/29] Added ANDROID_NDK_API --- android-arm/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android-arm/Dockerfile b/android-arm/Dockerfile index badcfa17..ab027828 100644 --- a/android-arm/Dockerfile +++ b/android-arm/Dockerfile @@ -17,6 +17,7 @@ ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \ LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld ENV ANDROID_NDK_REVISION 13b +ENV ANDROID_NDK_API 16 RUN mkdir -p /build && \ cd /build && \ curl -O https://dl.google.com/android/repository/android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.zip && \ @@ -24,7 +25,7 @@ RUN mkdir -p /build && \ cd android-ndk-r${ANDROID_NDK_REVISION} && \ ./build/tools/make_standalone_toolchain.py \ --arch arm \ - --api 16 \ + --api $(ANDROID_NDK_API) \ --stl=libc++ \ --install-dir=${CROSS_ROOT} && \ cd / && \ From f94d4a853f4903ce4c8ce6baecd97ee4aef06b65 Mon Sep 17 00:00:00 2001 From: "Nadav.Ruskin" Date: Thu, 15 Mar 2018 08:56:21 +0100 Subject: [PATCH 03/29] Added android arm 64 --- android-arm64/Dockerfile | 51 +++++++++++++++++++++++++++++++++++ android-arm64/Toolchain.cmake | 18 +++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 android-arm64/Dockerfile create mode 100644 android-arm64/Toolchain.cmake diff --git a/android-arm64/Dockerfile b/android-arm64/Dockerfile new file mode 100644 index 00000000..ec71b3cb --- /dev/null +++ b/android-arm64/Dockerfile @@ -0,0 +1,51 @@ +FROM dockcross/base:latest +MAINTAINER Matt McCormick "matt.mccormick@kitware.com" + +# The cross-compiling emulator +RUN apt-get update && apt-get install -y \ + qemu-user \ + qemu-user-static \ + unzip + +ENV CROSS_TRIPLE=aarch64-linux-androideabi +ENV CROSS_ROOT=/usr/${CROSS_TRIPLE} +ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \ + AR=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ar \ + CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gcc \ + CPP=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-cpp \ + CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-g++ \ + LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld + +ENV ANDROID_NDK_REVISION 13b +ENV ANDROID_NDK_API 16 +RUN mkdir -p /build && \ + cd /build && \ + curl -O https://dl.google.com/android/repository/android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.zip && \ + unzip ./android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.zip && \ + cd android-ndk-r${ANDROID_NDK_REVISION} && \ + ./build/tools/make_standalone_toolchain.py \ + --arch arm64 \ + --api $(ANDROID_NDK_API) \ + --stl=libc++ \ + --install-dir=${CROSS_ROOT} && \ + cd / && \ + rm -rf /build && \ + find ${CROSS_ROOT} -exec chmod a+r '{}' \; && \ + find ${CROSS_ROOT} -executable -exec chmod a+x '{}' \; + + +ENV DEFAULT_DOCKCROSS_IMAGE dockcross/android-arm64 + +COPY Toolchain.cmake ${CROSS_ROOT}/ +ENV CMAKE_TOOLCHAIN_FILE ${CROSS_ROOT}/Toolchain.cmake + +# Build-time metadata as defined at http://label-schema.org +ARG BUILD_DATE +ARG IMAGE +ARG VCS_REF +ARG VCS_URL +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$IMAGE \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url=$VCS_URL \ + org.label-schema.schema-version="1.0" diff --git a/android-arm64/Toolchain.cmake b/android-arm64/Toolchain.cmake new file mode 100644 index 00000000..1399fee4 --- /dev/null +++ b/android-arm64/Toolchain.cmake @@ -0,0 +1,18 @@ +set(CMAKE_SYSTEM_NAME Android) +set(CMAKE_SYSTEM_VERSION 1) + +set(cross_triple arm-linux-androideabi) +set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN /usr/${cross_triple}/) +set(CMAKE_ANDROID_ARM_MODE 1) +set(CMAKE_ANDROID_ARM_NEON 1) + +set(CMAKE_C_COMPILER /usr/${cross_triple}/bin/${cross_triple}-clang) +set(CMAKE_CXX_COMPILER /usr/${cross_triple}/bin/${cross_triple}-clang++) + +set(CMAKE_FIND_ROOT_PATH /usr/${cross_triple}) +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_SYSROOT /usr/${cross_triple}/sysroot) + +set(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/qemu-arm) From e362e021de85bdbd0f87b73fab9dff7aa10d0fea Mon Sep 17 00:00:00 2001 From: Nadav Date: Thu, 15 Mar 2018 10:27:46 +0200 Subject: [PATCH 04/29] Update Dockerfile --- android-arm/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android-arm/Dockerfile b/android-arm/Dockerfile index ab027828..948569e1 100644 --- a/android-arm/Dockerfile +++ b/android-arm/Dockerfile @@ -25,7 +25,7 @@ RUN mkdir -p /build && \ cd android-ndk-r${ANDROID_NDK_REVISION} && \ ./build/tools/make_standalone_toolchain.py \ --arch arm \ - --api $(ANDROID_NDK_API) \ + --api ${ANDROID_NDK_API} \ --stl=libc++ \ --install-dir=${CROSS_ROOT} && \ cd / && \ From f7b5a29b3d34771eaf93ca336016c44a09f97926 Mon Sep 17 00:00:00 2001 From: Nadav Date: Thu, 15 Mar 2018 12:37:39 +0200 Subject: [PATCH 05/29] Update Dockerfile Changed `androideabi` to `android` --- android-arm64/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android-arm64/Dockerfile b/android-arm64/Dockerfile index ec71b3cb..1e784601 100644 --- a/android-arm64/Dockerfile +++ b/android-arm64/Dockerfile @@ -7,7 +7,7 @@ RUN apt-get update && apt-get install -y \ qemu-user-static \ unzip -ENV CROSS_TRIPLE=aarch64-linux-androideabi +ENV CROSS_TRIPLE=aarch64-linux-android ENV CROSS_ROOT=/usr/${CROSS_TRIPLE} ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \ AR=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ar \ From 9b5f381b7203d4bb790f386551ba003718292ee2 Mon Sep 17 00:00:00 2001 From: Nadav Date: Thu, 15 Mar 2018 12:38:23 +0200 Subject: [PATCH 06/29] Fixed cross triple --- android-arm64/Toolchain.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android-arm64/Toolchain.cmake b/android-arm64/Toolchain.cmake index 1399fee4..86452751 100644 --- a/android-arm64/Toolchain.cmake +++ b/android-arm64/Toolchain.cmake @@ -1,7 +1,7 @@ set(CMAKE_SYSTEM_NAME Android) set(CMAKE_SYSTEM_VERSION 1) -set(cross_triple arm-linux-androideabi) +set(cross_triple aarch64-linux-android) set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN /usr/${cross_triple}/) set(CMAKE_ANDROID_ARM_MODE 1) set(CMAKE_ANDROID_ARM_NEON 1) @@ -16,3 +16,4 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_SYSROOT /usr/${cross_triple}/sysroot) set(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/qemu-arm) + From 8efd22e3dfc86e8d4dcd7993eba59666e99a07c1 Mon Sep 17 00:00:00 2001 From: Nadav Date: Thu, 15 Mar 2018 13:51:50 +0200 Subject: [PATCH 07/29] Updated API defaults to suit minimum arm64 --- android-arm64/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android-arm64/Dockerfile b/android-arm64/Dockerfile index 1e784601..5c2c76d8 100644 --- a/android-arm64/Dockerfile +++ b/android-arm64/Dockerfile @@ -17,7 +17,7 @@ ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \ LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld ENV ANDROID_NDK_REVISION 13b -ENV ANDROID_NDK_API 16 +ENV ANDROID_NDK_API 21 RUN mkdir -p /build && \ cd /build && \ curl -O https://dl.google.com/android/repository/android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.zip && \ From 496c4a259708227a9a3ac8ddbb53852ad3ad33d2 Mon Sep 17 00:00:00 2001 From: Nadav Date: Thu, 15 Mar 2018 14:37:54 +0200 Subject: [PATCH 08/29] Add arm64 packages by default --- android-arm64/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/android-arm64/Dockerfile b/android-arm64/Dockerfile index 5c2c76d8..59242b6c 100644 --- a/android-arm64/Dockerfile +++ b/android-arm64/Dockerfile @@ -1,5 +1,6 @@ FROM dockcross/base:latest MAINTAINER Matt McCormick "matt.mccormick@kitware.com" +RUN dpkg --add-architecture arm64 ; apt-get update # The cross-compiling emulator RUN apt-get update && apt-get install -y \ From d8adcfc2f4503e4f2547c589f4249a143ae671bf Mon Sep 17 00:00:00 2001 From: Nadav Date: Sun, 18 Mar 2018 11:08:14 +0200 Subject: [PATCH 09/29] Update Dockerfile --- android-arm64/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android-arm64/Dockerfile b/android-arm64/Dockerfile index 59242b6c..c22d3707 100644 --- a/android-arm64/Dockerfile +++ b/android-arm64/Dockerfile @@ -17,7 +17,7 @@ ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \ CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-g++ \ LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld -ENV ANDROID_NDK_REVISION 13b +ENV ANDROID_NDK_REVISION 16b ENV ANDROID_NDK_API 21 RUN mkdir -p /build && \ cd /build && \ From 71dfbcc5095de47d97d0ddfcf227e607471774f8 Mon Sep 17 00:00:00 2001 From: Nadav Date: Sun, 18 Mar 2018 11:10:47 +0200 Subject: [PATCH 10/29] Update Dockerfile --- android-arm/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android-arm/Dockerfile b/android-arm/Dockerfile index 948569e1..5ce348f0 100644 --- a/android-arm/Dockerfile +++ b/android-arm/Dockerfile @@ -16,7 +16,7 @@ ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \ CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-g++ \ LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld -ENV ANDROID_NDK_REVISION 13b +ENV ANDROID_NDK_REVISION 16b ENV ANDROID_NDK_API 16 RUN mkdir -p /build && \ cd /build && \ From 1cad97f9b2d3e79a58d5e0e5a345d8be739a22e2 Mon Sep 17 00:00:00 2001 From: Nadav Date: Mon, 19 Mar 2018 14:50:17 +0200 Subject: [PATCH 11/29] Adding android-arm64 as a target --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 765d5d87..b2c7eff7 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ ORG = dockcross BIN = ./bin # These images are built using the "build implicit rule" -STANDARD_IMAGES = linux-s390x android-arm linux-x86 linux-x64 linux-arm64 linux-armv5 linux-armv6 linux-armv7 linux-mips linux-mipsel linux-ppc64le windows-x86 windows-x64 +STANDARD_IMAGES = linux-s390x android-arm android-arm64 linux-x86 linux-x64 linux-arm64 linux-armv5 linux-armv6 linux-armv7 linux-mips linux-mipsel linux-ppc64le windows-x86 windows-x64 # Generated Dockerfiles. GEN_IMAGES = linux-s390x linux-mips manylinux-x86 manylinux-x64 browser-asmjs From bf71007be487eff8333927d7a22cd9797a5e78f2 Mon Sep 17 00:00:00 2001 From: Nadav Date: Mon, 19 Mar 2018 14:55:14 +0200 Subject: [PATCH 12/29] Added android-arm64 as a target --- .circleci/config.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 34e74439..b6a71e9c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,6 +44,25 @@ jobs: - save_cache: key: android-arm-assets-{{ .Revision }} paths: ~/docker/android-arm.tar + android-arm64: + <<: *build-settings + steps: + - restore_cache: + key: base-assets-{{ .Revision }} + - run: + name: android-arm64 build + no_output_timeout: 1.5h + command: | + docker load -i ~/docker/base.tar + make android-arm64 + docker save -o ~/docker/android-arm64.tar dockcross/android-arm64:latest + - run: + name: android-arm64 test + command: | + make android-arm64.test + - save_cache: + key: android-arm64-assets-{{ .Revision }} + paths: ~/docker/android-arm64.tar browser-asmjs: <<: *build-settings steps: @@ -333,6 +352,16 @@ jobs: docker login -u $DOCKER_USER -p $DOCKER_PASS docker push dockcross/android-arm:latest fi + - restore_cache: + key: android-arm64-assets-{{ .Revision }} + - deploy: + name: Deploy android-arm64 + command: | + docker load -i ~/docker/android-arm64.tar + if [ "${CIRCLE_BRANCH}" == "master" ]; then + docker login -u $DOCKER_USER -p $DOCKER_PASS + docker push dockcross/android-arm64:latest + fi - restore_cache: key: browser-asmjs-assets-{{ .Revision }} - deploy: @@ -482,6 +511,9 @@ workflows: - android-arm: requires: - base + - android-arm64: + requires: + - base - browser-asmjs: requires: - base @@ -528,6 +560,7 @@ workflows: requires: - base - android-arm + - android-arm64 - browser-asmjs - linux-arm64 - linux-armv5 From 3c4049d504ddaebbc6e7a31b182c2acda69b39a2 Mon Sep 17 00:00:00 2001 From: Nadav Date: Mon, 19 Mar 2018 14:57:00 +0200 Subject: [PATCH 13/29] Added android-arm64 --- README.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.rst b/README.rst index 38e527e4..114fbcd3 100644 --- a/README.rst +++ b/README.rst @@ -40,6 +40,13 @@ dockcross/android-arm architecture. +.. |android-arm64-images| image:: https://images.microbadger.com/badges/image/dockcross/android-arm64.svg + :target: https://microbadger.com/images/dockcross/android-arm64 + +dockcross/android-arm64 + |android-arm64-images| The Android NDK standalone toolchain for the arm + architecture. + .. |browser-asmjs-images| image:: https://images.microbadger.com/badges/image/dockcross/browser-asmjs.svg :target: https://microbadger.com/images/dockcross/browser-asmjs From 71d47e6888dcb8ef77406d5cbf8da5b8f3608d07 Mon Sep 17 00:00:00 2001 From: Nadav Date: Mon, 19 Mar 2018 14:57:40 +0200 Subject: [PATCH 14/29] Minor fix --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 114fbcd3..039f4634 100644 --- a/README.rst +++ b/README.rst @@ -44,7 +44,7 @@ dockcross/android-arm :target: https://microbadger.com/images/dockcross/android-arm64 dockcross/android-arm64 - |android-arm64-images| The Android NDK standalone toolchain for the arm + |android-arm64-images| The Android NDK standalone toolchain for the arm64 architecture. .. |browser-asmjs-images| image:: https://images.microbadger.com/badges/image/dockcross/browser-asmjs.svg From f14bfaa6e5335714c4dea539d8ea96d92330a494 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Mon, 19 Mar 2018 15:50:28 -0400 Subject: [PATCH 15/29] Update LICENSE copyright dates and add @jcfr [ci skip] --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index b9b9447c..6f3c9978 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015 Steeve Morin, Rob Burns, Matthew McCormick +Copyright (c) 2015, 2016, 2017, 2018 Steeve Morin, Rob Burns, Matthew McCormick, Jean-Christophe-Fillion-Robin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From b809eaade6ab981da1cca6e15fbae2f45ac84095 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Mon, 19 Mar 2018 16:23:22 -0400 Subject: [PATCH 16/29] README: Explain difference between dockcross and dockbuild [ci skip] --- README.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.rst b/README.rst index 38e527e4..22cb4c32 100644 --- a/README.rst +++ b/README.rst @@ -21,6 +21,15 @@ Features * Works with the `Docker for Mac `_ and `Docker for Windows `_. +What is the difference between `dockcross` and `dockbuild` ? +------------------------------------------------------------ + +The key difference is that `dockbuild `_ +images use the same method to conveniently isolate the build environment as +`dockcross `_ but they do **NOT** provide +a toolchain file. + + Cross compilers --------------- From a38741b30f8acfde9c3790c42e64a25075bd1a77 Mon Sep 17 00:00:00 2001 From: Nadav Date: Tue, 27 Mar 2018 17:48:27 +0300 Subject: [PATCH 17/29] Fixed bracket typo --- android-arm64/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android-arm64/Dockerfile b/android-arm64/Dockerfile index c22d3707..cfee5294 100644 --- a/android-arm64/Dockerfile +++ b/android-arm64/Dockerfile @@ -26,7 +26,7 @@ RUN mkdir -p /build && \ cd android-ndk-r${ANDROID_NDK_REVISION} && \ ./build/tools/make_standalone_toolchain.py \ --arch arm64 \ - --api $(ANDROID_NDK_API) \ + --api ${ANDROID_NDK_API} \ --stl=libc++ \ --install-dir=${CROSS_ROOT} && \ cd / && \ From a39041bf0d343127c88fc175731b76755cf060b1 Mon Sep 17 00:00:00 2001 From: Nadav Ruskin Date: Wed, 28 Mar 2018 04:42:48 -0400 Subject: [PATCH 18/29] Changed CC and CXX variables --- android-arm64/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android-arm64/Dockerfile b/android-arm64/Dockerfile index cfee5294..dda6733b 100644 --- a/android-arm64/Dockerfile +++ b/android-arm64/Dockerfile @@ -12,9 +12,9 @@ ENV CROSS_TRIPLE=aarch64-linux-android ENV CROSS_ROOT=/usr/${CROSS_TRIPLE} ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \ AR=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ar \ - CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gcc \ + CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-clang \ CPP=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-cpp \ - CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-g++ \ + CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-clang++ \ LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld ENV ANDROID_NDK_REVISION 16b From f8e034ee01a6fdc87aba1bef72a8af5c1bf6ffbd Mon Sep 17 00:00:00 2001 From: Nadav Date: Wed, 28 Mar 2018 11:43:22 +0300 Subject: [PATCH 19/29] Update Dockerfile --- android-arm/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android-arm/Dockerfile b/android-arm/Dockerfile index 5ce348f0..9a28c15b 100644 --- a/android-arm/Dockerfile +++ b/android-arm/Dockerfile @@ -11,9 +11,9 @@ ENV CROSS_TRIPLE=arm-linux-androideabi ENV CROSS_ROOT=/usr/${CROSS_TRIPLE} ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \ AR=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ar \ - CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gcc \ + CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-clang \ CPP=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-cpp \ - CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-g++ \ + CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-clang++ \ LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld ENV ANDROID_NDK_REVISION 16b From b7028af76e934d212df23bac2d6e34af686ed4f3 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 29 Mar 2018 04:43:26 -0400 Subject: [PATCH 20/29] entrypoint.sh: Update help text so that current image name is used xref https://github.com/dockbuild/dockbuild/issues/30 --- imagefiles/entrypoint.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/imagefiles/entrypoint.sh b/imagefiles/entrypoint.sh index b4dcab09..96cbaca3 100755 --- a/imagefiles/entrypoint.sh +++ b/imagefiles/entrypoint.sh @@ -9,7 +9,9 @@ if [[ $# == 0 ]]; then if [[ -n $DEFAULT_DOCKCROSS_IMAGE ]]; then head -n 2 /dockcross/dockcross echo "DEFAULT_DOCKCROSS_IMAGE=$DEFAULT_DOCKCROSS_IMAGE" - tail -n +4 /dockcross/dockcross + tail -n +4 /dockcross/dockcross | + sed -e "s@dockcross\/linux\-armv7@${DEFAULT_DOCKCROSS_IMAGE}@g" | + sed -e "s@dockcross\-linux\-armv7@${DEFAULT_DOCKCROSS_IMAGE//\//-}@g" else cat /dockcross/dockcross fi From f64ed37abb89b401fa87f2523046d007e4f048c1 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 29 Mar 2018 18:27:32 -0400 Subject: [PATCH 21/29] README: Fix Articles link Fixes #211 [ci skip] --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 22cb4c32..4af108c8 100644 --- a/README.rst +++ b/README.rst @@ -323,7 +323,7 @@ Articles - `dockcross: C++ Write Once, Run Anywhere `_ - `Cross-compiling binaries for multiple architectures with Docker - `_ + `_ --- From 7b76882b565cd4083c70e9a2dabbae0cb2163e6d Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 29 Mar 2018 21:04:52 -0400 Subject: [PATCH 22/29] entrypoint.sh: Account for image tag when updating help text This commit is a follow up of b7028af (entrypoint.sh: Update help text so that current image name is used) It ensures that the suggested script in the help text doesn't include ":" in its name. Assuming DEFAULT_DOCKCROSS_IMAGE is set to "dockcross/imagename:latest" Instead of suggesting: [...] # docker run --rm dockcross/imagename:latest > dockcross-imagename:latest # chmod +x dockcross-imagename:latest [...] it will now suggest [...] # docker run --rm dockcross/imagename:latest > dockcross-imagename-latest # chmod +x dockcross-imagename-latest [...] xref https://github.com/dockbuild/dockbuild/issues/30 [ci skip] --- imagefiles/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imagefiles/entrypoint.sh b/imagefiles/entrypoint.sh index 96cbaca3..13886c36 100755 --- a/imagefiles/entrypoint.sh +++ b/imagefiles/entrypoint.sh @@ -11,7 +11,7 @@ if [[ $# == 0 ]]; then echo "DEFAULT_DOCKCROSS_IMAGE=$DEFAULT_DOCKCROSS_IMAGE" tail -n +4 /dockcross/dockcross | sed -e "s@dockcross\/linux\-armv7@${DEFAULT_DOCKCROSS_IMAGE}@g" | - sed -e "s@dockcross\-linux\-armv7@${DEFAULT_DOCKCROSS_IMAGE//\//-}@g" + sed -e "s@dockcross\-linux\-armv7@${DEFAULT_DOCKCROSS_IMAGE//[\/:]/-}@g" else cat /dockcross/dockcross fi From 57bf16fa178cec8bd6f20a2bcd505d27fb8892ba Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 2 Apr 2018 15:01:06 -0400 Subject: [PATCH 23/29] crossbuild-essential images: disable because of missing packages Temporarily disable because the packages are not available. See #209. These should be replaced by crosstool-ng images. --- .circleci/config.yml | 163 +++++++++++++++++++++++-------------------- 1 file changed, 88 insertions(+), 75 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b6a71e9c..b145b489 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -87,17 +87,18 @@ jobs: steps: - restore_cache: key: base-assets-{{ .Revision }} - - run: - name: linux-arm64 build - no_output_timeout: 1.5h - command: | - docker load -i ~/docker/base.tar - make linux-arm64 - docker save -o ~/docker/linux-arm64.tar dockcross/linux-arm64:latest - - run: - name: linux-arm64 test - command: | - make linux-arm64.test + # Image build currently broken. See #209 + #- run: + #name: linux-arm64 build + #no_output_timeout: 1.5h + #command: | + #docker load -i ~/docker/base.tar + #make linux-arm64 + #docker save -o ~/docker/linux-arm64.tar dockcross/linux-arm64:latest + #- run: + #name: linux-arm64 test + #command: | + #make linux-arm64.test - save_cache: key: linux-arm64-assets-{{ .Revision }} paths: ~/docker/linux-arm64.tar @@ -106,17 +107,18 @@ jobs: steps: - restore_cache: key: base-assets-{{ .Revision }} - - run: - name: linux-armv5 build - no_output_timeout: 1.5h - command: | - docker load -i ~/docker/base.tar - make linux-armv5 - docker save -o ~/docker/linux-armv5.tar dockcross/linux-armv5:latest - - run: - name: linux-armv5 test - command: | - make linux-armv5.test + # Image build currently broken. See #209 + #- run: + #name: linux-armv5 build + #no_output_timeout: 1.5h + #command: | + #docker load -i ~/docker/base.tar + #make linux-armv5 + #docker save -o ~/docker/linux-armv5.tar dockcross/linux-armv5:latest + #- run: + #name: linux-armv5 test + #command: | + #make linux-armv5.test - save_cache: key: linux-armv5-assets-{{ .Revision }} paths: ~/docker/linux-armv5.tar @@ -144,17 +146,18 @@ jobs: steps: - restore_cache: key: base-assets-{{ .Revision }} - - run: - name: linux-armv7 build - no_output_timeout: 1.5h - command: | - docker load -i ~/docker/base.tar - make linux-armv7 - docker save -o ~/docker/linux-armv7.tar dockcross/linux-armv7:latest - - run: - name: linux-armv7 test - command: | - make linux-armv7.test + # Image build currently broken. See #209 + #- run: + #name: linux-armv7 build + #no_output_timeout: 1.5h + #command: | + #docker load -i ~/docker/base.tar + #make linux-armv7 + #docker save -o ~/docker/linux-armv7.tar dockcross/linux-armv7:latest + #- run: + #name: linux-armv7 test + #command: | + #make linux-armv7.test - save_cache: key: linux-armv7-assets-{{ .Revision }} paths: ~/docker/linux-armv7.tar @@ -163,17 +166,18 @@ jobs: steps: - restore_cache: key: base-assets-{{ .Revision }} - - run: - name: linux-mipsel build - no_output_timeout: 1.5h - command: | - docker load -i ~/docker/base.tar - make linux-mipsel - docker save -o ~/docker/linux-mipsel.tar dockcross/linux-mipsel:latest - - run: - name: linux-mipsel test - command: | - make linux-mipsel.test + # Image build currently broken. See #209 + #- run: + #name: linux-mipsel build + #no_output_timeout: 1.5h + #command: | + #docker load -i ~/docker/base.tar + #make linux-mipsel + #docker save -o ~/docker/linux-mipsel.tar dockcross/linux-mipsel:latest + #- run: + #name: linux-mipsel test + #command: | + #make linux-mipsel.test - save_cache: key: linux-mipsel-assets-{{ .Revision }} paths: ~/docker/linux-mipsel.tar @@ -201,17 +205,18 @@ jobs: steps: - restore_cache: key: base-assets-{{ .Revision }} - - run: - name: linux-ppc64le build - no_output_timeout: 1.5h - command: | - docker load -i ~/docker/base.tar - make linux-ppc64le - docker save -o ~/docker/linux-ppc64le.tar dockcross/linux-ppc64le:latest - - run: - name: linux-ppc64le test - command: | - make linux-ppc64le.test + # Image build currently broken. See #209 + #- run: + #name: linux-ppc64le build + #no_output_timeout: 1.5h + #command: | + #docker load -i ~/docker/base.tar + #make linux-ppc64le + #docker save -o ~/docker/linux-ppc64le.tar dockcross/linux-ppc64le:latest + #- run: + #name: linux-ppc64le test + #command: | + #make linux-ppc64le.test - save_cache: key: linux-ppc64le-assets-{{ .Revision }} paths: ~/docker/linux-ppc64le.tar @@ -517,27 +522,32 @@ workflows: - browser-asmjs: requires: - base - - linux-arm64: - requires: - - base - - linux-armv5: - requires: - - base + # Image build currently broken. See #209 + #- linux-arm64: + #requires: + #- base + # Image build currently broken. See #209 + #- linux-armv5: + #requires: + #- base - linux-armv6: requires: - base - - linux-armv7: - requires: - - base - - linux-mipsel: - requires: - - base + # Image build currently broken. See #209 + #- linux-armv7: + #requires: + #- base + # Image build currently broken. See #209 + #- linux-mipsel: + #requires: + #- base - linux-s390x: requires: - base - - linux-ppc64le: - requires: - - base + # Image build currently broken. See #209 + #- linux-ppc64le: + #requires: + #- base - linux-x64: requires: - base @@ -562,13 +572,16 @@ workflows: - android-arm - android-arm64 - browser-asmjs - - linux-arm64 - - linux-armv5 + # Image build currently broken. See #209 + #- linux-arm64 + #- linux-armv5 - linux-armv6 - - linux-armv7 - - linux-mipsel + # Image build currently broken. See #209 + #- linux-armv7 + #- linux-mipsel - linux-s390x - - linux-ppc64le + # Image build currently broken. See #209 + #- linux-ppc64le - linux-x64 - linux-x86 - manylinux-x64 From 53d98cf4ff4677b6e286ee479040933ac8077ba2 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 29 Mar 2018 15:07:54 -0400 Subject: [PATCH 24/29] Fix download of files using up-to-date "curl" instead of "wget" In few images, curl is only tool that able to download from https source requiring TLS 1.2 --- common.debian | 6 +++--- common.docker | 2 +- common.manylinux | 6 +++--- imagefiles/install-cmake.sh | 2 +- imagefiles/install-crosstool-ng-toolchain.sh | 2 +- imagefiles/install-ninja.sh | 2 +- imagefiles/install-openssl.sh | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/common.debian b/common.debian index 7a607834..a57fa898 100644 --- a/common.debian +++ b/common.debian @@ -36,10 +36,10 @@ RUN apt-get update --yes && apt-get install --no-install-recommends --yes \ ENV GOSU_VERSION 1.10 RUN set -x \ - && apt-get update && apt-get install -y --no-install-recommends ca-certificates wget && rm -rf /var/lib/apt/lists/* \ + && apt-get update && rm -rf /var/lib/apt/lists/* \ && dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \ - && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \ - && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \ + && curl -# -o /usr/local/bin/gosu -LO "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \ + && curl -# -o /usr/local/bin/gosu.asc -LO "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ diff --git a/common.docker b/common.docker index 10c8d1e8..533a7122 100644 --- a/common.docker +++ b/common.docker @@ -31,7 +31,7 @@ RUN \ RUN if [ -e /opt/python/cp35-cp35m/bin/python ]; then \ : nothing to do here since it is updated by manylinux-common/install-python-packages.sh ; \ else \ - wget https://bootstrap.pypa.io/get-pip.py && \ + curl -# -LO https://bootstrap.pypa.io/get-pip.py && \ python get-pip.py --ignore-installed && \ rm get-pip.py || exit 1; \ fi diff --git a/common.manylinux b/common.manylinux index 0d1a60a7..ada56ccc 100644 --- a/common.manylinux +++ b/common.manylinux @@ -1,10 +1,10 @@ ENV GOSU_VERSION 1.10 RUN set -x \ && yum -y install epel-release \ - && yum -y install wget gpg \ + && yum -y install gpg \ && dpkgArch=$(if test $(uname -m) = "x86_64"; then echo amd64; else echo i386; fi) \ - && wget -O /usr/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \ - && wget -O /tmp/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \ + && curl -o /usr/bin/gosu -LO "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \ + && curl -o /tmp/gosu.asc -LO "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ && gpg --batch --verify /tmp/gosu.asc /usr/bin/gosu \ diff --git a/imagefiles/install-cmake.sh b/imagefiles/install-cmake.sh index c0891cd7..3b465faf 100755 --- a/imagefiles/install-cmake.sh +++ b/imagefiles/install-cmake.sh @@ -46,7 +46,7 @@ cd /usr/src # Download CMAKE_REV=v3.10.1 -wget --progress=bar:force https://github.com/kitware/cmake/archive/$CMAKE_REV.tar.gz -O CMake.tar.gz +curl -# -o CMake.tar.gz -LO https://github.com/kitware/cmake/archive/$CMAKE_REV.tar.gz mkdir CMake tar -xzvf ./CMake.tar.gz --strip-components=1 -C ./CMake diff --git a/imagefiles/install-crosstool-ng-toolchain.sh b/imagefiles/install-crosstool-ng-toolchain.sh index a4076295..ccf535c7 100755 --- a/imagefiles/install-crosstool-ng-toolchain.sh +++ b/imagefiles/install-crosstool-ng-toolchain.sh @@ -58,7 +58,7 @@ cd "${CTNG}" # Download and install the "crosstool-ng" source. REV=1.23.0 -wget --progress=bar:force \ +curl -# -LO \ "https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-${REV}.tar.gz" tar -xf "crosstool-ng-${REV}.tar.gz" cd "crosstool-ng-crosstool-ng-${REV}" diff --git a/imagefiles/install-ninja.sh b/imagefiles/install-ninja.sh index 3ae06148..8d63883b 100755 --- a/imagefiles/install-ninja.sh +++ b/imagefiles/install-ninja.sh @@ -27,7 +27,7 @@ done # Download REV=v1.7.2 -wget --progress=bar:force https://github.com/ninja-build/ninja/archive/$REV.tar.gz -O ninja.tar.gz +curl -# -o ninja.tar.gz -LO https://github.com/ninja-build/ninja/archive/$REV.tar.gz mkdir ninja tar -xzvf ./ninja.tar.gz --strip-components=1 -C ./ninja diff --git a/imagefiles/install-openssl.sh b/imagefiles/install-openssl.sh index 460f6bd2..972f48d8 100755 --- a/imagefiles/install-openssl.sh +++ b/imagefiles/install-openssl.sh @@ -49,7 +49,7 @@ cd /usr/src # Download if [ ! -f ./openssl-$OPENSSL_VERSION.tar.gz ]; then - wget --progress=bar:force https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz + curl -# -LO https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz else rm -rf ./openssl-$OPENSSL_VERSION fi From 856ef6016e00e4688cb0aa0a8a7ed3bb51e8ff2d Mon Sep 17 00:00:00 2001 From: Francois Budin Date: Fri, 13 Apr 2018 14:53:21 -0400 Subject: [PATCH 25/29] BUG: Remove cpack symbolic link before creating the new link --- windows-x64/Dockerfile | 1 + windows-x86/Dockerfile | 1 + 2 files changed, 2 insertions(+) diff --git a/windows-x64/Dockerfile b/windows-x64/Dockerfile index 1ccfb651..f3e5fbf7 100644 --- a/windows-x64/Dockerfile +++ b/windows-x64/Dockerfile @@ -72,6 +72,7 @@ ENV CMAKE_TOOLCHAIN_FILE /usr/src/mxe/usr/x86_64-w64-mingw32.static/share/cmake/ RUN echo 'set(CMAKE_CROSSCOMPILING_EMULATOR "/usr/bin/wine")' >> ${CMAKE_TOOLCHAIN_FILE} RUN cd /usr/local/bin \ && rm cmake \ + && rm cpack \ && ln -s /usr/src/mxe/usr/bin/x86_64-w64-mingw32.static-cmake cmake \ && ln -s /usr/src/mxe/usr/bin/x86_64-w64-mingw32.static-cpack cpack diff --git a/windows-x86/Dockerfile b/windows-x86/Dockerfile index fbe064d4..8075f230 100644 --- a/windows-x86/Dockerfile +++ b/windows-x86/Dockerfile @@ -72,6 +72,7 @@ ENV CMAKE_TOOLCHAIN_FILE /usr/src/mxe/usr/i686-w64-mingw32.static/share/cmake/mx RUN echo 'set(CMAKE_CROSSCOMPILING_EMULATOR "/usr/bin/wine")' >> ${CMAKE_TOOLCHAIN_FILE} RUN cd /usr/local/bin \ && rm cmake \ + && rm cpack \ && ln -s /usr/src/mxe/usr/bin/i686-w64-mingw32.static-cmake cmake \ && ln -s /usr/src/mxe/usr/bin/i686-w64-mingw32.static-cpack cpack From 602fb22ccebf518551319888398312b4c0a14fed Mon Sep 17 00:00:00 2001 From: Francois Budin Date: Fri, 13 Apr 2018 14:56:49 -0400 Subject: [PATCH 26/29] ENH: Compile git with SSL support Older versions of git included in older linux distributions are not able to download source from Github. A newer version is required with a newer OpenSSL. This requires to also build curl with the same OpenSSL. CMake is downloaded precompiled if available (64bits system) or compiled from source otherwise. --- browser-asmjs/Dockerfile.in | 2 +- common.debian | 5 +- common.docker | 47 ++++++++--- common.manylinux | 1 + ...ll-cmake.sh => build-and-install-cmake.sh} | 72 ++++++++-------- imagefiles/build-and-install-curl.sh | 49 +++++++++++ imagefiles/build-and-install-git.sh | 44 ++++++++++ imagefiles/build-and-install-openssh.sh | 22 +++++ imagefiles/build-and-install-openssl.sh | 81 ++++++++++++++++++ imagefiles/install-cmake-binary.sh | 35 ++++++++ imagefiles/install-openssl.sh | 83 ------------------- imagefiles/utils.sh | 24 ++++++ linux-x86/Dockerfile | 5 -- manylinux-x64/Dockerfile.in | 4 +- manylinux-x86/Dockerfile.in | 4 +- windows-x64/Dockerfile | 1 - windows-x86/Dockerfile | 1 - 17 files changed, 332 insertions(+), 148 deletions(-) rename imagefiles/{install-cmake.sh => build-and-install-cmake.sh} (50%) create mode 100755 imagefiles/build-and-install-curl.sh create mode 100755 imagefiles/build-and-install-git.sh create mode 100755 imagefiles/build-and-install-openssh.sh create mode 100755 imagefiles/build-and-install-openssl.sh create mode 100755 imagefiles/install-cmake-binary.sh delete mode 100755 imagefiles/install-openssl.sh create mode 100644 imagefiles/utils.sh diff --git a/browser-asmjs/Dockerfile.in b/browser-asmjs/Dockerfile.in index adb7ac1d..92056a76 100644 --- a/browser-asmjs/Dockerfile.in +++ b/browser-asmjs/Dockerfile.in @@ -1,4 +1,4 @@ -FROM trzeci/emscripten-slim:sdk-tag-1.37.29-64bit +FROM trzeci/emscripten-slim:sdk-tag-1.37.36-64bit MAINTAINER Matt McCormick "matt.mccormick@kitware.com" # Revert back to "/bin/sh" as default shell diff --git a/common.debian b/common.debian index a57fa898..f258190e 100644 --- a/common.debian +++ b/common.debian @@ -13,7 +13,7 @@ RUN apt-get update --yes && apt-get install --no-install-recommends --yes \ ca-certificates \ curl \ file \ - git \ + gettext \ gzip \ zip \ make \ @@ -31,7 +31,8 @@ RUN apt-get update --yes && apt-get install --no-install-recommends --yes \ pax \ vim \ wget \ - xz-utils && \ + xz-utils \ + zlib1g-dev && \ apt-get clean --yes ENV GOSU_VERSION 1.10 diff --git a/common.docker b/common.docker index 533a7122..e01c9a18 100644 --- a/common.docker +++ b/common.docker @@ -1,21 +1,38 @@ -WORKDIR /usr/share -RUN git clone "https://github.com/nojhan/liquidprompt.git" && \ - cd liquidprompt && \ - git checkout v_1.11 -COPY imagefiles/.bashrc /root/ - WORKDIR /usr/src -COPY imagefiles/install-openssl.sh imagefiles/install-cmake.sh /dockcross/ +ARG GIT_VERSION=2.16.2 +ARG CMAKE_VERSION=3.11.0 + +COPY imagefiles/build-and-install-git.sh \ + imagefiles/utils.sh \ + imagefiles/build-and-install-openssl.sh \ + imagefiles/build-and-install-openssh.sh \ + imagefiles/build-and-install-cmake.sh \ + imagefiles/install-cmake-binary.sh \ + imagefiles/build-and-install-curl.sh \ + /dockcross/ + RUN \ if [ "$DEFAULT_DOCKCROSS_IMAGE" = "dockcross/manylinux-x86" ]; then \ - /dockcross/install-openssl.sh -32 && \ - /dockcross/install-cmake.sh -32 || exit 1; \ + /dockcross/build-and-install-openssl.sh -32 && \ + /dockcross/build-and-install-openssh.sh && \ + /dockcross/build-and-install-curl.sh && \ + /dockcross/build-and-install-git.sh && \ + /dockcross/build-and-install-cmake.sh -32 || exit 1; \ else \ - /dockcross/install-openssl.sh && \ - /dockcross/install-cmake.sh || exit 1; \ + /dockcross/build-and-install-openssl.sh && \ + /dockcross/build-and-install-openssh.sh && \ + /dockcross/build-and-install-curl.sh && \ + /dockcross/build-and-install-git.sh && \ + /dockcross/install-cmake-binary.sh || exit 1; \ fi; \ - rm /dockcross/install-openssl.sh /dockcross/install-cmake.sh + rm /dockcross/build-and-install-git.sh \ + /dockcross/utils.sh \ + /dockcross/build-and-install-openssl.sh \ + /dockcross/build-and-install-openssh.sh \ + /dockcross/build-and-install-cmake.sh \ + /dockcross/install-cmake-binary.sh \ + /dockcross/build-and-install-curl.sh COPY imagefiles/cmake.sh /usr/local/bin/cmake COPY imagefiles/ccmake.sh /usr/local/bin/ccmake @@ -38,6 +55,12 @@ RUN if [ -e /opt/python/cp35-cp35m/bin/python ]; then \ RUN $([ -e /opt/python/cp35-cp35m/bin/python ] && echo "/opt/python/cp35-cp35m/bin/python" || echo "python") -m pip install --ignore-installed conan +WORKDIR /usr/share +RUN git clone "https://github.com/nojhan/liquidprompt.git" && \ + cd liquidprompt && \ + git checkout v_1.11 +COPY imagefiles/.bashrc /root/ + RUN echo "root:root" | chpasswd WORKDIR /work ENTRYPOINT ["/dockcross/entrypoint.sh"] diff --git a/common.manylinux b/common.manylinux index ada56ccc..3f9a83d0 100644 --- a/common.manylinux +++ b/common.manylinux @@ -2,6 +2,7 @@ ENV GOSU_VERSION 1.10 RUN set -x \ && yum -y install epel-release \ && yum -y install gpg \ + && yum -y install zlib-devel gettext \ && dpkgArch=$(if test $(uname -m) = "x86_64"; then echo amd64; else echo i386; fi) \ && curl -o /usr/bin/gosu -LO "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \ && curl -o /tmp/gosu.asc -LO "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \ diff --git a/imagefiles/install-cmake.sh b/imagefiles/build-and-install-cmake.sh similarity index 50% rename from imagefiles/install-cmake.sh rename to imagefiles/build-and-install-cmake.sh index 3b465faf..7a6fd070 100755 --- a/imagefiles/install-cmake.sh +++ b/imagefiles/build-and-install-cmake.sh @@ -1,17 +1,4 @@ #!/bin/bash - -# -# Configure, build and install CMake -# -# Usage: -# -# install-cmake.sh [-32] -# -# Options: -# -# -32 Build CMake as a 32-bit executable -# -# Notes: # # * build directory is /usr/src/CMake # @@ -19,20 +6,14 @@ # # * after installation, archive, source and build directories are removed # - -set -e -set -o pipefail +set -ex WRAPPER="" -CONFIG_FLAG="" -SUFFIX=64 while [ $# -gt 0 ]; do case "$1" in -32) WRAPPER="linux32" - CONFIG_FLAG="-m32" - SUFFIX=32 ;; *) echo "Usage: Usage: ${0##*/} [-32]" @@ -42,27 +23,43 @@ while [ $# -gt 0 ]; do shift done -cd /usr/src +if ! command -v git &> /dev/null; then + echo >&2 'error: "git" not found!' + exit 1 +fi -# Download -CMAKE_REV=v3.10.1 -curl -# -o CMake.tar.gz -LO https://github.com/kitware/cmake/archive/$CMAKE_REV.tar.gz -mkdir CMake -tar -xzvf ./CMake.tar.gz --strip-components=1 -C ./CMake +if [[ "${CMAKE_VERSION}" == "" ]]; then + echo >&2 'error: CMAKE_VERSION env. variable must be set to a non-empty value' + exit 1 +fi -mkdir /usr/src/CMake-build +cd /usr/src -pushd /usr/src/CMake-build +git clone git://cmake.org/cmake.git CMake -NUM_PROCESSOR=$(grep -c processor /proc/cpuinfo) +(cd CMake && git checkout v$CMAKE_VERSION) -# Configure boostrap -${WRAPPER} /usr/src/CMake/bootstrap \ - --parallel=$NUM_PROCESSOR \ - --prefix=/usr +mkdir /usr/src/CMake-build +cd /usr/src/CMake-build -# Build and Install -${WRAPPER} make install -j$NUM_PROCESSOR +${WRAPPER} /usr/src/CMake/bootstrap \ + --parallel=$(grep -c processor /proc/cpuinfo) +${WRAPPER} make -j$(grep -c processor /proc/cpuinfo) + +mkdir /usr/src/CMake-ssl-build +cd /usr/src/CMake-ssl-build +${WRAPPER} /usr/src/CMake-build/bin/cmake \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DBUILD_TESTING:BOOL=ON \ + -DCMAKE_INSTALL_PREFIX:PATH=/usr/src/cmake-$CMAKE_VERSION \ + -DCMAKE_USE_OPENSSL:BOOL=ON \ + -DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl \ + ../CMake +${WRAPPER} make -j$(grep -c processor /proc/cpuinfo) install + +cd /usr/src/cmake-$CMAKE_VERSION +rm -rf doc man +find . -type f -exec install -D "{}" "/usr/{}" \; # Test ctest -R CMake.FileDownload @@ -88,8 +85,5 @@ EOF # Execute test script cmake -P cmake-test-https-download.cmake -rm cmake-test-https-download.cmake - -popd -rm -rf CMake* +rm -rf /usr/src/CMake* diff --git a/imagefiles/build-and-install-curl.sh b/imagefiles/build-and-install-curl.sh new file mode 100755 index 00000000..59fc2813 --- /dev/null +++ b/imagefiles/build-and-install-curl.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +set -ex + +MY_DIR=$(dirname "${BASH_SOURCE[0]}") +source $MY_DIR/utils.sh + +# +# Function 'do_curl_build' and 'build_curl' +# copied from https://github.com/pypa/manylinux/tree/master/docker/build_scripts +# + +CURL_ROOT=curl_7.52.1 +CURL_HASH=a8984e8b20880b621f61a62d95ff3c0763a3152093a9f9ce4287cfd614add6ae + +# We had to switch to a debian mirror because we can't use TLS until we +# bootstrap it with this curl + openssl +CURL_DOWNLOAD_URL=http://deb.debian.org/debian/pool/main/c/curl + +function do_curl_build { + # We do this shared to avoid obnoxious linker issues where git couldn't + # link properly. If anyone wants to make this build statically go for it. + LIBS=-ldl CFLAGS=-Wl,--exclude-libs,ALL ./configure --with-ssl --disable-static > /dev/null + make > /dev/null + make install > /dev/null +} + + +function build_curl { + local curl_fname=$1 + check_var ${curl_fname} + local curl_sha256=$2 + check_var ${curl_sha256} + check_var ${CURL_DOWNLOAD_URL} + # Can't use curl here because we don't have it yet...we are building it. + wget -q ${CURL_DOWNLOAD_URL}/${curl_fname}.orig.tar.gz + check_sha256sum ${curl_fname}.orig.tar.gz ${curl_sha256} + tar -zxf ${curl_fname}.orig.tar.gz + (cd curl-* && do_curl_build) + rm -rf curl_* +} + +cd /usr/src +build_curl $CURL_ROOT $CURL_HASH + +(cat /etc/ld.so.conf.d/usr-local.conf 2> /dev/null | grep -q "^/usr/local/lib$") || + echo '/usr/local/lib' >> /etc/ld.so.conf.d/usr-local.conf +ldconfig + diff --git a/imagefiles/build-and-install-git.sh b/imagefiles/build-and-install-git.sh new file mode 100755 index 00000000..fb7a8c28 --- /dev/null +++ b/imagefiles/build-and-install-git.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +set -ex + +if ! command -v curl &> /dev/null; then + echo >&2 'error: "curl" not found!' + exit 1 +fi + +if ! command -v tar &> /dev/null; then + echo >&2 'error: "tar" not found!' + exit 1 +fi + +if [[ "${GIT_VERSION}" == "" ]]; then + echo >&2 'error: GIT_VERSION env. variable must be set to a non-empty value' + exit 1 +fi + +(cat /etc/ld.so.conf.d/usr-local.conf 2> /dev/null | grep -q "^/usr/local/lib$") || + echo '/usr/local/lib' >> /etc/ld.so.conf.d/usr-local.conf +ldconfig + +cd /usr/src + +url="https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz" +echo "Downloading $url" +curl -# -LO $url + +tar xvzf git-${GIT_VERSION}.tar.gz +rm -f git-${GIT_VERSION}.tar.gz + +pushd git-${GIT_VERSION} +./configure --prefix=/usr/local --with-curl +make +make install +popd + +ldconfig + +rm -rf git-${GIT_VERSION} + +# turn the detached message off +git config --global advice.detachedHead false diff --git a/imagefiles/build-and-install-openssh.sh b/imagefiles/build-and-install-openssh.sh new file mode 100755 index 00000000..ebf54fc1 --- /dev/null +++ b/imagefiles/build-and-install-openssh.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +set -ex + +OPENSSH_ROOT=V_7_6_P1 + +cd /usr/src +curl -LO https://github.com/openssh/openssh-portable/archive/${OPENSSH_ROOT}.tar.gz +tar -xvf ${OPENSSH_ROOT}.tar.gz +rm -f ${OPENSSH_ROOT}.tar.gz + +OPENSSH_SRC_DIR=openssh-portable-${OPENSSH_ROOT} +cd ${OPENSSH_SRC_DIR} + +autoreconf + +./configure --prefix=/usr/local + +make -j1 install + +cd /usr/src +rm -rf ${OPENSSH_SRC_DIR} diff --git a/imagefiles/build-and-install-openssl.sh b/imagefiles/build-and-install-openssl.sh new file mode 100755 index 00000000..5d8f1777 --- /dev/null +++ b/imagefiles/build-and-install-openssl.sh @@ -0,0 +1,81 @@ +#!/bin/bash +# +# Configure, build and install OpenSSL +# +# Usage: +# +# build-and-install-openssl.sh [-32] +# +# Options: +# +# -32 Build OpenSSL as a 32-bit library +# +# Notes: +# +# * build directory is /usr/src/openssl-$OPENSSL_VERSION +# +# * install directory is /usr +# +# * after installation, build directory and archive are removed +# + +set -ex +set -o pipefail + +WRAPPER="" +CONFIG_FLAG="-fPIC" + +while [ $# -gt 0 ]; do + case "$1" in + -32) + WRAPPER="linux32" + CONFIG_FLAG="-m32" + ;; + *) + echo "Usage: Usage: ${0##*/} [-32]" + exit 1 + ;; + esac + shift +done + +MY_DIR=$(dirname "${BASH_SOURCE[0]}") +source $MY_DIR/utils.sh + +# +# Function 'do_openssl_build' and 'build_openssl' +# copied from https://github.com/pypa/manylinux/tree/master/docker/build_scripts +# + +OPENSSL_ROOT=openssl-1.0.2o +# Hash from https://www.openssl.org/source/openssl-1.0.2o.tar.gz.sha256 +# Matches hash at https://github.com/Homebrew/homebrew-core/blob/1766321103d9780f6e38d3ac7681b8fa42cdca86/Formula/openssl.rb#L11 +OPENSSL_HASH=ec3f5c9714ba0fd45cb4e087301eb1336c317e0d20b575a125050470e8089e4d + +# XXX: the official https server at www.openssl.org cannot be reached +# with the old versions of openssl and curl in Centos 5.11 hence the fallback +# to the ftp mirror: +OPENSSL_DOWNLOAD_URL=ftp://ftp.openssl.org/source + +function do_openssl_build { + ${WRAPPER} ./config no-ssl2 no-shared -fPIC $CONFIG_FLAG --prefix=/usr/local/ssl > /dev/null + ${WRAPPER} make > /dev/null + ${WRAPPER} make install_sw > /dev/null +} + +function build_openssl { + local openssl_fname=$1 + check_var ${openssl_fname} + local openssl_sha256=$2 + check_var ${openssl_sha256} + check_var ${OPENSSL_DOWNLOAD_URL} + # Can't use curl here because we don't have it yet + curl -# -LO ${OPENSSL_DOWNLOAD_URL}/${openssl_fname}.tar.gz + check_sha256sum ${openssl_fname}.tar.gz ${openssl_sha256} + tar -xzf ${openssl_fname}.tar.gz + (cd ${openssl_fname} && do_openssl_build) + rm -rf ${openssl_fname} ${openssl_fname}.tar.gz /usr/ssl/man +} + +cd /usr/src +build_openssl $OPENSSL_ROOT $OPENSSL_HASH diff --git a/imagefiles/install-cmake-binary.sh b/imagefiles/install-cmake-binary.sh new file mode 100755 index 00000000..4b710cf5 --- /dev/null +++ b/imagefiles/install-cmake-binary.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +set -ex + +if ! command -v curl &> /dev/null; then + echo >&2 'error: "curl" not found!' + exit 1 +fi + +if ! command -v tar &> /dev/null; then + echo >&2 'error: "tar" not found!' + exit 1 +fi + +if [[ "${CMAKE_VERSION}" == "" ]]; then + echo >&2 'error: CMAKE_VERSION env. variable must be set to a non-empty value' + exit 1 +fi + +cd /tmp + +filename=cmake-${CMAKE_VERSION}-Centos5-x86_64 +url=https://github.com/dockbuild/CMake/releases/download/v${CMAKE_VERSION}/${filename}.tar.gz +echo "Downloading $url" +curl -# -LO $url + +tar -xzvf ${filename}.tar.gz +rm -f ${filename}.tar.gz + +cd ${filename} + +rm -rf doc man +rm -rf bin/cmake-gui + +find . -type f -exec install -D "{}" "/usr/{}" \; diff --git a/imagefiles/install-openssl.sh b/imagefiles/install-openssl.sh deleted file mode 100755 index 972f48d8..00000000 --- a/imagefiles/install-openssl.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -# -# Configure, build and install OpenSSL -# -# Usage: -# -# install-openssl.sh [-32] -# -# Options: -# -# -32 Build OpenSSL as a 32-bit library -# -# Notes: -# -# * build directory is /usr/src/openssl-$OPENSSL_VERSION -# -# * install directory is /usr -# -# * after installation, build directory and archive are removed -# - -set -e -set -o pipefail - -WRAPPER="" -CONFIG_FLAG="-fPIC" -SUFFIX=64 - -while [ $# -gt 0 ]; do - case "$1" in - -32) - WRAPPER="linux32" - CONFIG_FLAG="-m32" - SUFFIX=32 - ;; - *) - echo "Usage: Usage: ${0##*/} [-32]" - exit 1 - ;; - esac - shift -done - -OPENSSL_VERSION=1.0.2j -OPENSSL_SHA256=e7aff292be21c259c6af26469c7a9b3ba26e9abaaffd325e3dccc9785256c431 - -cd /usr/src - -# Download -if [ ! -f ./openssl-$OPENSSL_VERSION.tar.gz ]; then - curl -# -LO https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz -else - rm -rf ./openssl-$OPENSSL_VERSION -fi - -# Verify -sha256_openssl=`sha256sum ./openssl-$OPENSSL_VERSION.tar.gz | awk '{ print $1 }'` -if [ "$sha256_openssl" != "$OPENSSL_SHA256" ] -then - echo "SHA256 mismatch. Problem downloading OpenSSL." - echo " current [$sha256_openssl]" - echo " expected[$OPENSSL_SHA256]" - exit 1 -fi - -# Extract -tar -xzvf openssl-$OPENSSL_VERSION.tar.gz - -pushd openssl-$OPENSSL_VERSION - -# Configure -${WRAPPER} ./config --prefix=/usr $CONFIG_FLAG - -# Build & Install -${WRAPPER} make install - -popd - -# Clean -rm -rf ./openssl-$OPENSSL_VERSION* -rm -rf /usr/ssl/man - diff --git a/imagefiles/utils.sh b/imagefiles/utils.sh new file mode 100644 index 00000000..2122f699 --- /dev/null +++ b/imagefiles/utils.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +# Copied from https://github.com/pypa/manylinux/blob/master/docker/build_scripts/build_utils.sh +function check_var { + if [ -z "$1" ]; then + echo "required variable not defined" + exit 1 + fi +} + +# Copied from https://github.com/pypa/manylinux/blob/master/docker/build_scripts/build_utils.sh +function check_sha256sum { + local fname=$1 + check_var ${fname} + local sha256=$2 + check_var ${sha256} + + echo "${sha256} ${fname}" > ${fname}.sha256 + sha256sum -c ${fname}.sha256 + rm -f ${fname}.sha256 +} + diff --git a/linux-x86/Dockerfile b/linux-x86/Dockerfile index 6ea2e11c..6a2d39cb 100644 --- a/linux-x86/Dockerfile +++ b/linux-x86/Dockerfile @@ -34,11 +34,6 @@ ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \ CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-g++ -COPY imagefiles/install-openssl.sh /dockcross/ -RUN \ - /dockcross/install-openssl.sh -32 && \ - rm /dockcross/install-openssl.sh - ENV DEFAULT_DOCKCROSS_IMAGE dockcross/linux-x86 # Note: Toolchain file support is currently in debian Experimental: diff --git a/manylinux-x64/Dockerfile.in b/manylinux-x64/Dockerfile.in index 27db9979..b57784fa 100644 --- a/manylinux-x64/Dockerfile.in +++ b/manylinux-x64/Dockerfile.in @@ -3,10 +3,10 @@ MAINTAINER Matt McCormick "matt.mccormick@kitware.com" ENV DEFAULT_DOCKCROSS_IMAGE dockcross/manylinux-x64 -#include "common.docker" - #include "common.manylinux" +#include "common.docker" + ENV CROSS_TRIPLE x86_64-linux-gnu ENV CROSS_ROOT /opt/rh/devtoolset-2/root/usr/bin ENV AS=${CROSS_ROOT}/as \ diff --git a/manylinux-x86/Dockerfile.in b/manylinux-x86/Dockerfile.in index 6a587dbb..a823e92a 100644 --- a/manylinux-x86/Dockerfile.in +++ b/manylinux-x86/Dockerfile.in @@ -3,10 +3,10 @@ MAINTAINER Matt McCormick "matt.mccormick@kitware.com" ENV DEFAULT_DOCKCROSS_IMAGE dockcross/manylinux-x86 -#include "common.docker" - #include "common.manylinux" +#include "common.docker" + ENV CROSS_TRIPLE i686-linux-gnu ENV CROSS_ROOT /opt/rh/devtoolset-2/root/usr/bin ENV AS=${CROSS_ROOT}/as \ diff --git a/windows-x64/Dockerfile b/windows-x64/Dockerfile index f3e5fbf7..1ccfb651 100644 --- a/windows-x64/Dockerfile +++ b/windows-x64/Dockerfile @@ -72,7 +72,6 @@ ENV CMAKE_TOOLCHAIN_FILE /usr/src/mxe/usr/x86_64-w64-mingw32.static/share/cmake/ RUN echo 'set(CMAKE_CROSSCOMPILING_EMULATOR "/usr/bin/wine")' >> ${CMAKE_TOOLCHAIN_FILE} RUN cd /usr/local/bin \ && rm cmake \ - && rm cpack \ && ln -s /usr/src/mxe/usr/bin/x86_64-w64-mingw32.static-cmake cmake \ && ln -s /usr/src/mxe/usr/bin/x86_64-w64-mingw32.static-cpack cpack diff --git a/windows-x86/Dockerfile b/windows-x86/Dockerfile index 8075f230..fbe064d4 100644 --- a/windows-x86/Dockerfile +++ b/windows-x86/Dockerfile @@ -72,7 +72,6 @@ ENV CMAKE_TOOLCHAIN_FILE /usr/src/mxe/usr/i686-w64-mingw32.static/share/cmake/mx RUN echo 'set(CMAKE_CROSSCOMPILING_EMULATOR "/usr/bin/wine")' >> ${CMAKE_TOOLCHAIN_FILE} RUN cd /usr/local/bin \ && rm cmake \ - && rm cpack \ && ln -s /usr/src/mxe/usr/bin/i686-w64-mingw32.static-cmake cmake \ && ln -s /usr/src/mxe/usr/bin/i686-w64-mingw32.static-cpack cpack From 9f0468a72f27a5a2a607c3e80330483526b73178 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sun, 15 Apr 2018 22:54:04 -0400 Subject: [PATCH 27/29] crossbuild-essential images: disable deploy This is a follow-up to 57bf16fa178cec8bd6f20a2bcd505d27fb8892ba --- .circleci/config.yml | 105 ++++++++++++++++++++++--------------------- 1 file changed, 55 insertions(+), 50 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b145b489..cb27b5ba 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -377,26 +377,28 @@ jobs: docker login -u $DOCKER_USER -p $DOCKER_PASS docker push dockcross/browser-asmjs:latest fi - - restore_cache: - key: linux-arm64-assets-{{ .Revision }} - - deploy: - name: Deploy linux-arm64 - command: | - docker load -i ~/docker/linux-arm64.tar - if [ "${CIRCLE_BRANCH}" == "master" ]; then - docker login -u $DOCKER_USER -p $DOCKER_PASS - docker push dockcross/linux-arm64:latest - fi - - restore_cache: - key: linux-armv5-assets-{{ .Revision }} - - deploy: - name: Deploy linux-armv5 - command: | - docker load -i ~/docker/linux-armv5.tar - if [ "${CIRCLE_BRANCH}" == "master" ]; then - docker login -u $DOCKER_USER -p $DOCKER_PASS - docker push dockcross/linux-armv5:latest - fi + # Image build currently broken. See #209 + #- restore_cache: + #key: linux-arm64-assets-{{ .Revision }} + #- deploy: + #name: Deploy linux-arm64 + #command: | + #docker load -i ~/docker/linux-arm64.tar + #if [ "${CIRCLE_BRANCH}" == "master" ]; then + #docker login -u $DOCKER_USER -p $DOCKER_PASS + #docker push dockcross/linux-arm64:latest + #fi + # Image build currently broken. See #209 + #- restore_cache: + #key: linux-armv5-assets-{{ .Revision }} + #- deploy: + #name: Deploy linux-armv5 + #command: | + #docker load -i ~/docker/linux-armv5.tar + #if [ "${CIRCLE_BRANCH}" == "master" ]; then + #docker login -u $DOCKER_USER -p $DOCKER_PASS + #docker push dockcross/linux-armv5:latest + #fi - restore_cache: key: linux-armv6-assets-{{ .Revision }} - deploy: @@ -407,26 +409,28 @@ jobs: docker login -u $DOCKER_USER -p $DOCKER_PASS docker push dockcross/linux-armv6:latest fi - - restore_cache: - key: linux-armv7-assets-{{ .Revision }} - - deploy: - name: Deploy linux-armv7 - command: | - docker load -i ~/docker/linux-armv7.tar - if [ "${CIRCLE_BRANCH}" == "master" ]; then - docker login -u $DOCKER_USER -p $DOCKER_PASS - docker push dockcross/linux-armv7:latest - fi - - restore_cache: - key: linux-mipsel-assets-{{ .Revision }} - - deploy: - name: Deploy linux-mipsel - command: | - docker load -i ~/docker/linux-mipsel.tar - if [ "${CIRCLE_BRANCH}" == "master" ]; then - docker login -u $DOCKER_USER -p $DOCKER_PASS - docker push dockcross/linux-mipsel:latest - fi + # Image build currently broken. See #209 + #- restore_cache: + #key: linux-armv7-assets-{{ .Revision }} + #- deploy: + #name: Deploy linux-armv7 + #command: | + #docker load -i ~/docker/linux-armv7.tar + #if [ "${CIRCLE_BRANCH}" == "master" ]; then + #docker login -u $DOCKER_USER -p $DOCKER_PASS + #docker push dockcross/linux-armv7:latest + #fi + # Image build currently broken. See #209 + #- restore_cache: + #key: linux-mipsel-assets-{{ .Revision }} + #- deploy: + #name: Deploy linux-mipsel + #command: | + #docker load -i ~/docker/linux-mipsel.tar + #if [ "${CIRCLE_BRANCH}" == "master" ]; then + #docker login -u $DOCKER_USER -p $DOCKER_PASS + #docker push dockcross/linux-mipsel:latest + #fi - restore_cache: key: linux-s390x-assets-{{ .Revision }} - deploy: @@ -437,16 +441,17 @@ jobs: docker login -u $DOCKER_USER -p $DOCKER_PASS docker push dockcross/linux-s390x:latest fi - - restore_cache: - key: linux-ppc64le-assets-{{ .Revision }} - - deploy: - name: Deploy linux-ppc64le - command: | - docker load -i ~/docker/linux-ppc64le.tar - if [ "${CIRCLE_BRANCH}" == "master" ]; then - docker login -u $DOCKER_USER -p $DOCKER_PASS - docker push dockcross/linux-ppc64le:latest - fi + # Image build currently broken. See #209 + #- restore_cache: + #key: linux-ppc64le-assets-{{ .Revision }} + #- deploy: + #name: Deploy linux-ppc64le + #command: | + #docker load -i ~/docker/linux-ppc64le.tar + #if [ "${CIRCLE_BRANCH}" == "master" ]; then + #docker login -u $DOCKER_USER -p $DOCKER_PASS + #docker push dockcross/linux-ppc64le:latest + #fi - restore_cache: key: linux-x64-assets-{{ .Revision }} - deploy: From fcfa9b6060789017566d2ed2195ca5bf37b7f973 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 16 Apr 2018 15:40:01 -0400 Subject: [PATCH 28/29] README: Improve section order New users should see the most relevant sections first. In particular, - Examples - Installation - Usage --- README.rst | 133 ++++++++++++++++++++++++++--------------------------- 1 file changed, 66 insertions(+), 67 deletions(-) diff --git a/README.rst b/README.rst index 1f574fb6..025a64d3 100644 --- a/README.rst +++ b/README.rst @@ -12,6 +12,7 @@ Features * Pre-built and configured toolchains for cross compiling. * Most images also contain an emulator for the target system. +* Clean separation of build tools, source code, and build artifacts. * Commands in the container are run as the calling user, so that any created files have the expected ownership, (i.e. not root). * Make variables (`CC`, `LD` etc) are set to point to the appropriate tools in the container. * Recent `CMake `_ and ninja are precompiled. @@ -20,15 +21,61 @@ Features * Current directory is mounted as the container's workdir, ``/work``. * Works with the `Docker for Mac `_ and `Docker for Windows `_. +Examples +-------- -What is the difference between `dockcross` and `dockbuild` ? ------------------------------------------------------------- +1. ``dockcross make``: Build the *Makefile* in the current directory. +2. ``dockcross cmake -Bbuild -H. -GNinja``: Run CMake with a build directory + ``./build`` for a *CMakeLists.txt* file in the current directory and generate + ``ninja`` build configuration files. +3. ``dockcross ninja -Cbuild``: Run ninja in the ``./build`` directory. +4. ``dockcross bash -c '$CC test/C/hello.c -o hello'``: Build the *hello.c* file + with the compiler identified with the ``CC`` environmental variable in the + build environment. +5. ``dockcross bash``: Run an interactive shell in the build environment. -The key difference is that `dockbuild `_ -images use the same method to conveniently isolate the build environment as -`dockcross `_ but they do **NOT** provide -a toolchain file. +Note that commands are executed verbatim. If any shell processing for +environment variable expansion or redirection is required, please use +`bash -c 'command args...'`. + +Installation +------------ + +This image does not need to be run manually. Instead, there is a helper script +to execute build commands on source code existing on the local host filesystem. This +script is bundled with the image. + +To install the helper script, run one of the images with no arguments, and +redirect the output to a file:: + docker run --rm CROSS_COMPILER_IMAGE_NAME > ./dockcross + chmod +x ./dockcross + mv ./dockcross ~/bin/ + +Where `CROSS_COMPILER_IMAGE_NAME` is the name of the cross-compiler toolchain +Docker instance, e.g. `dockcross/linux-armv7`. + +Only 64-bit x86_64 images are provided; a 64-bit x86_64 host system is required. + +Usage +----- + +For the impatient, here's how to compile a hello world for armv7:: + + cd ~/src/dockcross + docker run --rm dockcross/linux-armv7 > ./dockcross-linux-armv7 + chmod +x ./dockcross-linux-armv7 + ./dockcross-linux-armv7 bash -c '$CC test/C/hello.c -o hello_arm' + +Note how invoking any toolchain command (make, gcc, etc.) is just a matter of prepending the **dockcross** script on the commandline:: + + ./dockcross-linux-armv7 [command] [args...] + +The dockcross script will execute the given command-line inside the container, +along with all arguments passed after the command. Commands that evaluate +environmental variables in the image, like `$CC` above, should be executed in +`bash -c`. The present working directory is mounted within the image, which +can be used to make source code available in the Docker container. Cross compilers --------------- @@ -164,44 +211,13 @@ dockcross/windows-x86 |windows-x86-images| 32-bit Windows cross-compiler based on MXE/MinGW-w64. -Installation ------------- - -This image does not need to be run manually. Instead, there is a helper script -to execute build commands on source code existing on the local host filesystem. This -script is bundled with the image. - -To install the helper script, run one of the images with no arguments, and -redirect the output to a file:: - - docker run --rm CROSS_COMPILER_IMAGE_NAME > ./dockcross - chmod +x ./dockcross - mv ./dockcross ~/bin/ - -Where `CROSS_COMPILER_IMAGE_NAME` is the name of the cross-compiler toolchain -Docker instance, e.g. `dockcross/linux-armv7`. - -Only 64-bit images are provided; a 64-bit host system is required. - -Usage ------ - -For the impatient, here's how to compile a hello world for armv7:: - - cd ~/src/dockcross - docker run --rm dockcross/linux-armv7 > ./dockcross-linux-armv7 - chmod +x ./dockcross-linux-armv7 - ./dockcross-linux-armv7 bash -c '$CC test/C/hello.c -o hello_arm' - -Note how invoking any toolchain command (make, gcc, etc.) is just a matter of prepending the **dockcross** script on the commandline:: - - ./dockcross-linux-armv7 [command] [args...] +Articles +-------- -The dockcross script will execute the given command-line inside the container, -along with all arguments passed after the command. Commands that evaluate -environmental variables in the image, like `$CC` above, should be executed in -`bash -c`. The present working directory is mounted within the image, which -can be used to make source code available in the Docker container. +- `dockcross: C++ Write Once, Run Anywhere + `_ +- `Cross-compiling binaries for multiple architectures with Docker + `_ Built-in update commands @@ -285,23 +301,6 @@ For example, commands like ``git config --global advice.detachedHead false`` can be added to this script. -Examples --------- - -1. ``dockcross make``: Build the *Makefile* in the current directory. -2. ``dockcross cmake -Bbuild -H. -GNinja``: Run CMake with a build directory - ``./build`` for a *CMakeLists.txt* file in the current directory and generate - ``ninja`` build configuration files. -3. ``dockcross ninja -Cbuild``: Run ninja in the ``./build`` directory. -4. ``dockcross bash -c '$CC test/C/hello.c -o hello'``: Build the *hello.c* file - with the compiler identified with the ``CC`` environmental variable in the - build environment. -5. ``dockcross bash``: Run an interactive shell in the build environment. - -Note that commands are executed verbatim. If any shell processing for -environment variable expansion or redirection is required, please use -`bash -c 'command args...'`. - How to extend Dockcross images ------------------------------ In order to extend Dockcross images with your own commands, one must: @@ -312,7 +311,7 @@ In order to extend Dockcross images with your own commands, one must: An example Dockerfile would be:: FROM dockcross/linux-armv7 - + ENV DEFAULT_DOCKCROSS_IMAGE my_cool_image RUN apt-get install nano @@ -324,13 +323,13 @@ And then in the shell:: ./linux-armv7 bash # Runs the helper script with the argument "bash", which starts an interactive container using your extended image. -Articles --------- +What is the difference between `dockcross` and `dockbuild` ? +------------------------------------------------------------ -- `dockcross: C++ Write Once, Run Anywhere - `_ -- `Cross-compiling binaries for multiple architectures with Docker - `_ +The key difference is that `dockbuild `_ +images use the same method to conveniently isolate the build environment as +`dockcross `_ but they do **NOT** provide +a toolchain file. --- From 407ead371cf7dd24266336558c5c2d7d23da7ae5 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 23 Apr 2018 22:25:12 -0400 Subject: [PATCH 29/29] browser-asmjs: Bump Emscripten to 1.37.37 --- browser-asmjs/Dockerfile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/browser-asmjs/Dockerfile.in b/browser-asmjs/Dockerfile.in index 92056a76..acc9ec71 100644 --- a/browser-asmjs/Dockerfile.in +++ b/browser-asmjs/Dockerfile.in @@ -1,4 +1,4 @@ -FROM trzeci/emscripten-slim:sdk-tag-1.37.36-64bit +FROM trzeci/emscripten-slim:sdk-tag-1.37.37-64bit MAINTAINER Matt McCormick "matt.mccormick@kitware.com" # Revert back to "/bin/sh" as default shell @@ -9,7 +9,7 @@ RUN rm /bin/sh && ln -s /bin/dash /bin/sh #include "common.docker" -ENV EMSCRIPTEN_VERSION 1.37.29 +ENV EMSCRIPTEN_VERSION 1.37.37 ENV PATH /emsdk_portable:/emsdk_portable/llvm/clang/bin/:/emsdk_portable/sdk/:${PATH} ENV CC=/emsdk_portable/sdk/emcc \