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

Add iOS, Android, and macCatalyst into SupportedPlatform with the correct scope #16488

Closed
jeffhandley opened this issue Mar 23, 2021 · 4 comments
Assignees
Labels
untriaged Request triage from a team member

Comments

@jeffhandley
Copy link
Member

jeffhandley commented Mar 23, 2021

The Platform Compatibility Analyzer uses the MSBuild SupportedPlatform item to determine which platforms are included for platform compatibility checks. The default set of platforms included by the SDK previously included iOS, Android, and macCatalyst, but we found this to be too disruptive. Tools such as aspnetcore and the SDK itself encountered build warnings when iOS annotations were added to APIs such as Process.Start, surfacing that adding these annotations should be considered a breaking change. To mitigate that disruption, we've removed iOS, Android, and macCatalyst from the default set, but we need to find an appropriate way to include those platforms for scenarios where it makes sense--such as cross-platform class libraries.

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Mar 23, 2021
@terrajobst
Copy link
Member

terrajobst commented Mar 23, 2021

I think here is the behavior we want:

  • For projects representing general purpose libraries, we usually want newly supported platforms to be included by default. Yes, this might mean that the same code can generate more diagnostics later, but we believe that is the desired behavior to help library authors to ensure that their libraries remain portable across all the platforms .NET runs on. Library developers are free to exclude certain platforms from their project file if they explicitly don't care about certain targets.
  • We want to minimize false positives.
    • Newly added platforms that aren't widely used and have limited API support (such WASM) shouldn't be included by default because it's creating noise that prevents library developers to focus on what's important.
    • It's extremely unlikely that console apps, web sites or cloud services need to run on iOS, Android or macCatalyst. We should exclude platforms from certain projects when they don't make sense.

I believe we should:

  • Add iOS, Android, and macCatalyst if the OutputType is Library or Module.
  • Ensure that web projects do not add them (not sure if an ASP.NET project is considered a console app or a library)

/cc @mhutch @davidfowl @marek-safar @Redth @dsplaisted

@jeffhandley
Copy link
Member Author

  • For projects representing general purpose libraries, we usually want newly supported platforms to be included by default. Yes, this might mean that the same code can generate more diagnostics later...

This sounds similar to the AnalysisLevel concept. 🤔

@marcpopMSFT
Copy link
Member

Old issue triage, closing as it looks like it might have happened on the runtime side though unclear. Jeff can reopen if this is still something they are pursuing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

3 participants