Improve macOS packaging
Currently there are a few problems with building, installing, running a release on macOS...
- Given we don't yet have native support for Apple silicon, is there a way to build for the x86_64 architecture on an M3 Mac? For now I'm using the Build Release workflow on GitHub to build the release, but this requires manually editing the config.jam file and re-tarring the release because on the GitHub machine
xcrun --show-sdk-pathreturns a version-specific path, currently pointing to version 14.2 of Xcode. (I set it to/Library/Developer/CommandLineTools/SDKs/MacOSX.sdksince my understanding is that this is more general since installing Xcode will also install the command-line tools. We'll see.) - Untarring the release and running the binaries on macOS Sonoma 14.3.1 results in a security pop-up: "dylan-environment cannot be opened because the developer cannot be verified." This is easy enough to work around, once for each distinct executable. I think we need to sign our binaries.
- Ideally we should be making a real macOS application packaged in a dmg.
Re: the first point, I am currently using this to build on macOS, thanks to help from housel and brucem:
CC=/usr/bin/clang DYLANCOMPILER=/Users/cgay/dylan/opendylan-2024.2pre/bin/dylan-compiler ./configure --prefix=${DYLAN}/opendylan-dev --host=x86_64-darwin CFLAGS="-O2 -arch x86_64"
Update: I'm also adding the --with-gc=/usr/local/lib flag.
How difficult would it be to add support for Apple Silicon?
From Oct 9 Matrix chat:
https://matrix.to/#/!vrixQDmAvsEcTvrdVu:gitter.im/$wFz8NuBuxZ_xRQd3yxSEaFlLZkSrOOKXhZfvtVXwCrc?via=gitter.im&via=matrix.org&via=amber.tel indicates to me that it is fairly straight-forward.
"The main thing is that enables doing a native aarch64-darwin (Apple Silicon) port, which I got fully working (based on Bruce's initial work last year) in only a couple more hours"
and later...
"From preliminary benchmarking, I estimate a speedup of about 35% for going from Rosetta-executed to native"
My guess is that we might be able to have it in the next release, which is planned for this year, but it depends how much time Peter Housel spends watching Ken Burns documentaries and how much he spends on Dylan. :-)
Wow, that would be great to see. I've resisted installing Rosetta on my current Mac.