Closed breezewish closed 5 months ago
Label CI-no-fail-fast
may be needed in order to verify the newly added test case.
Oh, looks like the newly introduced dependency rustflags required rustc 1.74. Ref https://github.com/dtolnay/rustflags/pull/5
As a tool, a high rustc version requirement might be fine, as users can just install latest rustc and then install this tool.
CI is now passed, except for zig-master branch :)
Oh, looks like the newly introduced dependency rustflags required rustc 1.74. Ref dtolnay/rustflags#5
Not a big issue, I'll cut a new release from main before merging this.
Partially resolve https://github.com/rust-cross/cargo-zigbuild/issues/241
in zigbuild command, target-cpu in the RUSTFLAGS (or local Cargo config files) is parsed and appended to the compiler wrapper.
For example,
RUSTFLAGS="-Ctarget-cpu=x86-64-v3"
will cause compiler wrapper to becargo-zigbuild zig cc -- -g -mcpu=x86_64_v3 ...
-Ctarget-features is currently not respected in this PR. However it is parsed well.
Add a test using https://github.com/breezewish/x86-instruction-set-analyzer to check whether desired instruction set presents in the compiled binary. This helps us make sure that RUSTFLAGS are correctly passed.
Note: As we check instruction sets for the entire binary, it is possible that the instruction set (for example AVX2) comes from the Rust part, not the C++ part. I tested manually that, when
RUSTFLAGS="-C target_cpu=x86-64-v4"
is set, the Rust part will not produce AVX2 instructions fortests/target-cpu
. If we discovered AVX2 instruction, it must comes from the C++ part.Here is the instruction check result with
RUSTFLAGS="-C target_cpu=x86-64-v4"
without using this PR: