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 code trim safe #4002

Closed
danmoseley opened this issue May 25, 2023 · 7 comments · Fixed by #4962
Closed

make code trim safe #4002

danmoseley opened this issue May 25, 2023 · 7 comments · Fixed by #4962
Assignees
Labels
area-trimming enhancement This issue represents an ask for new feature or an enhancement to an existing one help wanted Up for grabs. We would accept a PR to help resolve this issue work in progress 🚧

Comments

@danmoseley
Copy link
Member

Remove these suppressions and fix the issues.

<!-- TODO: to be reenabled and all warnings fixed (https://github.com/dotnet/r9/issues/177) -->
<NoWarn>$(NoWarn);IL2026;IL2087;IL2067;IL2075;IL2091;IL2072;IL2090;CA1825;IL2070;IL2098;IL2057</NoWarn>

Then apps using these libraries can trim them down to just what they need.

@danmoseley danmoseley added untriaged help wanted Up for grabs. We would accept a PR to help resolve this issue and removed untriaged labels May 25, 2023
@afroze9
Copy link

afroze9 commented Jun 12, 2023

@danmoseley, any pointers on where to start with this? I would like to give it a try.

@danmoseley
Copy link
Member Author

https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trim-self-contained
https://github.com/dotnet/runtime/blob/472091827b6a266f9d964564a77ba11160622a50/docs/tools/illink/error-codes.md explains the codes.

@eerhardt is there any issue or doc somewhere where we have guidance on working through these things?

@danmoseley
Copy link
Member Author

(And, you're welcome to. Perhaps @eerhardt can suggest the easiest code to start with)

@eerhardt
Copy link
Member

is there any issue or doc somewhere where we have guidance on working through these things?

https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/prepare-libraries-for-trimming

@danmoseley
Copy link
Member Author

@afroze9 my suggestion is that you do a small piece and offer a PR, rather than try to do it all at once. Maybe just clear the easiest of the warnings.

afroze9 pushed a commit to afroze9/extensions that referenced this issue Jun 14, 2023
@geeknoid geeknoid added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Nov 27, 2023
@EricStG
Copy link
Contributor

EricStG commented Feb 14, 2024

Do you still need help on this one? Wouldn't mind giving it a go.

@RussKie
Copy link
Member

RussKie commented Feb 16, 2024

Do you still need help on this one? Wouldn't mind giving it a go.

Yes, the warnings are still there, so we do need help :)
Thank you

EricStG added a commit to EricStG/extensions that referenced this issue Feb 17, 2024
Part of dotnet#4002
Add DynamicallyAccessedMembers attributes where the warning was found
removed IL2091 from NoWarn in Directory.Build.targets
EricStG added a commit to EricStG/extensions that referenced this issue Feb 17, 2024
Part of dotnet#4002

Added DynamicallyAccessedMembers attributes where the warning was found

removed IL2091 from NoWarn in Directory.Build.targets
EricStG added a commit to EricStG/extensions that referenced this issue Feb 17, 2024
Part of dotnet#4002

Added DynamicallyAccessedMembers attributes where the warning was found

removed IL2091 from NoWarn in Directory.Build.targets
eerhardt added a commit that referenced this issue Feb 21, 2024
* Fix IL2091 warnings

Part of #4002

Added DynamicallyAccessedMembers attributes where the warning was found

removed IL2091 from NoWarn in Directory.Build.targets

* Remove more warnings that are no longer necessary.

* Remove Memoize with 3 parameters.

This code isn't being used.

---------

Co-authored-by: Eric Erhardt <[email protected]>
eerhardt added a commit to eerhardt/extensions that referenced this issue Feb 21, 2024
@eerhardt eerhardt assigned EricStG and eerhardt and unassigned afroze9 Feb 21, 2024
eerhardt added a commit that referenced this issue Feb 22, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-trimming enhancement This issue represents an ask for new feature or an enhancement to an existing one help wanted Up for grabs. We would accept a PR to help resolve this issue work in progress 🚧
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants