-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Define the managed dependencies of the crossgen-corelib.proj file through ProjectReferences #86735
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,72 +1,85 @@ | ||
| <Project Sdk="Microsoft.Build.NoTargets"> | ||
|
|
||
| <Target Name="PrepareForCrossgen"> | ||
| <PropertyGroup> | ||
| <OSPlatformConfig>$(TargetOS).$(TargetArchitecture).$(Configuration)</OSPlatformConfig> | ||
| <RootBinDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts'))</RootBinDir> | ||
| <LogsDir>$([MSBuild]::NormalizeDirectory('$(RootBinDir)', 'log'))</LogsDir> | ||
| <BinDir>$([MSBuild]::NormalizeDirectory('$(RootBinDir)', 'bin', 'coreclr', $(OSPlatformConfig)))</BinDir> | ||
| <IntermediatesDir>$([MSBuild]::NormalizeDirectory('$(RootBinDir)', 'obj', 'coreclr', $(OSPlatformConfig)))</IntermediatesDir> | ||
| <DotNetCli>$([MSBuild]::NormalizePath('$(RepoRoot)', 'dotnet.sh'))</DotNetCli> | ||
| <DotNetCli Condition="'$(OS)' == 'Windows_NT'">$([MSBuild]::NormalizePath('$(RepoRoot)', 'dotnet.cmd'))</DotNetCli> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <ProjectReference Include="$(CoreClrProjectRoot)/tools/aot/crossgen2/crossgen2.csproj" Condition="'$(CrossBuild)' != 'true' and '$(BuildArchitecture)' == '$(TargetArchitecture)'" OutputItemType="Crossgen2" /> | ||
| <ProjectReference Include="$(CoreClrProjectRoot)/tools/aot/crossgen2/crossgen2_crossarch.csproj" Condition="'$(CrossBuild)' == 'true' or '$(BuildArchitecture)' != '$(TargetArchitecture)'" OutputItemType="Crossgen2" /> | ||
| <ProjectReference Include="$(CoreClrProjectRoot)/tools/dotnet-pgo/dotnet-pgo.csproj" OutputItemType="DotNetPgo" Condition="'$(DotNetBuildFromSource)' != 'true'" /> | ||
| <ProjectReference Include="$([MSBuild]::NormalizePath('$(CoreClrProjectRoot)', 'System.Private.CoreLib', 'System.Private.CoreLib.csproj'))" OutputItemType="CoreLib" /> | ||
| </ItemGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <OSPlatformConfig>$(TargetOS).$(TargetArchitecture).$(Configuration)</OSPlatformConfig> | ||
| <RootBinDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts'))</RootBinDir> | ||
| <LogsDir>$([MSBuild]::NormalizeDirectory('$(RootBinDir)', 'log'))</LogsDir> | ||
| <BinDir>$([MSBuild]::NormalizeDirectory('$(RootBinDir)', 'bin', 'coreclr', $(OSPlatformConfig)))</BinDir> | ||
| <IntermediatesDir>$([MSBuild]::NormalizeDirectory('$(RootBinDir)', 'obj', 'coreclr', $(OSPlatformConfig)))</IntermediatesDir> | ||
| <DotNetCli>$([MSBuild]::NormalizePath('$(RepoRoot)', 'dotnet.sh'))</DotNetCli> | ||
| <DotNetCli Condition="'$(OS)' == 'Windows_NT'">$([MSBuild]::NormalizePath('$(RepoRoot)', 'dotnet.cmd'))</DotNetCli> | ||
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <BuildDll>true</BuildDll> | ||
| <BuildDll Condition="'$(TargetOS)' == 'netbsd' or '$(TargetOS)' == 'illumos' or '$(TargetOS)' == 'solaris'">false</BuildDll> | ||
| <BuildDll Condition="'$(TargetArchitecture)' == 'riscv64'">false</BuildDll> | ||
|
|
||
| <BuildPdb>false</BuildPdb> | ||
| <BuildPdb Condition="$(BuildDll) and '$(OS)' == 'Windows_NT' and '$(TargetOS)' == 'windows'">true</BuildPdb> | ||
|
|
||
| <BuildPerfMap>false</BuildPerfMap> | ||
| <BuildPerfMap Condition="$(BuildDll) and '$(TargetOS)' == 'linux'">true</BuildPerfMap> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <OptimizationMibcFiles Include="$(MibcOptimizationDataDir)/$(TargetOS)/$(TargetArchitecture)/**/*.mibc" /> | ||
| </ItemGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <CoreLibAssemblyName>System.Private.CoreLib</CoreLibAssemblyName> | ||
| <CoreLibOutputPath>$([MSBuild]::NormalizePath('$(BinDir)', '$(CoreLibAssemblyName).dll'))</CoreLibOutputPath> | ||
| <CoreLibNiPdbPath></CoreLibNiPdbPath> | ||
| <CoreLibPerfMapPath></CoreLibPerfMapPath> | ||
| <CoreLibNiPdbPath Condition="$(BuildPdb)">$([MSBuild]::NormalizePath('$(BinDir)', 'PDB', '$(CoreLibAssemblyName).ni.pdb'))</CoreLibNiPdbPath> | ||
| <CoreLibPerfMapPath Condition="$(BuildPerfMap)">$([MSBuild]::NormalizePath('$(BinDir)', '$(CoreLibAssemblyName).ni.r2rmap'))</CoreLibPerfMapPath> | ||
| <MergedMibcPath>$([MSBuild]::NormalizePath('$(BinDir)', 'StandardOptimizationData.mibc'))</MergedMibcPath> | ||
| </PropertyGroup> | ||
|
|
||
| <Target Name="MergeMibcFiles" | ||
| Inputs="@(OptimizationMibcFiles);@(DotNetPgo)" | ||
| Condition="'@(DotNetPgo)' != ''" | ||
|
jkoritzinsky marked this conversation as resolved.
|
||
| Outputs="$(MergedMibcPath)"> | ||
|
|
||
| <PropertyGroup> | ||
| <CrossDir></CrossDir> | ||
| <CrossDir Condition="'$(CrossBuild)' == 'true' or '$(BuildArchitecture)' != '$(TargetArchitecture)'">$(BuildArchitecture)</CrossDir> | ||
|
|
||
| <BuildDll>true</BuildDll> | ||
| <BuildDll Condition="'$(TargetOS)' == 'netbsd' or '$(TargetOS)' == 'illumos' or '$(TargetOS)' == 'solaris'">false</BuildDll> | ||
| <BuildDll Condition="'$(TargetArchitecture)' == 'riscv64'">false</BuildDll> | ||
|
|
||
| <BuildPdb>false</BuildPdb> | ||
| <BuildPdb Condition="$(BuildDll) and '$(OS)' == 'Windows_NT' and '$(TargetOS)' == 'windows'">true</BuildPdb> | ||
|
|
||
| <BuildPerfMap>false</BuildPerfMap> | ||
| <BuildPerfMap Condition="$(BuildDll) and '$(TargetOS)' == 'linux'">true</BuildPerfMap> | ||
| <DotNetPgoCmd>$(DotNetCli) @(DotNetPgo) merge</DotNetPgoCmd> | ||
| <DotNetPgoCmd>$(DotNetPgoCmd) -o:$(MergedMibcPath)</DotNetPgoCmd> | ||
| <DotNetPgoCmd>$(DotNetPgoCmd) @(OptimizationMibcFiles->'-i:%(Identity)', ' ')</DotNetPgoCmd> | ||
| <DotNetPgoCmd>$(DotNetPgoCmd) --inherit-timestamp</DotNetPgoCmd> <!-- For incremental builds, otherwise timestamp is too far in the future --> | ||
| <DotNetPgoCmd>$(DotNetPgoCmd) --compressed false</DotNetPgoCmd> <!-- Signing service doesn't handle compressed mibc signing correctly. --> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <CrossGen2DllFiles Condition="'$(CrossDir)' == ''" Include="$(BinDir)/crossgen2/*" /> | ||
| <CrossGen2DllFiles Condition="'$(CrossDir)' != ''" Include="$(BinDir)/$(CrossDir)/crossgen2/*" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <OptimizationMibcFiles Include="$(MibcOptimizationDataDir)/$(TargetOS)/$(TargetArchitecture)/**/*.mibc" /> | ||
| </ItemGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <CoreLibAssemblyName>System.Private.CoreLib</CoreLibAssemblyName> | ||
| <CoreLibInputPath>$([MSBuild]::NormalizePath('$(BinDir)', 'IL', '$(CoreLibAssemblyName).dll'))</CoreLibInputPath> | ||
| <CoreLibOutputPath>$([MSBuild]::NormalizePath('$(BinDir)', '$(CoreLibAssemblyName).dll'))</CoreLibOutputPath> | ||
| <CoreLibNiPdbPath></CoreLibNiPdbPath> | ||
| <CoreLibPerfMapPath></CoreLibPerfMapPath> | ||
| <CoreLibNiPdbPath Condition="$(BuildPdb)">$([MSBuild]::NormalizePath('$(BinDir)', 'PDB', '$(CoreLibAssemblyName).ni.pdb'))</CoreLibNiPdbPath> | ||
| <CoreLibPerfMapPath Condition="$(BuildPerfMap)">$([MSBuild]::NormalizePath('$(BinDir)', '$(CoreLibAssemblyName).ni.r2rmap'))</CoreLibPerfMapPath> | ||
| <MergedMibcPath>$([MSBuild]::NormalizePath('$(BinDir)', 'StandardOptimizationData.mibc'))</MergedMibcPath> | ||
| </PropertyGroup> | ||
| <Message Importance="High" Text="$(DotNetPgoCmd)"/> | ||
| <Exec Command="$(DotNetPgoCmd)" /> | ||
| </Target> | ||
|
|
||
| <Target Name="CreateMergedMibcFile" | ||
| DependsOnTargets="PrepareForCrossgen" | ||
| Inputs="@(OptimizationMibcFiles)" | ||
| Outputs="$(MergedMibcPath)"> | ||
| DependsOnTargets="ResolveProjectReferences;MergeMibcFiles" /> | ||
|
|
||
| <Target Name="PrepareInvokeCrossgen" DependsOnTargets="ResolveProjectReferences;CreateMergedMibcFile"> | ||
| <ItemGroup> | ||
| <Crossgen2Inputs Include="@(CoreLib)" /> | ||
| <Crossgen2Inputs Include="$(MergedMibcPath)" /> | ||
| </ItemGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <DotNetPgoCmd>$(DotNetCli) $([MSBuild]::NormalizePath('$(BinDir)', 'dotnet-pgo', 'dotnet-pgo.dll')) merge</DotNetPgoCmd> | ||
| <DotNetPgoCmd>$(DotNetPgoCmd) -o:$(MergedMibcPath)</DotNetPgoCmd> | ||
| <DotNetPgoCmd>$(DotNetPgoCmd) @(OptimizationMibcFiles->'-i:%(Identity)', ' ')</DotNetPgoCmd> | ||
| <DotNetPgoCmd>$(DotNetPgoCmd) --inherit-timestamp</DotNetPgoCmd> <!-- For incremental builds, otherwise timestamp is too far in the future --> | ||
| <DotNetPgoCmd>$(DotNetPgoCmd) --compressed false</DotNetPgoCmd> <!-- Signing service doesn't handle compressed mibc signing correctly. --> | ||
| <Crossgen2OutputPath>%(Crossgen2.RootDir)%(Crossgen2.Directory)</Crossgen2OutputPath> | ||
| </PropertyGroup> | ||
|
|
||
| <Message Condition="'$(DotNetBuildFromSource)' != 'true'" Importance="High" Text="$(DotNetPgoCmd)"/> | ||
| <Exec Condition="'$(DotNetBuildFromSource)' != 'true'" Command="$(DotNetPgoCmd)" /> | ||
| <ItemGroup> | ||
| <Crossgen2Files Include="$(Crossgen2OutputPath)/*.dll;$(Crossgen2OutputPath)/*.so;$(Crossgen2OutputPath)/*.dylib" /> | ||
| </ItemGroup> | ||
| </Target> | ||
|
|
||
| <Target Name="InvokeCrossgen" | ||
| DependsOnTargets="PrepareForCrossgen;CreateMergedMibcFile" | ||
| Inputs="$(CoreLibInputPath);@(CrossGen2DllFiles);$(MergedMibcPath)" | ||
| DependsOnTargets="PrepareInvokeCrossgen;CreateMergedMibcFile" | ||
| Inputs="@(Crossgen2Inputs);@(Crossgen2Files)" | ||
| Outputs="$(CoreLibOutputPath);$(CoreLibNiPdbPath);$(CoreLibPerfMapPath)" | ||
| AfterTargets="Build"> | ||
|
|
||
|
|
@@ -77,15 +90,15 @@ | |
| Text="Generating native image of System.Private.CoreLib for $(OSPlatformConfig). Logging to $(CrossGenCoreLibLog)" /> | ||
|
|
||
| <PropertyGroup> | ||
| <CrossGenDllCmd>$(DotNetCli) $([MSBuild]::NormalizePath('$(BinDir)', '$(CrossDir)', 'crossgen2', 'crossgen2.dll'))</CrossGenDllCmd> | ||
| <CrossGenDllCmd>$(DotNetCli) @(Crossgen2)</CrossGenDllCmd> | ||
| <CrossGenDllCmd>$(CrossGenDllCmd) -o:$(CoreLibOutputPath)</CrossGenDllCmd> | ||
| <CrossGenDllCmd>$(CrossGenDllCmd) -r:$([MSBuild]::NormalizePath('$(BinDir)', 'IL', '*.dll'))</CrossGenDllCmd> | ||
| <CrossGenDllCmd>$(CrossGenDllCmd) --targetarch:$(TargetArchitecture)</CrossGenDllCmd> | ||
| <CrossGenDllCmd>$(CrossGenDllCmd) --targetos:$(TargetOS)</CrossGenDllCmd> | ||
| <CrossGenDllCmd Condition="'$(UsingToolIbcOptimization)' != 'true' and '$(EnableNgenOptimization)' == 'true'">$(CrossGenDllCmd) -m:$(MergedMibcPath) --embed-pgo-data</CrossGenDllCmd> | ||
| <CrossGenDllCmd>$(CrossGenDllCmd) -O</CrossGenDllCmd> | ||
| <CrossGenDllCmd Condition="'$(Configuration)' == 'Debug' or '$(Configuration)' == 'Checked'">$(CrossGenDllCmd) --verify-type-and-field-layout</CrossGenDllCmd> | ||
| <CrossGenDllCmd>$(CrossGenDllCmd) $(CoreLibInputPath)</CrossGenDllCmd> | ||
| <CrossGenDllCmd>$(CrossGenDllCmd) @(CoreLib)</CrossGenDllCmd> | ||
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup Condition="$(BuildPdb)"> | ||
|
|
@@ -111,7 +124,7 @@ | |
|
|
||
| <Copy Condition="!$(BuildDll)" SourceFiles="$(CoreLibInputPath)" DestinationFiles="$(CoreLibOutputPath)" UseHardlinksIfPossible="true" /> | ||
|
|
||
| <Message Importance="High" Text="Crossgenning of System.Private.CoreLib succeeded. Finished at $(TIME)" /> | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| <Message Importance="High" Text="Crossgenning of System.Private.CoreLib succeeded." /> | ||
| <Message Importance="High" Text="Product binaries are available at $(BinDir)" /> | ||
| </Target> | ||
| </Project> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this anymore since we define this dependency through ProjectReferences now, which is nice.