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

[release/8.0-staging] Fix compilation error with generic type attributes #97717

Merged
merged 4 commits into from
Jan 31, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 30, 2024

Backport of #97613 to release/8.0-staging

/cc @tarekgh @martincostello

Customer Impact

  • Customer reported
  • Found internally

Users who employ the logging source generator and define the logger message method within a class featuring generic type parameters and applied attributes like public partial class Greeter<[Foo] T> will encounter a compilation error. Resolving this issue is not straightforward, and workarounds may prove challenging. While this problem doesn't stem from a regression in the latest release, it poses a significant obstacle for users aiming to build for Aot, given that Aot relies on these attributes. Here is a user report in their own words #97613 (comment)

image

Regression

  • Yes
  • No

Testing

Manually verified, added new tests, and passed all regression tests.

Risk

The impact is minimal; the modification specifically addresses the scenario when emitting the partial class name to prevent the compilation error. This alteration is isolated and shouldn't have any adverse effects on other aspects.

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/X.0.

  • If the change touches code that ships in a NuGet package, you have added the necessary package authoring and gotten it explicitly reviewed.

Strip generic type parameter attributes from partial classes emitted by the logging source generated to avoid CS0579 errors from duplicate attributes.
Fixes #97498.
Update comment as suggested by code review.
Verify that attributes on generic type parameters are not lost.
@ghost
Copy link

ghost commented Jan 30, 2024

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

Issue Details

Backport of #97613 to release/8.0-staging

/cc @tarekgh @martincostello

Customer Impact

  • Customer reported
  • Found internally

[Select one or both of the boxes. Describe how this issue impacts customers, citing the expected and actual behaviors and scope of the issue. If customer-reported, provide the issue number.]

Regression

  • Yes
  • No

[If yes, specify when the regression was introduced. Provide the PR or commit if known.]

Testing

[How was the fix verified? How was the issue missed previously? What tests were added?]

Risk

[High/Medium/Low. Justify the indication by mentioning how risks were measured and addressed.]

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/X.0.

  • If the change touches code that ships in a NuGet package, you have added the necessary package authoring and gotten it explicitly reviewed.

Author: github-actions[bot]
Assignees: -
Labels:

area-Extensions-Logging

Milestone: -

@tarekgh tarekgh added this to the 8.0.3 milestone Jan 30, 2024
@@ -5,6 +5,8 @@
<EnableDefaultItems>true</EnableDefaultItems>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsPackable>true</IsPackable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Copy link
Member

Choose a reason for hiding this comment

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

@ericstj @carlossanlop could you please verify this package authoring?

Copy link
Member

Choose a reason for hiding this comment

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

LGTM

@tarekgh tarekgh added the Servicing-consider Issue for next servicing release review label Jan 30, 2024
@tarekgh
Copy link
Member

tarekgh commented Jan 30, 2024

CC @artl93

@tarekgh tarekgh added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jan 31, 2024
@tarekgh
Copy link
Member

tarekgh commented Jan 31, 2024

This is approved offline.

@tarekgh tarekgh merged commit b54886b into release/8.0-staging Jan 31, 2024
109 of 111 checks passed
@jkotas jkotas deleted the backport/pr-97613-to-release/8.0-staging branch February 21, 2024 00:47
@github-actions github-actions bot locked and limited conversation to collaborators Mar 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Extensions-Logging Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants