-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[NativeAOT] Compile Error on M1 Mac - Missing OSX-ARM64 Runtime Package #71622
Comments
We are focused on Windows/Linux, x64/arm64 for .NET 7. Enabling OSX arm64 is tracked by #64337.
The workaround is to build x64 on OSX m1 is:
|
Let's use this issue to track a fixing this. |
Excellent!! Thank you so much. I'll get all this going today and report back. |
So I think I have it working! Switch the terminal to x64 "mode":
Outputs Then executing the compile:
Seems to have completed! I'm subsequently using dotnet-bundle to package up into a ".app" package so I need to confirm all that is working (it launches fine!) and using the expected AOT compiled bits rather than just the output of the initial build. Thanks again for all your help with this. It's really appreciated. |
My primary goal for using NativeAOT was leaning towards protection through the lack of IL code. Size wasn't really so much of an issue. Startup improvements etc would be nice-to-haves. The problem is that now my circa.100Mb application has ballooned into a 1.4Gb behemoth, start up time isn't great either. I was expecting a larger executable but 1.4Gb is a bit unruly. On Windows I'm ending up with a c.300mb exe. I've clearly still got some work to do or have explicitly included too much in my rd.xml file. I must admit that I have pieced together my rd file from many sources and trial and error. I'm wondering if things like this are to blame?
What would be the advice in such a situation? |
Yes, pinning all types in large assemblies is going to bloat your AOT binary. Another common source of code bloat are generics heavy libraries like #71333. |
Yeah, it took a long time for me to nail AOT for generics, particularly EFCore. Gonna go review my rd now I have a working baseline. |
I've just started testing my AOT build process on mac and immediately crashed into this error:
Problem is, I cannot find this package or refereneces to it anywhere. Seems like the only permutation I can't find. But there is some talk of it being worked on.
Is there any workaround until it's available? Like forcing it to do an Intel build?
The runtime switch I'm currently using is
--runtime osx-x64
but it's building on an M1 Mac Mini so it seems to be trying to do an ARM64 build ... ?!According to the docs here:
https://github.com/dotnet/runtimelab/blob/feature/NativeAOT/docs/using-nativeaot/compiling.md
You can compile ARM64 on a x64 processor and vice versa for Windows and Linux but it doesn't really mention OSX. Can you do OSX x64 on an M1 mac or am I going to have to source a mac with an intel chip? :/
The text was updated successfully, but these errors were encountered: