Trim unused CoreCLR native components from dotnet-linker-tests build - #131666
Draft
sbomer wants to merge 2 commits into
Draft
Trim unused CoreCLR native components from dotnet-linker-tests build#131666sbomer wants to merge 2 commits into
sbomer wants to merge 2 commits into
Conversation
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
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the runtime-linker-tests Azure Pipelines definition to build a narrower set of CoreCLR subsets for the Runtime_Release jobs, aiming to avoid building unused native components during trimming and NativeAOT test runs.
Changes:
- Replaces
-s clr+...with an explicit subset list centered onclr.runtimeplus NativeAOT/tooling subsets. - Adds inline pipeline comments documenting why
alljitsandspmiare intentionally excluded.
Show a summary per file
| File | Description |
|---|---|
| eng/pipelines/runtime-linker-tests.yml | Switches the CoreCLR build from clr to an explicit subset list intended to avoid building unused native components for linker/NativeAOT tests. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 1
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
jkoritzinsky
approved these changes
Jul 31, 2026
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.
The
Runtime_Releasejobs in thedotnet-linker-testspipeline build theclrsubset. That expands toclr.native, which performs a full CoreCLR native build — including several components the trimming and NativeAOT tests never use:alljits— six cross-target alt-JITs (clrjit_universal_arm64_x64,clrjit_win_x86_x64,clrjit_universal_wasm_x64, etc.)spmi— SuperPMI and its three shimsTogether these are 703 of 2837 ninja targets (~25%) of the CoreCLR native build.
This narrows the subset list to just the components the tests actually need.
src/coreclr/components.cmakeshows theruntimecomponent already depends onjit,iltools,debugandhosts, soclr.runtimecovers everything required to run the tests, andclr.tools+clr.nativeaotlibs+clr.nativeaotruntimecover ILCompiler and the NativeAOT test apps. OnlyILCompiler.ReadyToRun.Testsneedsalljits, and it builds them itself on demand.Two further subsets pulled in by
clrare also dropped:clr.packagesonly produces the ILAsm/ILDAsm/TestHost/Sdk.IL nupkgs, referenced solely byeng/Publishing.propsfor official-build publishing. (Packing them takes ~2.5s, so this is a cleanliness change, not a perf one.)clr.crossarchtoolsis redundant here —_BuildCrossComponentsis already set wheneverClrRuntimeBuildSubsetsis non-empty for CoreCLR, and the cross-tool build is gated on_BuildAnyCrossArch, which is false for native windows-x64/linux-x64. Verified no cross-arch build directory is produced either way.Measurements
CI runs the native build at
ninja -j 4, so measurements were taken locally at the same parallelism:-j4clr)Applied to the current CI native phases (15.6m on windows-x64, 11.0m on linux-x64), this should take roughly 3.5–4 min off the critical-path windows-x64 job, which currently runs ~62m within a ~75m build. linux-x64 saves ~2.6m but stays off the critical path. The browser-wasm job is unaffected (it builds
mono, notclr).The −24% is likely conservative for Windows, which drops a larger share of targets (780/2646 = 29.5%) since Linux keeps
clrjit_unix_x64_x64as part of the basejitcomponent.Validation
From a clean tree with the narrowed subsets:
libclrjit.soremains, superpmi is gone, andlibcoreclr.so,ilc,crossgen2,ilasm/ildasm, DAC/mscordbi and theaotsdkare all still presentNote
This content was created with assistance from AI.