Skip to content

Commit

Permalink
[mono] Include hostpolicy/hostfxr in mono desktop runtime packs (dotn…
Browse files Browse the repository at this point in the history
…et#42729)

Currently mono desktop runtime packs don't include `libhostfxr.*` and `libhostpolicy*` libs needed for corehost in self contained mode.

Co-authored-by: Alexander Köplinger <[email protected]>
  • Loading branch information
EgorBo and akoeplinger authored Oct 15, 2020
1 parent b72b13e commit d260e95
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 14 deletions.
1 change: 1 addition & 0 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

<DefaultInstallerSubsets>corehost+installer.managed+installer.depprojs+installer.pkgprojs+bundles+installers+installer.tests</DefaultInstallerSubsets>
<DefaultInstallerSubsets Condition="'$(RuntimeFlavor)' == 'Mono'">installer.pkgprojs</DefaultInstallerSubsets>
<DefaultInstallerSubsets Condition="'$(RuntimeFlavor)' == 'Mono' and '$(TargetsMobile)' != 'true'">corehost+$(DefaultInstallerSubsets)</DefaultInstallerSubsets>
</PropertyGroup>

<PropertyGroup>
Expand Down
1 change: 1 addition & 0 deletions src/installer/corehost/Windows/gen-buildsys-win.bat
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ popd
set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_SYSTEM_VERSION=10.0" "-DCLI_CMAKE_HOST_VER=%__HostVersion%" "-DCLI_CMAKE_COMMON_HOST_VER=%__AppHostVersion%" "-DCLI_CMAKE_HOST_FXR_VER=%__HostFxrVersion%"
set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCLI_CMAKE_HOST_POLICY_VER=%__HostPolicyVersion%" "-DCLI_CMAKE_PKG_RID=%cm_BaseRid%" "-DCLI_CMAKE_COMMIT_HASH=%__LatestCommit%" "-DCLR_CMAKE_HOST_ARCH=%__Arch%"
set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCORECLR_ARTIFACTS=%__CoreClrArtifacts% " "-DNATIVE_LIBS_ARTIFACTS=%__NativeLibsArtifacts%"
set __ExtraCmakeParams=%__ExtraCmakeParams% "-DRUNTIME_FLAVOR=%__RuntimeFlavor% "
set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_INSTALL_PREFIX=%__CMakeBinDir%" "-DCLI_CMAKE_RESOURCE_DIR=%__ResourcesDir%" "-DCLR_ENG_NATIVE_DIR=%__sourceDir%\..\..\..\eng\native"

echo "%CMakePath%" %__sourceDir% -G "Visual Studio %__VSString%" %__ExtraCmakeParams%
Expand Down
1 change: 1 addition & 0 deletions src/installer/corehost/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ if /i [%1] == [incremental-native-build] ( set __IncrementalNativeBuild=1&&shift
if /i [%1] == [rootDir] ( set __rootDir=%2&&shift&&shift&goto Arg_Loop)
if /i [%1] == [coreclrartifacts] (set __CoreClrArtifacts=%2&&shift&&shift&goto Arg_Loop)
if /i [%1] == [nativelibsartifacts] (set __NativeLibsArtifacts=%2&&shift&&shift&goto Arg_Loop)
if /i [%1] == [runtimeflavor] (set __RuntimeFlavor=%2&&shift&&shift&goto Arg_Loop)


shift
Expand Down
8 changes: 7 additions & 1 deletion src/installer/corehost/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ handle_arguments() {
__ShiftArgs=1
;;

runtimeflavor|-runtimeflavor)
__RuntimeFlavor="$2"
__ShiftArgs=1
;;

*)
__UnprocessedBuildArgs="$__UnprocessedBuildArgs $1"
esac
Expand All @@ -87,11 +92,12 @@ __DistroRidLower="$(echo $__DistroRid | tr '[:upper:]' '[:lower:]')"
__BinDir="$__RootBinDir/bin/$__DistroRidLower.$__BuildType"
__IntermediatesDir="$__RootBinDir/obj/$__DistroRidLower.$__BuildType"

export __BinDir __IntermediatesDir __CoreClrArtifacts __NativeLibsArtifacts
export __BinDir __IntermediatesDir __CoreClrArtifacts __NativeLibsArtifacts __RuntimeFlavor

__CMakeArgs="-DCLI_CMAKE_HOST_VER=\"$__host_ver\" -DCLI_CMAKE_COMMON_HOST_VER=\"$__apphost_ver\" -DCLI_CMAKE_HOST_FXR_VER=\"$__fxr_ver\" $__CMakeArgs"
__CMakeArgs="-DCLI_CMAKE_HOST_POLICY_VER=\"$__policy_ver\" -DCLI_CMAKE_PKG_RID=\"$__DistroRid\" -DCLI_CMAKE_COMMIT_HASH=\"$__commit_hash\" $__CMakeArgs"
__CMakeArgs="-DCORECLR_ARTIFACTS=\"$__CoreClrArtifacts\" -DNATIVE_LIBS_ARTIFACTS=\"$__NativeLibsArtifacts\" $__CMakeArgs"
__CMakeArgs="-DRUNTIME_FLAVOR=\"$__RuntimeFlavor\" $__CMakeArgs"
__CMakeArgs="-DFEATURE_DISTRO_AGNOSTIC_SSL=$__PortableBuild $__CMakeArgs"

if [[ "$__PortableBuild" == 1 ]]; then
Expand Down
30 changes: 18 additions & 12 deletions src/installer/corehost/cli/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
add_subdirectory(hostcommon)
add_subdirectory(apphost)
add_subdirectory(dotnet)
add_subdirectory(nethost)
add_subdirectory(test_fx_ver)
add_subdirectory(fxr)
add_subdirectory(hostpolicy)
if(RUNTIME_FLAVOR STREQUAL "Mono")
add_subdirectory(hostcommon)
add_subdirectory(fxr)
add_subdirectory(hostpolicy)
else()
add_subdirectory(hostcommon)
add_subdirectory(apphost)
add_subdirectory(dotnet)
add_subdirectory(nethost)
add_subdirectory(test_fx_ver)
add_subdirectory(fxr)
add_subdirectory(hostpolicy)

add_subdirectory(test)
add_subdirectory(test)

if(CLR_CMAKE_TARGET_WIN32)
add_subdirectory(comhost)
add_subdirectory(ijwhost)
endif()
if(CLR_CMAKE_TARGET_WIN32)
add_subdirectory(comhost)
add_subdirectory(ijwhost)
endif()
endif()
2 changes: 2 additions & 0 deletions src/installer/corehost/corehost.proj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<BuildArgs Condition="'$(CMakeArgs)' != ''">$(BuildArgs) $(CMakeArgs)</BuildArgs>
<BuildArgs>$(BuildArgs) -coreclrartifacts $(CoreCLRArtifactsPath)</BuildArgs>
<BuildArgs>$(BuildArgs) -nativelibsartifacts $(LibrariesArtifactsPath)/bin/native/$(NetCoreAppCurrent)-$(TargetOS)-$(LibrariesConfiguration)-$(TargetArchitecture)</BuildArgs>
<BuildArgs>$(BuildArgs) -runtimeflavor $(RuntimeFlavor)</BuildArgs>
</PropertyGroup>

<!--
Expand Down Expand Up @@ -90,6 +91,7 @@
<BuildArgs>$(BuildArgs) rootdir $(RepoRoot)</BuildArgs>
<BuildArgs>$(BuildArgs) coreclrartifacts $(CoreCLRArtifactsPath)</BuildArgs>
<BuildArgs>$(BuildArgs) nativelibsartifacts $(LibrariesArtifactsPath)/bin/native/$(NetCoreAppCurrent)-$(TargetOS)-$(LibrariesConfiguration)-$(TargetArchitecture)</BuildArgs>
<BuildArgs>$(BuildArgs) runtimeflavor $(RuntimeFlavor)</BuildArgs>
</PropertyGroup>

<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
shared framework on those platforms.
-->
<PropertyGroup>
<ExcludeHostAssets Condition="'$(RuntimeFlavor)' == 'Mono'">true</ExcludeHostAssets>
<ExcludeHostAssets Condition="'$(TargetsMobile)' == 'true'">true</ExcludeHostAssets>
</PropertyGroup>
<!--
Include HostPolicy and HostResolver based on legacy packages. This can be collapsed once the
Expand Down

0 comments on commit d260e95

Please sign in to comment.