ci(build): restore -C target-cpu=x86-64-v3 on published x86_64 builds
Some checks failed
Rust / build-linux (linux-x86_64, X64, ubuntu-24.04, x86_64-unknown-linux-gnu) (pull_request) Failing after 4s
Rust / build-android (29.0.14206865, ubuntu-24.04, 33) (pull_request) Failing after 3s
Rust-lint / lint-linux (pull_request) Failing after 15s
Rust / build-linux (linux-aarch64, ARM64, ubuntu-24.04-arm, aarch64-unknown-linux-gnu) (pull_request) Has been cancelled
Rust / build-windows (windows-aarch64, woa64, windows-11-arm, aarch64-pc-windows-msvc) (pull_request) Has been cancelled
Rust / build-windows (windows-x86_64, win64, windows-2025, x86_64-pc-windows-msvc) (pull_request) Has been cancelled
Rust / build-macos (macos-aarch64, ARM64, aarch64-apple-darwin) (pull_request) Has been cancelled
Rust / Collect release artifacts (pull_request) Has been cancelled

Issue #20: !17 (#16) made the x86-64-v3 baseline opt-in via RUSTFLAGS but
nothing set it, so release binaries silently fell back to the plain x86-64
baseline. Set RUSTFLAGS per matrix row on the two x86_64 entries only:

- linux  x86_64-unknown-linux-gnu: -C target-cpu=x86-64-v3
- windows x86_64-pc-windows-msvc: -C target-cpu=x86-64-v3
  -C link-arg=/STACK:8388608 (carries the 8 MB stack link-arg that the
  repo config supplies for Windows, because RUSTFLAGS REPLACES config
  rustflags rather than appending)

The aarch64 rows keep the config's link-args untouched (no RUSTFLAGS at
all), and macOS / android jobs plus .cargo/config.toml are unchanged.

Closes #20
This commit is contained in:
Hermes CI 2026-08-25 21:52:44 -05:00
parent 8a46ac58a2
commit f56f42a3e8

View File

@ -67,6 +67,15 @@ jobs:
https://github.com/llvm/llvm-project/releases/download/llvmorg-${{
env.LLVM_VERSION }}/LLVM-${{ env.LLVM_VERSION }}-Linux-${{
matrix.llvm }}.tar.xz
# The published x86_64 release artifact is the only Linux build that may
# use the AVX2/BMI2 baseline (.cargo/config.toml deliberately keeps the
# default build portable after !17; see issue #20). RUSTFLAGS REPLACES
# config rustflags, so set it here — per matrix row — never in the
# config. The aarch64 row must not receive any RUSTFLAGS (an empty
# RUSTFLAGS would also drop its -fuse-ld=lld link-arg).
- name: Set RUSTFLAGS for x86_64 (x86-64-v3)
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
run: echo "RUSTFLAGS=-C target-cpu=x86-64-v3" >> $GITHUB_ENV
- name: Build
run: |
cargo build --profile ${{ env.BUILD_PROFILE }} -v --target=${{ matrix.target }}
@ -115,6 +124,14 @@ jobs:
https://github.com/llvm/llvm-project/releases/download/llvmorg-${{
env.LLVM_VERSION }}/LLVM-${{ env.LLVM_VERSION }}-${{ matrix.llvm
}}.exe
# The published x86_64 Windows artifact must keep the optimised baseline
# (issue #20). RUSTFLAGS REPLACES config rustflags, so carry the 8 MB
# stack link-arg the config supplies for Windows alongside the CPU flag;
# the aarch64 row must not receive any RUSTFLAGS (an empty RUSTFLAGS
# would also drop its /STACK:8388608 link-arg).
- name: Set RUSTFLAGS for x86_64 (x86-64-v3 + 8 MB stack)
if: ${{ matrix.target == 'x86_64-pc-windows-msvc' }}
run: echo "RUSTFLAGS=-C target-cpu=x86-64-v3 -C link-arg=/STACK:8388608" >> $env:GITHUB_ENV
- name: Build
run: |
cargo build --profile ${{ env.BUILD_PROFILE }} -v --target=${{ matrix.target }}