Skip to content

Commit 8258597

Browse files
am11jkoritzinsky
andauthored
Use live apphost when publishing ilc as singlefile (#105004)
Co-authored-by: Jeremy Koritzinsky <[email protected]>
1 parent 5667c28 commit 8258597

File tree

8 files changed

+41
-24
lines changed

8 files changed

+41
-24
lines changed

eng/Subsets.props

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@
4242
<MonoAOTCrossCompilerSupported Condition="'$(_MonoAotCrossSupportedOS)' == 'true' and '$(_MonoAotCrossSupportedArch)' == 'true'">true</MonoAOTCrossCompilerSupported>
4343

4444
<!-- Determine if the NativeAOT runtime can run on the specified target. -->
45-
<_IsCommunityCrossArchitecture Condition="'$(CrossBuild)' == 'true' and ('$(TargetArchitecture)' == 'loongarch64' or '$(TargetArchitecture)' == 'riscv64')">true</_IsCommunityCrossArchitecture>
4645
<_NativeAotSupportedOS Condition="'$(TargetOS)' == 'windows' or '$(TargetOS)' == 'linux' or '$(TargetOS)' == 'osx' or '$(TargetOS)' == 'maccatalyst' or '$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'ios' or '$(TargetOS)' == 'tvossimulator' or '$(TargetOS)' == 'tvos' or '$(TargetOS)' == 'freebsd'">true</_NativeAotSupportedOS>
47-
<_NativeAotSupportedArch Condition="'$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'loongarch64' or ('$(TargetOS)' == 'windows' and '$(TargetArchitecture)' == 'x86')">true</_NativeAotSupportedArch>
48-
<NativeAotSupported Condition="'$(_NativeAotSupportedOS)' == 'true' and '$(_NativeAotSupportedArch)' == 'true' and '$(_IsCommunityCrossArchitecture)' != 'true'">true</NativeAotSupported>
46+
<_NativeAotSupportedArch Condition="'$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'loongarch64' or '$(TargetArchitecture)' == 'riscv64' or ('$(TargetOS)' == 'windows' and '$(TargetArchitecture)' == 'x86')">true</_NativeAotSupportedArch>
47+
<NativeAotSupported Condition="'$(_NativeAotSupportedOS)' == 'true' and '$(_NativeAotSupportedArch)' == 'true'">true</NativeAotSupported>
4948
</PropertyGroup>
5049

5150
<PropertyGroup>
@@ -151,7 +150,8 @@
151150
</PropertyGroup>
152151

153152
<PropertyGroup>
154-
<UseNativeAotForComponents Condition="'$(NativeAotSupported)' == 'true' and '$(TargetOS)' == '$(HostOS)' and '$(TargetsLinuxBionic)' != 'true'">true</UseNativeAotForComponents>
153+
<_IsCommunityCrossArchitecture Condition="'$(CrossBuild)' == 'true' and ('$(TargetArchitecture)' == 'loongarch64' or '$(TargetArchitecture)' == 'riscv64')">true</_IsCommunityCrossArchitecture>
154+
<UseNativeAotForComponents Condition="'$(NativeAotSupported)' == 'true' and '$(TargetOS)' == '$(HostOS)' and '$(TargetsLinuxBionic)' != 'true' and '$(_IsCommunityCrossArchitecture)' != 'true'">true</UseNativeAotForComponents>
155155

156156
<!-- If we're building clr.nativeaotlibs and not building the CLR runtime, compile libraries against NativeAOT CoreLib -->
157157
<UseNativeAotCoreLib Condition="'$(TestNativeAot)' == 'true' or ($(_subset.Contains('+clr.nativeaotlibs+')) and !$(_subset.Contains('+clr.native+')) and !$(_subset.Contains('+clr.runtime+')) and !$(_subset.Contains('+clr.corelib+')))">true</UseNativeAotCoreLib>
@@ -386,9 +386,9 @@
386386
$(CoreClrProjectRoot)tools\PdbChecker\PdbChecker.csproj;
387387
$(CoreClrProjectRoot)tools\AssemblyChecker\AssemblyChecker.csproj" Category="clr" Condition="'$(DotNetBuildSourceOnly)' != 'true'"/>
388388
<!-- skip the architectures that don't have LKG runtime packs -->
389-
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2_publish.csproj" Condition="'$(NativeAotSupported)' == 'true'" Category="clr" />
389+
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2_publish.csproj" Condition="'$(NativeAotSupported)' == 'true' and '$(StageOneBuild)' != 'true'" Category="clr" />
390390
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler.Build.Tasks\ILCompiler.Build.Tasks.csproj" Category="clr" Condition="'$(NativeAotSupported)' == 'true'" />
391-
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler.csproj" Category="clr" Condition="'$(NativeAotSupported)' == 'true'" />
391+
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler.csproj" Category="clr" Condition="'$(NativeAotSupported)' == 'true' and '$(StageOneBuild)' != 'true'" />
392392
<ProjectToBuild Include="$(CoreClrProjectRoot)nativeaot\BuildIntegration\BuildIntegration.proj" Category="clr" Condition="'$(NativeAotSupported)' == 'true'" />
393393

394394
<ProjectToBuild Condition="'$(NativeAotSupported)' == 'true' and ('$(CrossBuild)' == 'true' or '$(BuildArchitecture)' != '$(TargetArchitecture)' or '$(HostOS)' != '$(TargetOS)' or '$(EnableNativeSanitizers)' != '')" Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler_inbuild.csproj" Category="clr" />

eng/pipelines/runtime.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,27 @@ extends:
492492
- linux_loongarch64
493493
jobParameters:
494494
testScope: innerloop
495-
nameSuffix: CoreCLR
496-
buildArgs: -s clr+libs+host -c $(_BuildConfig) -rc Checked
495+
nameSuffix: CoreCLR_TwoStage
496+
buildArgs: -s clr+libs+host -c $(_BuildConfig) -rc Checked -p:StageOneBuild=true
497497
timeoutInMinutes: 120
498+
postBuildSteps:
499+
- script: |
500+
echo Running $(Build.SourcesDirectory)/build$(scriptExt) \
501+
${{ variables.debugOnPrReleaseOnRolling }} \
502+
-s clr.tools+packs -rc Checked -cross \
503+
-os $(osGroup) \
504+
-a $(archType) \
505+
-c $(_BuildConfig) \
506+
-p:StageTwoBuild=true
507+
508+
$(Build.SourcesDirectory)/build$(scriptExt) \
509+
${{ variables.debugOnPrReleaseOnRolling }} \
510+
-s clr.tools+packs -rc Checked -cross \
511+
-os $(osGroup) \
512+
-a $(archType) \
513+
-c $(_BuildConfig) \
514+
-p:StageTwoBuild=true
515+
displayName: Build clr.tools and packs
498516
condition: >-
499517
or(
500518
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true),

eng/targetingpacks.targets

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
ILCompilerPackNamePattern="runtime.**RID**.Microsoft.DotNet.ILCompiler"
7373
TargetFramework="$(NetCoreAppCurrent)"
7474
ILCompilerPackVersion="$(ProductVersion)"
75-
ILCompilerRuntimeIdentifiers="linux-musl-x64;linux-x64;win-x64;linux-arm;linux-arm64;linux-musl-arm;linux-musl-arm64;osx-arm64;osx-x64;win-arm64;win-x86"
75+
ILCompilerRuntimeIdentifiers="linux-musl-x64;linux-x64;win-x64;linux-arm;linux-arm64;linux-musl-arm;linux-musl-arm64;osx-arm64;osx-x64;win-arm64;win-x86;linux-riscv64;linux-musl-riscv64;linux-loongarch64;linux-musl-loongarch64"
7676
Condition="'$(UseLocalILCompilerPack)' == 'true' and '@(KnownILCompilerPack->AnyHaveMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))' != 'true'" />
7777
<KnownCrossgen2Pack Include="$(LocalFrameworkOverrideName).Crossgen2"
7878
TargetFramework="$(NetCoreAppCurrent)"
@@ -163,8 +163,10 @@
163163
Condition="'$(UseLocalTargetingRuntimePack)' == 'true'"
164164
AfterTargets="ResolveTargetingPackAssets">
165165
<ItemGroup>
166-
<RuntimeFramework Version="$(ProductVersion)"
167-
Condition="'%(RuntimeFramework.FrameworkName)' == '$(LocalFrameworkOverrideName)'" />
166+
<RuntimeFramework Condition="'%(RuntimeFramework.FrameworkName)' == '$(LocalFrameworkOverrideName)'">
167+
<Version Condition="'$(StageTwoBuild)' != 'true'">$(ProductVersion)</Version>
168+
<Version Condition="'$(StageTwoBuild)' == 'true'">$(BundledNETCoreAppPackageVersion)</Version>
169+
</RuntimeFramework>
168170
</ItemGroup>
169171
</Target>
170172
</Project>

eng/toolAot.targets

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010

1111
<PropertyGroup Condition="'$(AotOrSingleFile)' == 'true' and '$(UseNativeAotForComponents)' != 'true'">
1212
<PublishSingleFile>true</PublishSingleFile>
13-
<PublishReadyToRun>true</PublishReadyToRun>
14-
<!-- Disable crossgen on NetBSD, illumos, Solaris, and Haiku for now. This can be revisited when we have full support. -->
15-
<PublishReadyToRun Condition="'$(TargetOS)' == 'netbsd' Or '$(TargetOS)' == 'illumos' Or '$(TargetOS)' == 'solaris' Or '$(TargetOS)' == 'haiku'">false</PublishReadyToRun>
16-
<!-- Disable crossgen on FreeBSD when cross building from Linux. -->
17-
<PublishReadyToRun Condition="'$(TargetOS)' == 'freebsd' and '$(CrossBuild)' == 'true'">false</PublishReadyToRun>
18-
<PublishReadyToRunComposite>$(PublishReadyToRun)</PublishReadyToRunComposite>
1913
</PropertyGroup>
2014

2115
<!-- Allow overriding the LKG ILCompiler package with a specific version. -->

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,8 @@
66

77
<Import Project="ILCompiler.props" />
88

9-
10-
<!-- BEGIN: Workaround for https://github.com/dotnet/runtime/issues/67742 -->
119
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">
1210
<PublishDir>$(RuntimeBinDir)ilc-published/</PublishDir>
13-
<PublishAot Condition="'$(UseNativeAotForComponents)' == 'true'">true</PublishAot>
14-
<PublishReadyToRun Condition="'$(UseNativeAotForComponents)' != 'true'">true</PublishReadyToRun>
15-
<PublishSingleFile Condition="'$(UseNativeAotForComponents)' != 'true'">true</PublishSingleFile>
16-
<PublishTrimmed Condition="'$(UseNativeAotForComponents)' != 'true'">true</PublishTrimmed>
1711
</PropertyGroup>
1812

1913
<Target Name="PublishCompiler"

src/coreclr/tools/aot/ILCompiler/ILCompiler.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
1313
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
1414
<Configurations>Debug;Release;Checked</Configurations>
15+
<UseLocalTargetingRuntimePack Condition="'$(StageTwoBuild)' == 'true'">true</UseLocalTargetingRuntimePack>
1516
</PropertyGroup>
1617

1718
<Import Project="../AotCompilerCommon.props" />
19+
<Import Project="$(RepositoryEngineeringDir)targetingpacks.targets" Condition="'$(StageTwoBuild)' == 'true'" />
1820

1921
<PropertyGroup>
2022
<SelfContained>true</SelfContained>

src/coreclr/tools/aot/crossgen2/crossgen2.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
1616
<Configurations>Debug;Release;Checked</Configurations>
1717
<RunAnalyzers>false</RunAnalyzers>
18+
<UseLocalTargetingRuntimePack Condition="'$(StageTwoBuild)' == 'true'">true</UseLocalTargetingRuntimePack>
1819
</PropertyGroup>
1920

2021
<Import Project="../AotCompilerCommon.props" />
22+
<Import Project="$(RepositoryEngineeringDir)targetingpacks.targets" Condition="'$(StageTwoBuild)' == 'true'" />
2123

2224
<ItemGroup Label="Embedded Resources">
2325
<EmbeddedResource Include="Properties\Resources.resx">

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@
1212
-->
1313
<PublishAot Condition="$(NETCoreSdkPortableRuntimeIdentifier.StartsWith('win-'))">true</PublishAot>
1414
<PublishSingleFile Condition="'$(PublishAot)' != 'true'">true</PublishSingleFile>
15+
<TrimmerSingleWarn>false</TrimmerSingleWarn>
16+
</PropertyGroup>
17+
18+
<PropertyGroup Condition="'$(CrossBuild)' != 'true' or ('$(StageOneBuild)' != 'true' and '$(StageTwoBuild)' != 'true')">
1519
<PublishReadyToRun>true</PublishReadyToRun>
1620
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
17-
<TrimmerSingleWarn>false</TrimmerSingleWarn>
1821
</PropertyGroup>
22+
1923
<Import Project="crossgen2.props" />
24+
2025
</Project>

0 commit comments

Comments
 (0)