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

Use live apphost when publishing ilc as singlefile #105004

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
8 changes: 4 additions & 4 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
<_NativeAotSupportedArch Condition="'$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'loongarch64' or ('$(TargetOS)' == 'windows' and '$(TargetArchitecture)' == 'x86')">true</_NativeAotSupportedArch>
<NativeAotSupported Condition="'$(_NativeAotSupportedOS)' == 'true' and '$(_NativeAotSupportedArch)' == 'true'">true</NativeAotSupported>
<UseNativeAotForComponents Condition="'$(NativeAotSupported)' == 'true' and '$(TargetOS)' == '$(HostOS)' and '$(TargetsLinuxBionic)' != 'true' and ('$(TargetsLinuxMusl)' != 'true' or '$(TargetArchitecture)' != 'arm')">true</UseNativeAotForComponents>
<BuildNativeAotAfterPacks Condition="'$(NativeAotSupported)' == 'true' and '$(TargetOS)' != '$(HostOS)'">true</BuildNativeAotAfterPacks>

<!-- If we're building clr.nativeaotlibs and not building the CLR runtime, compile libraries against NativeAOT CoreLib -->
<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>
Expand Down Expand Up @@ -359,7 +360,7 @@
$(CoreClrProjectRoot)tools\AssemblyChecker\AssemblyChecker.csproj" Category="clr" Condition="'$(DotNetBuildSourceOnly)' != 'true'"/>
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2.csproj" Category="clr" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler.Build.Tasks\ILCompiler.Build.Tasks.csproj" Category="clr" Condition="'$(NativeAotSupported)' == 'true'" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler.csproj" Category="clr" Condition="'$(NativeAotSupported)' == 'true'" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler.csproj" Category="clr" Condition="'$(NativeAotSupported)' == 'true' and '$(BuildNativeAotAfterPacks)' != 'true'" />
<ProjectToBuild Include="$(CoreClrProjectRoot)nativeaot\BuildIntegration\BuildIntegration.proj" Category="clr" Condition="'$(NativeAotSupported)' == 'true'" />

<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" />
Expand Down Expand Up @@ -537,13 +538,12 @@
<SharedFrameworkProjectToBuild Condition="'$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)' and '$(TargetsMobile)' != 'true'" Include="$(InstallerProjectRoot)pkg\archives\dotnet-nethost.proj" />
<SharedFrameworkProjectToBuild Condition="'$(MonoCrossAOTTargetOS)' != ''" Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\monocrossaot.sfxproj" Pack="true" />
</ItemGroup>
<ItemGroup>
<ProjectToBuild Condition="'$(NativeAotSupported)' == 'true' and '$(RuntimeFlavor)' != 'Mono' and '$(BuildOnlyPgoInstrumentedAssets)' != 'true'" Include="$(InstallerProjectRoot)\pkg\projects\nativeaot-packages.proj" Category="packs" />
</ItemGroup>
<ItemGroup>
<SharedFrameworkProjectToBuild Condition="'$(BuildMonoAOTCrossCompilerOnly)' != 'true'" Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\Microsoft.NETCore.App.Runtime.sfxproj" />
<SharedFrameworkProjectToBuild Condition="'$(BuildNativeAOTRuntimePack)' != 'true' and '$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)' and '$(TargetsMobile)' != 'true'" Include="$(InstallerProjectRoot)pkg\sfx\bundle\Microsoft.NETCore.App.Bundle.bundleproj" />
<ProjectToBuild Include="@(SharedFrameworkProjectToBuild)" Category="packs" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler.csproj" Category="clr" Condition="$(_subset.Contains('+clr.tools+')) and '$(TargetsMobile)' != 'true' and '$(NativeAotSupported)' == 'true' and '$(BuildNativeAotAfterPacks)' == 'true'" />
<ProjectToBuild Condition="'$(NativeAotSupported)' == 'true' and '$(RuntimeFlavor)' != 'Mono' and '$(BuildOnlyPgoInstrumentedAssets)' != 'true'" Include="$(InstallerProjectRoot)\pkg\projects\nativeaot-packages.proj" Category="packs" />
</ItemGroup>
</When>
</Choose>
Expand Down
20 changes: 7 additions & 13 deletions src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputPath>$(RuntimeBinDir)ilc/</OutputPath>
<RuntimeIdentifier>$(PackageRID)</RuntimeIdentifier>
<RuntimeIdentifier>$(OutputRID)</RuntimeIdentifier>
<UseLocalTargetingRuntimePack Condition="'$(UseNativeAotForComponents)' != 'true' and '$(CrossBuild)' == 'true' and '$(TargetOS)' != '$(HostOS)'">true</UseLocalTargetingRuntimePack>
</PropertyGroup>

<Import Project="ILCompiler.props" />
<Import Project="$(RepositoryEngineeringDir)targetingpacks.targets" Condition="'$(UseLocalTargetingRuntimePack)' == 'true'" />
<Import Project="$(RepositoryEngineeringDir)codeOptimization.targets" Condition="'$(UseLocalTargetingRuntimePack)' == 'true'" />

<Import Project="ILCompiler.props" />

<!-- BEGIN: Workaround for https://github.com/dotnet/runtime/issues/67742 -->
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">
<PublishDir>$(RuntimeBinDir)ilc-published/</PublishDir>
<PublishAot Condition="'$(UseNativeAotForComponents)' == 'true'">true</PublishAot>
<SysRoot Condition="'$(UseNativeAotForComponents)' == 'true' and '$(CrossBuild)' == 'true' and '$(HostOS)' != 'windows'">$(ROOTFS_DIR)</SysRoot>
<PublishReadyToRun Condition="'$(UseNativeAotForComponents)' != 'true'">true</PublishReadyToRun>
<PublishReadyToRun Condition="'$(UseNativeAotForComponents)' != 'true' and '$(UseLocalTargetingRuntimePack)' != 'true'">true</PublishReadyToRun>
<PublishSingleFile Condition="'$(UseNativeAotForComponents)' != 'true'">true</PublishSingleFile>
<PublishTrimmed Condition="'$(UseNativeAotForComponents)' != 'true'">true</PublishTrimmed>
<SuppressGenerateILCompilerExplicitPackageReferenceWarning>true</SuppressGenerateILCompilerExplicitPackageReferenceWarning>
Expand Down Expand Up @@ -88,15 +91,6 @@
<Target Name="PublishCompiler"
am11 marked this conversation as resolved.
Show resolved Hide resolved
Condition="'$(BuildingInsideVisualStudio)' != 'true'"
AfterTargets="Build"
DependsOnTargets="Publish;StompSingleFileHostPath" />
DependsOnTargets="Publish" />

<!-- HACK: liveBuilds stomps over SingleFileHostSourcePath, setting it to the host that we just built.
That's unfortunate because it's not the host we're supposed to use here. -->
<Target Name="StompSingleFileHostPath"
BeforeTargets="ResolveFrameworkReferences">
<PropertyGroup>
<SingleFileHostSourcePath></SingleFileHostSourcePath>
</PropertyGroup>
</Target>
<!-- END: Workaround for https://github.com/dotnet/runtime/issues/67742 -->
am11 marked this conversation as resolved.
Show resolved Hide resolved
</Project>
2 changes: 1 addition & 1 deletion src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<PropertyGroup>
<PublishTrimmed>true</PublishTrimmed>
<RuntimeIdentifier>$(PackageRID)</RuntimeIdentifier>
<RuntimeIdentifier>$(OutputRID)</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<UseLocalAppHostPack>true</UseLocalAppHostPack>
Expand Down
4 changes: 3 additions & 1 deletion src/installer/pkg/projects/netcoreappRIDs.props
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
built during official builds, however we wish to include them
in our runtime.json to enable others to provide them. -->
<UnofficialBuildRID Include="freebsd-x64" />
<UnofficialBuildRID Include="freebsd-arm64" />
<UnofficialBuildRID Include="freebsd-arm64">
<Platform>arm64</Platform>
</UnofficialBuildRID>
<UnofficialBuildRID Include="tizen.4.0.0-armel">
<Platform>armel</Platform>
</UnofficialBuildRID>
Expand Down