make sure we get all the dgml files#54875
Conversation
There was a problem hiding this comment.
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.xmlanddotnet-aot.scan.dgml.xml. - Adjust the copy glob patterns for the NativeAOT size-analysis outputs under
artifacts/obj/dotnet-aot.
|
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>
5a989bb to
8842ace
Compare
The PublishDotnetAot target and its sequencing ProjectReference were gated on TargetRid == HostRid, which skipped NativeAOT publish on the macOS AoT CI leg (osx-x64 host cross-building osx-arm64). That left the macOS leg without the dotnet-aot .dylib and its mstat/dgml size-analysis artifacts. macOS's Xcode/clang toolchain can target both osx-x64 and osx-arm64 from a macOS host, so same-OS cross-architecture NativeAOT publishing is supported. Introduce a shared CanPublishDotnetAot property in src/Layout/Directory.Build.props that keeps Windows/Linux native-only but allows any osx host -> osx target, and reference it from both gates so they stay in sync. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Ok, the macOS AOT steps are now actually AOTing the product - but they are doing so in a cross-compilation-compatible way. We should consider changing the build host to be arm64 and rolling back the cross-compilation changes I added in this PR. Here is the pipeline for this implementation for future reference. |
Revert the CanPublishDotnetAot gate relaxation: NativeAOT does not support cross-compilation, so rather than allowing osx-x64 host -> osx-arm64 publish, restore the original native-only gate (TargetRid == HostRid) for dotnet-aot in GenerateLayout.targets and redist.csproj. Instead, run the macOS AoT CI leg on native arm64 macOS hardware so the build is native (HostRid == TargetRid == osx-arm64) and produces the dotnet-aot .dylib plus its mstat/dgml size-analysis output. The pool override is scoped to the AoT leg only (via the macOSJobParameterSets entry), so the non-AoT macOS TestBuild leg keeps using the x64 hosted image and does not add load to arm64 hosted capacity. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The previous attempt added a per-leg pool override inside the AoT
macOSJobParameterSets entry. Azure Pipelines rejects that at compile time
("pool is already defined") because sdk-job-matrix.yml merges both the
parameters object and the jobParameters object via two separate inserts,
and duplicate keys across two inserts are an error rather than last-wins.
The AoT leg is PR-only (.vsts-ci.yml always overrides macOSJobParameterSets and
has no AoT category), so move it out of the shared default and into a dedicated
.vsts-pr.yml macOS invocation whose pool is the native arm64 image
(macOS-15-arm64). The default macOSJobParameterSets keeps just the TestBuild leg
on the x64 hosted image, so only the AoT leg uses arm64 hosted capacity.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/ba-g unrelated flaky tests |
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, and makes the macOS AoT leg actually produce them.Changes
Correct file globs/names. ILC emits two DGML files (
*.codegen.dgml.xmland*.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.Only collect on AoT legs. The
Copy/Publish NativeAOT Size Analysissteps were unconditional, so non-AoT legs (TestBuild,FullFramework) were running them and uploading_AotSizeAnalysisartifacts too. They are now gated behindrunAoTTests.Preserve the build binlog. The
Copy Logsstep uploadsBuild.binlog, but on every leg it was byte-identical to…Tests.binlogand contained only test projects — neverredist/dotnet-aot. Root cause:-cimakes Arcade emit a defaultBuild.binlog, and the test step (also-ci) appended a raw/bl:, so it wrote both files and clobbered the build step's realBuild.binlog. The test step now uses Arcade's--binaryLogName, so the build binlog (which captures the redistGenerateSdkLayout→dotnet-aotNativeAOT publish) survives for diagnosis.Run the macOS AoT leg on native arm64 hardware. The macOS AoT leg targets
osx-arm64but the default macOS pool is the Intel (osx-x64) hosted image, soHostRid (osx-x64) != TargetRid (osx-arm64). BecausePublishDotnetAotis (correctly) native-only — NativeAOT does not support cross-compilation — the publish was skipped and the leg produced no.dylib/mstat/dgml. Rather than relax that product gate, the AoT leg now runs on a native arm64 macOS image (macOS-15-arm64) so the build is native (HostRid == TargetRid == osx-arm64) and produces the size-analysis output. Because a per-legpooloverride collides with the matrix template's${{ insert }}expansion ('pool' is already defined), the AoT leg is split into its own dedicatedsdk-job-matrix.ymlinvocation in.vsts-pr.ymlwhosepoolis the arm64 image; the non-AoT macOSTestBuildleg keeps using the x64 hosted image so it does not add load to arm64 hosted capacity. The AoT leg is PR-only (.vsts-ci.ymlnever includes an AoT macOS category), so it is removed from the shared defaultmacOSJobParameterSets.