Skip to content

ci: test on aarch64 macOS #1280

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

Merged
merged 8 commits into from
Jul 24, 2025
Merged

ci: test on aarch64 macOS #1280

merged 8 commits into from
Jul 24, 2025

Conversation

kkysen
Copy link
Contributor

@kkysen kkysen commented Jul 14, 2025

This starts testing in CI on aarch64 macOS, our first aarch64 target to test.

Varargs are broken on aarch64 (#1281), so this PR also disables varargs tests on aarch64.

However, doing this didn't work with the current test_translator.py, which textually searches the Rust test file for fn test_*s. #[cfg(not(target_arch = "aarch64"))] is the simplest and most straightforward way to disable such tests on aarch64, but parsing this from Python and generating a test runner in main.rs that's platform-dependent is tricky. Since Rust's built-in test runner already does much of this, and does it better, I switched test_translator.py to simply run cargo test. This means marking all of the test functions with #[test] and generating a mostly empty lib.rs instead of a main.rs. We also lose the ability to distinguish between expected failures and successes, as cargo test treats them the same, but I think this is fine. It also means we can use the idiomatic #[should_panic] instead of parsing the non-standard // xfail ourselves.

I can also break this part out into a separate PR if you think that'd be helpful.

@kkysen kkysen force-pushed the kkysen/ci-arm64-macos branch from 07e8fa9 to a0ec606 Compare July 14, 2025 09:11
@kkysen kkysen mentioned this pull request Jul 14, 2025
Base automatically changed from kkysen/github-actions-macos to master July 14, 2025 15:49
@kkysen kkysen changed the title ci: run CI on arm64 macOS ci: test on arm64 macOS Jul 15, 2025
@kkysen kkysen changed the base branch from master to kkysen/ci-arch-names July 15, 2025 03:55
@kkysen kkysen force-pushed the kkysen/ci-arm64-macos branch from a0ec606 to a780d51 Compare July 15, 2025 03:55
@kkysen kkysen changed the title ci: test on arm64 macOS ci: test on aarch64 macOS Jul 15, 2025
Base automatically changed from kkysen/ci-arch-names to master July 15, 2025 17:56
@kkysen kkysen force-pushed the kkysen/ci-arm64-macos branch 3 times, most recently from 55afd62 to 3d0c6a4 Compare July 21, 2025 10:28
@kkysen kkysen force-pushed the kkysen/ci-arm64-macos branch from 3bf57ec to 2dc2cb7 Compare July 21, 2025 11:38
@kkysen kkysen changed the base branch from master to kkysen/fix-platform-snapshots July 21, 2025 11:48
@kkysen kkysen requested a review from fw-immunant July 21, 2025 11:48
Copy link
Contributor

@fw-immunant fw-immunant left a comment

Choose a reason for hiding this comment

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

A couple questions inline; when addressed this is good to merge.

kkysen added 8 commits July 23, 2025 12:34
This way, things like `#[cfg]` and `#[should_panic]` work.
This seems simpler than trying to parse the `#[cfg]`s from Python
and keeping the old way.
This generates a much simpler `lib.rs` instead of a `main.rs`
that tries to be its own simple test runner.

Rust's test runner doesn't distinguish between expected and unexpected failures
(it should counts an expected failure as a success),
so we lose this output information, but an expected failure really is a success so this should be fine.
@kkysen kkysen force-pushed the kkysen/fix-platform-snapshots branch from 008e5d8 to d03ceb5 Compare July 23, 2025 19:34
@kkysen kkysen force-pushed the kkysen/ci-arm64-macos branch from 2dc2cb7 to 4f6f8c7 Compare July 23, 2025 19:34
Base automatically changed from kkysen/fix-platform-snapshots to master July 24, 2025 18:14
@kkysen kkysen merged commit d104bbd into master Jul 24, 2025
4 checks passed
@kkysen kkysen deleted the kkysen/ci-arm64-macos branch July 24, 2025 18:14
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.

Run CI on arm64 macOS
2 participants