Enable NativeAOT dotnet CLI for Source Build#55329
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: eaed26de-227d-466f-a063-c09bc7334995
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Member
Author
|
/azp run sdk-unified-build |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: eaed26de-227d-466f-a063-c09bc7334995
Member
Author
|
/azp run sdk-unified-build |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: eaed26de-227d-466f-a063-c09bc7334995
Member
Author
|
/azp run sdk-unified-build |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: eaed26de-227d-466f-a063-c09bc7334995
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: eaed26de-227d-466f-a063-c09bc7334995
baronfel
marked this pull request as ready for review
July 17, 2026 15:35
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Member
Author
|
/azp run sdk-unified-build |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
Enables publishing the NativeAOT dotnet-aot shared library as part of the SDK layout for supported Source Build configurations, including distro-specific RIDs, while keeping existing exclusions (linux-musl, Mono, cross-OS, unsupported arch, and Linux cross-toolchain constraints).
Changes:
- Update layout gating for
dotnet-aotpublishing to useTargetOS/HostOS+NativeAotSupported(instead of RID-prefix checks) so Source Build distro-specificTargetRidis supported. - Adjust the nested
dotnet-aotpublish invocation to rely on inherited global properties, only forcing_IsPublishing=trueand (when applicable)CrossBuild=true. - Extend known runtime/ILCompiler RID lists during Source Build so exact distro-specific pack RID matches work without enabling the portable RID graph.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Layout/redist/targets/GenerateLayout.targets | Simplifies dotnet-aot publish property forwarding to rely on inherited global properties; keeps cross-build signaling via CrossBuild=true. |
| src/Layout/redist/redist.csproj | Updates the rationale for conditioning the dotnet-aot.csproj reference on _ShouldPublishDotnetAot, including Source Build behavior. |
| src/Layout/Directory.Build.props | Reworks _ShouldPublishDotnetAot gating to be OS/arch-based (and Source Build–friendly) and ties it to NativeAotSupported/Mono exclusions. |
| Directory.Build.targets | Adds $(TargetRid) to runtime pack and ILCompiler runtime identifier lists for Source Build to allow exact RID pack resolution without RID graph reliance. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: eaed26de-227d-466f-a063-c09bc7334995
Member
|
/azp run sdk-unified-build |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
mthalman
approved these changes
Jul 17, 2026
mthalman
left a comment
Member
There was a problem hiding this comment.
Assuming UB pipeline is good, then I'm good.
Member
Author
|
@mthalman looks like UB pipeline is good - we are getting |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dotnetCLI library for supported Source Build configurationsTargetRidan exact supported RID for the regular runtime packs and ILCompiler pack, matching the existing Arcade/ASP.NET Core pattern without enabling the legacy RID graphHostOS,TargetOS,OSName,BuildArchitecture,TargetArchitecture,CrossBuild, andNativeAotSupportedproperties when deciding whether the layout can publishdotnet-aot_IsPublishing=trueand, for same-OS cross-architecture publishing,CrossBuild=trueexplicitlyValidation
VMR Source-Only BuildandSB_CentOSStream10_Online_MsftSdk_x64RuntimeIdentifier=centos.10-x64andUseRidGraph=falseMicrosoft.NETCore.App.Runtime.centos.10-x64,Microsoft.AspNetCore.App.Runtime.centos.10-x64, andMicrosoft.NETCore.App.Runtime.NativeAOT.centos.10-x64dotnet.dllandlibdotnet-aot.sotogether undersdk/11.0.100-ci/_IsPublishing=trueinherits the Source Build target properties and retains the same runtime-pack inferencedotnet-aot.csprojforwin-x64, and ran the NativeAOT CLI parser testsFixes #55283