From 487f5ee1375a3eb727d8079d1c389da155489916 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Wed, 8 Jul 2026 21:57:06 -0700 Subject: [PATCH 1/3] docker: install pkg-config and target-arch libatomic1 in the builder images Pinning coincurve to a git revision means it builds from source rather than installing a prebuilt wheel, which needs pkg-config for its CMake build. And with no system cmake in the image, scikit-build-core fetches the cmake wheel from PyPI; the arm stages install python3-dev:${target_arch_dpkg}, which swaps in a target-arch python (under qemu), so uv resolves target-arch wheels - and the armv7l/aarch64 cmake wheels need target-arch libatomic.so.1, while only the amd64 libatomic1 was installed. Regular CI installs both via .github/scripts/setup.sh, but the repro Dockerfiles maintain their own package list. --- Dockerfile | 7 +++++-- contrib/reprobuild/Dockerfile.jammy | 1 + contrib/reprobuild/Dockerfile.noble | 1 + contrib/reprobuild/Dockerfile.resolute | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 970537394ff0..8cd2e1974890 100644 --- a/Dockerfile +++ b/Dockerfile @@ -103,18 +103,21 @@ RUN dpkg --add-architecture ${target_arch_dpkg} RUN apt-get update && \ apt-get install -qq -y --no-install-recommends \ python3-dev \ - lowdown + lowdown \ + libatomic1 # Install target-arch libraries RUN apt-get install -qq -y --no-install-recommends \ pkg-config:${target_arch_dpkg} \ + libatomic1:${target_arch_dpkg} \ libffi-dev:${target_arch_dpkg} \ libicu-dev:${target_arch_dpkg} \ zlib1g-dev:${target_arch_dpkg} \ libsqlite3-dev:${target_arch_dpkg} \ libpq-dev:${target_arch_dpkg} \ libsodium-dev:${target_arch_dpkg} \ - crossbuild-essential-${target_arch_dpkg} + crossbuild-essential-${target_arch_dpkg} \ + python3-dev:${target_arch_dpkg} ARG AR=${target_arch}-ar ARG AS=${target_arch}-as diff --git a/contrib/reprobuild/Dockerfile.jammy b/contrib/reprobuild/Dockerfile.jammy index 56959cb81693..6085aaf2aa39 100644 --- a/contrib/reprobuild/Dockerfile.jammy +++ b/contrib/reprobuild/Dockerfile.jammy @@ -25,6 +25,7 @@ RUN apt-get update && \ libsodium-dev \ libtool \ m4 \ + pkg-config \ sudo \ unzip \ wget \ diff --git a/contrib/reprobuild/Dockerfile.noble b/contrib/reprobuild/Dockerfile.noble index 5a2fbade9fca..b7bf3da28e26 100644 --- a/contrib/reprobuild/Dockerfile.noble +++ b/contrib/reprobuild/Dockerfile.noble @@ -28,6 +28,7 @@ RUN apt-get update \ lowdown \ libtool \ m4 \ + pkg-config \ sudo \ unzip \ wget \ diff --git a/contrib/reprobuild/Dockerfile.resolute b/contrib/reprobuild/Dockerfile.resolute index e9b67e15cc51..763d3bf1e2ab 100644 --- a/contrib/reprobuild/Dockerfile.resolute +++ b/contrib/reprobuild/Dockerfile.resolute @@ -28,6 +28,7 @@ RUN apt-get update \ lowdown \ libtool \ m4 \ + pkg-config \ sudo \ unzip \ wget \ From 6e0380356f628845636cfc2863261c87e4966a77 Mon Sep 17 00:00:00 2001 From: daywalker90 Date: Thu, 9 Jul 2026 09:49:03 +0200 Subject: [PATCH 2/3] docs: add `pkg-config` as a dependency Also updated Arch linux instructions to use necessary dependencies, uv and rust Removed python plugin instructions, they can not be generalized and this repo no longer has any python plugins that need extra dependencies in production. Python plugins from the plugins repo have their own documentation. Changelog-None --- .../getting-started/installation.md | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/doc/getting-started/getting-started/installation.md b/doc/getting-started/getting-started/installation.md index 8236c0d147bf..4ce7a92e9d68 100644 --- a/doc/getting-started/getting-started/installation.md +++ b/doc/getting-started/getting-started/installation.md @@ -77,12 +77,12 @@ Get dependencies: sudo apt-get update sudo apt-get install -y \ jq autoconf automake build-essential git libtool libsqlite3-dev libffi-dev \ - python3 python3-pip net-tools zlib1g-dev libsodium-dev gettext lowdown + python3 python3-pip net-tools zlib1g-dev libsodium-dev gettext lowdown pkg-config pip3 install --upgrade pip curl -LsSf https://astral.sh/uv/install.sh | sh ``` -After installing uv, restart your shell or run `source ~/.bashrc` to ensure `uv` is in your PATH. +After installing uv, restart your shell or run the command shown by the install output (usually `source $HOME/.local/bin/env`) to ensure `uv` is in your PATH. If you don't have Bitcoin installed locally you'll need to install that as well. It's now available via [snapd](https://snapcraft.io/bitcoin-core). ```shell @@ -180,7 +180,8 @@ sudo dnf update -y && \ protobuf-compiler \ protobuf-devel \ postgresql-devel \ - python3-mako && \ + python3-mako \ + pkgconf-pkg-config && \ sudo dnf clean all ``` @@ -240,7 +241,7 @@ lightningd --network=testnet OS version: FreeBSD 11.1-RELEASE or above ```shell -pkg install git python py39-pip gmake libtool gmp sqlite3 postgresql13-client gettext autotools lowdown libsodium +pkg install git python py39-pip gmake libtool gmp sqlite3 postgresql13-client gettext autotools lowdown libsodium pkgconf git clone https://github.com/ElementsProject/lightning.git pip install --upgrade pip pip3 install mako @@ -282,7 +283,7 @@ OS version: OpenBSD 7.3 Install dependencies: ```shell -pkg_add git python gmake py3-pip libtool gettext-tools +pkg_add git python gmake py3-pip libtool gettext-tools pkgconf pkg_add automake # (select highest version, automake1.16.2 at time of writing) pkg_add autoconf # (select highest version, autoconf-2.69p2 at time of writing) ``` @@ -495,26 +496,34 @@ gmake install Install dependencies: ```shell -pacman --sync autoconf automake gcc git make python-pip -pip install --user poetry +pacman -Sy autoconf automake gcc git make python-pip which libtool lowdown jq libsodium pkgconf +curl -LsSf https://astral.sh/uv/install.sh | sh ``` +After installing uv, restart your shell or run the command shown by the install output (usually `source $HOME/.local/bin/env`) to ensure `uv` is in your PATH. + Clone Core Lightning: ```shell git clone https://github.com/ElementsProject/lightning.git cd lightning ``` +If you want to build the Rust plugins (cln-grpc, clnrest, cln-bip353 and wss-proxy): +```shell +pacman -Sy cargo rustfmt protobuf +``` + Build Core Lightning: ```shell -python -m poetry install +uv sync --all-extras --all-groups --frozen ./configure -python -m poetry run make +RUST_PROFILE=release uv run make +sudo RUST_PROFILE=release make install ``` Launch Core Lightning: ``` -./lightningd/lightningd +lightningd ``` ## To cross-compile for Android @@ -620,7 +629,7 @@ Get dependencies: ```shell apk update apk add --virtual .build-deps ca-certificates alpine-sdk autoconf automake git libtool \ -sqlite-dev python3 py3-mako net-tools zlib-dev libsodium gettext +sqlite-dev python3 py3-mako net-tools zlib-dev libsodium gettext pkgconf ``` Clone lightning: @@ -647,9 +656,3 @@ Install runtime dependencies: ```shell apk add libgcc libsodium sqlite-libs zlib ``` - -## Python plugins - -Python plugins will be installed with the `poetry install` step mentioned above from development setup. - -Other users will need some Python packages if python plugins are used. Unfortunately there are some Python packages which are not packaged in Ubuntu, and so forced installation will be needed (Flag `--user` is recommended which will install them in user's own .local directory, so at least the risk of breaking Python globally can be avoided!). From 2a108e98956f659ed2394fa8d5d0ab0135129166 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Thu, 9 Jul 2026 12:59:58 -0700 Subject: [PATCH 3/3] build-release: fix VERSION build-arg and add --no-push for the docker target Pass the computed VERSION as a build-arg, mirroring the docker-release workflow. Without it the container's VERSION is set-but-empty, `VERSION ?=` in the Makefile won't overwrite it, the git-describe fallback never runs, and `make install-program` fails with "git is required for generating version information". Also add --no-push, so a release captain can do a full test build without publishing elementsproject/lightningd:$VERSION and :latest (the target always runs `docker buildx build --push`, since multi-arch images cannot be --load'ed into the classic docker store). The build only populates the builder's cache; a subsequent run without the flag pushes from cache quickly. Co-Authored-By: Claude --- tools/build-release.sh | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/tools/build-release.sh b/tools/build-release.sh index 4e67f1df749f..fcdc8dce9f82 100755 --- a/tools/build-release.sh +++ b/tools/build-release.sh @@ -31,6 +31,7 @@ fi FORCE_UNCLEAN=false VERIFY_RELEASE=false WITHOUT_ZIP=false +NO_PUSH=false SUDO= ALL_TARGETS="bin-Fedora bin-Ubuntu docker sign" @@ -63,11 +64,14 @@ while [ $# -gt 0 ]; do --without-zip) WITHOUT_ZIP=true ;; + --no-push) + NO_PUSH=true + ;; --sudo) SUDO=sudo ;; --help) - echo "Usage: [--force-version=] [--force-unclean] [--force-mtime=YYYY-MM-DD] [--verify] [TARGETS]" + echo "Usage: [--force-version=] [--force-unclean] [--force-mtime=YYYY-MM-DD] [--verify] [--no-push] [TARGETS]" echo Known targets: "$ALL_TARGETS" echo "Example: tools/build-release.sh" echo "Example: tools/build-release.sh --force-version=v23.05 --force-unclean --force-mtime=2023-05-01 bin-Fedora bin-Ubuntu sign" @@ -213,9 +217,14 @@ if [ -z "${TARGETS##* docker *}" ] || [ -z "${TARGETS##* docker}" ]; then echo "Building Docker Images" DOCKER_USER="elementsproject" echo "Creating multi-platform images tagged as $VERSION and latest" - # --load does not work with multiarch. Only --push works. - # ERROR: docker exporter does not currently support exporting manifest lists - DOCKER_OPTS="--push --platform linux/amd64,linux/arm64,linux/arm/v7" + if $NO_PUSH; then + # Build without publishing: the result only populates the builder's + # cache, so a later run without --no-push pushes from cache quickly. + DOCKER_OPTS="--platform linux/amd64,linux/arm64,linux/arm/v7" + else + DOCKER_OPTS="--push --platform linux/amd64,linux/arm64,linux/arm/v7" + fi + DOCKER_OPTS="$DOCKER_OPTS --build-arg VERSION=$VERSION" DOCKER_OPTS="$DOCKER_OPTS -t $DOCKER_USER/lightningd:$VERSION" DOCKER_OPTS="$DOCKER_OPTS -t $DOCKER_USER/lightningd:latest" DOCKER_OPTS="$DOCKER_OPTS --cache-to=type=local,dest=/tmp/docker-cache --cache-from=type=local,src=/tmp/docker-cache" @@ -227,7 +236,11 @@ if [ -z "${TARGETS##* docker *}" ] || [ -z "${TARGETS##* docker}" ]; then fi # shellcheck disable=SC2086 $SUDO docker buildx build $DOCKER_OPTS . - echo "Pushed multi-platform images tagged as $VERSION and latest" + if $NO_PUSH; then + echo "Built multi-platform images without pushing (rerun without --no-push to publish)" + else + echo "Pushed multi-platform images tagged as $VERSION and latest" + fi fi if [ -z "${TARGETS##* sign *}" ] || [ -z "${TARGETS##* sign}" ]; then