Skip to content

Conversation

@JoeRobich
Copy link
Member

@JoeRobich JoeRobich commented May 2, 2025

Since merging roslyn-analyzers into the roslyn repo, Roslyn packages have been generated that include a dependency on Microsoft.CodeAnalysis.Analyzers (a roslyn-analyzer package) with the wrong version. The packages should depend on version 3.11.0 of the M.CA.Analyzers package but the nuspec is being rewritten to require a M.CA.Analyzers package from the same build. This behavior is due to NuGetRepack only using the package name to determine whether to update a dependency version. This PR additionally validates that the dependency version is from the current build prior to updating.

We can see that although TestPackageA is part of the packages being updated, the dependency in TestPackageG are not update because it is referencing an earlier version. TestPackageB and TestPackageC are updated because they are from the current build.
image

// change to match the platform that is executing. The reference packages that we use to validate
// the SemVer tests were built on Windows which makes these test only valid for Windows.
//
// This can be removed when https://github.com/dotnet/corefx/issues/39931 is fixed.
Copy link
Member

Choose a reason for hiding this comment

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

There seems to be workaround: dotnet/runtime#30442 (comment)

@JoeRobich JoeRobich merged commit 5e413a2 into dotnet:main May 5, 2025
11 checks passed
@JoeRobich
Copy link
Member Author

/backport to release/9.0

@github-actions
Copy link
Contributor

github-actions bot commented May 5, 2025

Started backporting to release/9.0: https://github.com/dotnet/arcade/actions/runs/14846832089

JoeRobich added a commit to dotnet/roslyn that referenced this pull request May 8, 2025
Arcade insertions into the VMR are blocked (see
dotnet/dotnet#431) due to
Microsoft.CodeAnalysis.Features depending on version 3.3.0 of
Microsoft.CodeAnalysis.AnalyzerUtilities instead of the version which
builds out of this repo. Previously this had not been a problem as
NuGetRepack would rewrite package dependencies with the current build
version, but after [a fix in
NuGetRepack](dotnet/arcade#15804) to only update
package version from the current build, we are correctly referencing the
lower package version.

This PR changes our package references to M.CA.AnalyzerUtilities to
instead be project references.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants