Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt at reproducible builds #6394

Open
wants to merge 9 commits into
base: unstable
Choose a base branch
from
3 changes: 3 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -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"]

Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
Loading