-
Notifications
You must be signed in to change notification settings - Fork 132
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 support in source-build #2885
Comments
[Triage] one suggestion is to try an run it today w/the prebuilt to see how much is functional and what is broken. |
Is NativeAOT a feature that gets delivered from the SDK, or does it ship out-of-band from nuget.org? I've downloaded preview 7, and for NativeAOT I need a to add a reference to If this ships out-of-band we can skip compiling it on source-build .NET. cc @omajid |
@jkotas can you answer my questions above? |
If you specify It is same scheme as what's used for publishing self-contained apps (SDK adds
Adding Just like with the crossgen2 package, you can manually add the native aot package reference and it will override the one added by the SDK. The explicit package reference should be only used as last resort (e.g. to workaround bugs in the runtime). It tends to produce version mismatches when people upgrade to new runtime, but forget to bump the aot package version. The manual package overriding is broken in preview 7. It should be fixed in rc builds.
It is not required to build .NET itself. We use nativeaot to optimize crossgen2 where possible, but this optimization is disabled for source build currently: https://github.com/dotnet/runtime/blob/main/src/coreclr/tools/aot/crossgen2/crossgen2.csproj#L9 |
@jkotas thanks. I think this means we have no need to build NativeAOT support for source-build in .NET 7.
Source-build doesn't need to build the end-user NativeAOT support. Like self-contained apps in .NET 6, the SDK uses packages published by Microsoft on nuget.org. I do think these should become features of source-built .NET (#1215). That's not for .NET 7.
When we build .NET from source, we still need And
This applies NativeAOT to crossgen2 application itself. We don't ship it. This optimization doesn't improve the resulting runtime assemblies after R2R compilation (I assume). |
I agree.
Correct. |
@jkotas, Microsoft's .NET 7 preview 7 includes Does that mean it doesn't get downloaded from nuget, and we should build it from source? |
I have discovered that just a few days ago as well. Related problem is that we are bundling more stuff into the SDK than what should be required (dotnet/runtime#75468 is opened on that). We either need to figure out how to remove the binaries from what we are bundling into SDK and/or we need to start building the package as part of the source build. @LakshanF Could you please look into this? |
From my point of view, it would make sense to source-build the I agree that we should eventually move the targets out of the bundled package to fix versioning issues, but I would hesitate to do so in 7.0 because the SDK doesn't have a way to import targets from the dynamically-downloaded "runtime packs" (the mechanism used for crossgen). We would need to work around this limitation and replace it with an implicit PackageReference, which could require changes to the targets logic. I'm happy to help in case we do want this to get fixed in 7.0. |
Is it correct that the SDK doesn't actually contain the ILCompiler (that is: the thing that does nativeaot), but it contains parts of the ILCompiler package so the SDK knows how to get the actual ILCompiler from nuget.org? |
Yes, roughly. The |
I've summarized what I believe to be the current state of play and the agreed-upon solution for NativeAOT in 7.0 in dotnet/runtime#76206. Please check this out and let me know if you have any concerns. |
NativeAOT support removed from net 7.0 source-build with dotnet/installer#14697 - closing |
From dotnet/runtime#69611, there is more work here than just building llvm in source-build - we have to make some decisions about how different native packages are linked. Currently NativeAOT will not work in source-build because of the assumptions it makes about these linkages.
The text was updated successfully, but these errors were encountered: