This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/main by this push:
new 2d89d277b1 ci: build the release mode tests with `-C
target-cpu=native` (#11192)
2d89d277b1 is described below
commit 2d89d277b18717260121de82f2c909be00e3fa25
Author: Andrew Lamb <[email protected]>
AuthorDate: Thu Sep 24 14:22:04 2026 -0400
ci: build the release mode tests with `-C target-cpu=native` (#11192)
# Which issue does this PR close?
- follow up to review discussion on
https://github.com/apache/arrow-rs/pull/10136
# Rationale for this change
The "Test Release Mode" job in `arrow.yml` compiles with the default
`x86_64` target, which only enables SSE2:
```
$ rustc | grep target_feature
target_feature="fxsr"
target_feature="sse"
target_feature="sse2"
```
So any code gated on `cfg(target_feature = ...)`, such as the AVX / AVX2
paths in `arrow-arith/src/aggregate.rs` and
`arrow-array/src/array/union_array.rs`, or the BMI2 `pext` path proposed
in #10136, is never compiled or tested on CI.
# What changes are included in this PR?
Add `-C target-cpu=native` to `RUSTFLAGS` for the `linux-release-test`
job, so we test with every instruction set extension of the runner CPU.
# Are these changes tested?
By CI: this job should now build and run the tests with the target
features enabled.
Example:
https://github.com/apache/arrow-rs/actions/runs/35922205002/job/107388798752?pr=11192
<img width="1160" height="624" alt="Screenshot 2026-09-23 at 5 29 40 PM"
src="https://github.com/user-attachments/assets/dac161bf-a918-4e86-88c3-e3584ecc0cf2"
/>
# Are there any user-facing changes?
No
---------
Co-authored-by: Claude Fable 5.1 <[email protected]>
---
.github/workflows/arrow.yml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/.github/workflows/arrow.yml b/.github/workflows/arrow.yml
index 844a421cc7..e5d11488d6 100644
--- a/.github/workflows/arrow.yml
+++ b/.github/workflows/arrow.yml
@@ -127,6 +127,13 @@ jobs:
submodules: true
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
+ - name: Enable all instruction set extensions of the runner CPU
+ # Compile for the CPU of the runner so that code gated on
+ # `cfg(target_feature = ...)` is built and tested rather than the
+ # portable fallback. The portable fallbacks are tested in debug builds
+ run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-cpu=native" >> $GITHUB_ENV
+ - name: Display runner CPU features
+ run: rustc --print cfg | grep target_feature
# Note only run the low level crates in release mode
# which are the most likely to have overflow tests
- name: Test arrow-buffer