Skip to content

Commit

Permalink
Fix cmake on Ubuntu 18.04 and CentOS 7 (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
fantix authored Aug 12, 2024
1 parent ed10d74 commit abfe8a8
Show file tree
Hide file tree
Showing 15 changed files with 259 additions and 18 deletions.
56 changes: 56 additions & 0 deletions integration/linux/.gitattributes
Original file line number Diff line number Diff line change
@@ -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
42 changes: 41 additions & 1 deletion integration/linux/build/Dockerfile-debian.template
Original file line number Diff line number Diff line change
Expand Up @@ -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%%
Expand All @@ -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 \
\
Expand All @@ -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 \
Expand Down Expand Up @@ -105,14 +118,41 @@ 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" \
\
&& python3 --version \
&& 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 \
Expand Down
37 changes: 35 additions & 2 deletions integration/linux/build/Dockerfile-linux.template
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand All @@ -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" \
\
Expand All @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions integration/linux/build/_keys/cmake.keys
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CBA23971357C2E6590D9EFD3EC8FEF3A7BFB4EDA
3 changes: 2 additions & 1 deletion integration/linux/build/debian-bookworm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion integration/linux/build/debian-bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion integration/linux/build/debian-buster/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 35 additions & 2 deletions integration/linux/build/linux-aarch64/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit abfe8a8

Please sign in to comment.