Skip to content
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

Add NativeAOT to build #62569

Merged
merged 1 commit into from
Dec 14, 2021
Merged

Add NativeAOT to build #62569

merged 1 commit into from
Dec 14, 2021

Conversation

MichalStrehovsky
Copy link
Member

@MichalStrehovsky MichalStrehovsky commented Dec 9, 2021

NativeAOT becomes part of the clr subset.

The NativeAOT runtime and libraries are a clr.nativeaotlibs subset.
The NativeAOT object writer (not built by default) is clr.objwriter subset.
The AOT compiler is part of the existing clr.tools subset.

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@ghost
Copy link

ghost commented Dec 9, 2021

Tagging subscribers to this area: @hoyosjs
See info in area-owners.md if you want to be subscribed.

Issue Details

NativeAOT becomes part of the clr subset.

The NativeAOT runtime and libraries are a clr.nativeaotlibs subset.
The NativeAOT object writer (not built by default) is clr.objwriter subset.
The AOT compiler is part of the existing clr.tools subset.

Author: MichalStrehovsky
Assignees: -
Labels:

area-Infrastructure-coreclr

Milestone: -

@@ -242,6 +257,22 @@
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\dotnet-pgo\dotnet-pgo-pack.proj" Pack="true" BuildInParallel="false" Category="clr" Condition="'$(DotNetBuildFromSource)' != 'true' and '$(RuntimeFlavor)' != 'Mono'"/>
</ItemGroup>

<ItemGroup Condition="$(_subset.Contains('+clr.nativeaotlibs+')) and '$(NativeAotSupported)' == 'true'">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are non-coreclr pieces located under coreclr (same applies to tools) ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NativeAOT is a flavor of CoreCLR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So there is no runtime agnostic tool or assembly in NativeAOT right now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll be moving files out as we unify the runtimes. E.g. a lot of src\coreclr\nativeaot\System.Private.Reflection.Core\src is basically src\libraries\System.Reflection.MetadataLoadContext\src but they need to be unified as we figure out the right shape of a common reflection stack (also shared with Mono). There's also bits and pieces in NativeAOT's corelib that we would like to share. Now that we have the things here, it's easier to do such refactorings.

@MichalStrehovsky
Copy link
Member Author

Cc @safern @jkoritzinsky for general build-infra. This is enabling NativeAOT bits in the CoreCLR build.

@MichalStrehovsky
Copy link
Member Author

@dotnet/runtime-infrastructure this is adding NativeAOT to the CLR build.

build.cmd clr -rc Debug -lc Release gets about 15% slower. It's 15% because we are building the NativeAOT bits 3 times on Windows because we need a flavor of the runtime with/without the Server GC, and one more flavor with Server GC and Control Flow Guard enabled. This is to accommodate user-facing configurability options. The overhead is smaller outside Windows because there's no CFG flavor.

@MichalStrehovsky MichalStrehovsky merged commit 5f9a532 into dotnet:main Dec 14, 2021
@@ -242,6 +257,22 @@
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\dotnet-pgo\dotnet-pgo-pack.proj" Pack="true" BuildInParallel="false" Category="clr" Condition="'$(DotNetBuildFromSource)' != 'true' and '$(RuntimeFlavor)' != 'Mono'"/>
</ItemGroup>

<ItemGroup Condition="$(_subset.Contains('+clr.nativeaotlibs+')) and '$(NativeAotSupported)' == 'true'">
<ProjectToBuild Include="$(CoreClrProjectRoot)nativeaot\System.Private.CoreLib\src\System.Private.CoreLib.csproj" Category="clr" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not include these as a wildcard?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! #62820

Copy link
Member

@safern safern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than a question, LGTM

@ghost ghost locked as resolved and limited conversation to collaborators Jan 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants