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

[APICompat] AssemblyLoadErrors should not be saved as CompatDifference #34064

Closed
ViktorHofer opened this issue Jul 18, 2023 · 2 comments
Closed
Labels
Area-ApiCompat help wanted Issues that we would accept external contributions on. Also known as up-for-grabs. untriaged Request triage from a team member
Milestone

Comments

@ViktorHofer
Copy link
Member

_assemblyLoadErrors.Add(new CompatDifference(
side == ElementSide.Left ? assembly.MetadataInformation : MetadataInformation.DefaultLeft,
side == ElementSide.Right ? assembly.MetadataInformation : MetadataInformation.DefaultRight,
DiagnosticIds.AssemblyReferenceNotFound,
string.Format(Resources.MatchingAssemblyNotFound, $"{symbol.ContainingAssembly.Name}.dll"),
DifferenceType.Changed,
symbol.ContainingAssembly.Identity.GetDisplayName()));

The assembly load errors are currently created per unresolved type forward. Try to find a more efficient way to determine if they are already stored.

It might not be useful to encode the left and right during an AssemblyLoadError and put that into a CompatDifference. APICompat currently emits the following in a situation where left exists but right is missing:

C:\git\runtime2\src\libraries\apicompat\ApiCompat.proj(84,5): API compatibility errors between 'left' (left) and 'net8.0/System.Data.dll' (right): [C:\git\runtime2\src\libraries\apicompat\ApiCompat.proj]
C:\git\runtime2\src\libraries\apicompat\ApiCompat.proj(84,5): error CP1002: Could not find matching assembly: 'System.Data.SqlClient.dll' in any of the search directories. [C:\git\runtime2\src\libraries\apicompat\ApiCompat.proj]

Based on that log it wasn't clear to me that this actually referred to the right hand side as the 'left' (left) entry confused me.

@ViktorHofer ViktorHofer added help wanted Issues that we would accept external contributions on. Also known as up-for-grabs. Area-ApiCompat labels Jul 18, 2023
@ViktorHofer ViktorHofer added this to the Backlog milestone Jul 18, 2023
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Jul 18, 2023
@ghost
Copy link

ghost commented Jul 18, 2023

@dotnet/area-infrastructure-libraries a new issue has been filed in the ApiCompat area, please triage

@ViktorHofer
Copy link
Member Author

This is completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-ApiCompat help wanted Issues that we would accept external contributions on. Also known as up-for-grabs. untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

1 participant