diff --git a/.gitignore b/.gitignore index 67217d6097f2..0be658dfaf55 100644 --- a/.gitignore +++ b/.gitignore @@ -84,6 +84,7 @@ plugins/cln-grpc bionic/ focal/ jammy/ +noble/ release/ .vscode/ .cache/ diff --git a/contrib/reprobuild/Dockerfile.focal b/contrib/reprobuild/Dockerfile.focal index 8cc500c934d6..ff9cd4eda4cc 100644 --- a/contrib/reprobuild/Dockerfile.focal +++ b/contrib/reprobuild/Dockerfile.focal @@ -24,8 +24,13 @@ RUN apt-get update \ sudo \ unzip \ wget \ + git \ zip +# Ensure correct ownership +RUN chown root:root /etc/sudoers +RUN chown root:root /usr/lib/sudo/sudoers.so + # Download and install jq from official repository RUN wget -O /usr/local/bin/jq https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64 \ && chmod +x /usr/local/bin/jq diff --git a/contrib/reprobuild/Dockerfile.jammy b/contrib/reprobuild/Dockerfile.jammy index 632799414f16..072a8a748e7b 100644 --- a/contrib/reprobuild/Dockerfile.jammy +++ b/contrib/reprobuild/Dockerfile.jammy @@ -17,7 +17,7 @@ RUN apt-get update \ file \ gettext \ git \ - libsqlite3-dev \ + libsqlite3-dev \ libpq-dev \ libsodium23 \ libtool \ @@ -25,9 +25,14 @@ RUN apt-get update \ sudo \ unzip \ wget \ - jq \ + jq \ zip +# Ensure correct ownership +RUN chown root:root /etc/sudoers +RUN chown root:root /etc/sudo.conf +RUN chown root:root /usr/libexec/sudo/sudoers.so + # Install Python3.10 (more reproducible than relying on python3-setuptools) RUN git clone https://github.com/pyenv/pyenv.git /root/.pyenv && \ apt-get install -y --no-install-recommends \ diff --git a/contrib/reprobuild/Dockerfile.noble b/contrib/reprobuild/Dockerfile.noble new file mode 100644 index 000000000000..5beb7e37af2b --- /dev/null +++ b/contrib/reprobuild/Dockerfile.noble @@ -0,0 +1,74 @@ +FROM ubuntu:noble + +ENV TZ=UTC +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +ENV RUST_PROFILE=release +ENV PATH=/root/.pyenv/shims:/root/.pyenv/bin:/root/.cargo/bin:$PATH +ENV PROTOC_VERSION=22.0 + +RUN sed -i '/updates/d' /etc/apt/sources.list && \ + sed -i '/security/d' /etc/apt/sources.list + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + autoconf \ + build-essential \ + ca-certificates \ + file \ + gettext \ + git \ + curl \ + libsqlite3-dev \ + libpq-dev \ + libsodium23 \ + libtool \ + m4 \ + sudo \ + unzip \ + wget \ + jq \ + zip + +# Configure /repo/.git as 'safe.directory' +RUN git config --global --add safe.directory /repo/.git + +# Install Python3.10 (more reproducible than relying on python3-setuptools) +RUN git clone https://github.com/pyenv/pyenv.git /root/.pyenv && \ + apt-get install -y --no-install-recommends \ + libbz2-dev \ + libffi-dev \ + libreadline-dev \ + libssl-dev \ + zlib1g-dev && \ + pyenv install 3.10.0 && \ + pyenv global 3.10.0 + +RUN wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py && python3 /tmp/get-pip.py \ + && rm /tmp/get-pip.py \ + && pip install poetry + +RUN wget https://sh.rustup.rs -O rustup-install.sh && \ + bash rustup-install.sh --default-toolchain none --quiet -y && \ + rm rustup-install.sh && \ + /root/.cargo/bin/rustup install 1.73 + +# Download protoc manually, it is in the update repos which we +# disabled above, so `apt-get` can't find it anymore. +RUN cd /tmp/ && \ + wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip && \ + unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip && \ + mv bin/protoc /usr/local/bin && \ + rm -rf include bin protoc-${PROTOC_VERSION}-linux-x86_64.zip + +RUN mkdir /build +WORKDIR /build + +# We mount the repo into `/repo` and then we take a snapshot of it +# first by cloning it. This ensures we're not including any +# uncommitted changes in the working directory on the host. Notice +# that we no longer take the zipfile. +CMD git clone /repo . \ + && poetry export -o requirements.txt --without-hashes \ + && pip install -r requirements.txt \ + && tools/repro-build.sh \ + && cp *.xz /repo/release/ diff --git a/doc/getting-started/advanced-setup/repro.md b/doc/getting-started/advanced-setup/repro.md index b8466fb5ad55..396770b99861 100644 --- a/doc/getting-started/advanced-setup/repro.md +++ b/doc/getting-started/advanced-setup/repro.md @@ -44,13 +44,16 @@ The following table lists the codenames of distributions that we currently suppo - Ubuntu 22.04: - Distribution Version: 22.04 - Codename: jammy +- Ubuntu 24.04: + - Distribution Version: 24.04 + - Codename: noble Depending on your host OS release you might not have `debootstrap` manifests for versions newer than your host OS. Due to this we run the `debootstrap` commands in a container of the latest version itself: ```shell -for v in focal jammy; do +for v in focal jammy noble; do echo "Building base image for $v" - sudo docker run --rm -v $(pwd):/build ubuntu:22.04 \ + sudo docker run --rm -v $(pwd):/build ubuntu:$v \ bash -c "apt-get update && apt-get install -y debootstrap && debootstrap $v /build/$v" sudo tar -C $v -c . | sudo docker import - $v done @@ -59,16 +62,16 @@ done Verify that the image corresponds to our expectation and is runnable: ```shell -sudo docker run jammy cat /etc/lsb-release +sudo docker run ubuntu:noble cat /etc/lsb-release ``` -Which should result in the following output for `jammy`: +Which should result in the following output for `noble`: ```shell DISTRIB_ID=Ubuntu -DISTRIB_RELEASE=22.04 -DISTRIB_CODENAME=jammy -DISTRIB_DESCRIPTION="Ubuntu 22.04 LTS" +DISTRIB_RELEASE=24.04 +DISTRIB_CODENAME=noble +DISTRIB_DESCRIPTION="Ubuntu 24.04 LTS" ``` ## Builder image setup @@ -82,6 +85,7 @@ We can then build the builder image by calling `docker build` and passing it the ```shell sudo docker build -t cl-repro-focal - < contrib/reprobuild/Dockerfile.focal sudo docker build -t cl-repro-jammy - < contrib/reprobuild/Dockerfile.jammy +sudo docker build -t cl-repro-noble - < contrib/reprobuild/Dockerfile.noble ``` Since we pass the `Dockerfile` through `stdin` the build command will not create a context, i.e., the current directory is not passed to `docker` and it'll be independent of the currently checked out version. This also means that you will be able to reuse the docker image for future builds, and don't have to repeat this dance every time. Verifying the `Dockerfile` therefore is @@ -97,6 +101,7 @@ We'll need the release directory available for this, so create it now if it does ```bash sudo docker run --rm -v $(pwd):/repo -ti cl-repro-focal sudo docker run --rm -v $(pwd):/repo -ti cl-repro-jammy +sudo docker run --rm -v $(pwd):/repo -ti cl-repro-noble ``` The last few lines of output also contain the `sha256sum` hashes of all artifacts, so if you're just verifying the build those are the lines that are of interest to you: @@ -115,7 +120,7 @@ The release captain is in charge of creating the manifest, whereas contributors ## Script build-release 1: Pull latest code from master -2: Run `tools/build-release.sh bin-Fedora-28-amd64 bin-Ubuntu sign` script. It will create release directory, build bineries for Fedora, build bineries for Ubuntu (Focal & Jammy), sign zip, fedora & ubuntu builds. +2: Run `tools/build-release.sh bin-Fedora-28-amd64 bin-Ubuntu sign` script. It will create release directory, build bineries for Fedora, build bineries for Ubuntu (Focal, Jammy & Noble), sign zip, fedora & ubuntu builds. ## Manual The release captain creates the manifest as follows: @@ -135,7 +140,7 @@ gpg -sb --armor SHA256SUMS 2: Copy above files in the lightning directory. -3: Run `tools/build-release.sh --verify` script. It will build bineries for Ubuntu (Focal & Jammy), verify zip & ubuntu builds while copying Fedora checksums from the release captain's file. +3: Run `tools/build-release.sh --verify` script. It will build bineries for Ubuntu (Focal, Jammy & Noble), verify zip & ubuntu builds while copying Fedora checksums from the release captain's file. 4. Then send the resulting `release/SHA256SUMS.asc` file to the release captain so it can be merged with the other signatures into `SHASUMS.asc`. diff --git a/tools/build-release.sh b/tools/build-release.sh index 0e37d269716e..a9726f9780a3 100755 --- a/tools/build-release.sh +++ b/tools/build-release.sh @@ -154,7 +154,7 @@ for target in $TARGETS; do echo "Fedora Image Built" ;; Ubuntu) - for d in focal jammy; do + for d in focal jammy noble; do # Capitalize the first letter of distro D=$(echo "$d" | awk '{print toupper(substr($0,1,1))substr($0,2)}') echo "Building Ubuntu $D Image" diff --git a/tools/repro-build.sh b/tools/repro-build.sh index daa4b58c494f..87594bf5a820 100755 --- a/tools/repro-build.sh +++ b/tools/repro-build.sh @@ -78,35 +78,6 @@ PKGS='autoconf automake libtool make gcc libsqlite3-dev zlib1g-dev libsodium-dev INST='sudo dpkg -i' case "$PLATFORM" in - Ubuntu-18.04) - cat > /tmp/SHASUMS < /tmp/SHASUMS < /tmp/SHASUMS <