Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] Create clr.host subset to remove patching step for mono runtime tests #62500

Merged
merged 5 commits into from
Dec 9, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
<SubsetName Include="Clr.Native" Description="All CoreCLR native non-test components, including the runtime, jits, and other native tools." />
<SubsetName Include="Clr.PalTests" OnDemand="true" Description="The CoreCLR PAL tests." />
<SubsetName Include="Clr.PalTestList" OnDemand="true" Description="Generate the list of the CoreCLR PAL tests. When using the command line, use Clr.PalTests instead." />
<SubsetName Include="Clr.Hosts" Description="The CoreCLR corerun test host." />
<SubsetName Include="Clr.Jit" Description="The JIT for the CoreCLR .NET runtime." />
<SubsetName Include="Clr.AllJits" Description="All of the cross-targeting JIT compilers for the CoreCLR .NET runtime." />
<SubsetName Include="Clr.CoreLib" Description="The managed System.Private.CoreLib library for CoreCLR." />
Expand Down Expand Up @@ -164,6 +165,10 @@
<ProjectToBuild Include="$(CoreClrProjectRoot)System.Private.CoreLib\System.Private.CoreLib.csproj" Category="clr" />
</ItemGroup>

<PropertyGroup Condition="$(_subset.Contains('+clr.hosts+'))">
<ClrRuntimeBuildSubsets>$(ClrRuntimeBuildSubsets);ClrHostsSubset=true</ClrRuntimeBuildSubsets>
</PropertyGroup>

<PropertyGroup Condition="$(_subset.Contains('+clr.runtime+'))">
<ClrRuntimeBuildSubsets>$(ClrRuntimeBuildSubsets);ClrRuntimeSubset=true</ClrRuntimeBuildSubsets>
</PropertyGroup>
Expand Down
5 changes: 4 additions & 1 deletion src/coreclr/build-runtime.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ if NOT DEFINED PYTHON (
set __CMakeTarget=
for /f "delims=" %%a in ("-%__RequestedBuildComponents%-") do (
set "string=%%a"
if not "!string:-hosts-=!"=="!string!" (
set __CMakeTarget=!__CMakeTarget! hosts
)
if not "!string:-jit-=!"=="!string!" (
set __CMakeTarget=!__CMakeTarget! jit
)
Expand Down Expand Up @@ -739,7 +742,7 @@ echo -all: Builds all configurations and platforms.
echo Build architecture: one of -x64, -x86, -arm, -arm64 ^(default: -x64^).
echo Build type: one of -Debug, -Checked, -Release ^(default: -Debug^).
echo -component ^<name^> : specify this option one or more times to limit components built to those specified.
echo Allowed ^<name^>: jit alljits runtime paltests iltools
echo Allowed ^<name^>: hosts jit alljits runtime paltests iltools
echo -enforcepgo: verify after the build that PGO was used for key DLLs, and fail the build if not
echo -pgoinstrument: generate instrumented code for profile guided optimization enabled binaries.
echo -cmakeargs: user-settable additional arguments passed to CMake.
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/build-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ usage_list+=("-pgodatapath: path to profile guided optimization data.")
usage_list+=("-pgoinstrument: generate instrumented code for profile guided optimization enabled binaries.")
usage_list+=("-skipcrossarchnative: Skip building cross-architecture native binaries.")
usage_list+=("-staticanalyzer: use scan_build static analyzer.")
usage_list+=("-component: Build individual components instead of the full project. Available options are 'jit', 'runtime', 'paltests', 'alljits', and 'iltools'. Can be specified multiple times.")
usage_list+=("-component: Build individual components instead of the full project. Available options are 'hosts', 'jit', 'runtime', 'paltests', 'alljits', and 'iltools'. Can be specified multiple times.")

setup_dirs_local()
{
Expand Down
3 changes: 3 additions & 0 deletions src/coreclr/components.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Define all the individually buildable components of the CoreCLR build and their respective targets
add_component(jit)
add_component(alljits)
add_component(hosts)
add_component(runtime)
add_component(paltests paltests_install)
add_component(iltools)
Expand All @@ -16,5 +17,7 @@ add_dependencies(runtime coreclr_misc)
# The runtime build requires the clrjit and iltools builds
add_dependencies(runtime jit iltools)

add_dependencies(runtime hosts)

# The cross-components build is separate, so we don't need to add a dependency on coreclr_misc
add_component(crosscomponents)
2 changes: 1 addition & 1 deletion src/coreclr/hosts/corerun/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ else(CLR_CMAKE_HOST_WIN32)
endif()
endif(CLR_CMAKE_HOST_WIN32)

install_clr(TARGETS corerun DESTINATIONS . COMPONENT runtime)
install_clr(TARGETS corerun DESTINATIONS . COMPONENT hosts)
naricc marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion src/coreclr/hosts/coreshim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ target_link_libraries(CoreShim
${STATIC_MT_VCRT_LIB}
)

install_clr(TARGETS CoreShim DESTINATIONS . COMPONENT runtime)
install_clr(TARGETS CoreShim DESTINATIONS . COMPONENT hosts)
1 change: 1 addition & 0 deletions src/coreclr/runtime.proj
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
</ItemGroup>

<ItemGroup Condition="'$(ClrFullNativeBuild)' != 'true'">
<_CoreClrBuildArg Condition="'$(ClrHostsSubset)' == 'true'" Include="-component hosts" />
<_CoreClrBuildArg Condition="'$(ClrRuntimeSubset)' == 'true'" Include="-component runtime" />
<_CoreClrBuildArg Condition="'$(ClrJitSubset)' == 'true'" Include="-component jit" />
<_CoreClrBuildArg Condition="'$(ClrPalTestsSubset)' == 'true'" Include="-component paltests" />
Expand Down
8 changes: 8 additions & 0 deletions src/tests/Common/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<GCStressDependsOnCoreDisTools Condition="'$(TargetOS)' == 'Linux' And '$(TargetArchitecture)' == 'x64'">true</GCStressDependsOnCoreDisTools>
<CopyCoreDisToolsToCoreRoot>false</CopyCoreDisToolsToCoreRoot>
<CopyCoreDisToolsToCoreRoot Condition="$(GCStressDependsOnCoreDisTools) And '$(DotNetBuildFromSource)' != 'true'">true</CopyCoreDisToolsToCoreRoot>
<IsDesktopArchitecture Condition="'$(TargetArchitecture)' != 'wasm' and '$(TargetArchitecture)' != 'android' and '$(TargetArchitecture)' != 'iOS' ">true</IsDesktopArchitecture>
naricc marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>

<Import Project="$(RepositoryEngineeringDir)coredistools.targets" Condition="$(CopyCoreDisToolsToCoreRoot)" />
Expand Down Expand Up @@ -103,6 +104,8 @@
Include="$(CoreCLRArtifactsPath)%(RunTimeArtifactsIncludeFolders.Identity)**/*"
Exclude="@(RunTimeArtifactsExcludeFiles -> '$(CoreCLRArtifactsPath)%(Identity)')"
TargetDir="%(RunTimeArtifactsIncludeFolders.Identity)" />


</ItemGroup>

<PropertyGroup>
Expand Down Expand Up @@ -167,6 +170,11 @@
<RunTimeDependencyCopyLocal Include="$(CoreDisToolsLibrary)" Condition="$(CopyCoreDisToolsToCoreRoot)" />
</ItemGroup>

<ItemGroup Condition="'$(RuntimeFlavor)' == 'mono' and '$(IsDesktopArchitecture)'" >
<RuntimeDependencyCopyLocal Include="$(MonoArtifactsPath)/libcoreclr$(LibSuffix)" TargetDir="" />
naricc marked this conversation as resolved.
Show resolved Hide resolved
<RuntimeDependencyCopyLocal Include="$(MonoArtifactsPath)/*.dll" TargetDir="/" />
</ItemGroup>

<Copy
SourceFiles="@(RunTimeDependencyCopyLocal)"
DestinationFiles="@(RunTimeDependencyCopyLocal -> '$(CORE_ROOT)/%(TargetDir)%(RecursiveDir)%(Filename)%(Extension)')"
Expand Down