From bebc532e0e69950765ecd96f8a71c630624fb394 Mon Sep 17 00:00:00 2001 From: Derek Cofausper <256792747+decofe@users.noreply.github.com> Date: Fri, 27 Feb 2026 02:55:14 -0800 Subject: [PATCH] ci: match release binary RUSTFLAGS with Depot Docker builds (#22640) Co-authored-by: Amp --- .github/workflows/release.yml | 6 +++++- Makefile | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0facb77ed2..3d3309a069 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -73,18 +73,22 @@ jobs: os: ubuntu-24.04 profile: maxperf allow_fail: false + rustflags: "-C target-cpu=x86-64-v3 -C target-feature=+pclmulqdq" - target: aarch64-unknown-linux-gnu os: ubuntu-24.04-arm profile: maxperf allow_fail: false + rustflags: "" - target: x86_64-apple-darwin os: macos-14 profile: maxperf allow_fail: false + rustflags: "-C target-cpu=x86-64-v3 -C target-feature=+pclmulqdq" - target: aarch64-apple-darwin os: macos-14 profile: maxperf allow_fail: false + rustflags: "" build: - command: build binary: reth @@ -110,7 +114,7 @@ jobs: echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV - name: Build Reth - run: make PROFILE=${{ matrix.configs.profile }} ${{ matrix.build.command }}-${{ matrix.configs.target }} + run: make PROFILE=${{ matrix.configs.profile }} EXTRA_RUSTFLAGS="${{ matrix.configs.rustflags }}" ${{ matrix.build.command }}-${{ matrix.configs.target }} - name: Move binary run: | mkdir artifacts diff --git a/Makefile b/Makefile index cc59017b8c..9fec1a2d0c 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,9 @@ FEATURES ?= # Cargo profile for builds. Default is for local builds, CI uses an override. PROFILE ?= release +# Extra RUSTFLAGS to append to build targets (e.g., "-C target-cpu=x86-64-v3") +EXTRA_RUSTFLAGS ?= + # Extra flags for Cargo CARGO_INSTALL_EXTRA_FLAGS ?= @@ -74,7 +77,7 @@ build-debug: ## Build the reth binary into `target/debug` directory. cargo build --bin reth --features "$(FEATURES)" # Builds the reth binary natively. build-native-%: - cargo build --bin reth --target $* --features "$(FEATURES)" --profile "$(PROFILE)" + $(if $(EXTRA_RUSTFLAGS),RUSTFLAGS="$(EXTRA_RUSTFLAGS)") cargo build --bin reth --target $* --features "$(FEATURES)" --profile "$(PROFILE)" # The following commands use `cross` to build a cross-compile. # @@ -96,7 +99,7 @@ build-aarch64-unknown-linux-gnu: export JEMALLOC_SYS_WITH_LG_PAGE=16 # Note: The additional rustc compiler flags are for intrinsics needed by MDBX. # See: https://github.com/cross-rs/cross/wiki/FAQ#undefined-reference-with-build-std build-%: - RUSTFLAGS="-C link-arg=-lgcc -Clink-arg=-static-libgcc" \ + RUSTFLAGS="-C link-arg=-lgcc -Clink-arg=-static-libgcc $(EXTRA_RUSTFLAGS)" \ cross build --bin reth --target $* --features "$(FEATURES)" --profile "$(PROFILE)" # Unfortunately we can't easily use cross to build for Darwin because of licensing issues.