From faeaa1b8e1d444b0ab3fff441014a0255dc49873 Mon Sep 17 00:00:00 2001 From: Se7enZ Date: Fri, 4 Oct 2024 13:05:25 +0200 Subject: [PATCH 1/4] make: Add a phony `version` target to output version string. --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f835842c99ee..80b61324dc24 100644 --- a/Makefile +++ b/Makefile @@ -899,8 +899,11 @@ installcheck: all-programs fi @rm -rf testinstall || true +version: + @echo ${VERSION} + .PHONY: installdirs install-program install-data install uninstall \ - installcheck ncc bin-tarball show-flags + installcheck ncc bin-tarball show-flags version # Make a tarball of opt/clightning/, optionally with label for distribution. ifneq ($(VERSION),) From d5e4542252a56e27732ec7c564a654163ba5dacc Mon Sep 17 00:00:00 2001 From: Se7enZ Date: Tue, 3 Sep 2024 13:27:46 +0200 Subject: [PATCH 2/4] build: Nightly repro build for Ubuntu Noble. --- .github/workflows/repro.yml | 69 +++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/repro.yml diff --git a/.github/workflows/repro.yml b/.github/workflows/repro.yml new file mode 100644 index 000000000000..8e22708ef2f3 --- /dev/null +++ b/.github/workflows/repro.yml @@ -0,0 +1,69 @@ +--- +# https://docs.corelightning.org/docs/repro +name: Repro Build Nightly +on: + # 05:00 Berlin, 03:00 UTC, 23:00 New York, 20:00 Los Angeles + schedule: + - cron: "0 3 * * *" +jobs: + ubuntu-noble: + name: Ubuntu Noble Repro build + runs-on: ubuntu-22.04 + steps: + - name: Git checkout + uses: actions/checkout@v4 + + - name: Build environment setup + run: | + echo "Building base image for noble" + docker run --rm -v $(pwd):/build ubuntu:noble bash -c "apt-get update && apt-get install -y debootstrap && debootstrap noble /build/noble" + tar -C noble -c . | docker import - noble + + - name: Builder image setup + run: docker build -t cl-repro-noble - < contrib/reprobuild/Dockerfile.noble + + - name: Create release directory + run: mkdir $GITHUB_WORKSPACE/release + + - name: Build using the builder image, storing version and Git state + run: | + # Perform the repro build. + docker run --name cl-build -v $GITHUB_WORKSPACE:/repo -e FORCE_MTIME=$(date +%F) -t cl-repro-noble + + # Commit the image in order to inspect the build later. + docker commit cl-build cl-release + + # Inspect the version. + docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-release bash -c "make version > /repo/release/version.txt" + + # Inspect the Git tree state. + docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-release bash -c "\ + git --no-pager status > /repo/release/git.log && \ + git --no-pager diff >> /repo/release/git.log" + + # Change permissions on the release files for access by build environment. + docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-repro-noble chmod -R 777 /repo/release + + - name: Assert clean version and release + run: | + echo 'Version:' + cat release/version.txt + echo -e + + releasefile=$(ls release/clightning-*) + echo 'Release file:' + ls -al release/clightning-* + echo -e + + if [ -n "$(cat release/version.txt | sed -n '/-modded/p')" ] || \ + [ -n "$(echo $releasefile | sed -n '/-modded/p')" ] + then + echo "Git Status and Diff:" + cat release/git.log + echo -e + + echo 'Error: release modded / dirty tree.' + exit 1 + else + echo 'Success! Clean release.' + fi From 7ed7e098889d6cfdac655504a9eaa22b65a8f34a Mon Sep 17 00:00:00 2001 From: Se7enZ Date: Tue, 17 Sep 2024 13:42:34 +0200 Subject: [PATCH 3/4] build: Repro build matrix strategy for focal, jammy and noble. ([#7117]) Changelog-None --- .github/workflows/repro.yml | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/repro.yml b/.github/workflows/repro.yml index 8e22708ef2f3..2888e01831c8 100644 --- a/.github/workflows/repro.yml +++ b/.github/workflows/repro.yml @@ -6,29 +6,36 @@ on: schedule: - cron: "0 3 * * *" jobs: - ubuntu-noble: - name: Ubuntu Noble Repro build + ubuntu: + name: "Ubuntu repro build: ${{ matrix.version }}" runs-on: ubuntu-22.04 + strategy: + fail-fast: false # Let each build finish. + matrix: + version: ['focal', 'jammy', 'noble'] steps: - name: Git checkout uses: actions/checkout@v4 - name: Build environment setup run: | - echo "Building base image for noble" - docker run --rm -v $(pwd):/build ubuntu:noble bash -c "apt-get update && apt-get install -y debootstrap && debootstrap noble /build/noble" - tar -C noble -c . | docker import - noble + echo "Building base image for ${{ matrix.version }}" + sudo docker run --rm -v $(pwd):/build ubuntu:${{ matrix.version }} bash -c "\ + apt-get update && \ + apt-get install -y debootstrap && \ + debootstrap ${{ matrix.version }} /build/${{ matrix.version }}" + sudo tar -C ${{ matrix.version }} -c . | docker import - ${{ matrix.version }} - name: Builder image setup - run: docker build -t cl-repro-noble - < contrib/reprobuild/Dockerfile.noble + run: docker build -t cl-repro-${{ matrix.version }} - < contrib/reprobuild/Dockerfile.${{ matrix.version }} - - name: Create release directory - run: mkdir $GITHUB_WORKSPACE/release - - - name: Build using the builder image, storing version and Git state + - name: Build using the builder image and store Git state run: | + # Create release directory. + mkdir $GITHUB_WORKSPACE/release + # Perform the repro build. - docker run --name cl-build -v $GITHUB_WORKSPACE:/repo -e FORCE_MTIME=$(date +%F) -t cl-repro-noble + docker run --name cl-build -v $GITHUB_WORKSPACE:/repo -e FORCE_MTIME=$(date +%F) -t cl-repro-${{ matrix.version }} # Commit the image in order to inspect the build later. docker commit cl-build cl-release @@ -41,8 +48,8 @@ jobs: git --no-pager status > /repo/release/git.log && \ git --no-pager diff >> /repo/release/git.log" - # Change permissions on the release files for access by build environment. - docker run --rm -v $GITHUB_WORKSPACE:/repo -t cl-repro-noble chmod -R 777 /repo/release + # Change permissions on the release files for access by the runner environment. + sudo chown -R runner $GITHUB_WORKSPACE/release - name: Assert clean version and release run: | From c7f89c39bf453d84c3dd60e96473dfa0574a6182 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Fri, 11 Oct 2024 17:33:17 -0700 Subject: [PATCH 4/4] repro: focal modded fix - Locked grpcio-tools version to fix dirty tree issue. Ref: https://github.com/ElementsProject/lightning/pull/7376#issuecomment-2161102381 - Updated python version to 3.10 for future proofing - Added manual dispatch for github action --- .github/workflows/repro.yml | 2 ++ contrib/reprobuild/Dockerfile.focal | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/repro.yml b/.github/workflows/repro.yml index 2888e01831c8..f21dbcb6cf20 100644 --- a/.github/workflows/repro.yml +++ b/.github/workflows/repro.yml @@ -5,6 +5,8 @@ on: # 05:00 Berlin, 03:00 UTC, 23:00 New York, 20:00 Los Angeles schedule: - cron: "0 3 * * *" + workflow_dispatch: + jobs: ubuntu: name: "Ubuntu repro build: ${{ matrix.version }}" diff --git a/contrib/reprobuild/Dockerfile.focal b/contrib/reprobuild/Dockerfile.focal index ea0d85516a90..5e951a88a726 100644 --- a/contrib/reprobuild/Dockerfile.focal +++ b/contrib/reprobuild/Dockerfile.focal @@ -44,12 +44,12 @@ RUN git clone https://github.com/pyenv/pyenv.git /root/.pyenv && \ libsqlite3-dev \ libssl-dev \ zlib1g-dev && \ - pyenv install 3.8.0 && \ - pyenv global 3.8.0 + 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 mako grpcio-tools + && pip install poetry mako grpcio-tools==1.62.2 RUN wget https://sh.rustup.rs -O rustup-install.sh && \ bash rustup-install.sh --default-toolchain none --quiet -y && \