diff options
author | Andy Gocke <angocke@microsoft.com> | 2022-07-18 21:27:40 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-18 21:27:40 +0300 |
commit | c4277b99ef2b623dca6ed2c1427890855e3deced (patch) | |
tree | f516a51c1dc13f6ad52fa666ca55fb5efd8e51a3 | |
parent | 187abaaf59eace91833e8264e1d4eae6ff17d53f (diff) |
Always use live host (#71725)
Eliminates package dependency on the host during build and test. This change adds steps to various build
pipelines to build the host where they wouldn't before. It also stops us from building the Microsoft.NETCore.{DotnetHost,DotNetHostPolicy,DotNetHostResolver}, since those weren't necessary beyond this internal usage.
11 files changed, 20 insertions, 101 deletions
diff --git a/eng/Subsets.props b/eng/Subsets.props index fc751194d24..39ecf822395 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -51,7 +51,7 @@ </PropertyGroup> <PropertyGroup> - <DefaultCoreClrSubsets>clr.native+linuxdac+clr.corelib+clr.tools+clr.nativecorelib+clr.packages+clr.nativeaotlibs+clr.crossarchtools</DefaultCoreClrSubsets> + <DefaultCoreClrSubsets>clr.native+linuxdac+clr.corelib+clr.tools+clr.nativecorelib+clr.packages+clr.nativeaotlibs+clr.crossarchtools+host</DefaultCoreClrSubsets> <!-- Even on platforms that do not support the CoreCLR runtime, we still want to build ilasm/ildasm. --> <DefaultCoreClrSubsets Condition="'$(PrimaryRuntimeFlavor)' != 'CoreCLR'">clr.iltools+clr.packages</DefaultCoreClrSubsets> @@ -61,7 +61,8 @@ <DefaultMonoSubsets Condition="'$(MonoAOTEnableLLVM)' == 'true' and '$(MonoAOTLLVMDir)' == ''">mono.llvm+</DefaultMonoSubsets> <DefaultMonoSubsets Condition="'$(TargetOS)' == 'Browser'">$(DefaultMonoSubsets)mono.wasmruntime+</DefaultMonoSubsets> <DefaultMonoSubsets Condition="'$(MonoCrossAOTTargetOS)' != ''">$(DefaultMonoSubsets)mono.aotcross+</DefaultMonoSubsets> - <DefaultMonoSubsets>$(DefaultMonoSubsets)mono.runtime+mono.corelib+mono.packages</DefaultMonoSubsets> + <DefaultMonoSubsets>$(DefaultMonoSubsets)mono.runtime+mono.corelib+mono.packages+</DefaultMonoSubsets> + <DefaultMonoSubsets Condition="'$(TargetsMobile)' != 'true'">$(DefaultMonoSubsets)host+</DefaultMonoSubsets> <DefaultLibrariesSubsets Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or '$(BuildTargetFramework)' == '' or diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 42be894f2d8..ff4a5abdb66 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -214,14 +214,6 @@ <Uri>https://github.com/dotnet/runtime</Uri> <Sha>1967649721058a457157d4321af3e6fceaa5441b</Sha> </Dependency> - <Dependency Name="Microsoft.NETCore.DotNetHost" Version="7.0.0-preview.7.22358.7"> - <Uri>https://github.com/dotnet/runtime</Uri> - <Sha>1967649721058a457157d4321af3e6fceaa5441b</Sha> - </Dependency> - <Dependency Name="Microsoft.NETCore.DotNetHostPolicy" Version="7.0.0-preview.7.22358.7"> - <Uri>https://github.com/dotnet/runtime</Uri> - <Sha>1967649721058a457157d4321af3e6fceaa5441b</Sha> - </Dependency> <Dependency Name="runtime.native.System.IO.Ports" Version="7.0.0-preview.7.22358.7"> <Uri>https://github.com/dotnet/runtime</Uri> <Sha>1967649721058a457157d4321af3e6fceaa5441b</Sha> diff --git a/eng/Versions.props b/eng/Versions.props index 27c391875d1..49b36949e35 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -73,8 +73,6 @@ <NuGetBuildTasksPackVersion>6.0.0-preview.1.102</NuGetBuildTasksPackVersion> <!-- Installer dependencies --> <MicrosoftNETCoreAppRuntimewinx64Version>7.0.0-preview.7.22358.7</MicrosoftNETCoreAppRuntimewinx64Version> - <MicrosoftNETCoreDotNetHostVersion>7.0.0-preview.7.22358.7</MicrosoftNETCoreDotNetHostVersion> - <MicrosoftNETCoreDotNetHostPolicyVersion>7.0.0-preview.7.22358.7</MicrosoftNETCoreDotNetHostPolicyVersion> <MicrosoftExtensionsDependencyModelVersion>3.1.0</MicrosoftExtensionsDependencyModelVersion> <!-- CoreClr dependencies --> <MicrosoftNETCoreILAsmVersion>7.0.0-preview.7.22358.7</MicrosoftNETCoreILAsmVersion> diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index fcda36b713b..be20c6f2951 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -118,6 +118,16 @@ <MonoIncludeFiles Include="$(MonoArtifactsPath)\include\**\*.*" /> </ItemGroup> + <!-- Host files. Mobile uses a different hosting model, so we don't include the .NET host components there. --> + <ItemGroup Condition="'$(TargetsMobile)' != 'true' and Exists('$(DotNetHostBinDir)')"> + <RuntimeFiles Include="$(DotNetHostBinDir)\$(LibPrefix)hostpolicy$(LibSuffix)"> + <IsNative>true</IsNative> + </RuntimeFiles> + <RuntimeFiles Include="$(DotNetHostBinDir)\$(LibPrefix)hostfxr$(LibSuffix)"> + <IsNative>true</IsNative> + </RuntimeFiles> + </ItemGroup> + <Error Condition="'@(RuntimeFiles)' == ''" Text="The '$(RuntimeFlavor)' subset must be built before building this project." /> </Target> diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index c6fbe831a4d..0d18eda1283 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -32,13 +32,14 @@ jobs: osGroup: ${{ parameters.osGroup }} osSubgroup: ${{ parameters.osSubgroup }} archType: ${{ parameters.archType }} + crossBuild: ${{ parameters.crossBuild }} framework: ${{ parameters.framework }} isOfficialBuild: ${{ parameters.isOfficialBuild }} liveRuntimeBuildConfig: ${{ parameters.liveRuntimeBuildConfig }} runtimeFlavor: ${{ parameters.runtimeFlavor }} runtimeVariant: ${{ parameters.runtimeVariant }} timeoutInMinutes: ${{ parameters.timeoutInMinutes }} - container: '' # we just send to helix, no need to use a container. + container: ${{ parameters.container }} condition: ${{ parameters.condition }} testScope: ${{ parameters.testScope }} runTests: true @@ -89,7 +90,7 @@ jobs: - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: - script: $(_buildScript) - -subset libs.pretest + -subset host+libs.pretest $(_buildArguments) /p:RuntimeFlavor=${{ parameters.runtimeFlavor }} /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/overrideRuntimeFromLiveDrop.binlog diff --git a/src/installer/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHost.pkgproj b/src/installer/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHost.pkgproj deleted file mode 100644 index 9d5a87980d4..00000000000 --- a/src/installer/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHost.pkgproj +++ /dev/null @@ -1,17 +0,0 @@ -<Project Sdk="Microsoft.NET.Sdk"> - - <PropertyGroup> - <VersionProp>HostVersion</VersionProp> - <InstallerName>dotnet-host</InstallerName> - <PackageDescription>Provides an executable implementation of the Microsoft DotNet Framework and SDK launcher module</PackageDescription> - </PropertyGroup> - - <ItemGroup Condition="'$(PackageTargetRuntime)' != ''"> - <NativeBinary Include="$(DotNetHostBinDir)/dotnet$(ExeSuffix)" /> - <File Include="@(NativeBinary)"> - <TargetPath>runtimes/$(PackageTargetRuntime)/native</TargetPath> - <IsNative>true</IsNative> - </File> - </ItemGroup> - -</Project> diff --git a/src/installer/pkg/projects/Microsoft.NETCore.DotNetHostPolicy/Microsoft.NETCore.DotNetHostPolicy.pkgproj b/src/installer/pkg/projects/Microsoft.NETCore.DotNetHostPolicy/Microsoft.NETCore.DotNetHostPolicy.pkgproj deleted file mode 100644 index 7eb288ae2ba..00000000000 --- a/src/installer/pkg/projects/Microsoft.NETCore.DotNetHostPolicy/Microsoft.NETCore.DotNetHostPolicy.pkgproj +++ /dev/null @@ -1,19 +0,0 @@ -<Project Sdk="Microsoft.NET.Sdk"> - - <PropertyGroup> - <VersionProp>HostPolicyVersion</VersionProp> - <PackageDescription>Provides a CoreCLR hosting policy implementation -- configuration settings, assembly paths and assembly servicing</PackageDescription> - </PropertyGroup> - - <ItemGroup> - <Dependency Include="Microsoft.NETCore.DotNetHostResolver" VersionProp="HostResolverVersion" /> - </ItemGroup> - - <ItemGroup Condition="'$(PackageTargetRuntime)' != ''"> - <NativeBinary Include="$(DotNetHostBinDir)/$(LibPrefix)hostpolicy$(LibSuffix)"/> - <File Include="@(NativeBinary)"> - <TargetPath>runtimes/$(PackageTargetRuntime)/native</TargetPath> - <IsNative>true</IsNative> - </File> - </ItemGroup> -</Project> diff --git a/src/installer/pkg/projects/Microsoft.NETCore.DotNetHostResolver/Microsoft.NETCore.DotNetHostResolver.pkgproj b/src/installer/pkg/projects/Microsoft.NETCore.DotNetHostResolver/Microsoft.NETCore.DotNetHostResolver.pkgproj deleted file mode 100644 index 2991a01cf40..00000000000 --- a/src/installer/pkg/projects/Microsoft.NETCore.DotNetHostResolver/Microsoft.NETCore.DotNetHostResolver.pkgproj +++ /dev/null @@ -1,22 +0,0 @@ -<Project Sdk="Microsoft.NET.Sdk"> - - <PropertyGroup> - <VersionProp>HostResolverVersion</VersionProp> - <InstallerName>dotnet-hostfxr</InstallerName> - <InstallerName Condition="'$(PgoInstrument)' != ''">$(InstallerName)-pgo</InstallerName> - <PackageDescription>Provides an implementation of framework resolution strategy used by Microsoft.NETCore.DotNetHost</PackageDescription> - </PropertyGroup> - - <ItemGroup> - <Dependency Include="Microsoft.NETCore.DotNetAppHost" VersionProp="AppHostVersion" /> - </ItemGroup> - - <ItemGroup Condition="'$(PackageTargetRuntime)' != ''"> - <NativeBinary Include="$(DotNetHostBinDir)/$(LibPrefix)hostfxr$(LibSuffix)"/> - <File Include="@(NativeBinary)"> - <TargetPath>runtimes/$(PackageTargetRuntime)/native</TargetPath> - <IsNative>true</IsNative> - </File> - </ItemGroup> - -</Project> diff --git a/src/installer/pkg/projects/host-packages.proj b/src/installer/pkg/projects/host-packages.proj index 9a6e896b59f..ded4836a568 100644 --- a/src/installer/pkg/projects/host-packages.proj +++ b/src/installer/pkg/projects/host-packages.proj @@ -1,9 +1,6 @@ <Project Sdk="Microsoft.Build.Traversal" DefaultTargets="Pack"> <ItemGroup> <ProjectReference Include="Microsoft.NETCore.DotNetAppHost\Microsoft.NETCore.DotNetAppHost.pkgproj" /> - <ProjectReference Include="Microsoft.NETCore.DotNetHost\Microsoft.NETCore.DotNetHost.pkgproj" /> - <ProjectReference Include="Microsoft.NETCore.DotNetHostPolicy\Microsoft.NETCore.DotNetHostPolicy.pkgproj" /> - <ProjectReference Include="Microsoft.NETCore.DotNetHostResolver\Microsoft.NETCore.DotNetHostResolver.pkgproj" /> <ProjectReference Include="@(ProjectReference)" AdditionalProperties="PackageTargetRuntime=$(OutputRid)" /> </ItemGroup> </Project> diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props index cce7d6aa54b..230e91e97e4 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props @@ -53,12 +53,6 @@ </ItemGroup> </Target> - <!-- Mobile uses a different hosting model, so we don't include the .NET host components. --> - <ItemGroup Condition="'$(TargetsMobile)' != 'true'"> - <NativeRuntimeAsset Include="$(DotNetHostBinDir)/$(LibPrefix)hostpolicy$(LibSuffix)" /> - <NativeRuntimeAsset Include="$(DotNetHostBinDir)/$(LibPrefix)hostfxr$(LibSuffix)" PackOnly="true" /> - </ItemGroup> - <Target Name="AddRuntimeFilesToPackage" DependsOnTargets="ResolveRuntimeFilesFromLocalBuild"> <ItemGroup> <RuntimeFiles Condition="'%(RuntimeFiles.IsNative)' == 'true'"> diff --git a/src/libraries/externals.csproj b/src/libraries/externals.csproj index 415545b533e..77746507193 100644 --- a/src/libraries/externals.csproj +++ b/src/libraries/externals.csproj @@ -1,7 +1,5 @@ <Project Sdk="Microsoft.Build.NoTargets"> <PropertyGroup> - <!-- Set the RuntimeIdentifier so that the DotNetHost and DotNetHostPolicy packages resolve for the corresponding runtime. --> - <RuntimeIdentifier>$(PackageRID)</RuntimeIdentifier> <SwapNativeForIL Condition="'$(SwapNativeForIL)' == '' and ('$(Configuration)' == 'Debug' or '$(Coverage)' == 'true') and '$(RuntimeFlavor)' != 'Mono'">true</SwapNativeForIL> <TargetFramework>$(NetCoreAppCurrent)</TargetFramework> <!-- Binplace properties --> @@ -9,7 +7,6 @@ <BinPlaceNative>true</BinPlaceNative> <BinPlaceRuntime>false</BinPlaceRuntime> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> - <UseLiveBuiltDotNetHost Condition="'$(DotNetBuildFromSource)' == 'true' or '$(TargetArchitecture)' == 's390x' or '$(TargetArchitecture)' == 'ppc64le' or '$(TargetArchitecture)' == 'armv6' or '$(TargetsLinuxBionic)' == 'true'">true</UseLiveBuiltDotNetHost> </PropertyGroup> <PropertyGroup> @@ -21,23 +18,16 @@ </PropertyGroup> <Import Project="$(RepositoryEngineeringDir)coredistools.targets" Condition="$(CopyCoreDisToolsToCoreRoot)" /> - + <ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true'"> <PackageReference Include="Microsoft.DiaSymReader.Native" Version="$(MicrosoftDiaSymReaderNativeVersion)" /> </ItemGroup> - <ItemGroup Condition="'$(TargetsMobile)' != 'true' and '$(UseLiveBuiltDotNetHost)' != 'true'"> - <PackageReference Include="Microsoft.NETCore.DotNetHost" - Version="$(MicrosoftNETCoreDotNetHostVersion)" /> - <PackageReference Include="Microsoft.NETCore.DotNetHostPolicy" - Version="$(MicrosoftNETCoreDotNetHostPolicyVersion)" /> - </ItemGroup> - <!-- Setup the testing shared framework host --> <Target Name="SetupTestingHost" AfterTargets="AfterResolveReferences" - Condition="'$(TestNativeAot)' != 'true'"> + Condition="Exists('$(DotNetHostBinDir)') and '$(TestNativeAot)' != 'true'"> <PropertyGroup> <UseHardlink>true</UseHardlink> </PropertyGroup> @@ -48,13 +38,7 @@ <ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(Filename)' == 'apphost'" /> </ItemGroup> - <ItemGroup Condition="'$(UseLiveBuiltDotNetHost)' != 'true'"> - <HostFxFile Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.Filename)' == 'hostfxr' or - '%(ReferenceCopyLocalPaths.Filename)' == 'libhostfxr'" /> - <DotnetExe Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.Filename)' == 'dotnet'" /> - </ItemGroup> - - <ItemGroup Condition="'$(UseLiveBuiltDotNetHost)' == 'true'"> + <ItemGroup> <CoreHostFiles Include="$(DotNetHostBinDir)*" /> <HostFxFile Include="@(CoreHostFiles)" Condition="'%(CoreHostFiles.Filename)' == 'hostfxr' or '%(CoreHostFiles.Filename)' == 'libhostfxr'" /> @@ -78,7 +62,7 @@ SkipUnchangedFiles="true" UseHardlinksIfPossible="$(UseHardlink)" /> - <Copy Condition="$(CopyCoreDisToolsToCoreRoot)" + <Copy Condition="$(CopyCoreDisToolsToCoreRoot)" SourceFiles="$(CoreDisToolsLibrary)" DestinationFolder="$(NetCoreAppCurrentTestHostPath)shared\Microsoft.NETCore.App\$(ProductVersion)" SkipUnchangedFiles="true" |