Skip to content

macOS/darwin compilation fails due to MIN_STATIC_FEATURES assertions #2527

Description

@zachschuermann

Our github actions macOS job is failing due to failing compile time assertions in ring:

error[E0080]: evaluation of constant value failed
  --> /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 panicked: assertion failed: (CAPS_STATIC & MIN_STATIC_FEATURES) == MIN_STATIC_FEATURES

error[E0080]: evaluation of constant value failed
  --> /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 panicked: assertion failed: CAPS_STATIC == MIN_STATIC_FEATURES

For more information about this error, try `rustc --explain E0080`.
error: could not compile `ring` (lib) due to 2 previous errors

Reference to those assertions just to make investigation easier:

// MSRV: Enforce 1.61.0 onaarch64-apple-*, in particular) prior to. Earlier
// versions of Rust before did not report the AAarch64 CPU features correctly
// for these targets. Cargo.toml specifies `rust-version` but versions before
// Rust 1.56 don't know about it.
#[allow(clippy::assertions_on_constants)]
const _AARCH64_APPLE_TARGETS_EXPECTED_FEATURES: () =
    assert!((CAPS_STATIC & MIN_STATIC_FEATURES) == MIN_STATIC_FEATURES);

// Ensure we don't accidentally allow features statically beyond
// `MIN_STATIC_FEATURES` so that dynamic detection is done uniformly for
// all of these targets.
#[allow(clippy::assertions_on_constants)]
const _AARCH64_APPLE_DARWIN_TARGETS_EXPECTED_FEATURES: () =
    assert!(CAPS_STATIC == MIN_STATIC_FEATURES);

Unfortunately i'm not really aware of the hardware github uses to run these - and was unable to repro locally on my M1 macbook pro. Let me know if there are any more useful details I can provide!

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions