Skip to content

[QUIC] Add platform guard to IsSupported - #103342

Merged
ManickaP merged 1 commit into
dotnet:mainfrom
ManickaP:quic-platform-guard
Jun 18, 2024
Merged

[QUIC] Add platform guard to IsSupported#103342
ManickaP merged 1 commit into
dotnet:mainfrom
ManickaP:quic-platform-guard

Conversation

@ManickaP

@ManickaP ManickaP commented Jun 12, 2024

Copy link
Copy Markdown
Member

This should make the IsSupported properties not trigger the compiler warning about using unsupported API, in other words avoiding this:

warning CA1416: This call site is reachable on all platforms. 'QuicListener.IsSupported' is only supported on: 'linux', 'macOS/OSX', 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

for a simple:

if (QuicListener.IsSupported)
{
    ...
}

We might even try if we could get away with using the QuicConnection.IsSupported as a trimming guard (instead of IsHttp3Supported()) in HTTP code.

EDIT: Analyzer is in main. PR as a draft for now since it depends on dotnet/roslyn-analyzers#7326

@ghost

ghost commented Jun 12, 2024

Copy link
Copy Markdown

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost

ghost commented Jun 12, 2024

Copy link
Copy Markdown

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@ManickaP
ManickaP force-pushed the quic-platform-guard branch from 1ffd525 to 3e7cc3d Compare June 17, 2024 12:11
@ManickaP
ManickaP marked this pull request as ready for review June 17, 2024 12:11

@rzikm rzikm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@buyaa-n buyaa-n left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Probably no need to add the attributes into generated files (QuicConnection.Unsupported.cs, QuicListener.Unsupported.cs), anyway if/when they regenerated the attributes will not be there.

@ManickaP

Copy link
Copy Markdown
Member Author

generated files (QuicConnection.Unsupported.cs, QuicListener.Unsupported.cs)

They're not generated though, their content is on PNSE exclusion list and these sources are used instead.

@ManickaP

Copy link
Copy Markdown
Member Author

/ba-g wasm failure reported here: #103623

@ManickaP
ManickaP merged commit 3620294 into dotnet:main Jun 18, 2024
@ManickaP
ManickaP deleted the quic-platform-guard branch June 18, 2024 08:21
@karelz karelz added this to the 9.0.0 milestone Jun 24, 2024
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants