arcade icon indicating copy to clipboard operation
arcade copied to clipboard

PackageReleasePackages target cannot handle multiple versions in artifacts

Open jjonescz opened this issue 3 months ago • 3 comments

  • [ ] This issue is blocking
  • [x] This issue is causing unreasonable pain

The PackageReleasePackages target fails with

D:\.tools\.nuget\packages\microsoft.dotnet.arcade.sdk\11.0.0-beta.25509.1\tools\BuildReleasePackages.targets(21,5): Multiple packages of name 'Microsoft.CodeAnalysis' specified [D:\.tools\.nuget\packages\microsoft.dotnet.arcade.sdk\11.0.0-beta.25509.1\tools\AfterSolutionBuild.proj]

often when packing Roslyn locally. I have investigated and the problem is that I have accumulated several versions of packages and the target can't handle that:

Image

That seems like a bug to me - or do I really need to remove all artifacts before running build.cmd -pack locally?

jjonescz avatar Oct 13 '25 09:10 jjonescz

It's a bug in the sense that the thing is using globbing to find the built packages. There are probably other cases like this hanging out. Publishing and signing almost certainly also have this issue.

@ViktorHofer Thoughts on how this kind of thing should be handled? Is globbing the best we can reasonably do?

mmitche avatar Oct 13 '25 17:10 mmitche

Yes, signing and publishing is also driven by globbing of the artifacts/packages folder. But those are usually no-op scenarios in local runs. Sounds like this task runs in roslyn's local dev workflow though. Is that necessary?

ViktorHofer avatar Oct 13 '25 17:10 ViktorHofer

Sounds like this task runs in roslyn's local dev workflow though. Is that necessary?

I personally don't use the packages repacked by this target. (Until today I didn't know what was the difference between them and the other created packages.) But it sounds like the target corrects some version ranges in the packages, so perhaps someone could be relying on having those locally to use them somewhere else for testing. Perhaps it could be opt in to run the target locally though.

jjonescz avatar Oct 13 '25 17:10 jjonescz