-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Prevent duplicate entries in _SourceItemsToCopyToPublishDirectory*
#52296
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
base: main
Are you sure you want to change the base?
Conversation
|
Not entirely sure if this is the right fix since I don't have experience in the area. Obviously this could also be fixed at the level of the ready to run command but handling it here seemed more appropriate. For a more detailed description of the issue and a simple repro see https://github.com/BrzVlad/repros/tree/main/composite-r2r-publish. Issue encountered while working on composite R2R configuration for BenchmarkDotNet. |
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.
Pull request overview
This PR adds duplicate prevention for _NoneWithTargetPath items when copying to the publish directory. The changes prevent duplicate entries that can occur when items exist in both child projects and the current project, which would later cause crossgen2 to fail when it receives duplicate assembly inputs.
Key changes:
- Add
KeepDuplicatesattribute to three_NoneWithTargetPathItemGroup declarations - Use the existing
_GCTPDIKeepDuplicatesproperty (set tofalse) to control deduplication behavior - Follow the same pattern already applied to child project items from
_AllChildProjectPublishItemsWithTargetPath
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets
Outdated
Show resolved
Hide resolved
We can end up with duplicated items if they exist both in child projects as well as in the current project that we are building. These end up added to `ResolvedFileToPublish` and later on passed to crossgen2, which doesn't accept duplicate assembly inputs.
7aef25e to
cb0c514
Compare
vitek-karas
left a comment
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.
Looks good to me - but let's also get review from Sven or somebody else from the trimmer/NativeAOT
We can end up with duplicated items if they exist both in child projects as well as in the current project that we are building. These end up added to
ResolvedFileToPublishand later on passed to crossgen2, which doesn't accept duplicate assembly inputs.