Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Build and publish .ni.pdb for R2R images #75489

Merged
merged 1 commit into from
Oct 11, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
<PropertyGroup>
<CrossgenWorkDir>$(PublishDir)CrossGen\</CrossgenWorkDir>
<OriginalAssemblyDir>$(CrossgenWorkDir)OriginalAssemblies\</OriginalAssemblyDir>
<PdbWorkDir>$(CrossgenWorkDir)Symbols\</PdbWorkDir>
</PropertyGroup>
</Target>

Expand All @@ -104,7 +105,21 @@
</ItemGroup>
</Target>

<!--
Compiles all R2R images and packages the symbol files (*.ni.pdb)
-->
<Target Name="CompileReadyToRun"
DependsOnTargets="CompileReadyToRunImage"
Condition="'$(GenerateReadyToRun)' == 'true'">

<MakeDir Directories="$(ArtifactsNonShippingPackagesDir)" />
<ZipDirectory SourceDirectory="$(PdbWorkDir)" DestinationFile="$(ArtifactsNonShippingPackagesDir)$(ProjectName).symbols.nupkg" />
Copy link
Member

Choose a reason for hiding this comment

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

I thought the fix would be much complicated than that, thanks! By the way how did you figured this out? Is there any documents related to this?

Copy link
Member Author

@tmat tmat Oct 11, 2024

Choose a reason for hiding this comment

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

Arcade is publishing symbol packages here: https://github.com/dotnet/arcade/blob/main/src/Microsoft.DotNet.Arcade.Sdk/tools/Publish.proj#L89

Typically a symbol package is created by nuget, but I think just zipping up the files might also work. I don't think arcade publishing specifically needs a nuget package, just a zip container.

</Target>

<!--
Compiles each image specified in _CrossgenTargetPaths items.
-->
<Target Name="CompileReadyToRunImage"
DependsOnTargets="PrepareCrossgenTargets"
Condition="'$(GenerateReadyToRun)' == 'true'"
Inputs="%(_CrossgenTargetPaths.FullPath)"
Expand All @@ -118,6 +133,8 @@
<ItemGroup>
<_RspFileLines Include="$(_R2ROptimizeAssemblyPath)" />
<_RspFileLines Include="--out:$(_R2ROptimizeAssemblyOutputPath)" />
<_RspFileLines Include="--pdb" />
<_RspFileLines Include="--pdb-path:$(PdbWorkDir)" />
<_RspFileLines Include="--targetarch:$(TargetArch)" />
<_RspFileLines Include="--optimize" />
<_RspFileLines Include="--opt-cross-module:*" />
Expand All @@ -128,6 +145,8 @@

<WriteLinesToFile File="$(_RspFilePath)" Lines="" Overwrite="true" />
<WriteLinesToFile File="$(_RspFilePath)" Lines="@(_RspFileLines)" />

<MakeDir Directories="$(PdbWorkDir)" />

<Exec Command='"$(_Crossgen2ExePath)" @"$(_RspFilePath)"' ConsoleToMSBuild="true" IgnoreExitCode="true">
<Output TaskParameter="ConsoleOutput" PropertyName="_Crossgen2Output" />
Expand Down
Loading