From d19a12436925fc7108c99fb40caa51e7f32a2819 Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 6 Jan 2026 14:24:30 -0500 Subject: [PATCH 1/7] Build ccache from source --- docker/debian/Dockerfile | 66 ++++++++++++++++++++++++++-------------- docker/debian/README.md | 6 ++++ docker/rhel/Dockerfile | 66 ++++++++++++++++++++++++++-------------- docker/rhel/README.md | 5 +++ docker/ubuntu/Dockerfile | 57 ++++++++++++++++++++++++++-------- docker/ubuntu/README.md | 8 +++++ 6 files changed, 151 insertions(+), 57 deletions(-) diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index 8ef120a..493cbfb 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -79,27 +79,6 @@ RUN pip install --no-cache \ gcovr==${GCOVR_VERSION} \ cmake==${CMAKE_VERSION} -# Install ccache. Note that the ccache version from the package manager is -# installed for Debian Bullseye, as the latest version requires a newer GLIBC -# version, and older compatible releases are x86-64 only. -ARG CCACHE_VERSION - -RUN < Date: Tue, 6 Jan 2026 15:24:58 -0500 Subject: [PATCH 2/7] Statically link ccache --- docker/debian/Dockerfile | 4 ++-- docker/rhel/Dockerfile | 4 ++-- docker/rhel/README.md | 2 +- docker/ubuntu/Dockerfile | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index 493cbfb..64dd0be 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -182,7 +182,7 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF .. +cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF -D STATIC_LINK=ON .. make make install cd ../.. @@ -297,7 +297,7 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF .. +cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF -D STATIC_LINK=ON .. make make install cd ../.. diff --git a/docker/rhel/Dockerfile b/docker/rhel/Dockerfile index 8221506..775e1f8 100644 --- a/docker/rhel/Dockerfile +++ b/docker/rhel/Dockerfile @@ -194,7 +194,7 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF .. +cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF -D STATIC_LINK=ON .. make make install cd ../.. @@ -292,7 +292,7 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF .. +cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF -D STATIC_LINK=ON .. make make install cd ../.. diff --git a/docker/rhel/README.md b/docker/rhel/README.md index a6a0f9c..f8d4d0b 100644 --- a/docker/rhel/README.md +++ b/docker/rhel/README.md @@ -59,7 +59,7 @@ directory of the repository. ```shell # The version of the distro to use. -RHEL_VERSION=10 +RHEL_VERSION=8 # The versions of the tools to use. CCACHE_VERSION=4.12.2 CMAKE_VERSION=4.1.0 diff --git a/docker/ubuntu/Dockerfile b/docker/ubuntu/Dockerfile index 3947a00..b6d1c3f 100644 --- a/docker/ubuntu/Dockerfile +++ b/docker/ubuntu/Dockerfile @@ -155,7 +155,7 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF .. +cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF -D STATIC_LINK=ON .. make make install cd ../.. @@ -265,7 +265,7 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF .. +cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF -D STATIC_LINK=ON .. make make install cd ../.. From 1808a905921abfd9cf458d576e12f2f60ac0aed6 Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 6 Jan 2026 15:43:29 -0500 Subject: [PATCH 3/7] Use default linker instead of ld.gold --- docker/debian/Dockerfile | 8 ++++++-- docker/rhel/Dockerfile | 8 ++++++-- docker/rhel/README.md | 2 +- docker/ubuntu/Dockerfile | 8 ++++++-- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index 64dd0be..b9f907d 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -182,7 +182,9 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF -D STATIC_LINK=ON .. +cmake -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_LINKER=/usr/bin/ld.bfd \ + -D ENABLE_TESTING=OFF .. make make install cd ../.. @@ -297,7 +299,9 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF -D STATIC_LINK=ON .. +cmake -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_LINKER=/usr/bin/ld.bfd \ + -D ENABLE_TESTING=OFF .. make make install cd ../.. diff --git a/docker/rhel/Dockerfile b/docker/rhel/Dockerfile index 775e1f8..f50350d 100644 --- a/docker/rhel/Dockerfile +++ b/docker/rhel/Dockerfile @@ -194,7 +194,9 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF -D STATIC_LINK=ON .. +cmake -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_LINKER=/usr/bin/ld.bfd \ + -D ENABLE_TESTING=OFF .. make make install cd ../.. @@ -292,7 +294,9 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF -D STATIC_LINK=ON .. +cmake -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_LINKER=/usr/bin/ld.bfd \ + -D ENABLE_TESTING=OFF .. make make install cd ../.. diff --git a/docker/rhel/README.md b/docker/rhel/README.md index f8d4d0b..a6a0f9c 100644 --- a/docker/rhel/README.md +++ b/docker/rhel/README.md @@ -59,7 +59,7 @@ directory of the repository. ```shell # The version of the distro to use. -RHEL_VERSION=8 +RHEL_VERSION=10 # The versions of the tools to use. CCACHE_VERSION=4.12.2 CMAKE_VERSION=4.1.0 diff --git a/docker/ubuntu/Dockerfile b/docker/ubuntu/Dockerfile index b6d1c3f..cbe4523 100644 --- a/docker/ubuntu/Dockerfile +++ b/docker/ubuntu/Dockerfile @@ -155,7 +155,9 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF -D STATIC_LINK=ON .. +cmake -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_LINKER=/usr/bin/ld.bfd \ + -D ENABLE_TESTING=OFF .. make make install cd ../.. @@ -265,7 +267,9 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF -D STATIC_LINK=ON .. +cmake -D CMAKE_BUILD_TYPE=Release \ + -D CMAKE_LINKER=/usr/bin/ld.bfd \ + -D ENABLE_TESTING=OFF .. make make install cd ../.. From 6fc64990c469e4f219bd20998270c3243711e40f Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 6 Jan 2026 16:35:14 -0500 Subject: [PATCH 4/7] Set USE_FASTER_LINKER=OFF on RHEL 8 only --- docker/debian/Dockerfile | 8 ++------ docker/rhel/Dockerfile | 21 ++++++++++++--------- docker/ubuntu/Dockerfile | 8 ++------ 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index b9f907d..10b7bc7 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -182,9 +182,7 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_LINKER=/usr/bin/ld.bfd \ - -D ENABLE_TESTING=OFF .. +cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF make make install cd ../.. @@ -299,9 +297,7 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_LINKER=/usr/bin/ld.bfd \ - -D ENABLE_TESTING=OFF .. +cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF make make install cd ../.. diff --git a/docker/rhel/Dockerfile b/docker/rhel/Dockerfile index f50350d..30bbe26 100644 --- a/docker/rhel/Dockerfile +++ b/docker/rhel/Dockerfile @@ -191,12 +191,14 @@ git clone https://github.com/ccache/ccache cd ccache git checkout v${CCACHE_VERSION} -# Build, install, and clean up. +# Build, install, and clean up. Note that the gold linker on RHEL 8 does not +# support the --dependency-file flag, so we use the regular linker instead. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_LINKER=/usr/bin/ld.bfd \ - -D ENABLE_TESTING=OFF .. +if [[ "${RHEL_VERSION}" -eq "8" ]]; then + LINKER_OPTION='-D USE_FASTER_LINKER=OFF' +fi +cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF ${LINKER_OPTION} .. make make install cd ../.. @@ -291,13 +293,14 @@ git clone https://github.com/ccache/ccache cd ccache git checkout v${CCACHE_VERSION} -# Build, install, and clean up. +# Build, install, and clean up. Note that the gold linker on RHEL 8 does not +# support the --dependency-file flag, so we use the regular linker instead. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_LINKER=/usr/bin/ld.bfd \ - -D ENABLE_TESTING=OFF .. -make +if [[ "${RHEL_VERSION}" -eq "8" ]]; then + LINKER_OPTION='-D USE_FASTER_LINKER=OFF' +fi +cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF ${LINKER_OPTION} .. make install cd ../.. rm -rf ccache diff --git a/docker/ubuntu/Dockerfile b/docker/ubuntu/Dockerfile index cbe4523..7740b88 100644 --- a/docker/ubuntu/Dockerfile +++ b/docker/ubuntu/Dockerfile @@ -155,9 +155,7 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_LINKER=/usr/bin/ld.bfd \ - -D ENABLE_TESTING=OFF .. +cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF make make install cd ../.. @@ -267,9 +265,7 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release \ - -D CMAKE_LINKER=/usr/bin/ld.bfd \ - -D ENABLE_TESTING=OFF .. +cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF make make install cd ../.. From 2143c2dbc2c109bc22c714bfcdf3f4f5c92bf330 Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 6 Jan 2026 16:43:27 -0500 Subject: [PATCH 5/7] Fix cmake directory --- docker/debian/Dockerfile | 4 ++-- docker/ubuntu/Dockerfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index 10b7bc7..493cbfb 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -182,7 +182,7 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF +cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF .. make make install cd ../.. @@ -297,7 +297,7 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF +cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF .. make make install cd ../.. diff --git a/docker/ubuntu/Dockerfile b/docker/ubuntu/Dockerfile index 7740b88..3947a00 100644 --- a/docker/ubuntu/Dockerfile +++ b/docker/ubuntu/Dockerfile @@ -155,7 +155,7 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF +cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF .. make make install cd ../.. @@ -265,7 +265,7 @@ git checkout v${CCACHE_VERSION} # Build, install, and clean up. mkdir build cd build -cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF +cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_TESTING=OFF .. make make install cd ../.. From 326bb1d62e460a06f460b8858deb8494db119df4 Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 6 Jan 2026 18:10:14 -0500 Subject: [PATCH 6/7] Install from release gzip --- docker/debian/Dockerfile | 28 ++++++++++++++-------------- docker/rhel/Dockerfile | 33 ++++++++++++++++----------------- docker/ubuntu/Dockerfile | 28 ++++++++++++++-------------- 3 files changed, 44 insertions(+), 45 deletions(-) diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index 493cbfb..56cf04a 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -174,19 +174,19 @@ EOF ARG CCACHE_VERSION RUN < Date: Tue, 6 Jan 2026 19:22:43 -0500 Subject: [PATCH 7/7] Combine make commands --- docker/debian/Dockerfile | 6 ++---- docker/rhel/Dockerfile | 6 ++---- docker/ubuntu/Dockerfile | 6 ++---- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index 56cf04a..644f6dc 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -183,8 +183,7 @@ cd ccache-${CCACHE_VERSION} mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=OFF .. -make -j -make install +make -j install cd ../.. rm -rf ccache-${CCACHE_VERSION} @@ -298,8 +297,7 @@ cd ccache-${CCACHE_VERSION} mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=OFF .. -make -j -make install +make -j install cd ../.. rm -rf ccache-${CCACHE_VERSION} diff --git a/docker/rhel/Dockerfile b/docker/rhel/Dockerfile index b9f199f..57e2784 100644 --- a/docker/rhel/Dockerfile +++ b/docker/rhel/Dockerfile @@ -198,8 +198,7 @@ if [[ "${RHEL_VERSION}" -eq "8" ]]; then LINKER_OPTION='-D USE_FASTER_LINKER=OFF' fi cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=OFF ${LINKER_OPTION} .. -make -j -make install +make -j install cd ../.. rm -rf ccache-${CCACHE_VERSION} @@ -299,8 +298,7 @@ if [[ "${RHEL_VERSION}" -eq "8" ]]; then LINKER_OPTION='-D USE_FASTER_LINKER=OFF' fi cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=OFF ${LINKER_OPTION} .. -make -j -make install +make -j install cd ../.. rm -rf ccache-${CCACHE_VERSION} diff --git a/docker/ubuntu/Dockerfile b/docker/ubuntu/Dockerfile index cfe1a98..7476246 100644 --- a/docker/ubuntu/Dockerfile +++ b/docker/ubuntu/Dockerfile @@ -156,8 +156,7 @@ cd ccache-${CCACHE_VERSION} mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=OFF .. -make -j -make install +make -j install cd ../.. rm -rf ccache-${CCACHE_VERSION} @@ -266,8 +265,7 @@ cd ccache-${CCACHE_VERSION} mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=OFF .. -make -j -make install +make -j install cd ../.. rm -rf ccache-${CCACHE_VERSION}