From 269d51aecd30257d505915a78ddd7de5413adb7a Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Fri, 13 Dec 2024 13:55:16 -0800 Subject: [PATCH 01/13] Re-enable crossgen2 in aspnetcore --- src/SourceBuild/content/repo-projects/aspnetcore.proj | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/SourceBuild/content/repo-projects/aspnetcore.proj b/src/SourceBuild/content/repo-projects/aspnetcore.proj index 90221b9c57ff..03385c22ef7e 100644 --- a/src/SourceBuild/content/repo-projects/aspnetcore.proj +++ b/src/SourceBuild/content/repo-projects/aspnetcore.proj @@ -32,8 +32,6 @@ $(BuildArgs) $(FlagParameterPrefix)no-build-repo-tasks - - $(BuildArgs) /p:CrossgenOutput=false From ab03d21cbd254241aff63e0c2daafa359942ed3e Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Fri, 13 Dec 2024 15:30:04 -0800 Subject: [PATCH 02/13] Add patches from different repo PRs/branches. Let's see if it works. --- .../0002-Use-host-live-crossgen2.patch | 48 ++ ...0002-add-new-crossgen2-build-variant.patch | 504 ++++++++++++++++++ .../0001-use-live-crossgen2.patch | 74 +++ 3 files changed, 626 insertions(+) create mode 100644 src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch create mode 100644 src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch create mode 100644 src/SourceBuild/patches/windowsdesktop/0001-use-live-crossgen2.patch diff --git a/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch b/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch new file mode 100644 index 000000000000..1c6c769daff5 --- /dev/null +++ b/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch @@ -0,0 +1,48 @@ + +From d37bcaf1cc55f4dd34ddad48ad726fc413c1a25b Fri Dec 13 13:33:17 2024 +Author: Jeremy Koritzinsky +Date: Fri Dec 13 13:33:17 2024 -0800 +Subject: [PATCH] In VMR builds, a host-SDK crossgen will always be available. + +Backport: TBD +--- + +diff --git a/eng/tools/GenerateFiles/Directory.Build.targets.in b/eng/tools/GenerateFiles/Directory.Build.targets.in +index 88f09a8c89..66976bd6cd 100644 +--- a/eng/tools/GenerateFiles/Directory.Build.targets.in ++++ b/eng/tools/GenerateFiles/Directory.Build.targets.in +@@ -108,7 +108,7 @@ + + ${MicrosoftNETCoreAppRuntimeVersion} +- $(TargetRuntimeIdentifier) ++ $(NETCoreSdkRuntimeIdentifier);$(TargetRuntimeIdentifier) + + + +diff --git a/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.Composite.sfxproj b/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.Composite.sfxproj +index 68d2861437..7d75aa7f8c 100644 +--- a/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.Composite.sfxproj ++++ b/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.Composite.sfxproj +@@ -15,8 +15,6 @@ + LatestPatch + + false +- +- false + true + + false +diff --git a/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.sfxproj b/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.sfxproj +index d3160de441..533c6840f9 100644 +--- a/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.sfxproj ++++ b/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.sfxproj +@@ -15,8 +15,6 @@ + LatestPatch + + false +- +- false + true + + false diff --git a/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch b/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch new file mode 100644 index 000000000000..9576d26ca390 --- /dev/null +++ b/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch @@ -0,0 +1,504 @@ +From 25efc5179a47fcdb3551167ecd56b6af950abdc9 Mon Sep 17 00:00:00 2001 +From: Jeremy Koritzinsky +Date: Tue, 10 Dec 2024 13:40:42 -0800 +Subject: [PATCH 1/9] Add a new crossgen2 build variant for a published + crossgen2 targetting the host OS + +Backport: https://github.com/dotnet/runtime/pull/110676 +--- + .../aot/crossgen2/crossgen2_inbuild_publish.csproj | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + create mode 100644 src/coreclr/tools/aot/crossgen2/crossgen2_inbuild_publish.csproj + +diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild_publish.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild_publish.csproj +new file mode 100644 +index 0000000000000..4514fc66051a2 +--- /dev/null ++++ b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild_publish.csproj +@@ -0,0 +1,13 @@ ++ ++ ++ $(BuildArchitecture) ++ <_IsPublishing>true ++ $(NETCoreSdkRuntimeIdentifier) ++ $(RuntimeBinDir)crossgen2-inbuild-published/ ++ true ++ true ++ false ++ true ++ ++ ++ + +From 4571db600f2fd5cd07f624c4321481461825aeea Mon Sep 17 00:00:00 2001 +From: Jeremy Koritzinsky +Date: Tue, 10 Dec 2024 13:45:08 -0800 +Subject: [PATCH 2/9] Remove the .NET-hosted in-build crossgen2 and just use + the published in-build host-targeting crossgen2. + +--- + .../tools/aot/crossgen2/crossgen2_inbuild.csproj | 12 ++++++++---- + .../aot/crossgen2/crossgen2_inbuild_publish.csproj | 13 ------------- + .../sfx/Microsoft.NETCore.App/ReadyToRun.targets | 6 ++---- + 3 files changed, 10 insertions(+), 21 deletions(-) + delete mode 100644 src/coreclr/tools/aot/crossgen2/crossgen2_inbuild_publish.csproj + +diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj +index bf997aa8ebb03..53f1880f8719e 100644 +--- a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj ++++ b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj +@@ -1,9 +1,13 @@ +- ++ + + $(BuildArchitecture) +- $(RuntimeBinDir)/$(BuildArchitecture)/crossgen2/ +- $(NetCoreAppToolCurrent) +- false ++ <_IsPublishing>true ++ $(NETCoreSdkRuntimeIdentifier) ++ $(RuntimeBinDir)/$(BuildArchitecture)/crossgen2/ ++ true ++ true ++ false ++ true + + + +diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild_publish.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild_publish.csproj +deleted file mode 100644 +index 4514fc66051a2..0000000000000 +--- a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild_publish.csproj ++++ /dev/null +@@ -1,13 +0,0 @@ +- +- +- $(BuildArchitecture) +- <_IsPublishing>true +- $(NETCoreSdkRuntimeIdentifier) +- $(RuntimeBinDir)crossgen2-inbuild-published/ +- true +- true +- false +- true +- +- +- +diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets b/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets +index 09730ed226502..1e27f828c5bf5 100644 +--- a/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets ++++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets +@@ -2,16 +2,14 @@ + + + 1 +- $([MSBuild]::NormalizePath('$(Crossgen2InBuildDir)', 'crossgen2.dll')) +- $(DotNetTool) ++ $([MSBuild]::NormalizePath('$(Crossgen2InBuildDir)', 'crossgen2$(ExeSuffix)')) + + + + + + +- +\ No newline at end of file ++ + +From 59407a278ee5f7bc022c797929d4c36d8688d187 Mon Sep 17 00:00:00 2001 +From: Jeremy Koritzinsky +Date: Thu, 12 Dec 2024 20:12:36 +0000 +Subject: [PATCH 3/9] Extract crossgen2 sfxproj changes from #109710 + +--- + .../Microsoft.NETCore.App.Crossgen2.sfxproj | 25 ++----------------- + 1 file changed, 2 insertions(+), 23 deletions(-) + +diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj +index c9d40b79d38db..d375b395092e8 100644 +--- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj ++++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj +@@ -1,6 +1,5 @@ +- +- +- ++ ++ + + + +@@ -11,7 +10,6 @@ + dotnet-crossgen2 + crossgen2 + false +- tools/ + true + + false +@@ -72,23 +70,4 @@ + <_SymbolFilesToPackage Include="@(_Crossgen2SymbolFilesToPackage)" TargetPath="tools/" /> + + +- +- +- +- +- +- +- +- +- +- <_PackagedFilesToPublish Include="@(_FilesToPackage)" Condition="'%(_FilesToPackage.PackOnly)' != 'true'" /> +- +- +- +- +- +- + + +From c888d16e33bf5b9fcdd58909a5981fcc70552d7a Mon Sep 17 00:00:00 2001 +From: Jeremy Koritzinsky +Date: Thu, 12 Dec 2024 20:15:28 +0000 +Subject: [PATCH 4/9] Extract the properties and targets that will be shared + into a separate props file. + +--- + .../Microsoft.NETCore.App.Crossgen2.props | 59 +++++++++++++++++++ + .../Microsoft.NETCore.App.Crossgen2.sfxproj | 56 +----------------- + 2 files changed, 61 insertions(+), 54 deletions(-) + create mode 100644 src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.props + +diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.props b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.props +new file mode 100644 +index 0000000000000..6650cee2f1894 +--- /dev/null ++++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.props +@@ -0,0 +1,59 @@ ++ ++ ++ ++ true ++ ToolPack ++ $(SharedFrameworkName).Crossgen2 ++ $(SharedFrameworkName).$(RuntimeIdentifier) ++ dotnet-crossgen2 ++ crossgen2 ++ false ++ true ++ ++ false ++ ++ ++ ++ ++ ++ ++ ++ ++ <_CrossgenPublishFiles Include="@(_RawCrossgenPublishFiles->'%(OutputPath)')" ++ KeepMetadata="REMOVE_ALL" /> ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ unix ++ win ++ $(TargetOSComponent)-$(TargetArchitecture) ++ ++ ++ ++ ++ <_Crossgen2SymbolFilesToPackage Include="@(_CrossgenPublishFiles)" Condition="'%(Extension)' == '.pdb'" /> ++ ++ <_Crossgen2SymbolFilesToPackage Include="@(NativeRuntimeAsset->'$(CoreCLRArtifactsPdbDir)%(FileName).pdb')" Condition="'$(TargetOS)' == 'windows' and '%(FileName)' != 'crossgen2'" /> ++ <_Crossgen2SymbolFilesToPackage Include="@(NativeRuntimeAsset->'$(CoreCLRArtifactsPath)%(FileName)%(Extension)$(SymbolsSuffix)')" Condition="'$(TargetOS)' != 'windows' and '%(FileName)' != 'crossgen2'" /> ++ <_Crossgen2SymbolFilesToPackage Remove="@(_Crossgen2SymbolFilesToPackage)" Condition="!Exists('%(Identity)')" /> ++ ++ <_SymbolFilesToPackage Include="@(_Crossgen2SymbolFilesToPackage)" TargetPath="tools/" /> ++ ++ ++ +diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj +index d375b395092e8..97e6737c777ac 100644 +--- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj ++++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj +@@ -2,48 +2,14 @@ + + + +- +- true +- ToolPack +- $(SharedFrameworkName).Crossgen2 +- $(SharedFrameworkName).$(RuntimeIdentifier) +- dotnet-crossgen2 +- crossgen2 +- false +- true +- +- false ++ $(RepoRoot)src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj + + + + + + +- +- +- +- +- +- +- <_CrossgenPublishFiles Include="@(_RawCrossgenPublishFiles->'%(OutputPath)')" +- KeepMetadata="REMOVE_ALL" /> +- +- +- +- +- +- +- +- +- ++ + + +@@ -52,22 +18,4 @@ + + + +- +- +- unix +- win +- $(TargetOSComponent)-$(TargetArchitecture) +- +- +- +- +- <_Crossgen2SymbolFilesToPackage Include="@(_CrossgenPublishFiles)" Condition="'%(Extension)' == '.pdb'" /> +- +- <_Crossgen2SymbolFilesToPackage Include="@(NativeRuntimeAsset->'$(CoreCLRArtifactsPdbDir)%(FileName).pdb')" Condition="'$(TargetOS)' == 'windows' and '%(FileName)' != 'crossgen2'" /> +- <_Crossgen2SymbolFilesToPackage Include="@(NativeRuntimeAsset->'$(CoreCLRArtifactsPath)%(FileName)%(Extension)$(SymbolsSuffix)')" Condition="'$(TargetOS)' != 'windows' and '%(FileName)' != 'crossgen2'" /> +- <_Crossgen2SymbolFilesToPackage Remove="@(_Crossgen2SymbolFilesToPackage)" Condition="!Exists('%(Identity)')" /> +- +- <_SymbolFilesToPackage Include="@(_Crossgen2SymbolFilesToPackage)" TargetPath="tools/" /> +- +- + + +From f79e23cd777704c02e8d4e0c2e4e17a1cff1dfee Mon Sep 17 00:00:00 2001 +From: Jeremy Koritzinsky +Date: Thu, 12 Dec 2024 22:41:10 +0000 +Subject: [PATCH 5/9] Add a "host crossgen2" project + +--- + .../tools/aot/crossgen2/crossgen2_inbuild.csproj | 2 +- + .../Microsoft.NETCore.App.Crossgen2.Host.sfxproj | 11 +++++++++++ + 2 files changed, 12 insertions(+), 1 deletion(-) + create mode 100644 src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.Host.sfxproj + +diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj +index 53f1880f8719e..ca803976ad878 100644 +--- a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj ++++ b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj +@@ -3,7 +3,7 @@ + $(BuildArchitecture) + <_IsPublishing>true + $(NETCoreSdkRuntimeIdentifier) +- $(RuntimeBinDir)/$(BuildArchitecture)/crossgen2/ ++ $(RuntimeBinDir)$(BuildArchitecture)/crossgen2/ + true + true + false +diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.Host.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.Host.sfxproj +new file mode 100644 +index 0000000000000..6f7c19cda2dab +--- /dev/null ++++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.Host.sfxproj +@@ -0,0 +1,11 @@ ++ ++ ++ ++ ++ $(RepoRoot)src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj ++ $(NETCoreSdkRuntimeIdentifier) ++ false ++ ++ ++ ++ + +From 6d7961d6adb3fb5ac6b81714baf611bd6f8ccbfa Mon Sep 17 00:00:00 2001 +From: Jeremy Koritzinsky +Date: Thu, 12 Dec 2024 23:20:41 +0000 +Subject: [PATCH 6/9] Add the crossgen2 host package to Subsets.props for the + correct scenarios. + +--- + eng/Subsets.props | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/eng/Subsets.props b/eng/Subsets.props +index a50fd3e80025e..d10deecfe4127 100644 +--- a/eng/Subsets.props ++++ b/eng/Subsets.props +@@ -548,6 +548,13 @@ + + + ++ ++ ++ ++ + + + + +From 080336c4f6614ae8dc6867680a0915eff9207872 Mon Sep 17 00:00:00 2001 +From: Jeremy Koritzinsky +Date: Fri, 13 Dec 2024 12:03:10 -0800 +Subject: [PATCH 7/9] Fix crossgen-corelib to work with the new in-build + crossgen2 + +--- + src/coreclr/crossgen-corelib.proj | 16 ++++------------ + 1 file changed, 4 insertions(+), 12 deletions(-) + +diff --git a/src/coreclr/crossgen-corelib.proj b/src/coreclr/crossgen-corelib.proj +index 714c1efafd55a..ed54fc3cf11fa 100644 +--- a/src/coreclr/crossgen-corelib.proj ++++ b/src/coreclr/crossgen-corelib.proj +@@ -1,7 +1,7 @@ + + + +- ++ + + + +@@ -92,21 +92,13 @@ + + + +- +- +- +- %(Crossgen2.RootDir)/%(Crossgen2.Directory) +- +- +- +- +- ++ + + + + + +@@ -117,7 +109,7 @@ + Text="Generating native image of System.Private.CoreLib for $(OSPlatformConfig). Logging to $(CrossGenCoreLibLog)" /> + + +- $(DotNetCli) @(Crossgen2) ++ @(Crossgen2Files->Metadata('OutputPath')->WithMetadataValue('Filename','crossgen2')->WithMetadataValue('Extension','$(ExeSuffix)')) + $(CrossGenDllCmd) -o:$(CoreLibOutputPath) + $(CrossGenDllCmd) -r:$([MSBuild]::NormalizePath('$(BinDir)', 'IL', '*.dll')) + $(CrossGenDllCmd) --targetarch:$(TargetArchitecture) + +From b1b74f7fcb7a8d0509c7e7d05cfcbe38f159bdfc Mon Sep 17 00:00:00 2001 +From: Jeremy Koritzinsky +Date: Fri, 13 Dec 2024 13:20:36 -0800 +Subject: [PATCH 8/9] Publish the in-build crossgen2 as single file to avoid + having to adjust the AOT-in-build logic to handle AOT-ing for the host. + +--- + src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj +index ca803976ad878..5794e80b532f0 100644 +--- a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj ++++ b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj +@@ -6,8 +6,10 @@ + $(RuntimeBinDir)$(BuildArchitecture)/crossgen2/ + true + true ++ true ++ true ++ true + false +- true + + + + +From dd2461f510c5b959982fd8c11f6aae224f6b47c7 Mon Sep 17 00:00:00 2001 +From: Jeremy Koritzinsky +Date: Fri, 13 Dec 2024 14:06:29 -0800 +Subject: [PATCH 9/9] AOT on Windows only + +--- + src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj +index 5794e80b532f0..5e19365fad161 100644 +--- a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj ++++ b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj +@@ -6,7 +6,12 @@ + $(RuntimeBinDir)$(BuildArchitecture)/crossgen2/ + true + true +- true ++ ++ true ++ true + true + true + false diff --git a/src/SourceBuild/patches/windowsdesktop/0001-use-live-crossgen2.patch b/src/SourceBuild/patches/windowsdesktop/0001-use-live-crossgen2.patch new file mode 100644 index 000000000000..6c3b53e28e60 --- /dev/null +++ b/src/SourceBuild/patches/windowsdesktop/0001-use-live-crossgen2.patch @@ -0,0 +1,74 @@ +From 1ef690888a7668a6c25ea3f0647ca06108e64d6b Mon Sep 17 00:00:00 2001 +From: Jeremy Koritzinsky +Date: Fri, 13 Dec 2024 13:40:47 -0800 +Subject: [PATCH 1/2] Use the live crossgen2 corresponding to the runtime we're + building against. + +Backport: https://github.com/dotnet/windowsdesktop/pull/4815 + +--- + src/windowsdesktop/src/sfx/Directory.Build.targets | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/windowsdesktop/src/sfx/Directory.Build.targets b/src/windowsdesktop/src/sfx/Directory.Build.targets +index ca14567ba..721779d78 100644 +--- a/src/windowsdesktop/src/sfx/Directory.Build.targets ++++ b/src/windowsdesktop/src/sfx/Directory.Build.targets +@@ -5,13 +5,19 @@ + + ++ + + + + ++ + + + + +From aa7933c4e56dae574cc2314d59561e32f9c12ebe Mon Sep 17 00:00:00 2001 +From: Jeremy Koritzinsky +Date: Fri, 13 Dec 2024 14:14:34 -0800 +Subject: [PATCH 2/2] Change style to enable referencing custom metadata + +--- + .../src/sfx/Directory.Build.targets | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/src/windowsdesktop/src/sfx/Directory.Build.targets b/src/windowsdesktop/src/sfx/Directory.Build.targets +index 721779d78..7da1ca224 100644 +--- a/src/windowsdesktop/src/sfx/Directory.Build.targets ++++ b/src/windowsdesktop/src/sfx/Directory.Build.targets +@@ -4,15 +4,15 @@ + + + ++ Update="Microsoft.NETCore.App"> ++ $(MicrosoftNETCoreAppRefVersion) ++ $(MicrosoftNETCoreAppRefVersion) ++ $(MicrosoftNETCoreAppRefVersion) ++ + ++ Update="Microsoft.NETCore.App.Crossgen2"> ++ $(MicrosoftNETCoreAppRefVersion) ++ + + + From 4041bfe30e1410f023d71387ff11e8b124aa2be3 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Fri, 13 Dec 2024 16:13:06 -0800 Subject: [PATCH 03/13] Cleanup patch into one unified diff patch and adjust to not conflict with the other runtime patch --- ...0002-add-new-crossgen2-build-variant.patch | 489 ++++++------------ 1 file changed, 156 insertions(+), 333 deletions(-) diff --git a/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch b/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch index 9576d26ca390..f007aed96d03 100644 --- a/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch +++ b/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch @@ -1,53 +1,79 @@ From 25efc5179a47fcdb3551167ecd56b6af950abdc9 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Tue, 10 Dec 2024 13:40:42 -0800 -Subject: [PATCH 1/9] Add a new crossgen2 build variant for a published +Subject: [PATCH] Add a new crossgen2 build variant for a published crossgen2 targetting the host OS Backport: https://github.com/dotnet/runtime/pull/110676 --- - .../aot/crossgen2/crossgen2_inbuild_publish.csproj | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - create mode 100644 src/coreclr/tools/aot/crossgen2/crossgen2_inbuild_publish.csproj - -diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild_publish.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild_publish.csproj -new file mode 100644 -index 0000000000000..4514fc66051a2 ---- /dev/null -+++ b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild_publish.csproj -@@ -0,0 +1,13 @@ -+ -+ -+ $(BuildArchitecture) -+ <_IsPublishing>true -+ $(NETCoreSdkRuntimeIdentifier) -+ $(RuntimeBinDir)crossgen2-inbuild-published/ -+ true -+ true -+ false -+ true -+ -+ -+ - -From 4571db600f2fd5cd07f624c4321481461825aeea Mon Sep 17 00:00:00 2001 -From: Jeremy Koritzinsky -Date: Tue, 10 Dec 2024 13:45:08 -0800 -Subject: [PATCH 2/9] Remove the .NET-hosted in-build crossgen2 and just use - the published in-build host-targeting crossgen2. - ---- - .../tools/aot/crossgen2/crossgen2_inbuild.csproj | 12 ++++++++---- - .../aot/crossgen2/crossgen2_inbuild_publish.csproj | 13 ------------- - .../sfx/Microsoft.NETCore.App/ReadyToRun.targets | 6 ++---- - 3 files changed, 10 insertions(+), 21 deletions(-) - delete mode 100644 src/coreclr/tools/aot/crossgen2/crossgen2_inbuild_publish.csproj - +diff --git a/eng/Subsets.props b/eng/Subsets.props +index a50fd3e8002..3b7082d9178 100644 +--- a/eng/Subsets.props ++++ b/eng/Subsets.props +@@ -548,5 +548,12 @@ + + + ++ ++ ++ ++ + + +diff --git a/src/coreclr/crossgen-corelib.proj b/src/coreclr/crossgen-corelib.proj +index 714c1efafd5..ed54fc3cf11 100644 +--- a/src/coreclr/crossgen-corelib.proj ++++ b/src/coreclr/crossgen-corelib.proj +@@ -1,7 +1,7 @@ + + + +- ++ + + + +@@ -92,21 +92,13 @@ + + + +- +- +- +- %(Crossgen2.RootDir)/%(Crossgen2.Directory) +- +- +- +- +- ++ + + + + + +@@ -117,7 +109,7 @@ + Text="Generating native image of System.Private.CoreLib for $(OSPlatformConfig). Logging to $(CrossGenCoreLibLog)" /> + + +- $(DotNetCli) @(Crossgen2) ++ @(Crossgen2Files->Metadata('OutputPath')->WithMetadataValue('Filename','crossgen2')->WithMetadataValue('Extension','$(ExeSuffix)')) + $(CrossGenDllCmd) -o:$(CoreLibOutputPath) + $(CrossGenDllCmd) -r:$([MSBuild]::NormalizePath('$(BinDir)', 'IL', '*.dll')) + $(CrossGenDllCmd) --targetarch:$(TargetArchitecture) diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj -index bf997aa8ebb03..53f1880f8719e 100644 +index bf997aa8ebb..5e19365fad1 100644 --- a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj +++ b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj -@@ -1,9 +1,13 @@ +@@ -1,9 +1,20 @@ - + @@ -57,128 +83,60 @@ index bf997aa8ebb03..53f1880f8719e 100644 - false + <_IsPublishing>true + $(NETCoreSdkRuntimeIdentifier) -+ $(RuntimeBinDir)/$(BuildArchitecture)/crossgen2/ ++ $(RuntimeBinDir)$(BuildArchitecture)/crossgen2/ + true + true ++ ++ true ++ true ++ true ++ true + false -+ true diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild_publish.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild_publish.csproj -deleted file mode 100644 -index 4514fc66051a2..0000000000000 ---- a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild_publish.csproj -+++ /dev/null -@@ -1,13 +0,0 @@ -- -- -- $(BuildArchitecture) -- <_IsPublishing>true -- $(NETCoreSdkRuntimeIdentifier) -- $(RuntimeBinDir)crossgen2-inbuild-published/ -- true -- true -- false -- true -- -- -- -diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets b/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets -index 09730ed226502..1e27f828c5bf5 100644 ---- a/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets -+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets -@@ -2,16 +2,14 @@ - - - 1 -- $([MSBuild]::NormalizePath('$(Crossgen2InBuildDir)', 'crossgen2.dll')) -- $(DotNetTool) -+ $([MSBuild]::NormalizePath('$(Crossgen2InBuildDir)', 'crossgen2$(ExeSuffix)')) - - - - - - -- -\ No newline at end of file +new file mode 100644 +index 00000000000..4514fc66051 +--- /dev/null ++++ b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild_publish.csproj +@@ -0,0 +1,13 @@ ++ ++ ++ $(BuildArchitecture) ++ <_IsPublishing>true ++ $(NETCoreSdkRuntimeIdentifier) ++ $(RuntimeBinDir)crossgen2-inbuild-published/ ++ true ++ true ++ false ++ true ++ ++ + - -From 59407a278ee5f7bc022c797929d4c36d8688d187 Mon Sep 17 00:00:00 2001 -From: Jeremy Koritzinsky -Date: Thu, 12 Dec 2024 20:12:36 +0000 -Subject: [PATCH 3/9] Extract crossgen2 sfxproj changes from #109710 - ---- - .../Microsoft.NETCore.App.Crossgen2.sfxproj | 25 ++----------------- - 1 file changed, 2 insertions(+), 23 deletions(-) - -diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj -index c9d40b79d38db..d375b395092e8 100644 ---- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj -+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj -@@ -1,6 +1,5 @@ -- -- -- +diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.Host.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.Host.sfxproj +new file mode 100644 +index 00000000000..6f7c19cda2d +--- /dev/null ++++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.Host.sfxproj +@@ -0,0 +1,11 @@ + + - - - -@@ -11,7 +10,6 @@ - dotnet-crossgen2 - crossgen2 - false -- tools/ - true - - false -@@ -72,23 +70,4 @@ - <_SymbolFilesToPackage Include="@(_Crossgen2SymbolFilesToPackage)" TargetPath="tools/" /> - - -- -- -- -- -- -- -- -- -- -- <_PackagedFilesToPublish Include="@(_FilesToPackage)" Condition="'%(_FilesToPackage.PackOnly)' != 'true'" /> -- -- -- -- -- -- - - -From c888d16e33bf5b9fcdd58909a5981fcc70552d7a Mon Sep 17 00:00:00 2001 -From: Jeremy Koritzinsky -Date: Thu, 12 Dec 2024 20:15:28 +0000 -Subject: [PATCH 4/9] Extract the properties and targets that will be shared - into a separate props file. - ---- - .../Microsoft.NETCore.App.Crossgen2.props | 59 +++++++++++++++++++ - .../Microsoft.NETCore.App.Crossgen2.sfxproj | 56 +----------------- - 2 files changed, 61 insertions(+), 54 deletions(-) - create mode 100644 src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.props - ++ ++ ++ $(RepoRoot)src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj ++ $(NETCoreSdkRuntimeIdentifier) ++ false ++ ++ ++ ++ diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.props b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.props new file mode 100644 -index 0000000000000..6650cee2f1894 +index 00000000000..6650cee2f18 --- /dev/null +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.props @@ -0,0 +1,59 @@ @@ -242,11 +200,15 @@ index 0000000000000..6650cee2f1894 + + diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj -index d375b395092e8..97e6737c777ac 100644 +index c9d40b79d38..97e6737c777 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj -@@ -2,48 +2,14 @@ - +@@ -1,51 +1,15 @@ +- +- +- ++ ++ - @@ -257,6 +219,7 @@ index d375b395092e8..97e6737c777ac 100644 - dotnet-crossgen2 - crossgen2 - false +- tools/ - true - - false @@ -296,7 +259,7 @@ index d375b395092e8..97e6737c777ac 100644 -@@ -52,22 +18,4 @@ +@@ -54,41 +18,4 @@ @@ -318,187 +281,47 @@ index d375b395092e8..97e6737c777ac 100644 - <_SymbolFilesToPackage Include="@(_Crossgen2SymbolFilesToPackage)" TargetPath="tools/" /> - - +- +- +- +- +- +- +- +- +- +- <_PackagedFilesToPublish Include="@(_FilesToPackage)" Condition="'%(_FilesToPackage.PackOnly)' != 'true'" /> +- +- +- +- +- +- - -From f79e23cd777704c02e8d4e0c2e4e17a1cff1dfee Mon Sep 17 00:00:00 2001 -From: Jeremy Koritzinsky -Date: Thu, 12 Dec 2024 22:41:10 +0000 -Subject: [PATCH 5/9] Add a "host crossgen2" project - ---- - .../tools/aot/crossgen2/crossgen2_inbuild.csproj | 2 +- - .../Microsoft.NETCore.App.Crossgen2.Host.sfxproj | 11 +++++++++++ - 2 files changed, 12 insertions(+), 1 deletion(-) - create mode 100644 src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.Host.sfxproj - -diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj -index 53f1880f8719e..ca803976ad878 100644 ---- a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj -+++ b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj -@@ -3,7 +3,7 @@ - $(BuildArchitecture) - <_IsPublishing>true - $(NETCoreSdkRuntimeIdentifier) -- $(RuntimeBinDir)/$(BuildArchitecture)/crossgen2/ -+ $(RuntimeBinDir)$(BuildArchitecture)/crossgen2/ - true - true - false -diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.Host.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.Host.sfxproj -new file mode 100644 -index 0000000000000..6f7c19cda2dab ---- /dev/null -+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.Host.sfxproj -@@ -0,0 +1,11 @@ -+ -+ -+ -+ -+ $(RepoRoot)src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj -+ $(NETCoreSdkRuntimeIdentifier) -+ false -+ -+ -+ -+ - -From 6d7961d6adb3fb5ac6b81714baf611bd6f8ccbfa Mon Sep 17 00:00:00 2001 -From: Jeremy Koritzinsky -Date: Thu, 12 Dec 2024 23:20:41 +0000 -Subject: [PATCH 6/9] Add the crossgen2 host package to Subsets.props for the - correct scenarios. - ---- - eng/Subsets.props | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/eng/Subsets.props b/eng/Subsets.props -index a50fd3e80025e..d10deecfe4127 100644 ---- a/eng/Subsets.props -+++ b/eng/Subsets.props -@@ -548,6 +548,13 @@ - - - -+ -+ -+ -+ - - - - -From 080336c4f6614ae8dc6867680a0915eff9207872 Mon Sep 17 00:00:00 2001 -From: Jeremy Koritzinsky -Date: Fri, 13 Dec 2024 12:03:10 -0800 -Subject: [PATCH 7/9] Fix crossgen-corelib to work with the new in-build - crossgen2 - ---- - src/coreclr/crossgen-corelib.proj | 16 ++++------------ - 1 file changed, 4 insertions(+), 12 deletions(-) - -diff --git a/src/coreclr/crossgen-corelib.proj b/src/coreclr/crossgen-corelib.proj -index 714c1efafd55a..ed54fc3cf11fa 100644 ---- a/src/coreclr/crossgen-corelib.proj -+++ b/src/coreclr/crossgen-corelib.proj -@@ -1,7 +1,7 @@ - +diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets b/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets +index 09730ed2265..1e27f828c5b 100644 +--- a/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets ++++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets +@@ -2,16 +2,14 @@ + + + 1 +- $([MSBuild]::NormalizePath('$(Crossgen2InBuildDir)', 'crossgen2.dll')) +- $(DotNetTool) ++ $([MSBuild]::NormalizePath('$(Crossgen2InBuildDir)', 'crossgen2$(ExeSuffix)')) + - -- -+ - - - -@@ -92,21 +92,13 @@ - - -- -- -- -- %(Crossgen2.RootDir)/%(Crossgen2.Directory) -- -- -- -- -- -+ + - - - -@@ -117,7 +109,7 @@ - Text="Generating native image of System.Private.CoreLib for $(OSPlatformConfig). Logging to $(CrossGenCoreLibLog)" /> - - -- $(DotNetCli) @(Crossgen2) -+ @(Crossgen2Files->Metadata('OutputPath')->WithMetadataValue('Filename','crossgen2')->WithMetadataValue('Extension','$(ExeSuffix)')) - $(CrossGenDllCmd) -o:$(CoreLibOutputPath) - $(CrossGenDllCmd) -r:$([MSBuild]::NormalizePath('$(BinDir)', 'IL', '*.dll')) - $(CrossGenDllCmd) --targetarch:$(TargetArchitecture) - -From b1b74f7fcb7a8d0509c7e7d05cfcbe38f159bdfc Mon Sep 17 00:00:00 2001 -From: Jeremy Koritzinsky -Date: Fri, 13 Dec 2024 13:20:36 -0800 -Subject: [PATCH 8/9] Publish the in-build crossgen2 as single file to avoid - having to adjust the AOT-in-build logic to handle AOT-ing for the host. - ---- - src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj -index ca803976ad878..5794e80b532f0 100644 ---- a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj -+++ b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj -@@ -6,8 +6,10 @@ - $(RuntimeBinDir)$(BuildArchitecture)/crossgen2/ - true - true -+ true -+ true -+ true - false -- true - - - - -From dd2461f510c5b959982fd8c11f6aae224f6b47c7 Mon Sep 17 00:00:00 2001 -From: Jeremy Koritzinsky -Date: Fri, 13 Dec 2024 14:06:29 -0800 -Subject: [PATCH 9/9] AOT on Windows only - ---- - src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj -index 5794e80b532f0..5e19365fad161 100644 ---- a/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj -+++ b/src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj -@@ -6,7 +6,12 @@ - $(RuntimeBinDir)$(BuildArchitecture)/crossgen2/ - true - true -- true -+ -+ true -+ true - true - true - false +- +\ No newline at end of file ++ From 20f7ec6c3faecfe829588b5e83a0cf322d693173 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Mon, 16 Dec 2024 11:52:45 -0800 Subject: [PATCH 04/13] Update patches. --- .../0002-Use-host-live-crossgen2.patch | 14 +++ ...0002-add-new-crossgen2-build-variant.patch | 93 +++++++++++++++++++ 2 files changed, 107 insertions(+) diff --git a/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch b/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch index 1c6c769daff5..389821e50caf 100644 --- a/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch +++ b/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch @@ -46,3 +46,17 @@ index d3160de441..533c6840f9 100644 true false +diff --git a/eng/tools/GenerateFiles/Directory.Build.targets.in b/eng/tools/GenerateFiles/Directory.Build.targets.in +index 66976bd6cd..535ad48b08 100644 +--- a/eng/tools/GenerateFiles/Directory.Build.targets.in ++++ b/eng/tools/GenerateFiles/Directory.Build.targets.in +@@ -80,7 +80,8 @@ + ${MicrosoftNETCoreAppRuntimeVersion} +- $(TargetRuntimeIdentifier) ++ ++ $(NETCoreSdkRuntimeIdentifier);$(TargetRuntimeIdentifier) + + + diff --git a/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch b/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch index f007aed96d03..5c9ab7dead22 100644 --- a/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch +++ b/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch @@ -325,3 +325,96 @@ index 09730ed2265..1e27f828c5b 100644 - \ No newline at end of file + +diff --git a/src/installer/pkg/Directory.Build.props b/src/installer/pkg/Directory.Build.props +deleted file mode 100644 +index f5171867636..00000000000 +--- a/src/installer/pkg/Directory.Build.props ++++ /dev/null +@@ -1,21 +0,0 @@ +- +- +- +- +- $(TargetArchitecture) +- +- +- +- $(Platform) +- x64 +- +- $(MSBuildThisFileDirectory)packageIndex.json +- +- +- true +- +- +- +- +- +- +diff --git a/src/installer/pkg/Directory.Build.targets b/src/installer/pkg/Directory.Build.targets +deleted file mode 100644 +index 9a502b2705e..00000000000 +--- a/src/installer/pkg/Directory.Build.targets ++++ /dev/null +@@ -1,19 +0,0 @@ +- +- +- +- +- +- +- +- +- +diff --git a/src/installer/pkg/projects/Directory.Build.props b/src/installer/pkg/projects/Directory.Build.props +index a07b360efc0..08e5bde54a5 100644 +--- a/src/installer/pkg/projects/Directory.Build.props ++++ b/src/installer/pkg/projects/Directory.Build.props +@@ -2,6 +2,19 @@ + + + ++ ++ $(MSBuildThisFileDirectory)packageIndex.json ++ ++ ++ true ++ ++ ++ ++ ++ ++ ++ ++ $(TargetArchitecture) + AnyCPU + + true +diff --git a/src/installer/pkg/packageIndex.json b/src/installer/pkg/projects/packageIndex.json +similarity index 100% +rename from src/installer/pkg/packageIndex.json +rename to src/installer/pkg/projects/packageIndex.json +diff --git a/src/installer/pkg/sfx/installers/dotnet-host.proj b/src/installer/pkg/sfx/installers/dotnet-host.proj +index 1d4b96ab335..26374305866 100644 +--- a/src/installer/pkg/sfx/installers/dotnet-host.proj ++++ b/src/installer/pkg/sfx/installers/dotnet-host.proj +@@ -20,7 +20,7 @@ + osx_scripts/host + The .NET Shared Host. + +- dotnet-host $(MajorVersion).$(MinorVersion) $(Platform) ++ dotnet-host $(MajorVersion).$(MinorVersion) $(TargetArchitecture) + + + From 3faace4003a785f3378b15a81324feb2da1383ba Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Mon, 16 Dec 2024 15:18:24 -0800 Subject: [PATCH 05/13] Reference live RID graph for sfxproj projects in aspnetcore --- .../0002-Use-host-live-crossgen2.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch b/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch index 389821e50caf..634728e32987 100644 --- a/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch +++ b/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch @@ -60,3 +60,21 @@ index 66976bd6cd..535ad48b08 100644 +diff --git a/eng/targets/Sfx.Common.targets b/eng/targets/Sfx.Common.targets +index 5ff818b44f..c587e3760e 100644 +--- a/eng/targets/Sfx.Common.targets ++++ b/eng/targets/Sfx.Common.targets +@@ -36,4 +36,13 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ $(NuGetPackageRoot)Microsoft.NETCore.Platforms/$(MicrosoftNETCorePlatformsVersion)/PortableRuntimeIdentifierGraph.json ++ + From 66e14f5a327b28639c2624d35c03343927c00a53 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Tue, 17 Dec 2024 13:33:00 -0800 Subject: [PATCH 06/13] Update patches --- .../0002-Use-host-live-crossgen2.patch | 14 ++++++++++ ...0002-add-new-crossgen2-build-variant.patch | 27 +++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch b/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch index 634728e32987..7307ceb68edd 100644 --- a/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch +++ b/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch @@ -78,3 +78,17 @@ index 5ff818b44f..c587e3760e 100644 + $(NuGetPackageRoot)Microsoft.NETCore.Platforms/$(MicrosoftNETCorePlatformsVersion)/PortableRuntimeIdentifierGraph.json + +diff --git a/eng/targets/Sfx.Common.targets b/eng/targets/Sfx.Common.targets +index c587e3760e..f97b379391 100644 +--- a/eng/targets/Sfx.Common.targets ++++ b/eng/targets/Sfx.Common.targets +@@ -42,7 +42,7 @@ + + + +- +- $(NuGetPackageRoot)Microsoft.NETCore.Platforms/$(MicrosoftNETCorePlatformsVersion)/PortableRuntimeIdentifierGraph.json ++ ++ $(NuGetPackageRoot)microsoft.netcore.platforms/$(MicrosoftNETCorePlatformsVersion)/PortableRuntimeIdentifierGraph.json + + diff --git a/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch b/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch index 5c9ab7dead22..ba7dd6ef772d 100644 --- a/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch +++ b/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch @@ -418,3 +418,30 @@ index 1d4b96ab335..26374305866 100644 +diff --git a/eng/DotNetBuild.props b/eng/DotNetBuild.props +index 86f8ce3b0ff..d4ace3ebb7c 100644 +--- a/eng/DotNetBuild.props ++++ b/eng/DotNetBuild.props +@@ -107,6 +107,9 @@ + + + $(InnerBuildArgs) /p:NetCoreAppToolCurrentVersion=$(NetCoreAppToolCurrentVersion) ++ ++ ++ $(InnerBuildArgs) /p:ShortStack=true + + + +diff --git a/eng/Subsets.props b/eng/Subsets.props +index d10deecfe41..693b3c0d097 100644 +--- a/eng/Subsets.props ++++ b/eng/Subsets.props +@@ -553,7 +553,7 @@ + When we're building in the VMR, we need to provide a crossgen2 that runs on the host machine for downstream repos to use to R2R their code. + In non-VMR builds, downstream repos can use the crossgen2 built for the target host SDK from another build leg, but in the VMR we need to provide one to use. + --> +- ++ + + + From d4b715bdacf2385a63f8b1db1f2c7b61bfd5ba48 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Tue, 17 Dec 2024 14:54:50 -0800 Subject: [PATCH 07/13] Add an os-only RID into the RID graph to enable the crossgen2 discovery in aspnetcore to work --- ...0002-add-new-crossgen2-build-variant.patch | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch b/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch index ba7dd6ef772d..a1a890997e32 100644 --- a/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch +++ b/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch @@ -445,3 +445,48 @@ index d10deecfe41..693b3c0d097 100644 +diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj b/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj +index 84e378bd855..03b61f277c3 100644 +--- a/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj ++++ b/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj +@@ -22,8 +22,18 @@ + + + ++ ++ ++ ++ $(OutputRID.Split('-')[0]) ++ $(AdditionalRuntimeIdentifierParent.Split('-')[0]) ++ $(AdditionalRuntimeIdentifierParent) ++ ++ ++ + +- ++ ++ + + + +diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/UpdateRuntimeIdentifierGraph.cs b/src/libraries/Microsoft.NETCore.Platforms/src/UpdateRuntimeIdentifierGraph.cs +index 867da09df9b..182e724f4f9 100644 +--- a/src/libraries/Microsoft.NETCore.Platforms/src/UpdateRuntimeIdentifierGraph.cs ++++ b/src/libraries/Microsoft.NETCore.Platforms/src/UpdateRuntimeIdentifierGraph.cs +@@ -1,6 +1,7 @@ + // Licensed to the .NET Foundation under one or more agreements. + // The .NET Foundation licenses this file to you under the MIT license. + ++using System; + using System.IO; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; +@@ -40,7 +41,7 @@ public override bool Execute() + continue; + } + +- string[] importedRids = rid.GetMetadata("Imports").Split(';'); ++ string[] importedRids = rid.GetMetadata("Imports").Split([';'], StringSplitOptions.RemoveEmptyEntries); + runtimes.Add(rid.ItemSpec, new JObject(new JProperty("#import", new JArray(importedRids)))); + } + From c32c58a5d6c96cc0b4e4195c61af905bdcad5d3d Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Wed, 18 Dec 2024 15:19:54 -0800 Subject: [PATCH 08/13] mark crossgen2 host package as vertical-only --- ...0002-add-new-crossgen2-build-variant.patch | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch b/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch index a1a890997e32..ab915b96e123 100644 --- a/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch +++ b/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch @@ -490,3 +490,83 @@ index 867da09df9b..182e724f4f9 100644 runtimes.Add(rid.ItemSpec, new JObject(new JProperty("#import", new JArray(importedRids)))); } +diff --git a/eng/Signing.props b/eng/Signing.props +index c1ff2d8ba47..f3c1cb5b25a 100644 +--- a/eng/Signing.props ++++ b/eng/Signing.props +@@ -1,6 +1,6 @@ + + +- false ++ false + + + +@@ -27,10 +27,10 @@ + + + +- + +@@ -45,20 +45,35 @@ + + + ++ ++ ++ ++ + + +- +- +- %(FullPath).sha512 +- ++ ++ ++ ++ %(FullPath).sha512 ++ ++ ++ ++ ++ ++ %(FullPath).sha512 ++ ++ ++ + + + + +- +- +- +- ++ + + + + ++ ++ unix ++ win ++ $(TargetOSComponent)-$(TargetArchitecture) ++ ++ + + + <_Crossgen2SymbolFilesToPackage Include="@(_CrossgenPublishFiles)" Condition="'%(Extension)' == '.pdb'" /> +diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj b/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj +index 580023b627f..03b61f277c3 100644 +--- a/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj ++++ b/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj +@@ -24,7 +24,6 @@ + + + +- + + $(OutputRID.Split('-')[0]) + $(AdditionalRuntimeIdentifierParent.Split('-')[0]) From 0020f62059fb9c34348fa922a01c784d51b5c1cd Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Thu, 19 Dec 2024 14:07:51 -0800 Subject: [PATCH 10/13] Update aspnetcore patch --- .../0002-Use-host-live-crossgen2.patch | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch b/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch index 7307ceb68edd..595fb64c2c79 100644 --- a/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch +++ b/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch @@ -92,3 +92,25 @@ index c587e3760e..f97b379391 100644 + $(NuGetPackageRoot)microsoft.netcore.platforms/$(MicrosoftNETCorePlatformsVersion)/PortableRuntimeIdentifierGraph.json +diff --git a/eng/tools/GenerateFiles/Directory.Build.targets.in b/eng/tools/GenerateFiles/Directory.Build.targets.in +index 4d56e7e3f1..535ad48b08 100644 +--- a/eng/tools/GenerateFiles/Directory.Build.targets.in ++++ b/eng/tools/GenerateFiles/Directory.Build.targets.in +@@ -81,7 +81,7 @@ + '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' AND + '$(TargetLatestDotNetRuntime)' != 'false' ">${MicrosoftNETCoreAppRuntimeVersion} + +- %(RuntimePackRuntimeIdentifiers);$(NETCoreSdkRuntimeIdentifier);$(TargetRuntimeIdentifier) ++ $(NETCoreSdkRuntimeIdentifier);$(TargetRuntimeIdentifier) + + + +@@ -109,7 +109,7 @@ + + ${MicrosoftNETCoreAppRuntimeVersion} +- %(Crossgen2RuntimeIdentifiers);$(NETCoreSdkRuntimeIdentifier);$(TargetRuntimeIdentifier) ++ $(NETCoreSdkRuntimeIdentifier);$(TargetRuntimeIdentifier) + + + From f8855f2476962af2bf996eb5518ddcbc8016c2d2 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Thu, 19 Dec 2024 14:32:18 -0800 Subject: [PATCH 11/13] Update runtime patch --- .../0002-add-new-crossgen2-build-variant.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch b/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch index 4513389427d8..eb691b279afa 100644 --- a/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch +++ b/src/SourceBuild/patches/runtime/0002-add-new-crossgen2-build-variant.patch @@ -622,3 +622,16 @@ index 580023b627f..03b61f277c3 100644 $(OutputRID.Split('-')[0]) $(AdditionalRuntimeIdentifierParent.Split('-')[0]) +diff --git a/eng/Signing.props b/eng/Signing.props +index 1afa4131efc..e1c09e470e8 100644 +--- a/eng/Signing.props ++++ b/eng/Signing.props +@@ -74,7 +74,7 @@ + %(FullPath).sha512 + + +- + + From 992e3bba254970eacc4d3df20a1c154834d5a1df Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Thu, 19 Dec 2024 14:50:48 -0800 Subject: [PATCH 12/13] Update aspnetcore patch --- .../0002-Use-host-live-crossgen2.patch | 63 ++++++------------- 1 file changed, 19 insertions(+), 44 deletions(-) diff --git a/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch b/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch index 595fb64c2c79..1f6e382e8826 100644 --- a/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch +++ b/src/SourceBuild/patches/aspnetcore/0002-Use-host-live-crossgen2.patch @@ -1,27 +1,15 @@ +From d37bcaf1cc55f4dd34ddad48ad726fc413c1a25b Mon Sep 17 00:00:00 2001 +From: Jeremy Koritzinsky +Date: Fri, 13 Dec 2024 13:33:17 -0800 +Subject: [PATCH 1/5] In VMR builds, a host-SDK crossgen will always be + available. -From d37bcaf1cc55f4dd34ddad48ad726fc413c1a25b Fri Dec 13 13:33:17 2024 -Author: Jeremy Koritzinsky -Date: Fri Dec 13 13:33:17 2024 -0800 -Subject: [PATCH] In VMR builds, a host-SDK crossgen will always be available. +Backport: https://github.com/dotnet/aspnetcore/pull/59551 -Backport: TBD --- -diff --git a/eng/tools/GenerateFiles/Directory.Build.targets.in b/eng/tools/GenerateFiles/Directory.Build.targets.in -index 88f09a8c89..66976bd6cd 100644 ---- a/eng/tools/GenerateFiles/Directory.Build.targets.in -+++ b/eng/tools/GenerateFiles/Directory.Build.targets.in -@@ -108,7 +108,7 @@ - - ${MicrosoftNETCoreAppRuntimeVersion} -- $(TargetRuntimeIdentifier) -+ $(NETCoreSdkRuntimeIdentifier);$(TargetRuntimeIdentifier) - - - diff --git a/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.Composite.sfxproj b/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.Composite.sfxproj -index 68d2861437..7d75aa7f8c 100644 +index 68d28614376b..7d75aa7f8caf 100644 --- a/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.Composite.sfxproj +++ b/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.Composite.sfxproj @@ -15,8 +15,6 @@ @@ -34,7 +22,7 @@ index 68d2861437..7d75aa7f8c 100644 false diff --git a/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.sfxproj b/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.sfxproj -index d3160de441..533c6840f9 100644 +index d3160de441ac..533c6840f9e0 100644 --- a/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.sfxproj +++ b/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.sfxproj @@ -15,8 +15,6 @@ @@ -47,7 +35,7 @@ index d3160de441..533c6840f9 100644 false diff --git a/eng/tools/GenerateFiles/Directory.Build.targets.in b/eng/tools/GenerateFiles/Directory.Build.targets.in -index 66976bd6cd..535ad48b08 100644 +index 66976bd6cd56..535ad48b08f3 100644 --- a/eng/tools/GenerateFiles/Directory.Build.targets.in +++ b/eng/tools/GenerateFiles/Directory.Build.targets.in @@ -80,7 +80,8 @@ @@ -60,8 +48,9 @@ index 66976bd6cd..535ad48b08 100644 + diff --git a/eng/targets/Sfx.Common.targets b/eng/targets/Sfx.Common.targets -index 5ff818b44f..c587e3760e 100644 +index 5ff818b44f2d..c587e3760e83 100644 --- a/eng/targets/Sfx.Common.targets +++ b/eng/targets/Sfx.Common.targets @@ -36,4 +36,13 @@ @@ -74,43 +63,29 @@ index 5ff818b44f..c587e3760e 100644 + + + -+ -+ $(NuGetPackageRoot)Microsoft.NETCore.Platforms/$(MicrosoftNETCorePlatformsVersion)/PortableRuntimeIdentifierGraph.json -+ - -diff --git a/eng/targets/Sfx.Common.targets b/eng/targets/Sfx.Common.targets -index c587e3760e..f97b379391 100644 ---- a/eng/targets/Sfx.Common.targets -+++ b/eng/targets/Sfx.Common.targets -@@ -42,7 +42,7 @@ - - - -- -- $(NuGetPackageRoot)Microsoft.NETCore.Platforms/$(MicrosoftNETCorePlatformsVersion)/PortableRuntimeIdentifierGraph.json + + $(NuGetPackageRoot)microsoft.netcore.platforms/$(MicrosoftNETCorePlatformsVersion)/PortableRuntimeIdentifierGraph.json - ++ + diff --git a/eng/tools/GenerateFiles/Directory.Build.targets.in b/eng/tools/GenerateFiles/Directory.Build.targets.in -index 4d56e7e3f1..535ad48b08 100644 +index 535ad48b08f3..4d56e7e3f139 100644 --- a/eng/tools/GenerateFiles/Directory.Build.targets.in +++ b/eng/tools/GenerateFiles/Directory.Build.targets.in @@ -81,7 +81,7 @@ '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' AND '$(TargetLatestDotNetRuntime)' != 'false' ">${MicrosoftNETCoreAppRuntimeVersion} -- %(RuntimePackRuntimeIdentifiers);$(NETCoreSdkRuntimeIdentifier);$(TargetRuntimeIdentifier) -+ $(NETCoreSdkRuntimeIdentifier);$(TargetRuntimeIdentifier) +- $(NETCoreSdkRuntimeIdentifier);$(TargetRuntimeIdentifier) ++ %(RuntimePackRuntimeIdentifiers);$(NETCoreSdkRuntimeIdentifier);$(TargetRuntimeIdentifier) -@@ -109,7 +109,7 @@ - +@@ -110,6 +110,6 @@ ${MicrosoftNETCoreAppRuntimeVersion} -- %(Crossgen2RuntimeIdentifiers);$(NETCoreSdkRuntimeIdentifier);$(TargetRuntimeIdentifier) -+ $(NETCoreSdkRuntimeIdentifier);$(TargetRuntimeIdentifier) +- $(TargetRuntimeIdentifier) ++ %(Crossgen2RuntimeIdentifiers);$(NETCoreSdkRuntimeIdentifier);$(TargetRuntimeIdentifier) From 72bfd652e03110c9ac1e0ff47847e1e093d74b14 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Thu, 19 Dec 2024 18:53:18 -0800 Subject: [PATCH 13/13] Update runtime patch --- .../runtime/0001-add-new-crossgen2-build-variant.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SourceBuild/patches/runtime/0001-add-new-crossgen2-build-variant.patch b/src/SourceBuild/patches/runtime/0001-add-new-crossgen2-build-variant.patch index 40566b56c277..62651713c2d4 100644 --- a/src/SourceBuild/patches/runtime/0001-add-new-crossgen2-build-variant.patch +++ b/src/SourceBuild/patches/runtime/0001-add-new-crossgen2-build-variant.patch @@ -21,7 +21,7 @@ index 86f8ce3b0ff..d4ace3ebb7c 100644 diff --git a/eng/Signing.props b/eng/Signing.props -index c1ff2d8ba47..1afa4131efc 100644 +index c1ff2d8ba47..83d46fd57a7 100644 --- a/eng/Signing.props +++ b/eng/Signing.props @@ -1,6 +1,6 @@ @@ -71,7 +71,7 @@ index c1ff2d8ba47..1afa4131efc 100644 + + + -+ ++ + +