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

Documentation status of _AggressiveAttributeTrimming #88805

Closed
MichalStrehovsky opened this issue Jul 13, 2023 · 10 comments
Closed

Documentation status of _AggressiveAttributeTrimming #88805

MichalStrehovsky opened this issue Jul 13, 2023 · 10 comments
Labels
area-Tools-ILLink .NET linker development as well as trimming analyzers linkable-framework Issues associated with delivering a linker friendly framework
Milestone

Comments

@MichalStrehovsky
Copy link
Member

These options are currently not documented on learn, but Blazor WASM enables them by default. So customers who get broken by this have no recourse but to dig into undocumented properties. Should these be documented?

https://github.com/dotnet/sdk/blob/16546adca23bbbea314c734a684ea696b866d5fd/src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets#L49-L50

Cc @dotnet/illink @eerhardt

@MichalStrehovsky MichalStrehovsky added linkable-framework Issues associated with delivering a linker friendly framework area-Tools-ILLink .NET linker development as well as trimming analyzers labels Jul 13, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jul 13, 2023
@ghost
Copy link

ghost commented Jul 13, 2023

Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas
See info in area-owners.md if you want to be subscribed.

Issue Details

These options are currently not documented on learn, but Blazor WASM enables them by default. So customers who get broken by this have no recourse but to dig into undocumented properties. Should these be documented?

https://github.com/dotnet/sdk/blob/16546adca23bbbea314c734a684ea696b866d5fd/src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets#L49-L50

Cc @dotnet/illink @eerhardt

Author: MichalStrehovsky
Assignees: -
Labels:

linkable-framework, area-Tools-ILLink

Milestone: -

@MichalStrehovsky
Copy link
Member Author

If _AggressiveAttributeTrimming (or it's renamed equivalent) become public, we need to do something for #88994.

@Sergio0694
Copy link
Contributor

Would a documented version of _AggressiveAttributeTrimming unconditionally trim all attributes, or would it be able to preserve some? Eg. those it can see code specifically looking for (ie. via calls to GetCustomAttribute<T>, etc.), or perhaps via opt-in in some way? Asking because it sounds nice on paper, and I'm wondering how/if we could benefit from this too in CsWinRT, which does need to preserve a few attributes needed to support the interop infrastructure though 🤔

@MichalStrehovsky
Copy link
Member Author

Would a documented version of _AggressiveAttributeTrimming unconditionally trim all attributes, or would it be able to preserve some? Eg. those it can see code specifically looking for (ie. via calls to GetCustomAttribute<T>, etc.), or perhaps via opt-in in some way? Asking because it sounds nice on paper, and I'm wondering how/if we could benefit from this too in CsWinRT, which does need to preserve a few attributes needed to support the interop infrastructure though 🤔

You're basically asking for #103934. Yep, it would be great if attribute stripping was done in way that it doesn't break apps. It currently does break apps.

@agocke agocke added this to the 9.0.0 milestone Feb 26, 2024
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Feb 26, 2024
@sbomer
Copy link
Member

sbomer commented Jun 27, 2024

Closing this because the feature switch was removed in #103970, and we don't want to support/document the current attribute trimming model. See more context in #103004 (comment).

@sbomer sbomer closed this as completed Jun 27, 2024
@MichalStrehovsky
Copy link
Member Author

@sbomer sbomer changed the title Documentation status of NullabilityInfoContextSupport and _AggressiveAttributeTrimming Documentation status of _AggressiveAttributeTrimming Jun 27, 2024
@sbomer sbomer reopened this Jun 27, 2024
@sbomer
Copy link
Member

sbomer commented Jun 27, 2024

I'm not sure what we should do here (aside from implementing #103934 as a better long-term solution).

_AggressiveAttributeTrimming is an underscored property, which I understand to mean "intentionally undocumented and technically unsupported". Do we really want to document it? Maybe we should push on Android to stop using it instead? I opened dotnet/android#9060 for discussion.

@MichalStrehovsky
Copy link
Member Author

The issue is that if Android opts into it and someone gets broken by it, they don't know what hit them and how to disable it. Documenting would involve dropping the underscore. Android SDK would ideally not do that. We can still keep the underscored feature for experimentation or just delete it.

@sbomer
Copy link
Member

sbomer commented Jun 28, 2024

Android removed it in dotnet/android#9062.

@sbomer
Copy link
Member

sbomer commented Aug 13, 2024

Closing this since the only remaining work is for xamarin-macios to remove use of the property.

@sbomer sbomer closed this as completed Aug 13, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Tools-ILLink .NET linker development as well as trimming analyzers linkable-framework Issues associated with delivering a linker friendly framework
Projects
Archived in project
Development

No branches or pull requests

4 participants