From 1cb67588293d385631f952ae73ed02fd0e938a49 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Wed, 24 May 2023 16:13:27 -0700 Subject: [PATCH 1/3] Define the managed dependencies of the crossgen-corelib.proj file through ProjectReferences Instead of having an implicit ordering, directly add ProjectReference dependencies here to make it possible to "dotnet build" this project to crossgen corelib. This also fixes a long-standing bug from a clean build that you'd need to build clr.tools as dotnet-pgo wouldn't be built when just building clr.runtime+clr.corelib+clr.nativecorelib. --- eng/Subsets.props | 3 - src/coreclr/crossgen-corelib.proj | 118 ++++++++++++++++-------------- 2 files changed, 64 insertions(+), 57 deletions(-) diff --git a/eng/Subsets.props b/eng/Subsets.props index 093120feb24111..2906f49cd76d73 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -357,9 +357,6 @@ - - - diff --git a/src/coreclr/crossgen-corelib.proj b/src/coreclr/crossgen-corelib.proj index 7be878d4e19abf..4f6ab2b14aee08 100644 --- a/src/coreclr/crossgen-corelib.proj +++ b/src/coreclr/crossgen-corelib.proj @@ -1,59 +1,55 @@ - - - $(TargetOS).$(TargetArchitecture).$(Configuration) - $([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts')) - $([MSBuild]::NormalizeDirectory('$(RootBinDir)', 'log')) - $([MSBuild]::NormalizeDirectory('$(RootBinDir)', 'bin', 'coreclr', $(OSPlatformConfig))) - $([MSBuild]::NormalizeDirectory('$(RootBinDir)', 'obj', 'coreclr', $(OSPlatformConfig))) - $([MSBuild]::NormalizePath('$(RepoRoot)', 'dotnet.sh')) - $([MSBuild]::NormalizePath('$(RepoRoot)', 'dotnet.cmd')) - - - - - $(BuildArchitecture) - - true - false - false - - false - true - - false - true - - - - - - - - - - - - - System.Private.CoreLib - $([MSBuild]::NormalizePath('$(BinDir)', 'IL', '$(CoreLibAssemblyName).dll')) - $([MSBuild]::NormalizePath('$(BinDir)', '$(CoreLibAssemblyName).dll')) - - - $([MSBuild]::NormalizePath('$(BinDir)', 'PDB', '$(CoreLibAssemblyName).ni.pdb')) - $([MSBuild]::NormalizePath('$(BinDir)', '$(CoreLibAssemblyName).ni.r2rmap')) - $([MSBuild]::NormalizePath('$(BinDir)', 'StandardOptimizationData.mibc')) - - + + + + + + + + + $(TargetOS).$(TargetArchitecture).$(Configuration) + $([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts')) + $([MSBuild]::NormalizeDirectory('$(RootBinDir)', 'log')) + $([MSBuild]::NormalizeDirectory('$(RootBinDir)', 'bin', 'coreclr', $(OSPlatformConfig))) + $([MSBuild]::NormalizeDirectory('$(RootBinDir)', 'obj', 'coreclr', $(OSPlatformConfig))) + $([MSBuild]::NormalizePath('$(RepoRoot)', 'dotnet.sh')) + $([MSBuild]::NormalizePath('$(RepoRoot)', 'dotnet.cmd')) + + + + true + false + false + + false + true + + false + true + + + + + + + + System.Private.CoreLib + $([MSBuild]::NormalizePath('$(BinDir)', '$(CoreLibAssemblyName).dll')) + + + $([MSBuild]::NormalizePath('$(BinDir)', 'PDB', '$(CoreLibAssemblyName).ni.pdb')) + $([MSBuild]::NormalizePath('$(BinDir)', '$(CoreLibAssemblyName).ni.r2rmap')) + $([MSBuild]::NormalizePath('$(BinDir)', 'StandardOptimizationData.mibc')) + - $(DotNetCli) $([MSBuild]::NormalizePath('$(BinDir)', 'dotnet-pgo', 'dotnet-pgo.dll')) merge + $(DotNetCli) @(DotNetPgo) merge $(DotNetPgoCmd) -o:$(MergedMibcPath) $(DotNetPgoCmd) @(OptimizationMibcFiles->'-i:%(Identity)', ' ') $(DotNetPgoCmd) --inherit-timestamp @@ -64,9 +60,23 @@ + + + + + + + + %(Crossgen2.RootDir)%(Crossgen2.Directory) + + + + + + @@ -77,7 +87,7 @@ Text="Generating native image of System.Private.CoreLib for $(OSPlatformConfig). Logging to $(CrossGenCoreLibLog)" /> - $(DotNetCli) $([MSBuild]::NormalizePath('$(BinDir)', '$(CrossDir)', 'crossgen2', 'crossgen2.dll')) + $(DotNetCli) @(Crossgen2) $(CrossGenDllCmd) -o:$(CoreLibOutputPath) $(CrossGenDllCmd) -r:$([MSBuild]::NormalizePath('$(BinDir)', 'IL', '*.dll')) $(CrossGenDllCmd) --targetarch:$(TargetArchitecture) @@ -85,7 +95,7 @@ $(CrossGenDllCmd) -m:$(MergedMibcPath) --embed-pgo-data $(CrossGenDllCmd) -O $(CrossGenDllCmd) --verify-type-and-field-layout - $(CrossGenDllCmd) $(CoreLibInputPath) + $(CrossGenDllCmd) @(CoreLib) @@ -111,7 +121,7 @@ - + From f5650cbbef0f9370bb1ccd14d645a066e8b07f8f Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Thu, 25 May 2023 10:28:29 -0700 Subject: [PATCH 2/3] Disable the ProjectReference to dotnet-pgo in source-build. It isn't source-build compatible. --- src/coreclr/crossgen-corelib.proj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/coreclr/crossgen-corelib.proj b/src/coreclr/crossgen-corelib.proj index 4f6ab2b14aee08..fb453aa849756a 100644 --- a/src/coreclr/crossgen-corelib.proj +++ b/src/coreclr/crossgen-corelib.proj @@ -3,7 +3,7 @@ - + @@ -46,6 +46,7 @@ @@ -56,8 +57,8 @@ $(DotNetPgoCmd) --compressed false - - + + From 73dc181a5385c369e457c94f2fc8e7715c48118f Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Thu, 25 May 2023 11:03:31 -0700 Subject: [PATCH 3/3] PR feedback. --- src/coreclr/crossgen-corelib.proj | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/coreclr/crossgen-corelib.proj b/src/coreclr/crossgen-corelib.proj index fb453aa849756a..0ee3d5185c1934 100644 --- a/src/coreclr/crossgen-corelib.proj +++ b/src/coreclr/crossgen-corelib.proj @@ -43,8 +43,7 @@ $([MSBuild]::NormalizePath('$(BinDir)', 'StandardOptimizationData.mibc')) - @@ -61,6 +60,9 @@ + + @@ -71,13 +73,13 @@ %(Crossgen2.RootDir)%(Crossgen2.Directory) - +