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

Fix CoreLib fast up-to-date check #69240

Merged
merged 7 commits into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/NoTargetsSdk.BeforeTargets.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
<TargetFramework Condition="'$(TargetFramework)' == '' and '$(TargetFrameworks)' == ''">$(NetCoreAppCurrent)</TargetFramework>
</PropertyGroup>

</Project>
</Project>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please just ignore this change. I originally had a change in that file and then reverted it in the GH UI. Don't want to spin another build for this...

46 changes: 19 additions & 27 deletions src/coreclr/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,28 @@
<Import Project="..\..\Directory.Build.targets" />

<ItemGroup>
<BuiltBinary Include="$(TargetPath)" />
<_AllPdbs Include="@(BuiltBinary -> '%(RootDir)%(Directory)%(Filename).pdb')">
<FolderName>$([System.IO.Directory]::GetParent(`%(Identity)`).Name)</FolderName>
</_AllPdbs>
<_DebugSymbolToMove Include="@(DebugSymbolsProjectOutputGroupOutput->Metadata('FinalOutputPath'))"
FolderName="$([System.IO.Directory]::GetParent('%(Identity)').Name)" />
<_DebugSymbolToMoveToExclude Include="@(_DebugSymbolToMove->WithMetadataValue('FolderName', 'aotsdk'))" />
<_DebugSymbolToMoveToUpdate Include="@(_DebugSymbolToMove)"
Exclude="@(_DebugSymbolToMoveToExclude)" />
<!-- Remove the FolderName metadata for projects that don't reside under an aotsdk folder. -->
<_DebugSymbolToMove Update="@(_DebugSymbolToMoveToUpdate)"
FolderName="" />
<_DebugSymbolToMove Update="@(_DebugSymbolToMove)"
Destination="$(RuntimeBinDir)PDB\%(FolderName)\%(Filename)%(Extension)" />
</ItemGroup>

<!-- Target used to consolidate all PDBs into a single location, except the aotsdk
PDBs, as S.P.C will overwrite the coreclr PDBs -->
<!-- Consolidate all PDBs into a single location, except the aotsdk PDBs, as S.P.C will overwrite the coreclr PDBs. -->
<Target Name="MoveSymbolFiles"
AfterTargets="Build"
Condition="Exists(@(_AllPdbs))"
Inputs="@(_AllPdbs)"
Outputs="@(_AllPdbs -> '$(RuntimeBinDir)PDB/%(Filename).pdb')">

<Move SourceFiles="@(_AllPdbs)"
DestinationFolder="$(RuntimeBinDir)PDB"
Condition="'%(_AllPdbs.FolderName)' != 'aotsdk'" />

</Target>

<Target Name="MoveAotSymbolFiles"
AfterTargets="Build"
Condition="Exists(@(_AllPdbs))"
Inputs="@(_AllPdbs)"
Outputs="@(_AllPdbs -> '$(RuntimeBinDir)PDB/aotsdk/%(Filename).pdb')">

<Move SourceFiles="@(_AllPdbs)"
DestinationFolder="$(RuntimeBinDir)PDB/aotsdk"
Condition="'%(_AllPdbs.FolderName)' == 'aotsdk'" />

AfterTargets="CopyFilesToOutputDirectory"
DependsOnTargets="_CheckForCompileOutputs"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any non-internal target that we can hang off of? Like this target is implied by CopyFilesToOutputDirectory. Is the AfterTargets here not enough?

Inputs="@(_DebugSymbolToMove)"
Outputs="@(_DebugSymbolToMove->Metadata('Destination'))"
Condition="'$(_DebugSymbolsProduced)' == 'true'">
<Copy SourceFiles="@(_DebugSymbolToMove)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason we're avoiding SkipUnchangedFiles?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That setting isn't useful when you leverage Target Inputs and Outputs. The documentation actually warns on using it: https://docs.microsoft.com/en-us/visualstudio/msbuild/copy-task?view=vs-2022.

DestinationFiles="@(_DebugSymbolToMove->Metadata('Destination'))"
UseHardlinksIfPossible="false" />
</Target>

<!-- Import targets here to have TargetPath and other macros defined. Limit to CoreLib. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>

<!-- Force System.Private.CoreLib.dll into a special IL output directory -->
<OutputPath>$(RuntimeBinDir)/IL/</OutputPath>
<OutputPath>$(RuntimeBinDir)IL\</OutputPath>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we usually normalize or use linux path separators?

<Configurations>Debug;Release;Checked</Configurations>
<Platforms>x64;x86;arm;arm64</Platforms>

Expand Down