Browse Source

Merge topic 'rel-linux-aarch64' into release-3.19

2c1127a7a9 Help: Add 3.19.3 release note for Linux aarch64 binary
76742c4cbe gitlab-ci: add jobs to make Linux release packages for aarch64 on 3.19 branch
e14fb01c41 Utilities/Release: Add docker specs for Linux aarch64 binaries
595551a805 gitlab-ci: consolidate Linux release package job spec for x86_64

Acked-by: Kitware Robot <[email protected]>
Acked-by: Bruno Verachten <[email protected]>
Merge-request: !5538
Brad King 4 years ago
parent
commit
511158a03b

+ 23 - 0
.gitlab-ci.yml

@@ -186,6 +186,29 @@ build:linux-x86_64-package:
     variables:
         RSYNC_DESTINATION: dev
 
+build:linux-aarch64-package:
+    extends:
+        - .linux_package_aarch64
+        - .cmake_build_linux_package
+        - .cmake_release_artifacts
+        - .linux_builder_tags_aarch64
+        - .run_only_for_package
+    dependencies:
+        - prep:doc-package
+    needs:
+        - prep:doc-package
+
+.upload:linux-aarch64-package:
+    extends:
+        - .rsync_upload
+        - .run_only_for_package
+    dependencies:
+        - build:linux-aarch64-package
+    needs:
+        - build:linux-aarch64-package
+    variables:
+        RSYNC_DESTINATION: dev
+
 # macOS builds
 
 build:macos-ninja:

+ 1 - 0
.gitlab/artifacts.yml

@@ -74,6 +74,7 @@
         paths:
             # Any packages made.
             - build/cmake-*-Linux-x86_64.*
+            - build/cmake-*-Linux-aarch64.*
             - build/cmake-*-macos-universal.*
             # Any source packages made.
             - build/cmake-*.tar.gz

+ 14 - 7
.gitlab/ci/sccache.sh

@@ -2,21 +2,30 @@
 
 set -e
 
-case "$( uname -s )" in
-    Linux)
+readonly kernel="$(uname -s)-$(uname -m)"
+case $kernel in
+    Linux-x86_64)
         version="0.2.13"
         shatool="sha256sum"
         sha256sum="28a5499e340865b08b632306b435913beb590fbd7b49a3f887a623b459fabdeb"
         platform="x86_64-unknown-linux-musl"
         ;;
-    Darwin)
+    Linux-aarch64)
+        version="g6628e1f"
+        shatool="sha256sum"
+        sha256sum="bb88adbb5a29c166ecaa78d0593493b609a7f84d91d1228502a908f319b513f0"
+        platform="aarch64-unknown-linux-musl"
+        url="https://github.com/hwinit/sccache/releases/download/$version"
+        ;;
+    Darwin-x86_64)
         version="gfe63078"
         shatool="shasum -a 256"
         sha256sum="60a0302b1d7227f7ef56abd82266353f570d27c6e850c56c6448bf62def38888"
         platform="x86_64-apple-darwin"
+        url="https://paraview.org/files/dependencies"
         ;;
     *)
-        echo "Unrecognized platform $( uname -s )"
+        echo "Unrecognized platform $kernel"
         exit 1
         ;;
 esac
@@ -28,9 +37,7 @@ readonly platform
 readonly filename="sccache-$version-$platform"
 readonly tarball="$filename.tar.gz"
 
-if [ "$( uname -s )" = "Darwin" ]; then
-    url="https://paraview.org/files/dependencies"
-else
+if [ -z "$url" ]; then
     url="https://github.com/mozilla/sccache/releases/download/$version"
 fi
 readonly url

+ 16 - 6
.gitlab/os-linux.yml

@@ -17,18 +17,21 @@
     variables:
         GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
 
-.linux_package:
+.linux_package_x86_64:
+    image: "kitware/cmake:build-linux-x86_64-deps-2020-04-02@sha256:77e9ab183f34680990db9da5945473e288f0d6556bce79ecc1589670d656e157"
+
     variables:
         GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
         LAUNCHER: "scl enable devtoolset-6 rh-python36 --"
+        CMAKE_ARCH: x86_64
 
-.linux_package_x86_64:
-    extends: .linux_package
-
-    image: "kitware/cmake:build-linux-x86_64-deps-2020-04-02@sha256:77e9ab183f34680990db9da5945473e288f0d6556bce79ecc1589670d656e157"
+.linux_package_aarch64:
+    image: "kitware/cmake:build-linux-aarch64-deps-2020-12-21@sha256:0bd7dfe4e45593b04e39cd21e44011034610cfd376900558c5ef959bb1af15af"
 
     variables:
-        CMAKE_ARCH: x86_64
+        GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
+        LAUNCHER: "scl enable devtoolset-7 --"
+        CMAKE_ARCH: aarch64
 
 ### Debian
 
@@ -160,6 +163,13 @@
         - docker
         - linux
 
+.linux_builder_tags_aarch64:
+    tags:
+        - cmake
+        - build
+        - docker
+        - linux-aarch64
+
 ## Linux-specific scripts
 
 .before_script_linux: &before_script_linux

+ 5 - 0
Help/release/3.19.rst

@@ -385,3 +385,8 @@ Changes made since CMake 3.19.0 include the following.
 * The :variable:`CMAKE_ISPC_HEADER_SUFFIX` variable and corresponding
   :prop_tgt:`ISPC_HEADER_SUFFIX` target property were added to control
   the header suffix used by ``ISPC`` compiler generated headers.
+
+3.19.3
+------
+
+* A precompiled Linux ``aarch64`` binary is now provided on ``cmake.org``.

+ 35 - 0
Utilities/Release/linux/aarch64/Dockerfile

@@ -0,0 +1,35 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+# Produce an image containing a portable CMake binary package for Linux/aarch64.
+# Build using the CMake source directory as the build context.
+# The resulting image will have an '/out' directory containing the package.
+
+# Keep this in sync with the `.gitlab-ci.yml` `release_linux` image.
+ARG FROM_IMAGE_NAME=kitware/cmake:build-linux-aarch64-deps-2020-12-21
+ARG FROM_IMAGE_DIGEST=@sha256:0bd7dfe4e45593b04e39cd21e44011034610cfd376900558c5ef959bb1af15af
+ARG FROM_IMAGE=$FROM_IMAGE_NAME$FROM_IMAGE_DIGEST
+FROM $FROM_IMAGE
+
+COPY . /opt/cmake/src/cmake
+
+ARG TEST=true
+
+RUN : \
+ && mkdir -p /opt/cmake/src/cmake-build \
+ && cd /opt/cmake/src/cmake-build \
+ && cp ../cmake/Utilities/Release/linux/aarch64/cache.txt CMakeCache.txt \
+ && source /opt/rh/devtoolset-7/enable \
+ && set -x \
+ && ../cmake/bootstrap --parallel=$(nproc) --docdir=doc/cmake \
+ && nice make -j $(nproc) \
+ && if $TEST; then \
+        # Run tests that require the full build tree.
+        bin/ctest --output-on-failure -j 8 -R '^(CMake\.|CMakeLib\.|CMakeServerLib\.|RunCMake\.ctest_memcheck)'; \
+    fi \
+ && bin/cpack -G TGZ \
+ && bin/cpack -G STGZ \
+ && set +x \
+ && mkdir /out \
+ && mv cmake-*-Linux-aarch64.* /out \
+ && :

+ 31 - 0
Utilities/Release/linux/aarch64/base/Dockerfile

@@ -0,0 +1,31 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+# Produce a base image with a build environment for portable CMake binaries.
+# Build using the directory containing this file as its own build context.
+
+ARG FROM_IMAGE_NAME=centos:7
+ARG FROM_IMAGE_DIGEST=@sha256:43964203bf5d7fe38c6fca6166ac89e4c095e2b0c0a28f6c7c678a1348ddc7fa
+ARG FROM_IMAGE=$FROM_IMAGE_NAME$FROM_IMAGE_DIGEST
+FROM $FROM_IMAGE
+
+RUN : \
+ && yum install -y centos-release-scl \
+ && yum install -y \
+        ca-certificates \
+        curl \
+        devtoolset-7-gcc \
+        devtoolset-7-gcc-c++ \
+        fontconfig-devel \
+        freetype-devel \
+        git \
+        libX11-devel \
+        libxcb-devel \
+        make \
+        patch \
+        perl \
+        python3-pip \
+        xz \
+        which \
+ && yum clean all \
+ && :

+ 44 - 0
Utilities/Release/linux/aarch64/cache.txt

@@ -0,0 +1,44 @@
+CMAKE_BUILD_TYPE:STRING=Release
+
+CMAKE_C_STANDARD:STRING=11
+CMAKE_CXX_STANDARD:STRING=14
+
+# Require only older APIs where possible.
+CMAKE_C_FLAGS:STRING=-D_POSIX_C_SOURCE=199506L -D_POSIX_SOURCE=1 -D_SVID_SOURCE=1 -D_BSD_SOURCE=1
+
+# Link C++ library statically.
+CMAKE_EXE_LINKER_FLAGS:STRING=-static-libstdc++ -static-libgcc
+
+# Enable ssl support in curl
+CMAKE_USE_OPENSSL:BOOL=ON
+OPENSSL_CRYPTO_LIBRARY:STRING=/opt/openssl/lib/libcrypto.a;-pthread
+OPENSSL_INCLUDE_DIR:PATH=/opt/openssl/include
+OPENSSL_SSL_LIBRARY:FILEPATH=/opt/openssl/lib/libssl.a
+
+# Enable ccmake
+BUILD_CursesDialog:BOOL=ON
+CURSES_FORM_LIBRARY:FILEPATH=/opt/ncurses/lib/libform.a
+CURSES_INCLUDE_PATH:PATH=/opt/ncurses/include
+CURSES_NCURSES_LIBRARY:FILEPATH=/opt/ncurses/lib/libncurses.a
+
+# Enable cmake-gui with static qt plugins
+BUILD_QtDialog:BOOL=TRUE
+CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:STRING=3
+CMAKE_PREFIX_PATH:STRING=/opt/qt
+CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES:STRING=/opt/qt/plugins/platforms/libqxcb.a;/opt/qt/lib/libQt5XcbQpa.a;/opt/qt/lib/libQt5ServiceSupport.a;/opt/qt/lib/libQt5EdidSupport.a;/opt/qt/lib/libQt5EventDispatcherSupport.a;/opt/qt/lib/libQt5FontDatabaseSupport.a;/opt/qt/lib/libQt5ThemeSupport.a;/opt/qt/lib/libxcb-static.a;-lxcb;-lfontconfig;-lfreetype
+
+# Build documentation.
+SPHINX_EXECUTABLE:FILEPATH=/usr/local/bin/sphinx-build
+SPHINX_HTML:BOOL=ON
+SPHINX_MAN:BOOL=ON
+SPHINX_QTHELP:BOOL=ON
+QCOLLECTIONGENERATOR_EXECUTABLE:PATH=/opt/qt/bin/qhelpgenerator
+
+# We bootstrap as part of the build so skip its test.
+CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE
+
+# Skip Qt5 tests because our Qt is static.
+CMake_TEST_Qt5:BOOL=FALSE
+
+# CPack package file name component for this platform.
+CPACK_SYSTEM_NAME:STRING=Linux-aarch64

+ 141 - 0
Utilities/Release/linux/aarch64/deps/Dockerfile

@@ -0,0 +1,141 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+# Produce an image with custom-built dependencies for portable CMake binaries.
+# Build using the directory containing this file as its own build context.
+
+ARG FROM_IMAGE_NAME=kitware/cmake:build-linux-aarch64-base-2020-12-21
+ARG FROM_IMAGE_DIGEST=@sha256:c8d9fa279ef09c26e74ff28770ae0db1f4cb75ef53b782ace604daba71a41f65
+ARG FROM_IMAGE=$FROM_IMAGE_NAME$FROM_IMAGE_DIGEST
+FROM $FROM_IMAGE
+
+# Sphinx
+RUN : \
+ && pip3 install sphinx==2.1.2 \
+ && :
+
+# Qt
+# Version 5.12.0 was the last to bundle xkbcommon.
+COPY qt-install.patch /opt/qt/src/
+RUN : \
+ && mkdir -p /opt/qt/src/qt-build \
+ && cd /opt/qt/src \
+ && curl -OL https://download.qt.io/archive/qt/5.12/5.12.0/single/qt-everywhere-src-5.12.0.tar.xz \
+ && sha512sum qt-everywhere-src-5.12.0.tar.xz | grep -q 0dd03d2645fb6dac5b58c8caf92b4a0a6900131f1ccfb02443a0df4702b5da0458f4c45e758d1b929ec709b0f4b36900df2fd60a058af9cc8c1a0748b6d57aae \
+ && tar xJf qt-everywhere-src-5.12.0.tar.xz \
+ && cd qt-build \
+ && source /opt/rh/devtoolset-7/enable \
+ && ../qt-everywhere-src-5.12.0/configure \
+      -prefix /opt/qt \
+      -static \
+      -release \
+      -c++std c++11 \
+      -opensource -confirm-license \
+      -gui \
+      -widgets \
+      -xcb \
+      -fontconfig \
+      -sql-sqlite \
+      -qt-doubleconversion \
+      -qt-libjpeg \
+      -qt-libpng \
+      -qt-pcre \
+      -qt-sqlite \
+      -qt-xcb \
+      -qt-xkbcommon \
+      -qt-zlib \
+      -system-freetype \
+      -no-accessibility \
+      -no-compile-examples \
+      -no-cups \
+      -no-dbus \
+      -no-directfb \
+      -no-egl \
+      -no-eglfs \
+      -no-evdev \
+      -no-gbm \
+      -no-gif \
+      -no-glib \
+      -no-gtk \
+      -no-harfbuzz \
+      -no-iconv \
+      -no-icu \
+      -no-journald \
+      -no-kms \
+      -no-libinput \
+      -no-libproxy \
+      -no-linuxfb \
+      -no-ltcg \
+      -no-mirclient \
+      -no-mtdev \
+      -no-opengl \
+      -no-openssl \
+      -no-pch \
+      -no-sql-mysql \
+      -no-sql-psql \
+      -no-sql-sqlite2 \
+      -no-syslog \
+      -no-system-proxies \
+      -no-tslib \
+      -no-use-gold-linker \
+      -skip declarative \
+      -skip multimedia \
+      -skip qtcanvas3d \
+      -skip qtconnectivity \
+      -skip qtdeclarative \
+      -skip qtlocation \
+      -skip qtmultimedia \
+      -skip qtsensors \
+      -skip qtserialport \
+      -skip qtsvg \
+      -skip qtwayland \
+      -skip qtwebchannel \
+      -skip qtwebengine \
+      -skip qtwebsockets \
+      -skip qtwinextras \
+      -skip qtxmlpatterns \
+      -nomake examples \
+      -nomake tests \
+ && make install -j $(nproc) \
+ && cd /opt/qt \
+ && patch -p1 -i src/qt-install.patch \
+ && cd /opt \
+ && rm -rf /opt/qt/src \
+ && :
+
+# Curses
+RUN : \
+ && mkdir -p /opt/ncurses/src/ncurses-build \
+ && cd /opt/ncurses/src \
+ && curl -O https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.1.tar.gz \
+ && sha512sum ncurses-6.1.tar.gz | grep -q e308af43f8b7e01e98a55f4f6c4ee4d1c39ce09d95399fa555b3f0cdf5fd0db0f4c4d820b4af78a63f6cf6d8627587114a40af48cfc066134b600520808a77ee \
+ && tar xzf ncurses-6.1.tar.gz \
+ && cd ncurses-build \
+ && source /opt/rh/devtoolset-7/enable \
+ && ../ncurses-6.1/configure \
+      --prefix=/opt/ncurses \
+      --with-terminfo-dirs=/etc/terminfo:/lib/terminfo:/usr/share/terminfo \
+      --with-default-terminfo-dir=/usr/share/terminfo \
+      --without-shared \
+ && make -j $(nproc) \
+ && make install.libs install.includes \
+ && cd /opt \
+ && rm -rf /opt/ncurses/src \
+ && :
+
+# OpenSSL
+COPY openssl-source.patch /opt/openssl/src/
+RUN : \
+ && mkdir -p /opt/openssl/src \
+ && cd /opt/openssl/src \
+ && curl -O https://www.openssl.org/source/openssl-1.1.1f.tar.gz \
+ && sha512sum openssl-1.1.1f.tar.gz | grep -q b00bd9b5ad5298fbceeec6bb19c1ab0c106ca5cfb31178497c58bf7e0e0cf30fcc19c20f84e23af31cc126bf2447d3e4f8461db97bafa7bd78f69561932f000c \
+ && tar xzf openssl-1.1.1f.tar.gz \
+ && cd openssl-1.1.1f \
+ && patch -p1 -i ../openssl-source.patch \
+ && source /opt/rh/devtoolset-7/enable \
+ && ./Configure --prefix=/opt/openssl linux-elf no-asm no-shared -D_POSIX_C_SOURCE=199506L -D_POSIX_SOURCE=1 -D_SVID_SOURCE=1 -D_BSD_SOURCE=1 \
+ && make install_dev -j $(nproc) \
+ && cd /opt \
+ && rm -rf /opt/openssl/src \
+ && :

+ 12 - 0
Utilities/Release/linux/aarch64/deps/openssl-source.patch

@@ -0,0 +1,12 @@
+# enable pthread APIs disabled by our _POSIX_SOURCE definitions
+--- openssl-source/crypto/threads_pthread.c.orig
++++ openssl-source/crypto/threads_pthread.c
+@@ -6,6 +6,8 @@
+  * in the file LICENSE in the source distribution or at
+  * https://www.openssl.org/source/license.html
+  */
++#undef _POSIX_C_SOURCE
++#undef _POSIX_SOURCE
+
+ #include <openssl/crypto.h>
+ #include "internal/cryptlib.h"

+ 24 - 0
Utilities/Release/linux/aarch64/deps/qt-install.patch

@@ -0,0 +1,24 @@
+# Add Qt Core dependencies missing from static Qt build.
+--- qt-install/lib/cmake/Qt5Core/Qt5CoreConfig.cmake.orig
++++ qt-install/lib/cmake/Qt5Core/Qt5CoreConfig.cmake
+@@ -111,7 +111,7 @@
+     list(REMOVE_DUPLICATES Qt5Core_COMPILE_DEFINITIONS)
+     list(REMOVE_DUPLICATES Qt5Core_EXECUTABLE_COMPILE_FLAGS)
+
+-    set(_Qt5Core_LIB_DEPENDENCIES "")
++    set(_Qt5Core_LIB_DEPENDENCIES "${_qt5Core_install_prefix}/lib/libqtpcre2.a")
+
+
+     add_library(Qt5::Core STATIC IMPORTED)
+# Add Qt Gui dependencies missing from static Qt build.
+--- qt-install/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake.orig
++++ qt-install/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake
+@@ -111,7 +111,7 @@
+     list(REMOVE_DUPLICATES Qt5Gui_COMPILE_DEFINITIONS)
+     list(REMOVE_DUPLICATES Qt5Gui_EXECUTABLE_COMPILE_FLAGS)
+
+-    set(_Qt5Gui_LIB_DEPENDENCIES "Qt5::Core")
++    set(_Qt5Gui_LIB_DEPENDENCIES "Qt5::Core;${_qt5Gui_install_prefix}/lib/libqtlibpng.a")
+
+
+     add_library(Qt5::Gui STATIC IMPORTED)

+ 26 - 0
Utilities/Release/linux/aarch64/test/Dockerfile

@@ -0,0 +1,26 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+# Produce a base image with a test environment for packaged CMake binaries.
+# Build using the directory containing this file as its own build context.
+
+ARG FROM_IMAGE_NAME=debian:10
+ARG FROM_IMAGE_DIGEST=@sha256:ab0ba5b78bfe01d61ac4f9919cd0e7bef8beefa0a77d3d710bfc8630d96804b8
+ARG FROM_IMAGE=$FROM_IMAGE_NAME$FROM_IMAGE_DIGEST
+FROM $FROM_IMAGE
+
+RUN : \
+ && apt-get update \
+ && apt-get install -y \
+        dpkg \
+        file \
+        gcc \
+        g++ \
+        gfortran \
+        qt5-default \
+        make \
+        ninja-build \
+ && apt-get clean \
+ && :
+
+COPY test-make.bash test-ninja.bash /

+ 17 - 0
Utilities/Release/linux/aarch64/test/test-make.bash

@@ -0,0 +1,17 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+set -e
+set -x
+mkdir -p /opt/cmake/src/cmake-make
+cd /opt/cmake/src/cmake-make
+echo >CMakeCache.txt '
+CMake_TEST_IPO_WORKS_C:BOOL=ON
+CMake_TEST_IPO_WORKS_CXX:BOOL=ON
+CMake_TEST_IPO_WORKS_Fortran:BOOL=ON
+CMake_TEST_NO_NETWORK:BOOL=ON
+CMake_TEST_Qt5:BOOL=ON
+'
+cmake ../cmake -DCMake_TEST_HOST_CMAKE=1 -G "Unix Makefiles"
+make -j $(nproc)
+ctest --output-on-failure -j $(nproc)

+ 17 - 0
Utilities/Release/linux/aarch64/test/test-ninja.bash

@@ -0,0 +1,17 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+set -e
+set -x
+mkdir -p /opt/cmake/src/cmake-ninja
+cd /opt/cmake/src/cmake-ninja
+echo >CMakeCache.txt '
+CMAKE_Fortran_COMPILER:STRING=
+CMake_TEST_IPO_WORKS_C:BOOL=ON
+CMake_TEST_IPO_WORKS_CXX:BOOL=ON
+CMake_TEST_NO_NETWORK:BOOL=ON
+CMake_TEST_Qt5:BOOL=ON
+'
+cmake ../cmake -DCMake_TEST_HOST_CMAKE=1 -G "Ninja"
+ninja
+ctest --output-on-failure -j $(nproc)