@@ -132,7 +132,8 @@ jobs:
132132 set -euo pipefail
133133 cp .cargo/config-portable.toml .cargo/config.toml
134134 shell : " bash"
135- - name : " Verify runner CPU + AVX2 visibility"
135+ - name : " Verify runner AVX2 visibility (x86_64 only)"
136+ if : " contains(join(matrix.targets, ','), 'x86_64-')"
136137 run : |
137138 set -euo pipefail
138139 uname -m
@@ -141,15 +142,27 @@ jobs:
141142 lscpu | grep -qi avx2
142143 else
143144 sysctl -n machdep.cpu.brand_string || true
144- sysctl -n machdep.cpu.features | grep -q AVX2
145+ (sysctl -n machdep.cpu.features 2>/dev/null; sysctl -n machdep.cpu.leaf7_features 2>/dev/null) \
146+ | tr ' ' '\n' | grep -q AVX2
145147 fi
146148 shell : " bash"
147- - name : " Force AVX2 for x86_64"
149+ - name : " Force AVX2 for x86_64 targets"
150+ if : " contains(join(matrix.targets, ','), 'x86_64-')"
148151 run : |
149152 set -euo pipefail
150153 echo 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS=-C target-cpu=x86-64-v3 -C target-feature=+avx2' >> "$GITHUB_ENV"
151154 echo 'CARGO_TARGET_X86_64_APPLE_DARWIN_RUSTFLAGS=-C target-cpu=x86-64-v3 -C target-feature=+avx2' >> "$GITHUB_ENV"
152155 shell : " bash"
156+ - name : " Confirm rustc sees AVX2 cfg (x86_64 only)"
157+ if : " contains(join(matrix.targets, ','), 'x86_64-')"
158+ run : |
159+ set -euo pipefail
160+ if [[ "$RUNNER_OS" == "Linux" ]]; then
161+ rustc --print cfg --target x86_64-unknown-linux-gnu | grep 'target_feature="avx2"'
162+ else
163+ rustc --print cfg --target x86_64-apple-darwin | grep 'target_feature="avx2"'
164+ fi
165+ shell : " bash"
153166 - name : Install dist
154167 run : ${{ matrix.install_dist.run }}
155168 # Get the dist-manifest
0 commit comments