diff --git a/Cross.toml b/Cross.toml index 871391253d3..809a24839a2 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,3 +1,6 @@ +[build.env] +passthrough = ["SOURCE_DATE_EPOCH=1"] + [target.x86_64-unknown-linux-gnu] pre-build = ["apt-get install -y cmake clang-5.0"] diff --git a/Makefile b/Makefile index fd7d45f26a0..bb0c23a8a59 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,14 @@ install: --profile "$(PROFILE)" \ $(CARGO_INSTALL_EXTRA_FLAGS) +# Builds Lighthouse in a reproducible way such that two binaries for the same commit on the same +# architecture are bit-identical. We remap the source directory to `/project/` as that is what +# the Cross builds use. +reproducible: + env SOURCE_DATE_EPOCH="1" RUSTFLAGS="--remap-path-prefix=$(CURDIR)=/project" cargo build --bin lighthouse --locked \ + --features "$(FEATURES)" \ + --profile "$(PROFILE)" + # Builds the lcli binary in release (optimized). install-lcli: cargo install --path lcli --force --locked \