Skip to content

Commit

Permalink
feat: Add reproducible build profile
Browse files Browse the repository at this point in the history
  • Loading branch information
MoeMahhouk committed Aug 22, 2024
1 parent ed6ee0c commit 176f1de
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,13 @@ inherits = "release"
lto = "fat"
codegen-units = 1

[profile.reproducible]
inherits = "release"
debug = false
panic = "abort"
codegen-units = 1
overflow-checks = true

[workspace.dependencies]
# reth
reth = { path = "bin/reth" }
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ install-op: ## Build and install the op-reth binary under `~/.cargo/bin`.
build: ## Build the reth binary into `target` directory.
cargo build --bin reth --features "$(FEATURES)" --profile "$(PROFILE)"

.PHONY: build-reproducible
build-reproducible: ## Build the reth binary into `target` directory with reproducible builds.
SOURCE_DATE_EPOCH=1724346102 \
CARGO_INCREMENTAL=0 \
LC_ALL=C \
TZ=UTC \
RUSTFLAGS="-C link-arg=-Wl,--build-id=none -C metadata='' --remap-path-prefix $$(pwd)=." \
cargo build --bin reth --features "$(FEATURES)" --profile "reproducible" --locked

.PHONY: build-debug
build-debug: ## Build the reth binary into `target/debug` directory.
cargo build --bin reth --features "$(FEATURES)"
Expand Down

0 comments on commit 176f1de

Please sign in to comment.