From 9ff850ea5d29f487961d1c773bd495630aa8d2ea Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Wed, 5 Feb 2025 11:27:52 -0800 Subject: [PATCH] Allow the NativeAOT runtime pack to be specified as the ILC runtime package (#111876) * Allow the NativeAOT runtime pack to be specified as the ILC runtime package * Put the property in a PropertyGroup * Finish sentence * PR feedback --- ...soft.DotNet.ILCompiler.SingleEntry.targets | 6 ++++- .../Microsoft.NETCore.Native.Publish.targets | 4 +-- .../Microsoft.NETCore.Native.targets | 27 +++++++++++++------ ...soft.NETCore.App.Runtime.NativeAOT.sfxproj | 3 +++ 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets index c2627502f9ddd6..059d1754c68263 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets @@ -24,6 +24,8 @@ <_hostPackageName Condition="'$(_targetsNonPortableSdkRid)' == 'true'">runtime.$(RuntimeIdentifier).Microsoft.DotNet.ILCompiler <_targetPackageName>runtime.$(_originalTargetOS)-$(_targetArchitecture).Microsoft.DotNet.ILCompiler <_targetPackageName Condition="'$(_targetsNonPortableSdkRid)' == 'true'">runtime.$(RuntimeIdentifier).Microsoft.DotNet.ILCompiler + <_targetRuntimePackName>Microsoft.NETCore.App.Runtime.NativeAOT.$(_originalTargetOS)-$(_targetArchitecture) + <_targetRuntimePackName Condition="'$(_targetsNonPortableSdkRid)' == 'true'">Microsoft.NETCore.App.Runtime.NativeAOT.$(RuntimeIdentifier) <_targetOS>$(_originalTargetOS) @@ -64,8 +66,10 @@ @(ResolvedILCompilerPack->'%(PackageDirectory)') - @(ResolvedTargetILCompilerPack->'%(PackageDirectory)') @(ResolvedILCompilerPack->'%(PackageDirectory)') + @(ResolvedTargetILCompilerPack->'%(PackageDirectory)') + true + $(PublishAotUsingRuntimePack) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets index 0e633f34e3b24f..656e525ca32eb7 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets @@ -68,8 +68,8 @@ Text="Add a PackageReference for '$(_hostPackageName)' to allow cross-compilation for $(_targetArchitecture)" /> - - + + + + + <_NETCoreAppRuntimePackPath Condition="'$(PublishAotUsingRuntimePack)' == 'true'">%(_NETCoreAppFrameworkReference.RuntimePackPath)/runtimes/$(RuntimeIdentifier)/ + <_NETCoreAppRuntimePackPath Condition="'$(PublishAotUsingRuntimePack)' != 'true'">$(RuntimePackagePath)/runtimes/$(RuntimeIdentifier)/ + $(_NETCoreAppRuntimePackPath)\native\ + $(IlcFrameworkNativePath) + + + + $(RuntimePackagePath)\framework\ + $(RuntimePackagePath)\framework\ + $(RuntimePackagePath)\sdk\ + + $(IlcHostPackagePath)\tools\ - $(RuntimePackagePath)\framework\ - <_NETCoreAppRuntimePackPath>%(_NETCoreAppFrameworkReference.RuntimePackPath)/runtimes/$(RuntimeIdentifier)/ - $(_NETCoreAppRuntimePackPath)\native\ - $(RuntimePackagePath)\framework\ - $(IlcFrameworkNativePath) - $(RuntimePackagePath)\sdk\ $(RuntimePackagePath)\mibc\ - + - + diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.NativeAOT.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.NativeAOT.sfxproj index 336574ffe10fc7..34587e9fa80607 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.NativeAOT.sfxproj +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.NativeAOT.sfxproj @@ -20,8 +20,11 @@ + +