_AARCH64_APPLE_DARWIN_TARGETS_EXPECTED_FEATURES failure - #2872
Conversation
| // default: | ||
| // | ||
| // ``` | ||
| // $ rustc --print cfg --target=aarch64-apple-darwin -Ctarget-cpu=generic | grep -E "neon|aes|sha" |
There was a problem hiding this comment.
We don't intend to support -Ctarget-cpu=generic on apple hardware.
| // the default one (`cyclone`, or `generic` on hosts whose CPU LLVM does not | ||
| // recognize, e.g. virtualized CI runners); see | ||
| // https://github.com/rust-lang/rust/issues/93889. Users also disable target | ||
| // features explicitly. Formerly such a configuration was a hard compile error |
There was a problem hiding this comment.
If users want to do -Ctarget-cpu=native or -Ctarget-cpu=generic or similar, then they should also enable the target features we expect ("aes", etc.). I think we should document this in BUILDING.md and avoid making these code changes.
|
In my mind, target-cpu and feature sets are two completely different beast. Target CPU is a performance choice (esp when we perform benchmarking to see what instructions are crucial, or what sections need hand tuning); Features is a choice of how much code bloat we are ok with pulling in (more important in wasm context, but there's also compile time aspects) I think it will create a lot of confusion if these two aspects are confounded |
This fix is for the error below
I believe the error has been reported before as
#2527
...and I confirm that this happens only when doing native cpu builds. The checks in the current code don't line up
The fix is a "dynamic" test of features. It's a smaller subset than this patch
Included is a related CI-test you can choose to ignore
Error
error[E0080]: evaluation panicked: assertion failed: (CAPS_STATIC & MIN_STATIC_FEATURES) == MIN_STATIC_FEATURES
--> /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ring-0.17.14/src/cpu/arm/darwin.rs:44:5
|
44 | assert!((CAPS_STATIC & MIN_STATIC_FEATURES) == MIN_STATIC_FEATURES);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of
cpu::arm::darwin::_AARCH64_APPLE_TARGETS_EXPECTED_FEATURESfailed hereerror[E0080]: evaluation panicked: assertion failed: CAPS_STATIC == MIN_STATIC_FEATURES
--> /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ring-0.17.14/src/cpu/arm/darwin.rs:51:5
|
51 | assert!(CAPS_STATIC == MIN_STATIC_FEATURES);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of
cpu::arm::darwin::_AARCH64_APPLE_DARWIN_TARGETS_EXPECTED_FEATURESfailed hereFor more information about this error, try
rustc --explain E0080.error: could not compile
ring(lib) due to 2 previous errorswarning: build failed, waiting for other jobs to finish...
Error: Process completed with exit code 101.