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 \ 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!). 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