-
Notifications
You must be signed in to change notification settings - Fork 710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSRV 1.60: cpu: Use std::arch::is_aarch64_feature_detected on AArch64. #1542
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1542 +/- ##
=======================================
Coverage 92.09% 92.09%
=======================================
Files 132 132
Lines 18869 18834 -35
Branches 196 196
=======================================
- Hits 17377 17346 -31
+ Misses 1455 1452 -3
+ Partials 37 36 -1
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Thanks. It builds fine on FreeBSD aarch64 with rust 1.63.0. There is a warning though:
Tests are passing. |
Thanks! That means the new logic isn't being used, and the reason is that in cpu.rs we have these conditionals:
I updated the PR with a new commit that expands this list. PTAL. |
It builds fine once I added the missing bit in Cargo.toml, tests are also passing:
|
a8e6ae3
to
aa15beb
Compare
aa15beb
to
12ca250
Compare
Our MSRV supports `if` in const expressions. Implement a workaround for Apple targets.
Switch to `std::arch::is_aarch64_feature_detected` on AArch64 to support more operating systems and environments without having to add new OS- specific code. This requires bumping the MSRV for AAarch64 targets to 1.60.0.
12ca250
to
07b68f3
Compare
I rebased this. Now our MSRV is 1.60 so we can move forward with this. |
I did some testing and seem to have mixed results about this PR. Inside of an ARM64 Windows 11 VM (running on a M1 host), the tests passed just fine. Additionally, while generally noisy, the benchmarks didn't seem to show a significant difference between this branch and The benchmark results were about the same on the M1 host, strangely. When I attempted to run the test suite on my M1 host, a large number of them failed:
CI also seems to be seeing the same failure cause, although the result is different. It looks like the new detection code isn't picking up on everything from before on Apple's ARM64 systems. |
Thanks @complexspaces. Because so much was refactored in this module, a non-trivial rebase of this on top of main is needed. I suspect the assertion you are hitting is:
I am not sure we really want that assertion at all, but if we do, it probably belongs here: pub unsafe fn initialize_OPENSSL_armcap_P() {
let detected = detect_features();
+ debug_assert_eq!(detected & ARMCAP_STATIC, ARMCAP_STATIC); |
The reason this PR failed in CI is because CI had a MSRV of 1.60.0 when this was submitted, and there was a bug in 1.60.0 and earlier in the feature detection logic for aarch64-apple-* targets. Were you testing on 1.60.0 and earlier? Other PRs raised the MSRV specifically for this reason and added additional testing in arm.rs. Regardless, I think I need to rebase this on main before we can investigate further. |
I was testing using Rust 1.72.0 on both systems.
Sounds good 👍. I didn't realize at a glance that there was such a large difference between this branch and |
Closing this for now. We've implemented some workarounds for rust-lang/rust issues that we can't implement on top of |
Switch to
std::arch::is_aarch64_feature_detected
on AArch64 to support more operating systems and environments without having to add new OS- specific code. This requires bumping the MSRV for AAarch64 targets to 1.60.0.