Skip to content

Add macOS support #94

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 7 commits into from
Feb 13, 2024
Merged

Add macOS support #94

merged 7 commits into from
Feb 13, 2024

Conversation

Ivan-Velickovic
Copy link
Collaborator

@Ivan-Velickovic Ivan-Velickovic commented Jan 27, 2024

It would be sad to force macOS users to have to dual boot or use a Docker container in order to use the Microkit SDK. These patches add macOS support to the Microkit SDK and have received internal use at TS for a while now so I think it's fair to say that the macOS support will be stable.

Couple of things left to do:

  • Update README to mention macOS is supported too
  • Use the same toolchain version across macOS/Linux (ARM only supplies macOS ARM64 toolchains for GCC 12.2 and above so we should make it consistent across environments when building Microkit).
  • I have noticed the ARM GCC toolchains are really slow to download sometimes, causing timeouts in the CI. I've been annoyed by this to the point that I just use my own web server on my fork of Microkit but it's probably not a good idea to do that here. Not sure what to do about this, let's start with using ARM's website for a start and see what happens (ideally we'd have backups of these toolchains etc anyways).

@Ivan-Velickovic Ivan-Velickovic force-pushed the macos_support branch 2 times, most recently from 1021e12 to 2cfe8b0 Compare January 27, 2024 07:03
@Ivan-Velickovic
Copy link
Collaborator Author

Right, well looks like the timeout I mentioned happened on the very first CI run for building the macOS SDK.

@lsf37
Copy link
Member

lsf37 commented Jan 27, 2024

If you're referencing a specific file, then a faster mirror would be fine. It's an additional step when you update the dependency, but you could have a script for that. We could put the file on a foundation's AWS S3 bucket, for instance. Cost would be negligible for CI traffic.

You could also try caching the download with http://github.com/actions/cache, but that first needs a successful download.

The Microkit tool can now be built for x64 macOS as well as ARM64
macOS, allowing the use of the Microkit SDK in macOS environments.

Note that unlike the Linux Microkit tool, the macOS one will be
dynamically linked due to macOS not supporting statically linked
binaries.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
Add the `--tool-target-triple` option to specify which target
to build the tool for. Unfortunately Rust does not allow you to
cross-compile from Linux to macOS, however this will allow x64 macOS
hosts to cross-compile to ARM64 macOS. In theory the reverse would
work as well but I have not tried it.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
The only change necessary to update from GCC 10 to GCC 12 is that
the option `-g3` needs to be `-g` instead.

Why do we have to update to GCC 12? The main motivation is to have
the toolchain available for macOS Apple Silicon hosts that want to
build the Microkit SDK from source. The toolchain for Apple Silicon
hosts is only available from GCC 12 and above.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
@Ivan-Velickovic Ivan-Velickovic force-pushed the macos_support branch 3 times, most recently from 7e2ed03 to d533e5d Compare January 29, 2024 06:54
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
This patch updates the pyoxidizer dependency to the latest current
version. The main motivation for this is that it fixes an issue with
cross-compiling from x86-64 macOS to AArch64 macOS.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
@Ivan-Velickovic Ivan-Velickovic merged commit 52aa6ad into main Feb 13, 2024
@Ivan-Velickovic Ivan-Velickovic deleted the macos_support branch February 13, 2024 09:17
@Ivan-Velickovic
Copy link
Collaborator Author

Getting the toolchains from the AWS bucket seems to be working well. I kept the README links to the ARM website since it probably looks a bit dodgy to newcomers to download some specific toolchain off an AWS bucket. @lsf37 what do you think?

@Ivan-Velickovic Ivan-Velickovic mentioned this pull request Feb 13, 2024
@lsf37
Copy link
Member

lsf37 commented Feb 13, 2024

Getting the toolchains from the AWS bucket seems to be working well. I kept the README links to the ARM website since it probably looks a bit dodgy to newcomers to download some specific toolchain off an AWS bucket. @lsf37 what do you think?

Agreed, that's a good idea. Also reduces traffic to AWS :-)

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