You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NuGet doesn't error when packaging nuspec with duplicate files. #6941
@JonDouglas@nkolev92 at face value, fixing this as suggested is a breaking change. An alternative suggestion that we could do now without risking breaking anyone is to manually dedupe these files before writing out the nupkg, so the last file with a certain path "wins", and only one ever makes it into the nupkg itself.
Or I could just validate and throw. I'm not sure how many people this would break, but it might certainly be surprising.
This does look like it's breaking the server, at least, so I don't imagine it's all that common: NuGet/NuGetGallery#7744
I think breaking this experience is ideal given that it is not deterministic of what file "wins". I think validating this and providing a warning/error is a path forward. We should inform the package authors in these scenarios to only include one file?
This breaking change is not documented in the release notes as a breaking change.
While I somewhat understand your decision to treat packages broken by this change as containing a "bug" due to having nondeterministic contents, in our case, we were simply finding the same file twice with two different globs. Thus there was no problem with the output.
Thus this undocumented breaking change broke our build process for no benefit.
We are another case of finding the same file a few times via wildcards in some of our large nuspecs where we've been transitioning to wildcards to make maintenance more manageable. This is a thing which can occur frequently given how VS projects copy their dependencies into each library bin that you build. We haven't though of a good way to cope with this yet.
This change has brought down our CI. Please give a little more weight to considering breaking changes going forward. Kind of a nightmare when the fix requires us either to pin the nuget version in our CI scripts across many active support branches, or fix our nuspecs across all those branches.
I think the fix here may be erroring out in situations that aren't actually problematic. The reported bug complains about a duplicate file coming from two different source locations.
The fix here appears to error when there are multiple entries for the exact same source file (can happen with overlapping wildcard specifiers), which wasn't previously resulting in duplicate files in the destination package.
Activity
mishra14 commentedon May 16, 2018
cc @rohit21agrawal
23 remaining items
zkat commentedon Feb 23, 2021
@JonDouglas @nkolev92 at face value, fixing this as suggested is a breaking change. An alternative suggestion that we could do now without risking breaking anyone is to manually dedupe these files before writing out the nupkg, so the last file with a certain path "wins", and only one ever makes it into the nupkg itself.
Or I could just validate and throw. I'm not sure how many people this would break, but it might certainly be surprising.
This does look like it's breaking the server, at least, so I don't imagine it's all that common: NuGet/NuGetGallery#7744
zkat commentedon Feb 23, 2021
cc @zivkan too
JonDouglas commentedon Feb 23, 2021
I think breaking this experience is ideal given that it is not deterministic of what file "wins". I think validating this and providing a warning/error is a path forward. We should inform the package authors in these scenarios to only include one file?
zkat commentedon Feb 23, 2021
yeah. I'll hack that up and we can take a look and see how we feel about it :)
@ericstj do you have any particular opinion on this beyond wanting it to fail?
error when attempting to pack multiple files into the same destination (
andrew-polk commentedon Jul 6, 2021
This breaking change is not documented in the release notes as a breaking change.
While I somewhat understand your decision to treat packages broken by this change as containing a "bug" due to having nondeterministic contents, in our case, we were simply finding the same file twice with two different globs. Thus there was no problem with the output.
Thus this undocumented breaking change broke our build process for no benefit.
DannyMeister commentedon Jul 13, 2021
We are another case of finding the same file a few times via wildcards in some of our large nuspecs where we've been transitioning to wildcards to make maintenance more manageable. This is a thing which can occur frequently given how VS projects copy their dependencies into each library bin that you build. We haven't though of a good way to cope with this yet.
This change has brought down our CI. Please give a little more weight to considering breaking changes going forward. Kind of a nightmare when the fix requires us either to pin the nuget version in our CI scripts across many active support branches, or fix our nuspecs across all those branches.
watters commentedon Sep 22, 2021
I think the fix here may be erroring out in situations that aren't actually problematic. The reported bug complains about a duplicate file coming from two different source locations.
The fix here appears to error when there are multiple entries for the exact same source file (can happen with overlapping wildcard specifiers), which wasn't previously resulting in duplicate files in the destination package.