From dd173199bc27ad24c8552abe3a45161465e213db Mon Sep 17 00:00:00 2001 From: Fantix King Date: Mon, 12 Aug 2024 16:25:06 -0400 Subject: [PATCH 1/2] Fix cmake on Ubuntu 18.04 and CentOS 7 --- .../linux/build/Dockerfile-debian.template | 42 ++++++++++++++++++- .../linux/build/Dockerfile-linux.template | 37 +++++++++++++++- integration/linux/build/_keys/cmake.keys | 1 + .../linux/build/debian-bookworm/Dockerfile | 3 +- .../linux/build/debian-bullseye/Dockerfile | 3 +- .../linux/build/debian-buster/Dockerfile | 3 +- .../linux/build/linux-aarch64/Dockerfile | 37 +++++++++++++++- .../linux/build/linux-x86_64/Dockerfile | 37 +++++++++++++++- .../linux/build/ubuntu-bionic/Dockerfile | 35 +++++++++++++++- .../linux/build/ubuntu-focal/Dockerfile | 3 +- .../linux/build/ubuntu-hirsute/Dockerfile | 3 +- .../linux/build/ubuntu-jammy/Dockerfile | 3 +- .../linux/build/ubuntu-noble/Dockerfile | 3 +- integration/linux/build/update.sh | 11 ++++- 14 files changed, 203 insertions(+), 18 deletions(-) create mode 100644 integration/linux/build/_keys/cmake.keys diff --git a/integration/linux/build/Dockerfile-debian.template b/integration/linux/build/Dockerfile-debian.template index 89d88687..5745baf8 100644 --- a/integration/linux/build/Dockerfile-debian.template +++ b/integration/linux/build/Dockerfile-debian.template @@ -13,7 +13,9 @@ RUN apt-get update \ flex \ patchelf \ zstd \ +%%IFNOT VARIANT=bionic%% cmake \ +%%ENDIF%% && rm -rf /var/lib/apt/lists/* ENV PYTHON_VERSION %%PLACEHOLDER%% @@ -23,6 +25,9 @@ ENV PATH /usr/local/cargo/bin:$PATH ENV RUST_VERSION %%PLACEHOLDER%% ENV NODE_VERSION %%PLACEHOLDER%% ENV YARN_VERSION %%PLACEHOLDER%% +%%IF VARIANT=bionic%% +ENV CMAKE_VERSION %%PLACEHOLDER%% +%%ENDIF%% RUN set -ex \ \ @@ -48,6 +53,14 @@ RUN set -ex \ gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" ; \ done \ +%%IF VARIANT=bionic%% + && for key in \ + "${CMAKE_KEYS[@]}" + ; do \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \ + gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" ; \ + done \ +%%ENDIF%% && gpg --batch --verify python.tar.xz.asc python.tar.xz \ && rm -rf python.tar.xz.asc \ && mkdir -p /usr/src/python \ @@ -105,6 +118,32 @@ RUN set -ex \ && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \ && ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \ && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ +%%IF VARIANT=bionic%% + && case "${dpkgArch##*-}" in \ + amd64) CMAKE_ARCH='x86_64';; \ + arm64) CMAKE_ARCH='aarch64';; \ + *) CMAKE_ARCH='' ;; \ + esac \ + && curl -fsSLO --compressed "https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION${CMAKE_ARCH:+-linux-$CMAKE_ARCH}.tar.gz" \ + && curl -fsSLO --compressed "https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-SHA-256.txt" \ + && curl -fsSLO --compressed "https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-SHA-256.txt.asc" \ + && gpg --batch --verify cmake-$CMAKE_VERSION-SHA-256.txt.asc cmake-$CMAKE_VERSION-SHA-256.txt \ + && grep " cmake-$CMAKE_VERSION${CMAKE_ARCH:+-linux-$CMAKE_ARCH}.tar.gz\$" cmake-$CMAKE_VERSION-SHA-256.txt | sha256sum -c - \ + && if [ -n "$CMAKE_ARCH" ]; then \ + echo $CMAKE_ARCH; \ + tar -xzf "cmake-$CMAKE_VERSION-linux-$CMAKE_ARCH.tar.gz" -C /usr/local --strip-components=1 --no-same-owner; \ + else \ + mkdir cmake-build; \ + tar -xzf "cmake-$CMAKE_VERSION.tar.gz" -C cmake-build --strip-components=1; \ + cd cmake-build; \ + ./bootstrap --parallel="$(nproc)"; \ + make -j "$(nproc)"; \ + make install; \ + cd ..; \ + rm -rf cmake-build; \ + fi \ + && rm "cmake-$CMAKE_VERSION${CMAKE_ARCH:+-linux-$CMAKE_ARCH}.tar.gz" "cmake-$CMAKE_VERSION-SHA-256.txt" "cmake-$CMAKE_VERSION-SHA-256.txt.asc" \ +%%ENDIF%% && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" \ \ @@ -112,7 +151,8 @@ RUN set -ex \ && rustc --version \ && node --version \ && npm --version \ - && yarn --version + && yarn --version \ + && cmake --version # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/integration/linux/build/Dockerfile-linux.template b/integration/linux/build/Dockerfile-linux.template index def92aa3..a37b798f 100644 --- a/integration/linux/build/Dockerfile-linux.template +++ b/integration/linux/build/Dockerfile-linux.template @@ -18,6 +18,7 @@ ENV GO_VERSION %%PLACEHOLDER%% ENV RUST_VERSION %%PLACEHOLDER%% ENV NODE_VERSION %%PLACEHOLDER%% ENV YARN_VERSION %%PLACEHOLDER%% +ENV CMAKE_VERSION %%PLACEHOLDER%% ENV GCC_VERSION 11 # rpm on centos 7 iterates over all fds up to the limit, which is @@ -50,7 +51,7 @@ RUN case "$HOSTTYPE" in \ expat-devel ncurses-devel gdbm-devel readline-devel libuuid-devel \ curl-devel xz-devel libffi-devel gettext \ perl-Getopt-Long perl-IPC-Cmd perl-Data-Dumper \ - sudo ca-certificates zstd cmake + sudo ca-certificates zstd RUN printf "#!/bin/bash\nsource scl_source enable devtoolset-${GCC_VERSION}" \ > /etc/profile.d/enabledevtoolset${GCC_VERSION}.sh @@ -94,6 +95,12 @@ RUN set -ex \ ; do \ gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys "$key" || \ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" ; \ + done \ + && for key in \ + "${CMAKE_KEYS[@]}" + ; do \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \ + gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" ; \ done \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ && rm -rf python.tar.xz.asc \ @@ -160,26 +167,32 @@ RUN set -ex \ x86_64) \ NODE_ARCH='x64' \ GO_ARCH='amd64' \ + CMAKE_ARCH='x86_64' \ ;; \ ppc64el) \ NODE_ARCH='ppc64le' \ GO_ARCH='ppc64le' \ + CMAKE_ARCH='' \ ;; \ s390x) \ NODE_ARCH='s390x' \ GO_ARCH='s390x' \ + CMAKE_ARCH='' \ ;; \ arm64) \ NODE_ARCH='arm64' \ GO_ARCH='arm64' \ + CMAKE_ARCH='' \ ;; \ aarch64) \ NODE_ARCH='arm64' \ GO_ARCH='arm64' \ + CMAKE_ARCH='aarch64' \ ;; \ i386) \ NODE_ARCH='x86' \ GO_ARCH='386' \ + CMAKE_ARCH='' \ ;; \ *) echo "unsupported architecture"; exit 1 ;; \ esac \ @@ -202,6 +215,25 @@ RUN set -ex \ https://go.dev/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz -o /tmp/go.tgz \ && tar -C /usr/local -xzf /tmp/go.tgz \ && rm /tmp/go.tgz \ + && curl -fsSLO --compressed "https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION${CMAKE_ARCH:+-linux-$CMAKE_ARCH}.tar.gz" \ + && curl -fsSLO --compressed "https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-SHA-256.txt" \ + && curl -fsSLO --compressed "https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-SHA-256.txt.asc" \ + && gpg --batch --verify cmake-$CMAKE_VERSION-SHA-256.txt.asc cmake-$CMAKE_VERSION-SHA-256.txt \ + && grep " cmake-$CMAKE_VERSION${CMAKE_ARCH:+-linux-$CMAKE_ARCH}.tar.gz\$" cmake-$CMAKE_VERSION-SHA-256.txt | sha256sum -c - \ + && if [ -n "$CMAKE_ARCH" ]; then \ + echo $CMAKE_ARCH; \ + tar -xzf "cmake-$CMAKE_VERSION-linux-$CMAKE_ARCH.tar.gz" -C /usr/local --strip-components=1 --no-same-owner; \ + else \ + mkdir cmake-build; \ + tar -xzf "cmake-$CMAKE_VERSION.tar.gz" -C cmake-build --strip-components=1; \ + cd cmake-build; \ + ./bootstrap --parallel="$(nproc)"; \ + make -j "$(nproc)"; \ + make install; \ + cd ..; \ + rm -rf cmake-build; \ + fi \ + && rm "cmake-$CMAKE_VERSION${CMAKE_ARCH:+-linux-$CMAKE_ARCH}.tar.gz" "cmake-$CMAKE_VERSION-SHA-256.txt" "cmake-$CMAKE_VERSION-SHA-256.txt.asc" \ && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" \ \ @@ -211,7 +243,8 @@ RUN set -ex \ && npm --version \ && yarn --version \ && git --version \ - && tar --version + && tar --version \ + && cmake --version # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/integration/linux/build/_keys/cmake.keys b/integration/linux/build/_keys/cmake.keys new file mode 100644 index 00000000..f7c96357 --- /dev/null +++ b/integration/linux/build/_keys/cmake.keys @@ -0,0 +1 @@ +CBA23971357C2E6590D9EFD3EC8FEF3A7BFB4EDA diff --git a/integration/linux/build/debian-bookworm/Dockerfile b/integration/linux/build/debian-bookworm/Dockerfile index 200171eb..eb35436d 100644 --- a/integration/linux/build/debian-bookworm/Dockerfile +++ b/integration/linux/build/debian-bookworm/Dockerfile @@ -130,7 +130,8 @@ RUN set -ex \ && rustc --version \ && node --version \ && npm --version \ - && yarn --version + && yarn --version \ + && cmake --version # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/integration/linux/build/debian-bullseye/Dockerfile b/integration/linux/build/debian-bullseye/Dockerfile index 6b1ba86c..ecccb0d4 100644 --- a/integration/linux/build/debian-bullseye/Dockerfile +++ b/integration/linux/build/debian-bullseye/Dockerfile @@ -130,7 +130,8 @@ RUN set -ex \ && rustc --version \ && node --version \ && npm --version \ - && yarn --version + && yarn --version \ + && cmake --version # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/integration/linux/build/debian-buster/Dockerfile b/integration/linux/build/debian-buster/Dockerfile index d764d630..bfc35bae 100644 --- a/integration/linux/build/debian-buster/Dockerfile +++ b/integration/linux/build/debian-buster/Dockerfile @@ -130,7 +130,8 @@ RUN set -ex \ && rustc --version \ && node --version \ && npm --version \ - && yarn --version + && yarn --version \ + && cmake --version # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/integration/linux/build/linux-aarch64/Dockerfile b/integration/linux/build/linux-aarch64/Dockerfile index 6eec61fa..d72388ca 100644 --- a/integration/linux/build/linux-aarch64/Dockerfile +++ b/integration/linux/build/linux-aarch64/Dockerfile @@ -24,6 +24,7 @@ ENV GO_VERSION 1.21.6 ENV RUST_VERSION 1.76.0 ENV NODE_VERSION 16.16.0 ENV YARN_VERSION 1.22.19 +ENV CMAKE_VERSION 3.30.2 ENV GCC_VERSION 11 # rpm on centos 7 iterates over all fds up to the limit, which is @@ -56,7 +57,7 @@ RUN case "$HOSTTYPE" in \ expat-devel ncurses-devel gdbm-devel readline-devel libuuid-devel \ curl-devel xz-devel libffi-devel gettext \ perl-Getopt-Long perl-IPC-Cmd perl-Data-Dumper \ - sudo ca-certificates zstd cmake + sudo ca-certificates zstd RUN printf "#!/bin/bash\nsource scl_source enable devtoolset-${GCC_VERSION}" \ > /etc/profile.d/enabledevtoolset${GCC_VERSION}.sh @@ -113,6 +114,12 @@ RUN set -ex \ ; do \ gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys "$key" || \ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" ; \ + done \ + && for key in \ + CBA23971357C2E6590D9EFD3EC8FEF3A7BFB4EDA \ + ; do \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \ + gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" ; \ done \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ && rm -rf python.tar.xz.asc \ @@ -179,26 +186,32 @@ RUN set -ex \ x86_64) \ NODE_ARCH='x64' \ GO_ARCH='amd64' \ + CMAKE_ARCH='x86_64' \ ;; \ ppc64el) \ NODE_ARCH='ppc64le' \ GO_ARCH='ppc64le' \ + CMAKE_ARCH='' \ ;; \ s390x) \ NODE_ARCH='s390x' \ GO_ARCH='s390x' \ + CMAKE_ARCH='' \ ;; \ arm64) \ NODE_ARCH='arm64' \ GO_ARCH='arm64' \ + CMAKE_ARCH='' \ ;; \ aarch64) \ NODE_ARCH='arm64' \ GO_ARCH='arm64' \ + CMAKE_ARCH='aarch64' \ ;; \ i386) \ NODE_ARCH='x86' \ GO_ARCH='386' \ + CMAKE_ARCH='' \ ;; \ *) echo "unsupported architecture"; exit 1 ;; \ esac \ @@ -221,6 +234,25 @@ RUN set -ex \ https://go.dev/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz -o /tmp/go.tgz \ && tar -C /usr/local -xzf /tmp/go.tgz \ && rm /tmp/go.tgz \ + && curl -fsSLO --compressed "https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION${CMAKE_ARCH:+-linux-$CMAKE_ARCH}.tar.gz" \ + && curl -fsSLO --compressed "https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-SHA-256.txt" \ + && curl -fsSLO --compressed "https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-SHA-256.txt.asc" \ + && gpg --batch --verify cmake-$CMAKE_VERSION-SHA-256.txt.asc cmake-$CMAKE_VERSION-SHA-256.txt \ + && grep " cmake-$CMAKE_VERSION${CMAKE_ARCH:+-linux-$CMAKE_ARCH}.tar.gz\$" cmake-$CMAKE_VERSION-SHA-256.txt | sha256sum -c - \ + && if [ -n "$CMAKE_ARCH" ]; then \ + echo $CMAKE_ARCH; \ + tar -xzf "cmake-$CMAKE_VERSION-linux-$CMAKE_ARCH.tar.gz" -C /usr/local --strip-components=1 --no-same-owner; \ + else \ + mkdir cmake-build; \ + tar -xzf "cmake-$CMAKE_VERSION.tar.gz" -C cmake-build --strip-components=1; \ + cd cmake-build; \ + ./bootstrap --parallel="$(nproc)"; \ + make -j "$(nproc)"; \ + make install; \ + cd ..; \ + rm -rf cmake-build; \ + fi \ + && rm "cmake-$CMAKE_VERSION${CMAKE_ARCH:+-linux-$CMAKE_ARCH}.tar.gz" "cmake-$CMAKE_VERSION-SHA-256.txt" "cmake-$CMAKE_VERSION-SHA-256.txt.asc" \ && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" \ \ @@ -230,7 +262,8 @@ RUN set -ex \ && npm --version \ && yarn --version \ && git --version \ - && tar --version + && tar --version \ + && cmake --version # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/integration/linux/build/linux-x86_64/Dockerfile b/integration/linux/build/linux-x86_64/Dockerfile index 6eec61fa..d72388ca 100644 --- a/integration/linux/build/linux-x86_64/Dockerfile +++ b/integration/linux/build/linux-x86_64/Dockerfile @@ -24,6 +24,7 @@ ENV GO_VERSION 1.21.6 ENV RUST_VERSION 1.76.0 ENV NODE_VERSION 16.16.0 ENV YARN_VERSION 1.22.19 +ENV CMAKE_VERSION 3.30.2 ENV GCC_VERSION 11 # rpm on centos 7 iterates over all fds up to the limit, which is @@ -56,7 +57,7 @@ RUN case "$HOSTTYPE" in \ expat-devel ncurses-devel gdbm-devel readline-devel libuuid-devel \ curl-devel xz-devel libffi-devel gettext \ perl-Getopt-Long perl-IPC-Cmd perl-Data-Dumper \ - sudo ca-certificates zstd cmake + sudo ca-certificates zstd RUN printf "#!/bin/bash\nsource scl_source enable devtoolset-${GCC_VERSION}" \ > /etc/profile.d/enabledevtoolset${GCC_VERSION}.sh @@ -113,6 +114,12 @@ RUN set -ex \ ; do \ gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys "$key" || \ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" ; \ + done \ + && for key in \ + CBA23971357C2E6590D9EFD3EC8FEF3A7BFB4EDA \ + ; do \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \ + gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" ; \ done \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ && rm -rf python.tar.xz.asc \ @@ -179,26 +186,32 @@ RUN set -ex \ x86_64) \ NODE_ARCH='x64' \ GO_ARCH='amd64' \ + CMAKE_ARCH='x86_64' \ ;; \ ppc64el) \ NODE_ARCH='ppc64le' \ GO_ARCH='ppc64le' \ + CMAKE_ARCH='' \ ;; \ s390x) \ NODE_ARCH='s390x' \ GO_ARCH='s390x' \ + CMAKE_ARCH='' \ ;; \ arm64) \ NODE_ARCH='arm64' \ GO_ARCH='arm64' \ + CMAKE_ARCH='' \ ;; \ aarch64) \ NODE_ARCH='arm64' \ GO_ARCH='arm64' \ + CMAKE_ARCH='aarch64' \ ;; \ i386) \ NODE_ARCH='x86' \ GO_ARCH='386' \ + CMAKE_ARCH='' \ ;; \ *) echo "unsupported architecture"; exit 1 ;; \ esac \ @@ -221,6 +234,25 @@ RUN set -ex \ https://go.dev/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz -o /tmp/go.tgz \ && tar -C /usr/local -xzf /tmp/go.tgz \ && rm /tmp/go.tgz \ + && curl -fsSLO --compressed "https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION${CMAKE_ARCH:+-linux-$CMAKE_ARCH}.tar.gz" \ + && curl -fsSLO --compressed "https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-SHA-256.txt" \ + && curl -fsSLO --compressed "https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-SHA-256.txt.asc" \ + && gpg --batch --verify cmake-$CMAKE_VERSION-SHA-256.txt.asc cmake-$CMAKE_VERSION-SHA-256.txt \ + && grep " cmake-$CMAKE_VERSION${CMAKE_ARCH:+-linux-$CMAKE_ARCH}.tar.gz\$" cmake-$CMAKE_VERSION-SHA-256.txt | sha256sum -c - \ + && if [ -n "$CMAKE_ARCH" ]; then \ + echo $CMAKE_ARCH; \ + tar -xzf "cmake-$CMAKE_VERSION-linux-$CMAKE_ARCH.tar.gz" -C /usr/local --strip-components=1 --no-same-owner; \ + else \ + mkdir cmake-build; \ + tar -xzf "cmake-$CMAKE_VERSION.tar.gz" -C cmake-build --strip-components=1; \ + cd cmake-build; \ + ./bootstrap --parallel="$(nproc)"; \ + make -j "$(nproc)"; \ + make install; \ + cd ..; \ + rm -rf cmake-build; \ + fi \ + && rm "cmake-$CMAKE_VERSION${CMAKE_ARCH:+-linux-$CMAKE_ARCH}.tar.gz" "cmake-$CMAKE_VERSION-SHA-256.txt" "cmake-$CMAKE_VERSION-SHA-256.txt.asc" \ && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" \ \ @@ -230,7 +262,8 @@ RUN set -ex \ && npm --version \ && yarn --version \ && git --version \ - && tar --version + && tar --version \ + && cmake --version # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/integration/linux/build/ubuntu-bionic/Dockerfile b/integration/linux/build/ubuntu-bionic/Dockerfile index f705d03f..742475e7 100644 --- a/integration/linux/build/ubuntu-bionic/Dockerfile +++ b/integration/linux/build/ubuntu-bionic/Dockerfile @@ -19,7 +19,6 @@ RUN apt-get update \ flex \ patchelf \ zstd \ - cmake \ && rm -rf /var/lib/apt/lists/* ENV PYTHON_VERSION 3.9.19 @@ -29,6 +28,7 @@ ENV PATH /usr/local/cargo/bin:$PATH ENV RUST_VERSION 1.76.0 ENV NODE_VERSION 16.16.0 ENV YARN_VERSION 1.22.19 +ENV CMAKE_VERSION 3.30.2 RUN set -ex \ \ @@ -65,6 +65,12 @@ RUN set -ex \ ; do \ gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" ; \ + done \ + && for key in \ + CBA23971357C2E6590D9EFD3EC8FEF3A7BFB4EDA \ + ; do \ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \ + gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" ; \ done \ && gpg --batch --verify python.tar.xz.asc python.tar.xz \ && rm -rf python.tar.xz.asc \ @@ -123,6 +129,30 @@ RUN set -ex \ && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \ && ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \ && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ + && case "${dpkgArch##*-}" in \ + amd64) CMAKE_ARCH='x86_64';; \ + arm64) CMAKE_ARCH='aarch64';; \ + *) CMAKE_ARCH='' ;; \ + esac \ + && curl -fsSLO --compressed "https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION${CMAKE_ARCH:+-linux-$CMAKE_ARCH}.tar.gz" \ + && curl -fsSLO --compressed "https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-SHA-256.txt" \ + && curl -fsSLO --compressed "https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-SHA-256.txt.asc" \ + && gpg --batch --verify cmake-$CMAKE_VERSION-SHA-256.txt.asc cmake-$CMAKE_VERSION-SHA-256.txt \ + && grep " cmake-$CMAKE_VERSION${CMAKE_ARCH:+-linux-$CMAKE_ARCH}.tar.gz\$" cmake-$CMAKE_VERSION-SHA-256.txt | sha256sum -c - \ + && if [ -n "$CMAKE_ARCH" ]; then \ + echo $CMAKE_ARCH; \ + tar -xzf "cmake-$CMAKE_VERSION-linux-$CMAKE_ARCH.tar.gz" -C /usr/local --strip-components=1 --no-same-owner; \ + else \ + mkdir cmake-build; \ + tar -xzf "cmake-$CMAKE_VERSION.tar.gz" -C cmake-build --strip-components=1; \ + cd cmake-build; \ + ./bootstrap --parallel="$(nproc)"; \ + make -j "$(nproc)"; \ + make install; \ + cd ..; \ + rm -rf cmake-build; \ + fi \ + && rm "cmake-$CMAKE_VERSION${CMAKE_ARCH:+-linux-$CMAKE_ARCH}.tar.gz" "cmake-$CMAKE_VERSION-SHA-256.txt" "cmake-$CMAKE_VERSION-SHA-256.txt.asc" \ && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" \ \ @@ -130,7 +160,8 @@ RUN set -ex \ && rustc --version \ && node --version \ && npm --version \ - && yarn --version + && yarn --version \ + && cmake --version # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/integration/linux/build/ubuntu-focal/Dockerfile b/integration/linux/build/ubuntu-focal/Dockerfile index 362c441c..86faf93e 100644 --- a/integration/linux/build/ubuntu-focal/Dockerfile +++ b/integration/linux/build/ubuntu-focal/Dockerfile @@ -130,7 +130,8 @@ RUN set -ex \ && rustc --version \ && node --version \ && npm --version \ - && yarn --version + && yarn --version \ + && cmake --version # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/integration/linux/build/ubuntu-hirsute/Dockerfile b/integration/linux/build/ubuntu-hirsute/Dockerfile index 8aa2bc2e..758c710d 100644 --- a/integration/linux/build/ubuntu-hirsute/Dockerfile +++ b/integration/linux/build/ubuntu-hirsute/Dockerfile @@ -130,7 +130,8 @@ RUN set -ex \ && rustc --version \ && node --version \ && npm --version \ - && yarn --version + && yarn --version \ + && cmake --version # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/integration/linux/build/ubuntu-jammy/Dockerfile b/integration/linux/build/ubuntu-jammy/Dockerfile index 1672f72b..e8032f01 100644 --- a/integration/linux/build/ubuntu-jammy/Dockerfile +++ b/integration/linux/build/ubuntu-jammy/Dockerfile @@ -130,7 +130,8 @@ RUN set -ex \ && rustc --version \ && node --version \ && npm --version \ - && yarn --version + && yarn --version \ + && cmake --version # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/integration/linux/build/ubuntu-noble/Dockerfile b/integration/linux/build/ubuntu-noble/Dockerfile index 473ecb97..69cdcd1a 100644 --- a/integration/linux/build/ubuntu-noble/Dockerfile +++ b/integration/linux/build/ubuntu-noble/Dockerfile @@ -130,7 +130,8 @@ RUN set -ex \ && rustc --version \ && node --version \ && npm --version \ - && yarn --version + && yarn --version \ + && cmake --version # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/integration/linux/build/update.sh b/integration/linux/build/update.sh index dd9aa296..24e591fd 100755 --- a/integration/linux/build/update.sh +++ b/integration/linux/build/update.sh @@ -63,6 +63,7 @@ rustVersion="1.76.0" nodeVersion="16.16.0" yarnVersion="1.22.19" goVersion="1.21.6" +cmakeVersion="3.30.2" generated_warning() { cat <<-EOH @@ -148,10 +149,15 @@ fi template="${1}" target="${2}" variant="$(dirname ${target})" +variant="${variant#*-}" { generated_warning; cat "${template}"; } > "${target}" $SED -ri \ + -e '/%%IF VARIANT=.*'"${variant}"'.*%%/,/%%ENDIF%%/ { /%%IF VARIANT=/d; /%%ENDIF%%/d; }' \ + -e '/%%IFNOT VARIANT=.*'"${variant}"'.*%%/,/%%ENDIF%%/d' \ + -e '/%%IF VARIANT=.*%%/,/%%ENDIF%%/d' \ + -e '/%%IFNOT VARIANT=.*%%/,/%%ENDIF%%/ { /%%IFNOT VARIANT=/d; /%%ENDIF%%/d; }' \ -e 's/^(ENV PYTHON_VERSION) .*/\1 '"$fullVersion"'/' \ -e 's/^(ENV PYTHON_RELEASE) .*/\1 '"${fullVersion%%[a-z]*}"'/' \ -e 's/^(ENV PYTHON_PIP_VERSION) .*/\1 '"$pipVersion"'/' \ @@ -159,8 +165,9 @@ $SED -ri \ -e 's/^(ENV NODE_VERSION) .*/\1 '"$nodeVersion"'/' \ -e 's/^(ENV YARN_VERSION) .*/\1 '"$yarnVersion"'/' \ -e 's/^(ENV GO_VERSION) .*/\1 '"$goVersion"'/' \ - -e 's!^(FROM (buildpack-deps)):%%PLACEHOLDER%%!\1:'"${variant#*-}"'!' \ - -e 's!^(FROM (\w+)):%%PLACEHOLDER%%!\1:'"${variant#*-}"'!'\ + -e 's/^(ENV CMAKE_VERSION) .*/\1 '"$cmakeVersion"'/' \ + -e 's!^(FROM (buildpack-deps)):%%PLACEHOLDER%%!\1:'"${variant}"'!' \ + -e 's!^(FROM (\w+)):%%PLACEHOLDER%%!\1:'"${variant}"'!'\ "${target}" # Add GPG keys From 0db0184785d671d45e6f8146bd2cd541aceb0703 Mon Sep 17 00:00:00 2001 From: Fantix King Date: Mon, 12 Aug 2024 16:39:10 -0400 Subject: [PATCH 2/2] Use .gitattributes to hide the generated Dockerfile in diffs --- integration/linux/.gitattributes | 56 ++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 integration/linux/.gitattributes diff --git a/integration/linux/.gitattributes b/integration/linux/.gitattributes new file mode 100644 index 00000000..64d57492 --- /dev/null +++ b/integration/linux/.gitattributes @@ -0,0 +1,56 @@ +build/centos-7/Dockerfile linguist-generated=true +build/centos-8/Dockerfile linguist-generated=true +build/debian-bullseye/Dockerfile linguist-generated=true +build/debian-buster/Dockerfile linguist-generated=true +build/fedora-29/Dockerfile linguist-generated=true +build/linux-aarch64/Dockerfile linguist-generated=true +build/linux-x86_64/Dockerfile linguist-generated=true +build/linuxmusl-aarch64/Dockerfile linguist-generated=true +build/linuxmusl-x86_64/Dockerfile linguist-generated=true +build/ubuntu-bionic/Dockerfile linguist-generated=true +build/ubuntu-focal/Dockerfile linguist-generated=true +build/ubuntu-hirsute/Dockerfile linguist-generated=true +build/ubuntu-jammy/Dockerfile linguist-generated=true +build/debian-bookworm/Dockerfile linguist-generated=true +build/rockylinux-9/Dockerfile linguist-generated=true +build/ubuntu-noble/Dockerfile linguist-generated=true +test/centos-7/Dockerfile linguist-generated=true +test/centos-8/Dockerfile linguist-generated=true +test/debian-bullseye/Dockerfile linguist-generated=true +test/debian-buster/Dockerfile linguist-generated=true +test/linux-aarch64/Dockerfile linguist-generated=true +test/linux-x86_64/Dockerfile linguist-generated=true +test/linuxmusl-aarch64/Dockerfile linguist-generated=true +test/linuxmusl-x86_64/Dockerfile linguist-generated=true +test/ubuntu-bionic/Dockerfile linguist-generated=true +test/ubuntu-focal/Dockerfile linguist-generated=true +test/ubuntu-hirsute/Dockerfile linguist-generated=true +test/ubuntu-jammy/Dockerfile linguist-generated=true +test/debian-bookworm/Dockerfile linguist-generated=true +test/rockylinux-9/Dockerfile linguist-generated=true +test/ubuntu-noble/Dockerfile linguist-generated=true +testpublished/centos-7/Dockerfile linguist-generated=true +testpublished/centos-8/Dockerfile linguist-generated=true +testpublished/debian-bullseye/Dockerfile linguist-generated=true +testpublished/debian-buster/Dockerfile linguist-generated=true +testpublished/linux-aarch64/Dockerfile linguist-generated=true +testpublished/linux-x86_64/Dockerfile linguist-generated=true +testpublished/linuxmusl-aarch64/Dockerfile linguist-generated=true +testpublished/linuxmusl-x86_64/Dockerfile linguist-generated=true +testpublished/ubuntu-bionic/Dockerfile linguist-generated=true +testpublished/ubuntu-focal/Dockerfile linguist-generated=true +testpublished/ubuntu-hirsute/Dockerfile linguist-generated=true +testpublished/ubuntu-jammy/Dockerfile linguist-generated=true +testpublished/debian-bookworm/Dockerfile linguist-generated=true +testpublished/rockylinux-9/Dockerfile linguist-generated=true +testpublished/ubuntu-noble/Dockerfile linguist-generated=true +test-systemd/centos-7/Dockerfile linguist-generated=true +test-systemd/centos-8/Dockerfile linguist-generated=true +test-systemd/debian-bullseye/Dockerfile linguist-generated=true +test-systemd/debian-buster/Dockerfile linguist-generated=true +test-systemd/fedora-29/Dockerfile linguist-generated=true +test-systemd/ubuntu-bionic/Dockerfile linguist-generated=true +test-systemd/ubuntu-focal/Dockerfile linguist-generated=true +test-systemd/debian-bookworm/Dockerfile linguist-generated=true +test-systemd/rockylinux-9/Dockerfile linguist-generated=true +upload/linux-x86_64/Dockerfile linguist-generated=true