Avoid double writes to PDB in NAOT publish#98342
Conversation
We currently let the publish logic do its things unaware of what PublishAot will do and then copy over native bits. In general, I wonder if we should switch to the same mechanism that R2R, ILLink, or Single file publishing use - have SDK [be aware of the magic target](https://github.com/dotnet/sdk/blob/95025c62f4e260540c1257627616641e9670501e/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets#L453-L460) and then modify ResolvedFileToPublish items as needed.
|
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsResolves #89763 (although it will only get fixed once we also update the SDK). We currently let the publish logic do its things unaware of what PublishAot will do and then copy over native bits. So before this PR, we had to overwrite the PDB that Publish placed there. The fix in this PR fixes things based on the current par for the course. In general, I wonder if we should switch to the same mechanism that R2R, ILLink, or Single file publishing use - have SDK be aware of the magic target and then modify ResolvedFileToPublish items as needed in the magic target. Cc @dotnet/ilc-contrib
|
sbomer
left a comment
There was a problem hiding this comment.
LGTM
In general, I wonder if we should switch to the same mechanism that R2R, ILLink, or Single file publishing use - have SDK be aware of the magic target and then modify ResolvedFileToPublish items as needed in the magic target.
For ILLink, I made SDK aware of the target in response to this feedback: dotnet/sdk#3125 (comment).
I think it'd make sense to switch to a similar model where we modify ResolvedFileToPublish (this could be done whether or not we hard-code a dependency on a magic target).
|
Thank you for the extra context! I'll look into doing this like the other publish extension points are doing. |
Resolves #89763 (although it will only get fixed once we also update the SDK).
We currently let the publish logic do its things unaware of what PublishAot will do and then copy over native bits. So before this PR, we had to overwrite the PDB that Publish placed there. The fix in this PR fixes things based on the current par for the course.
In general, I wonder if we should switch to the same mechanism that R2R, ILLink, or Single file publishing use - have SDK be aware of the magic target and then modify ResolvedFileToPublish items as needed in the magic target.
Cc @dotnet/ilc-contrib