From 7f34cfcf9c0305c043e2332c94729dba7fb47744 Mon Sep 17 00:00:00 2001 From: Guofang Date: Mon, 26 Oct 2026 14:39:51 +0800 Subject: [PATCH] Build log4cplus from source archives instead of git clone Co-Authored-By: Claude Sonnet 5.5 --- AGENTS.md | 2 +- alpine3.24/Dockerfile | 7 +++++-- debian13/Dockerfile | 7 +++++-- fetch-sources.sh | 4 ++++ rocky9/Dockerfile | 7 +++++-- 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 160dfd2..ecf52a0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,7 +9,7 @@ - Add each dependency as a separate, reviewable build step so its source and version remain visible. - Append new dependency build steps after all existing dependency build steps. Do not insert or reorder steps in the existing build sequence, so previously successful build layers remain unchanged. - The DuckDB `ui` extension (`duckdb-ui`) is built in the same step as DuckDB instead of a separate step. It is statically linked into the DuckDB shell and can only be compiled as part of the DuckDB source tree (via `-DDUCKDB_EXTENSION_CONFIGS`), against the matching DuckDB version. Keep its pinned commit in the same `RUN` as DuckDB and update the two together. Because DuckDB is built from a tarball, pass `-DOVERRIDE_GIT_DESCRIBE` with the DuckDB version so the extension selects the correct API. -- The log4cplus build is allowed to fetch its required `ThreadPool` submodule as a shallow repository pinned by `REL_2_0_5` to commit `cc0b6371d3963f7028c2da5fc007733f9f3bf205`. Do not fetch unused log4cplus submodules. +- The log4cplus build also takes its required `ThreadPool` dependency in the same step, as a second source archive extracted into `src/threadpool`. log4cplus `REL_2_0_5` pins `ThreadPool` to commit `cc0b6371d3963f7028c2da5fc007733f9f3bf205`; keep the two in sync and do not fetch unused log4cplus submodules. ## System Development Packages diff --git a/alpine3.24/Dockerfile b/alpine3.24/Dockerfile index 2dbf1c4..10748ea 100644 --- a/alpine3.24/Dockerfile +++ b/alpine3.24/Dockerfile @@ -108,8 +108,11 @@ RUN --mount=type=bind,from=sources,source=protobuf-v3.21.12.tar.gz,target=/tmp/p && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN git clone --branch=REL_2_0_5 --depth=1 https://github.com/log4cplus/log4cplus.git src \ - && git -C src submodule update --init --depth=1 threadpool \ +RUN --mount=type=bind,from=sources,source=log4cplus-REL_2_0_5.tar.gz,target=/tmp/log4cplus.tar.gz \ + --mount=type=bind,from=sources,source=ThreadPool-cc0b6371d3963f7028c2da5fc007733f9f3bf205.tar.gz,target=/tmp/threadpool.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/log4cplus.tar.gz --directory=src --strip-components=1 \ + && tar --extract --gzip --file=/tmp/threadpool.tar.gz --directory=src/threadpool --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ -DBUILD_SHARED_LIBS=OFF \ diff --git a/debian13/Dockerfile b/debian13/Dockerfile index 35db931..a69a918 100644 --- a/debian13/Dockerfile +++ b/debian13/Dockerfile @@ -117,8 +117,11 @@ RUN --mount=type=bind,from=sources,source=protobuf-v3.21.12.tar.gz,target=/tmp/p && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN git clone --branch=REL_2_0_5 --depth=1 https://github.com/log4cplus/log4cplus.git src \ - && git -C src submodule update --init --depth=1 threadpool \ +RUN --mount=type=bind,from=sources,source=log4cplus-REL_2_0_5.tar.gz,target=/tmp/log4cplus.tar.gz \ + --mount=type=bind,from=sources,source=ThreadPool-cc0b6371d3963f7028c2da5fc007733f9f3bf205.tar.gz,target=/tmp/threadpool.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/log4cplus.tar.gz --directory=src --strip-components=1 \ + && tar --extract --gzip --file=/tmp/threadpool.tar.gz --directory=src/threadpool --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu \ diff --git a/fetch-sources.sh b/fetch-sources.sh index 53dbcc8..5c28223 100755 --- a/fetch-sources.sh +++ b/fetch-sources.sh @@ -148,3 +148,7 @@ fetch gitlab-libxml2-v2.15.3.tar.gz \ https://gitlab.gnome.org/GNOME/libxml2/-/archive/v2.15.3/libxml2-v2.15.3.tar.gz fetch makeself-release-2.7.1.tar.gz \ https://wangguofang.net/github.com/megastep/makeself/archive/release-2.7.1.tar.gz +fetch log4cplus-REL_2_0_5.tar.gz \ + https://wangguofang.net/github.com/log4cplus/log4cplus/archive/REL_2_0_5.tar.gz +fetch ThreadPool-cc0b6371d3963f7028c2da5fc007733f9f3bf205.tar.gz \ + https://wangguofang.net/github.com/log4cplus/ThreadPool/archive/cc0b6371d3963f7028c2da5fc007733f9f3bf205.tar.gz diff --git a/rocky9/Dockerfile b/rocky9/Dockerfile index 2e9f3dc..23bbe78 100644 --- a/rocky9/Dockerfile +++ b/rocky9/Dockerfile @@ -128,8 +128,11 @@ RUN --mount=type=bind,from=sources,source=protobuf-v3.21.12.tar.gz,target=/tmp/p && cmake --build build --parallel "$(nproc)" --target install \ && rm -rf build src -RUN git clone --branch=REL_2_0_5 --depth=1 https://github.com/log4cplus/log4cplus.git src \ - && git -C src submodule update --init --depth=1 threadpool \ +RUN --mount=type=bind,from=sources,source=log4cplus-REL_2_0_5.tar.gz,target=/tmp/log4cplus.tar.gz \ + --mount=type=bind,from=sources,source=ThreadPool-cc0b6371d3963f7028c2da5fc007733f9f3bf205.tar.gz,target=/tmp/threadpool.tar.gz \ + mkdir src \ + && tar --extract --gzip --file=/tmp/log4cplus.tar.gz --directory=src --strip-components=1 \ + && tar --extract --gzip --file=/tmp/threadpool.tar.gz --directory=src/threadpool --strip-components=1 \ && cmake -G Ninja -S src -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \