Skip to content

ci: add arm64 macOS to the testing matrix#483

Merged
saghul merged 3 commits intomasterfrom
ci-more-macos
Apr 11, 2024
Merged

ci: add arm64 macOS to the testing matrix#483
saghul merged 3 commits intomasterfrom
ci-more-macos

Conversation

@saghul
Copy link
Copy Markdown
Owner

@saghul saghul commented Apr 11, 2024

No description provided.

@saghul
Copy link
Copy Markdown
Owner Author

saghul commented Apr 11, 2024

@lal12 The sprintf test fails on arm64 macOS. Got any idea why that would be? I can repro locally too.

@lal12
Copy link
Copy Markdown
Contributor

lal12 commented Apr 11, 2024

@lal12 The sprintf test fails on arm64 macOS. Got any idea why that would be? I can repro locally too.

It seems libffi does not officially support arm64-darwin. It seems to be stale WIP (libffi/libffi#621)

There seem to be to options though:

  • there is a fork from apple for libffi which apparently works
  • there are some patches floating around supposedly making it work (no idea how well)

Everything at first glance for now.

@lal12
Copy link
Copy Markdown
Contributor

lal12 commented Apr 11, 2024

Or disabling libffi for this scenario by default in CMAKE.

@lal12
Copy link
Copy Markdown
Contributor

lal12 commented Apr 11, 2024

Just tested with the newest libffi release, now it's a SEGFAULT instead. (https://github.com/lal12/txiki.js/actions/runs/8643918438/job/23697940801)

Hard to debug without a bare metal. Tried scaleway to book one online, but they didn't let me book it.

@saghul
Copy link
Copy Markdown
Owner Author

saghul commented Apr 11, 2024

  • there is a fork from apple for libffi which apparently works

Can we try this?

@saghul
Copy link
Copy Markdown
Owner Author

saghul commented Apr 11, 2024

Added a commit which links with the system provided libffi, but it segfaults 🙃

@lal12
Copy link
Copy Markdown
Contributor

lal12 commented Apr 11, 2024

Added a commit which links with the system provided libffi, but it segfaults 🙃

I fiddled around a bit. My suspicion is that all is fine with libffi, just that sprintf and dirent have different definitions on MacOS for arm. If I comment both test parts out it works fine.

I think moving all tests into our own binary testlib (as one test already is), is more robust (also considering the windows exceptions).

@saghul
Copy link
Copy Markdown
Owner Author

saghul commented Apr 11, 2024

I fiddled around a bit. My suspicion is that all is fine with libffi, just that sprintf and dirent have different definitions on MacOS for arm. If I comment both test parts out it works fine.

I see. THe sprintf part is surprising TBH, but I'm no expert 😅 I'll ignore it on macOS + arm for the time being then.

I think moving all tests into our own binary testlib (as one test already is), is more robust (also considering the windows exceptions).

Ah, the ffi-test-lib.c file. Yeah that makes sense! Feel free to do that change when you've got the time!

@lal12
Copy link
Copy Markdown
Contributor

lal12 commented Apr 11, 2024

I see. THe sprintf part is surprising TBH, but I'm no expert 😅 I'll ignore it on macOS + arm for the time being then.

Yep, you're right. At least sprintf has a wrong call in test-ffi.js. Interesting that it works on any other platform.
But I am gonna move everything to the testlib anyway.

@saghul saghul merged commit b3453ab into master Apr 11, 2024
@saghul saghul deleted the ci-more-macos branch April 11, 2024 12:04
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