build-release.sh: do make -j inside docker image.
What changed, and why it matters
This change simply speeds up the project's release build scripts by allowing them to compile multiple parts at once (parallel make). It does not fix or introduce any security issue.
No security action needed; this is a benign build-script optimization.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies tools/build-release.sh and tools/repro-build.sh to pass a MAKEPAR variable (defaulting to nproc or 1) to make via the -j flag. This is a build-performance optimization only. There are no code changes to Core Lightning’s runtime, no changes to cryptographic handling, network behavior, or privilege model, and no security-relevant content in the commit message or diff.
Changed components
tools/build-release.shtools/repro-build.shInspect captured patch +10 / −5
diff --git a/tools/build-release.sh b/tools/build-release.sh
index 44a40192..8c1866e5 100755
--- a/tools/build-release.sh
+++ b/tools/build-release.sh
@@ -8,6 +8,7 @@ if [ "$1" = "--inside-docker" ]; then
PLTFM="$3"
PLTFMVER="$4"
ARCH="$5"
+ MAKEPAR="$6"
git config --global --add safe.directory /src/.git
git clone /src /build
cd /build || exit
@@ -15,8 +16,8 @@ if [ "$1" = "--inside-docker" ]; then
uv export --format requirements.txt > /tmp/requirements.txt
uv pip install -r /tmp/requirements.txt
./configure
- uv run make VERSION="$VER"
- uv run make install DESTDIR=/"$VER-$PLTFM-$PLTFMVER-$ARCH" RUST_PROFILE=release
+ uv run make -j"$MAKEPAR" VERSION="$VER"
+ uv run make -j"$MAKEPAR" install DESTDIR=/"$VER-$PLTFM-$PLTFMVER-$ARCH" RUST_PROFILE=release
cd /"$VER-$PLTFM-$PLTFMVER-$ARCH" && tar cvfz /release/clightning-"$VER-$PLTFM-$PLTFMVER-$ARCH".tar.gz -- *
echo "Inside docker: build finished"
exit 0
@@ -97,6 +98,9 @@ if [ -z "$MTIME" ]; then
exit 1
fi
+MAKEPAR=${MAKEPAR:-$(nproc)}
+echo "Parallel: $MAKEPAR"
+
if [ "$VERIFY_RELEASE" = "true" ]; then
if [ -f "SHA256SUMS-$VERSION.asc" ] && [ -f "SHA256SUMS-$VERSION" ]; then
ALL_TARGETS="bin-Ubuntu"
@@ -165,7 +169,7 @@ for target in $TARGETS; do
DOCKERFILE=contrib/docker/Dockerfile.builder.fedora
FEDORA_VERSION=$(grep -oP '^FROM fedora:\K[0-9]+' "$DOCKERFILE")
docker build -f $DOCKERFILE -t $TAG --load .
- docker run --rm=true -v "$(pwd)":/src:ro -v "$RELEASEDIR":/release $TAG /src/tools/build-release.sh --inside-docker "$VERSION" "$platform" "$FEDORA_VERSION" "$ARCH"
+ docker run --rm=true -v "$(pwd)":/src:ro -v "$RELEASEDIR":/release $TAG /src/tools/build-release.sh --inside-docker "$VERSION" "$platform" "$FEDORA_VERSION" "$ARCH" "$MAKEPAR"
docker run --rm=true -w /build $TAG rm -rf /"$VERSION-$platform-$FEDORA_VERSION-$ARCH" /build
echo "Fedora Image Built"
;;
diff --git a/tools/repro-build.sh b/tools/repro-build.sh
index 0d0963da..c7b6e17f 100755
--- a/tools/repro-build.sh
+++ b/tools/repro-build.sh
@@ -56,6 +56,7 @@ fi
ARCH=$(dpkg --print-architecture)
PLATFORM="$OS"-"$VER"
VERSION=${FORCE_VERSION:-$(git describe --tags --always --dirty=-modded --abbrev=7 2>/dev/null || pwd | sed -n 's,.*/clightning-\(v[0-9.rc\-]*\)$,\1,p')}
+MAKEPAR=${MAKEPAR:-1}
# eg. ## [0.6.3] - 2019-01-09: "The Smallblock Conspiracy"
# Skip 'v' here in $VERSION
@@ -160,8 +161,8 @@ $INST $(cut -c66- < /tmp/SHASUMS)
# Once everyone has gcc8, we can use CC="gcc -ffile-prefix-map=$(pwd)=/home/clightning"
./configure --prefix=/usr CC="gcc -fdebug-prefix-map=$(pwd)=/home/clightning"
# libwally wants "python". Seems to work to force it here.
-make PYTHON_VERSION=3 VERSION="$VERSION"
-make install DESTDIR=inst/
+make -j"$MAKEPAR" PYTHON_VERSION=3 VERSION="$VERSION"
+make -j"$MAKEPAR" install DESTDIR=inst/
cd inst && tar --sort=name \
--mtime="$MTIME 00:00Z" \
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.