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

Fix RS1038 related warnings found in Interop source generators #88701

Open
buyaa-n opened this issue Jul 11, 2023 · 2 comments
Open

Fix RS1038 related warnings found in Interop source generators #88701

buyaa-n opened this issue Jul 11, 2023 · 2 comments

Comments

@buyaa-n
Copy link
Member

buyaa-n commented Jul 11, 2023

Fix warnings found with RS1038 analyzer

Recent analyzer updates flown to the runtime repo having build failures related to RS1038: Compiler extensions should be implemented in assemblies with compiler-provided references. The warnings looks valid and needs a proper fix, for now they are suppressed.

Sample log:

warning RS1038: This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably.

Related to #87768
CC @jkoritzinsky

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jul 11, 2023
@ghost
Copy link

ghost commented Jul 11, 2023

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

Issue Details

Fix warnings found with RS1038 analyzer

Recent analyzer updates flown to the runtime repo having build failures related to RS1038: Compiler extensions should be implemented in assemblies with compiler-provided references. The warnings looks valid and needs a proper fix, for now they are suppressed.

Sample log:

warning RS1038: This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably.

Related to #87768
CC @jkoritzinsky

Author: buyaa-n
Assignees: -
Labels:

area-System.Runtime.InteropServices

Milestone: -

@jkoritzinsky
Copy link
Member

This is due to the interop analyzers putting analyzers and code fixes into the same assembly. It looks like we need to split them into separate assemblies for the re-written RS1038 rule to be satisfied. Moving to .NET 9 as this is more infra work than anything else (as we're careful to not use the workspaces APIs in the analyzer or generator code).

@jkoritzinsky jkoritzinsky added this to the 9.0.0 milestone Jul 11, 2023
@jkoritzinsky jkoritzinsky removed the untriaged New issue has not been triaged by the area owner label Jul 11, 2023
@jkoritzinsky jkoritzinsky modified the milestones: 9.0.0, 10.0.0 Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants