Skip to content
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

Update for publishing and package source mappings #19343

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

NikolaMilosavljevic
Copy link
Member

@NikolaMilosavljevic NikolaMilosavljevic commented Apr 7, 2024

Fixes: dotnet/source-build#4287
Fixes: dotnet/source-build#4204
Fixes: dotnet/source-build#4205

Description of findings

Source-build has always had multiple versions of packages produced by roslyn-analyzers and symreader - stable and unstable package versions, i.e.

Microsoft.CodeAnalysis.NetAnalyzers.9.0.0.nupkg
Microsoft.CodeAnalysis.NetAnalyzers.9.0.0-preview.24203.1.nupkg

These packages would end up in PSB artifacts archive.

PVP flow would use the first encountered package version, so any consumers of Microsoft.CodeAnalysis.NetAnalyzers would get version 9.0.0.

We wanted to fix NuGet non-determinism by carefully populating package source mappings for previously-source-built feed. However, we did allow package mapping for a package ID that has any version not present in current (live) package sources. Therefore, there would be a mapping in PSB feed for Microsoft.CodeAnalysis.NetAnalyzers. And there would be two identically-version packages (9.0.0), with different content - one in current sources, and one in PSB.

roslyn repo did not have a dependency on roslyn-analyzers repo, so it did not have access to those packages in current feeds. The only available package was in PSB, and this was causing a poison leak.

Changes

  • Add roslyn-analyzers and symreader dependencies to roslyn as there are packages consumed from both.
  • Modify package-source mappings task to not add a mapping for a package in PSB, if any of PSB package versions are present in current (live) package sources.
  • Stop publishing of additional packages in roslyn-analyzers - prevents publishing of stable-versioned packages
  • Stop publishing of additional packages in symreader - prevents publishing of stable-versioned packages

Copy link
Member

@ViktorHofer ViktorHofer left a comment

Choose a reason for hiding this comment

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

I will let @MichaelSimons and @mthalman review the source-build specific changes (roslyn.proj and the task update) but this looks great.

@MichaelSimons
Copy link
Member

This will be a nice improvement.

@NikolaMilosavljevic NikolaMilosavljevic merged commit aa3e889 into dotnet:main Apr 8, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants