diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index feb5869..8dfa930 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 }}