From b88ec99ffb0b73ba9dfd52004bef498e3026ec8a Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 31 Jul 2026 11:59:51 -0700 Subject: [PATCH 1/2] Trim unused CoreCLR native components from dotnet-linker-tests build The Runtime_Release jobs in the dotnet-linker-tests pipeline built the `clr` subset, which expands to `clr.native` and therefore performs a full CoreCLR native build. That includes several components the trimming and NativeAOT tests never use, most notably the `alljits` component (six cross-target alt-JITs) and `spmi` (SuperPMI and its shims). Narrow the subset list to just the components the tests need. This drops 703 of 2837 ninja targets (~25%) from the CoreCLR native build. Measured locally at `ninja -j 4`, matching the parallelism CI uses, the native build goes from 4m03s to 3m05s (-24%). Also drop two subsets that were pulled in by `clr` but are not needed: * `clr.packages` only produces the ILAsm, ILDAsm, TestHost and Sdk.IL nupkgs, which are consumed solely by official-build publishing. * `clr.crossarchtools` is redundant here: `_BuildCrossComponents` is already set whenever `ClrRuntimeBuildSubsets` is non-empty for CoreCLR, and the cross-tool build is gated on `_BuildAnyCrossArch`, which is false for native windows-x64 and linux-x64. Validated from a clean tree with the narrowed subsets: the trimming tests (88) and the NativeAOT test apps (57) all pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ce99ab84-7dd0-4307-8dbe-47d695b514de Assisted-by: Copilot:claude-opus-5 --- eng/pipelines/runtime-linker-tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/runtime-linker-tests.yml b/eng/pipelines/runtime-linker-tests.yml index 6f3fc0eb11a7c0..602a69dfc374da 100644 --- a/eng/pipelines/runtime-linker-tests.yml +++ b/eng/pipelines/runtime-linker-tests.yml @@ -116,7 +116,11 @@ extends: or( eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_non_mono_and_wasm.containsChange'], true), eq(variables['isRollingBuild'], true)) - buildArgs: -s clr+libs+tools.illink+host.native -c $(_BuildConfig) /p:ToolsConfiguration=Debug + # This is the `clr` subset with `clr.native` (which builds every native component) + # narrowed to just the components the trimming/NativeAOT tests need. Most notably it + # drops `alljits` (the cross-target alt-JITs) and `spmi` (SuperPMI and its shims), + # none of which these tests use. + buildArgs: -s clr.runtime+clr.nativeaotruntime+clr.corelib+clr.tools+clr.nativecorelib+clr.nativeaotlibs+libs+tools.illink+host.native -c $(_BuildConfig) /p:ToolsConfiguration=Debug postBuildSteps: - template: /eng/pipelines/libraries/execute-trimming-tests-steps.yml parameters: From c9cf63743fd91945e45113c998bb5ffe7a6c7ec5 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 31 Jul 2026 12:17:39 -0700 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- eng/pipelines/runtime-linker-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/runtime-linker-tests.yml b/eng/pipelines/runtime-linker-tests.yml index 602a69dfc374da..d16b2a022987e2 100644 --- a/eng/pipelines/runtime-linker-tests.yml +++ b/eng/pipelines/runtime-linker-tests.yml @@ -116,9 +116,9 @@ extends: or( eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_non_mono_and_wasm.containsChange'], true), eq(variables['isRollingBuild'], true)) - # This is the `clr` subset with `clr.native` (which builds every native component) - # narrowed to just the components the trimming/NativeAOT tests need. Most notably it - # drops `alljits` (the cross-target alt-JITs) and `spmi` (SuperPMI and its shims), + # This replaces the previous `clr` subset (which expands to `clr.native` and builds every native component) + # with a narrower CoreCLR subset list that the trimming/NativeAOT tests need. + # Most notably it drops `alljits` (cross-target alt-JITs) and `spmi` (SuperPMI and shims), # none of which these tests use. buildArgs: -s clr.runtime+clr.nativeaotruntime+clr.corelib+clr.tools+clr.nativecorelib+clr.nativeaotlibs+libs+tools.illink+host.native -c $(_BuildConfig) /p:ToolsConfiguration=Debug postBuildSteps: