diff --git a/Cargo.toml b/Cargo.toml index 9b525ff4e4aa..cb101fc3b8b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" } diff --git a/Makefile b/Makefile index 6b43c19e4f42..74c7198bc8ae 100644 --- a/Makefile +++ b/Makefile @@ -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)"