Skip to content

Commit 06128bf

Browse files
committed
Use live apphost when publishing ilc as singlefile
1 parent ceccfe0 commit 06128bf

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

eng/Subsets.props

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,6 @@
361361
$(CoreClrProjectRoot)tools\AssemblyChecker\AssemblyChecker.csproj" Category="clr" Condition="'$(DotNetBuildSourceOnly)' != 'true'"/>
362362
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2.csproj" Category="clr" />
363363
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler.Build.Tasks\ILCompiler.Build.Tasks.csproj" Category="clr" Condition="'$(NativeAotSupported)' == 'true'" />
364-
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler.csproj" Category="clr" Condition="'$(NativeAotSupported)' == 'true'" />
365364
<ProjectToBuild Include="$(CoreClrProjectRoot)nativeaot\BuildIntegration\BuildIntegration.proj" Category="clr" Condition="'$(NativeAotSupported)' == 'true'" />
366365

367366
<ProjectToBuild Condition="'$(NativeAotSupported)' == 'true' and ('$(CrossBuild)' == 'true' or '$(BuildArchitecture)' != '$(TargetArchitecture)' or '$(HostOS)' != '$(TargetOS)' or '$(EnableNativeSanitizers)' != '')" Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler_crossarch.csproj" Category="clr" />
@@ -529,13 +528,17 @@
529528

530529
<!-- Packs sets -->
531530

531+
<ItemGroup>
532+
<ProjectToBuild Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\Microsoft.NETCore.App.Host.sfxproj" Category="packs" Condition="$(_subset.Contains('+packs.product+')) and '$(BuildNativeAOTRuntimePack)' != 'true' and '$(BuildOnlyPgoInstrumentedAssets)' != 'true' and '$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)' and '$(TargetsMobile)' != 'true'" />
533+
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler.csproj" Category="clr" Condition="'$(NativeAotSupported)' == 'true' and $(_subset.Contains('+clr.tools+'))" />
534+
</ItemGroup>
535+
532536
<Choose>
533537
<When Condition="$(_subset.Contains('+packs.product+'))">
534538
<ItemGroup Condition="'$(BuildOnlyPgoInstrumentedAssets)' != 'true'">
535539
<SharedFrameworkProjectToBuild Condition="'$(BuildMonoAOTCrossCompilerOnly)' != 'true'" Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\Microsoft.NETCore.App.Ref.sfxproj" />
536540
</ItemGroup>
537541
<ItemGroup Condition="'$(BuildNativeAOTRuntimePack)' != 'true' and '$(BuildOnlyPgoInstrumentedAssets)' != 'true'">
538-
<SharedFrameworkProjectToBuild Condition="'$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)' and '$(TargetsMobile)' != 'true'" Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\Microsoft.NETCore.App.Host.sfxproj" />
539542
<SharedFrameworkProjectToBuild Condition="'$(RuntimeFlavor)' != 'Mono'" Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\Microsoft.NETCore.App.Crossgen2.sfxproj" />
540543
<SharedFrameworkProjectToBuild Condition="'$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)' and '$(TargetsMobile)' != 'true'" Include="$(InstallerProjectRoot)pkg\sfx\installers\dotnet-host.proj" />
541544
<SharedFrameworkProjectToBuild Condition="'$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)' and '$(TargetsMobile)' != 'true'" Include="$(InstallerProjectRoot)pkg\sfx\installers\dotnet-hostfxr.proj" />

src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputPath>$(RuntimeBinDir)ilc/</OutputPath>
4-
<RuntimeIdentifier>$(PackageRID)</RuntimeIdentifier>
4+
<RuntimeIdentifier>$(OutputRID)</RuntimeIdentifier>
5+
6+
<!-- Mobile platforms do not have apphost and we don't need it. However, restore requires
7+
"some" apphost; use PackageRID of host machine to satisfy that bogus requirement. -->
8+
<RuntimeIdentifier Condition="'$(TargetsMobile)' == 'true'">$(PackageRID)</RuntimeIdentifier>
59
</PropertyGroup>
610

7-
<Import Project="ILCompiler.props" />
11+
<PropertyGroup Condition="'$(UseNativeAotForComponents)' != 'true' and '$(CrossBuild)' == 'true' and '$(TargetsMobile)' != 'true'">
12+
<UseLocalTargetingRuntimePack>true</UseLocalTargetingRuntimePack>
13+
</PropertyGroup>
14+
15+
<Import Project="$(RepositoryEngineeringDir)targetingpacks.targets" Condition="'$(UseNativeAotForComponents)' != 'true' and '$(CrossBuild)' == 'true' and '$(TargetsMobile)' != 'true'" />
16+
<Import Project="$(RepositoryEngineeringDir)codeOptimization.targets" Condition="'$(UseNativeAotForComponents)' != 'true' and '$(CrossBuild)' == 'true' and '$(TargetsMobile)' != 'true'" />
817

18+
<Import Project="ILCompiler.props" />
919

1020
<!-- BEGIN: Workaround for https://github.com/dotnet/runtime/issues/67742 -->
1121
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">
1222
<PublishDir>$(RuntimeBinDir)ilc-published/</PublishDir>
1323
<PublishAot Condition="'$(UseNativeAotForComponents)' == 'true'">true</PublishAot>
1424
<SysRoot Condition="'$(UseNativeAotForComponents)' == 'true' and '$(CrossBuild)' == 'true' and '$(HostOS)' != 'windows'">$(ROOTFS_DIR)</SysRoot>
15-
<PublishReadyToRun Condition="'$(UseNativeAotForComponents)' != 'true'">true</PublishReadyToRun>
25+
<PublishReadyToRun Condition="'$(UseNativeAotForComponents)' != 'true' and '$(UseLocalTargetingRuntimePack)' != 'true'">true</PublishReadyToRun>
1626
<PublishSingleFile Condition="'$(UseNativeAotForComponents)' != 'true'">true</PublishSingleFile>
1727
<PublishTrimmed Condition="'$(UseNativeAotForComponents)' != 'true'">true</PublishTrimmed>
1828
<SuppressGenerateILCompilerExplicitPackageReferenceWarning>true</SuppressGenerateILCompilerExplicitPackageReferenceWarning>
@@ -88,15 +98,6 @@
8898
<Target Name="PublishCompiler"
8999
Condition="'$(BuildingInsideVisualStudio)' != 'true'"
90100
AfterTargets="Build"
91-
DependsOnTargets="Publish;StompSingleFileHostPath" />
101+
DependsOnTargets="Publish" />
92102

93-
<!-- HACK: liveBuilds stomps over SingleFileHostSourcePath, setting it to the host that we just built.
94-
That's unfortunate because it's not the host we're supposed to use here. -->
95-
<Target Name="StompSingleFileHostPath"
96-
BeforeTargets="ResolveFrameworkReferences">
97-
<PropertyGroup>
98-
<SingleFileHostSourcePath></SingleFileHostSourcePath>
99-
</PropertyGroup>
100-
</Target>
101-
<!-- END: Workaround for https://github.com/dotnet/runtime/issues/67742 -->
102103
</Project>

src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<PropertyGroup>
1010
<PublishTrimmed>true</PublishTrimmed>
11-
<RuntimeIdentifier>$(PackageRID)</RuntimeIdentifier>
11+
<RuntimeIdentifier>$(OutputRID)</RuntimeIdentifier>
1212
<SelfContained>true</SelfContained>
1313
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
1414
<UseLocalAppHostPack>true</UseLocalAppHostPack>

0 commit comments

Comments
 (0)