Skip to content

Trim attribute used by compilation to generate EventSources during build - #51873

Closed
marek-safar wants to merge 1 commit into
dotnet:mainfrom
marek-safar:linkattrs
Closed

marek-safar wants to merge 1 commit into
dotnet:mainfrom
marek-safar:linkattrs

Conversation

@marek-safar

Copy link
Copy Markdown
Contributor

No description provided.

@ghost

ghost commented Apr 26, 2021

Copy link
Copy Markdown

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

@jkotas jkotas added the linkable-framework Issues associated with delivering a linker friendly framework label Apr 26, 2021
@ghost

ghost commented Apr 26, 2021

Copy link
Copy Markdown

Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer
See info in area-owners.md if you want to be subscribed.

Issue Details
Author: marek-safar
Assignees: -
Labels:

linkable-framework

Milestone: -

@eerhardt

Copy link
Copy Markdown
Member

I think this is kind of interesting w.r.t. some of the "built-in source generator" discussions we've been having. cc @ericstj @jaredpar

Basically, the approach we are taking here is one that was proposed as a feature for source generators. Allowing the "source generator" to generate an attribute that user code can reference/use, but then the attribute gets removed by the compiler.

If we had that feature in Roslyn, we wouldn't need this change here.

@ericstj

ericstj commented Apr 26, 2021

Copy link
Copy Markdown
Member

We could add Conditional("SOURCE_GENERATOR") (or whatever define that's never set) to avoid emitting the references to the attribute, but nothing available today that can avoid the definition of the attribute. Would just setting Conditional here make the linker do the right thing with no additional settings (trim an unused internal attribute)?

Related dotnet/roslyn#52749

@marek-safar

marek-safar commented Apr 27, 2021 •

Copy link
Copy Markdown
Contributor Author

I like the conditional attribute suggestion. Made alternative #51913 using it.

@karelz karelz added this to the 6.0.0 milestone May 20, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Diagnostics.Tracing linkable-framework Issues associated with delivering a linker friendly framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants