Skip to content

make sure we get all the dgml files#54875

Open
baronfel wants to merge 2 commits into
mainfrom
fix-aot-size-analysis-paths
Open

make sure we get all the dgml files#54875
baronfel wants to merge 2 commits into
mainfrom
fix-aot-size-analysis-paths

Conversation

@baronfel

@baronfel baronfel commented Jun 18, 2026

Copy link
Copy Markdown
Member

NativeAOT size-analysis pipeline fixes

This PR fixes how the NativeAOT size-analysis files (dotnet-aot.mstat, dotnet-aot.codegen.dgml.xml, dotnet-aot.scan.dgml.xml) are collected and uploaded from the SDK build legs.

Changes

  1. Correct file globs/names. ILC emits two DGML files (*.codegen.dgml.xml and *.scan.dgml.xml, not *.scan.dgml) plus the *.mstat, all under <config>/<tfm>/<rid>/native/. The copy step now matches all three with a precise <config>/*/*/native/ glob. Verified on the Windows AoT leg, where the copy now finds 3 files.

  2. Only collect on AoT legs. The Copy/Publish NativeAOT Size Analysis steps were unconditional, so non-AoT legs (TestBuild, FullFramework) were running them and uploading _AotSizeAnalysis artifacts too. They're now gated behind runAoTTests.

  3. Preserve the build binlog. The Copy Logs step uploads Build.binlog, but on every leg it was byte-identical to …Tests.binlog and contained only test projects — never redist/dotnet-aot. Root cause: -ci makes Arcade emit a default Build.binlog, and the test step (also -ci) appended a raw /bl:, so it wrote both files and clobbered the build step's real Build.binlog. The test step now uses Arcade's --binaryLogName, so the build binlog (which captures the redist GenerateSdkLayoutdotnet-aot NativeAOT publish) survives for diagnosis.

Still open: macOS (and Linux) don't publish dotnet-aot

Investigation of build 1471340 shows only the Windows legs produced _AotSizeAnalysis artifacts. On macOS the build console only shows the managed dotnet-aot.dll build (no …/publish/ native step), and the copy step logged found 0 files. PublishDotnetAot is gated by '$(TargetRid)' == '$(HostRid)' (redist.csproj, GenerateLayout.targets); the non-Windows legs pass a portable TargetRid (osx-arm64/linux-x64) while HostRid resolves to a different value (on Linux, the non-portable distro RID), so the gate fails and the NativeAOT publish never runs.

Next step: with the build binlog now preserved, confirm the exact HostRid/TargetRid values on the macOS leg before deciding how to fix the publish gate (that condition controls whether dotnet-aot ships in the macOS/Linux SDK layout at all, so it needs care).

Copilot AI review requested due to automatic review settings June 18, 2026 18:29
@baronfel baronfel requested a review from MiYanni as a code owner June 18, 2026 18:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the SDK build pipeline to publish the complete set of NativeAOT size-analysis artifacts by copying additional DGML graph outputs into the _AotSizeAnalysis pipeline artifact.

Changes:

  • Extend NativeAOT size-analysis artifact collection to include dotnet-aot.codegen.dgml.xml and dotnet-aot.scan.dgml.xml.
  • Adjust the copy glob patterns for the NativeAOT size-analysis outputs under artifacts/obj/dotnet-aot.

Comment thread eng/pipelines/templates/jobs/sdk-build.yml Outdated
@baronfel

Copy link
Copy Markdown
Member Author

It would be good to also figure out how to only collect these assets on the AOT legs? We seem to be trying to collect on TestBuild legs too, and I'm not sure everything needed is in place.

Only the AoT legs publish the dotnet-aot NativeAOT library, so gate the
Copy/Publish NativeAOT Size Analysis steps behind runAoTTests so they no
longer run (and upload empty artifacts) on non-AoT legs.

Also switch the test step to Arcade's --binaryLogName instead of a raw
/bl:. The raw /bl: left Arcade's default Build.binlog logger active too,
so the test run overwrote the build step's Build.binlog -- the one that
captures the redist GenerateSdkLayout / dotnet-aot NativeAOT publish.
Naming the test binlog explicitly preserves the build binlog so the
dotnet-aot publish is actually captured for diagnosis.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@baronfel baronfel linked an issue Jun 22, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-dotnet AOT Items that are part of the dotnet CLI AOT-ification effort Area-Infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build Errors from Publish NativeAOT Size Analysis step

3 participants