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

Make DllImportGenerator emit a GeneratedCodeAttribute on our stubs #65868

Merged
merged 4 commits into from
Mar 2, 2022

Conversation

jkoritzinsky
Copy link
Member

Emit a GeneratedCodeAttibute on our generated stubs for better auditing purposes. Fixes #64562

@jkoritzinsky jkoritzinsky added area-System.Runtime.InteropServices source-generator Indicates an issue with a source generator feature labels Feb 24, 2022
@ghost
Copy link

ghost commented Feb 24, 2022

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

Issue Details

Emit a GeneratedCodeAttibute on our generated stubs for better auditing purposes. Fixes #64562

Author: jkoritzinsky
Assignees: -
Labels:

area-System.Runtime.InteropServices, source-generator

Milestone: -

@ghost ghost assigned jkoritzinsky Feb 24, 2022
SeparatedList(
new[]
{
AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal("Microsoft.Interop.DllImportGenerator"))),
Copy link
Member

Choose a reason for hiding this comment

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

Since we're already using the DllImportGenerator assembly name to get the version string, we can probably just use it for the name too.

@jkotas
Copy link
Member

jkotas commented Feb 25, 2022

Do we also need to add the GeneratedCodeAttribute to src\libraries\System.Private.CoreLib\src\ILLink\ILLink.LinkAttributes.Shared.xml so that it gets trimmed?

cc @marek-safar

@elinor-fung
Copy link
Member

Yeah, I think we should add it to be trimmed.

@jkoritzinsky
Copy link
Member Author

I've added the attribute to be trimmed and now I'm seeing really weird failures in Windows x86. Do we have any known Win-x86 issues at the moment?

@jkotas
Copy link
Member

jkotas commented Mar 1, 2022

Do we have any known Win-x86 issues at the moment?

These should be fixed by #65910 . Merging from main should clear them.

@jkoritzinsky
Copy link
Member Author

llvmfullaot timeouts are happening in other builds in main (such as https://dev.azure.com/dnceng/public/_build/results?buildId=1638498&view=results), so I'm going to merge this

@jkoritzinsky jkoritzinsky merged commit 2330b4b into dotnet:main Mar 2, 2022
@jkoritzinsky jkoritzinsky deleted the generated-code-attribute branch March 2, 2022 05:45
@ghost ghost locked as resolved and limited conversation to collaborators Apr 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Runtime.InteropServices source-generator Indicates an issue with a source generator feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interop source generator should insert [GeneratedCodeAttribute]
4 participants