briansmith / ring

Safe, fast, small crypto using Rust
Other
3.74k stars 704 forks source link

Unable to build with rustc_codegen_cranelift on Apple M1 #2129

Open nsabovic opened 2 months ago

nsabovic commented 2 months ago

Trying to compile a project that depends on ring with Cranelift fails. I didn't see any issue filed about it so I thought there should be a place to track progress.

While they plan on implementing a bunch of std::arch SIMD intrinsics, maybe the correct solution is to check for cranelift and not use them?

Versions:

error[E0080]: evaluation of constant value failed
   --> /Users/nsabovic/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.17.8/src/cpu/arm.rs:352:54
    |
352 |   const _AARCH64_APPLE_TARGETS_EXPECTED_FEATURES: () = assert!(
    |  ______________________________________________________^
353 | |     ((ARMCAP_STATIC & _AARCH64_APPLE_FEATURES) == _AARCH64_APPLE_FEATURES)
354 | |         || !cfg!(all(target_arch = "aarch64", target_vendor = "apple"))
355 | | );
    | |_^ the evaluated program panicked at 'assertion failed: ((ARMCAP_STATIC & _AARCH64_APPLE_FEATURES) == _AARCH64_APPLE_FEATURES) ||
    !cfg!(all(target_arch = "aarch64", target_vendor = "apple"))', /Users/nsabovic/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.17.8/src/cpu/arm.rs:352:54
    |
    = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
briansmith commented 3 weeks ago

Which target features does ring expect that cranelift isn't enabling automatically for these targets?