Skip to content

Commit 66a4f23

Browse files
Extract SuperPMI into a separate component (#64035)
Allows building the runtime without SPMI. `build.cmd clr` will still build SPMI. `build.cmd clr.native` will still build SPMI. `build.cmd clr.runtime` will no longer build SPMI. This is mostly motivated by NativeAOT subset builds where SPMI contributes to 10% of the native build time (nativeaot CorecLR subset builds pretty quickly compared to full CoreCLR).
1 parent 5851430 commit 66a4f23

File tree

12 files changed

+22
-12
lines changed

12 files changed

+22
-12
lines changed

eng/Subsets.props

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
</PropertyGroup>
5959

6060
<PropertyGroup>
61-
<DefaultCoreClrSubsets>clr.native+linuxdac+clr.corelib+clr.tools+clr.nativecorelib+clr.packages+clr.nativeaotlibs</DefaultCoreClrSubsets>
61+
<DefaultCoreClrSubsets>clr.native+linuxdac+clr.corelib+clr.tools+clr.nativecorelib+clr.packages+clr.nativeaotlibs+clr.spmi</DefaultCoreClrSubsets>
6262
<!-- Even on platforms that do not support the CoreCLR runtime, we still want to build ilasm/ildasm. -->
6363
<DefaultCoreClrSubsets Condition="'$(PrimaryRuntimeFlavor)' != 'CoreCLR'">clr.iltools+clr.packages</DefaultCoreClrSubsets>
6464

@@ -112,6 +112,7 @@
112112
<SubsetName Include="Clr.Hosts" Description="The CoreCLR corerun test host." />
113113
<SubsetName Include="Clr.Jit" Description="The JIT for the CoreCLR .NET runtime." />
114114
<SubsetName Include="Clr.AllJits" Description="All of the cross-targeting JIT compilers for the CoreCLR .NET runtime." />
115+
<SubsetName Include="Clr.Spmi" Description="SuperPMI, a tool for CoreCLR JIT testing." />
115116
<SubsetName Include="Clr.CoreLib" Description="The managed System.Private.CoreLib library for CoreCLR." />
116117
<SubsetName Include="Clr.NativeCoreLib" Description="Run crossgen on System.Private.CoreLib library for CoreCLR." />
117118
<SubsetName Include="Clr.Tools" Description="Managed tools that support CoreCLR development and testing." />
@@ -206,6 +207,10 @@
206207
<ClrRuntimeBuildSubsets>$(ClrRuntimeBuildSubsets);ClrNativeAotSubset=true</ClrRuntimeBuildSubsets>
207208
</PropertyGroup>
208209

210+
<PropertyGroup Condition="$(_subset.Contains('+clr.spmi+'))">
211+
<ClrRuntimeBuildSubsets>$(ClrRuntimeBuildSubsets);ClrSpmiSubset=true</ClrRuntimeBuildSubsets>
212+
</PropertyGroup>
213+
209214
<ItemGroup Condition="'$(ClrRuntimeBuildSubsets)' != '' or $(_subset.Contains('+clr.nativeprereqs+'))">
210215
<ProjectToBuild Include="$(CoreClrProjectRoot)runtime-prereqs.proj" Category="clr" />
211216
</ItemGroup>

eng/pipelines/coreclr/templates/build-jit-job.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ jobs:
107107

108108
# Build CoreCLR JIT
109109
- ${{ if ne(parameters.osGroup, 'windows') }}:
110-
- script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) $(crossArg) -ci $(compilerArg) -component alljits
110+
- script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) $(crossArg) -ci $(compilerArg) -component alljits -component spmi
111111
displayName: Build CoreCLR JIT
112112
- ${{ if eq(parameters.osGroup, 'windows') }}:
113-
- script: set __TestIntermediateDir=int&&$(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -ci -component alljits
113+
- script: set __TestIntermediateDir=int&&$(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -ci -component alljits -component spmi
114114
displayName: Build CoreCLR JIT
115115

116116
- ${{ if eq(parameters.uploadAs, 'azureBlob') }}:

eng/pipelines/coreclr/templates/build-job.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ jobs:
132132
value: ''
133133
- ${{ if ne(parameters.testGroup, 'innerloop') }}:
134134
- name: clrRuntimeComponentsBuildArg
135-
value: '-component runtime -component alljits -component paltests -component nativeaot '
135+
value: '-component runtime -component alljits -component paltests -component nativeaot -component spmi '
136136
- ${{ if and(eq(parameters.osGroup, 'Linux'), eq(parameters.archType, 'x86')) }}:
137137
- name: clrRuntimeComponentsBuildArg
138-
value: '-component runtime -component jit -component iltools '
138+
value: '-component runtime -component jit -component iltools -component spmi '
139139

140140
- name: pgoInstrumentArg
141141
value: ''

src/coreclr/build-runtime.cmd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,9 @@ for /f "delims=" %%a in ("-%__RequestedBuildComponents%-") do (
345345
if not "!string:-nativeaot-=!"=="!string!" (
346346
set __CMakeTarget=!__CMakeTarget! nativeaot
347347
)
348+
if not "!string:-spmi-=!"=="!string!" (
349+
set __CMakeTarget=!__CMakeTarget! spmi
350+
)
348351
)
349352
if [!__CMakeTarget!] == [] (
350353
set __CMakeTarget=install
@@ -745,7 +748,7 @@ echo -all: Builds all configurations and platforms.
745748
echo Build architecture: one of -x64, -x86, -arm, -arm64 ^(default: -x64^).
746749
echo Build type: one of -Debug, -Checked, -Release ^(default: -Debug^).
747750
echo -component ^<name^> : specify this option one or more times to limit components built to those specified.
748-
echo Allowed ^<name^>: hosts jit alljits runtime paltests iltools
751+
echo Allowed ^<name^>: hosts jit alljits runtime paltests iltools nativeaot spmi
749752
echo -enforcepgo: verify after the build that PGO was used for key DLLs, and fail the build if not
750753
echo -pgoinstrument: generate instrumented code for profile guided optimization enabled binaries.
751754
echo -cmakeargs: user-settable additional arguments passed to CMake.

src/coreclr/build-runtime.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ usage_list+=("-pgodatapath: path to profile guided optimization data.")
2222
usage_list+=("-pgoinstrument: generate instrumented code for profile guided optimization enabled binaries.")
2323
usage_list+=("-skipcrossarchnative: Skip building cross-architecture native binaries.")
2424
usage_list+=("-staticanalyzer: use scan_build static analyzer.")
25-
usage_list+=("-component: Build individual components instead of the full project. Available options are 'hosts', 'jit', 'runtime', 'paltests', 'alljits', 'iltools', and 'nativeaot'. Can be specified multiple times.")
25+
usage_list+=("-component: Build individual components instead of the full project. Available options are 'hosts', 'jit', 'runtime', 'paltests', 'alljits', 'iltools', 'nativeaot', and 'spmi'. Can be specified multiple times.")
2626

2727
setup_dirs_local()
2828
{

src/coreclr/components.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ add_component(runtime)
66
add_component(paltests paltests_install)
77
add_component(iltools)
88
add_component(nativeaot)
9+
add_component(spmi)
910

1011
# Define coreclr_all as the fallback component and make every component depend on this component.
1112
# iltools and paltests should be minimal subsets, so don't add a dependency on coreclr_misc

src/coreclr/runtime.proj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
<_CoreClrBuildArg Condition="'$(ClrAllJitsSubset)' == 'true'" Include="-component alljits" />
4949
<_CoreClrBuildArg Condition="'$(ClrILToolsSubset)' == 'true'" Include="-component iltools" />
5050
<_CoreClrBuildArg Condition="'$(ClrNativeAotSubset)' == 'true'" Include="-component nativeaot" />
51+
<_CoreClrBuildArg Condition="'$(ClrSpmiSubset)' == 'true'" Include="-component spmi" />
5152
</ItemGroup>
5253

5354
<PropertyGroup>

src/coreclr/tools/superpmi/mcs/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ else()
6868

6969
endif(CLR_CMAKE_HOST_UNIX)
7070

71-
install_clr(TARGETS mcs DESTINATIONS .)
71+
install_clr(TARGETS mcs DESTINATIONS . COMPONENT spmi)

src/coreclr/tools/superpmi/superpmi-shim-collector/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ else()
6161
)
6262
endif(CLR_CMAKE_HOST_UNIX)
6363

64-
install_clr(TARGETS superpmi-shim-collector DESTINATIONS .)
64+
install_clr(TARGETS superpmi-shim-collector DESTINATIONS . COMPONENT spmi)

src/coreclr/tools/superpmi/superpmi-shim-counter/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ else()
6363
)
6464
endif(CLR_CMAKE_HOST_UNIX)
6565

66-
install_clr(TARGETS superpmi-shim-counter DESTINATIONS .)
66+
install_clr(TARGETS superpmi-shim-counter DESTINATIONS . COMPONENT spmi)

src/coreclr/tools/superpmi/superpmi-shim-simple/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ else()
6262
)
6363
endif(CLR_CMAKE_HOST_UNIX)
6464

65-
install_clr(TARGETS superpmi-shim-simple DESTINATIONS .)
65+
install_clr(TARGETS superpmi-shim-simple DESTINATIONS . COMPONENT spmi)

src/coreclr/tools/superpmi/superpmi/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ else()
6464
)
6565
endif(CLR_CMAKE_HOST_UNIX)
6666

67-
install_clr(TARGETS superpmi DESTINATIONS .)
67+
install_clr(TARGETS superpmi DESTINATIONS . COMPONENT spmi)

0 commit comments

Comments
 (0)