Skip to content

Commit 490fb0f

Browse files
ShahanaFarooquirustyrussell
authored andcommitted
contrib: Added fixed SOURCE_DATE_EPOCH flag for reproducible ubuntu builds
clnrest's `utoipa-swagger-ui` library has an indirect `rust-embed` dependency which by default includes timestamps in build. It results in non-deterministic build for clnrest. Using environment variable `SOURCE_DATE_EPOCH` with fixed value will enforce a consistent timestamp for builds. Also adding the `--locked` flag to ensure the release build uses exact dependencies from Cargo.lock. The `--locked` flag is particularly important for deterministic builds as it prevents Cargo from updating the lockfile. Fixes #8288. Changelog-Fixed: Core lightning builds for Ubuntu Focal, Jammy and Noble are deterministic again.
1 parent 6f4cfed commit 490fb0f

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ endif
346346

347347
RUST_PROFILE ?= debug
348348
ifneq ($(RUST_PROFILE),debug)
349-
CARGO_OPTS := --profile=$(RUST_PROFILE) --quiet
349+
CARGO_OPTS := --profile=$(RUST_PROFILE) --locked --quiet
350350
else
351351
CARGO_OPTS := --quiet
352352
endif

contrib/reprobuild/Dockerfile.focal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ FROM focal
22

33
ENV TZ=UTC
44
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
5+
ENV SOURCE_DATE_EPOCH=1672531200
56
ENV RUST_PROFILE=release
67
ENV PATH=/root/.pyenv/shims:/root/.pyenv/bin:/root/.cargo/bin:/root/.local/bin:$PATH
78
ENV PROTOC_VERSION=29.4

contrib/reprobuild/Dockerfile.jammy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ FROM jammy
22

33
ENV TZ=UTC
44
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
5+
ENV SOURCE_DATE_EPOCH=1672531200
56
ENV RUST_PROFILE=release
67
ENV PATH=/root/.pyenv/shims:/root/.pyenv/bin:/root/.cargo/bin:/root/.local/bin:$PATH
78
ENV PROTOC_VERSION=29.4

contrib/reprobuild/Dockerfile.noble

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ FROM ubuntu:noble
22

33
ENV TZ=UTC
44
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
5+
ENV SOURCE_DATE_EPOCH=1672531200
56
ENV RUST_PROFILE=release
67
ENV PATH=/root/.pyenv/shims:/root/.pyenv/bin:/root/.cargo/bin:/root/.local/bin:$PATH
78
ENV PROTOC_VERSION=29.4

0 commit comments

Comments
 (0)