Skip to content

_AARCH64_APPLE_DARWIN_TARGETS_EXPECTED_FEATURES failure - #2872

Open
mahogny wants to merge 2 commits into
briansmith:mainfrom
mahogny:ci/target-cpu-regression
Open

_AARCH64_APPLE_DARWIN_TARGETS_EXPECTED_FEATURES failure#2872
mahogny wants to merge 2 commits into
briansmith:mainfrom
mahogny:ci/target-cpu-regression

Conversation

@mahogny

@mahogny mahogny commented Aug 1, 2026

Copy link
Copy Markdown

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_FEATURES failed here

error[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_FEATURES failed here

For more information about this error, try rustc --explain E0080.
error: could not compile ring (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
Error: Process completed with exit code 101.

Comment thread src/cpu/aarch64/darwin.rs
// default:
//
// ```
// $ rustc --print cfg --target=aarch64-apple-darwin -Ctarget-cpu=generic | grep -E "neon|aes|sha"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't intend to support -Ctarget-cpu=generic on apple hardware.

Comment thread src/cpu/aarch64/darwin.rs
// 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

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants