Skip to content

Don't suppress trim analysis warnings when linking all assemblies #11246

Closed

Description

@sbomer

dotnet/sdk#16865 adds a property (available in preview4) TrimmerDefaultAction which can be set to link to enable "LinkAll" behavior. Consider not suppressing trim analysis warnings in this case to warn users about possible issues.

This can be done by setting the following in some targets that are imported after the project file but before the .NET illink targets (so that it takes into account any user-set value for TrimmerDefaultAction):

<SuppressTrimAnalysisWarnings Condition="'$(SuppressTrimAnalysisWarnings)' == '' And '$(TrimmerDefaultAction)' != 'link'">true</SuppressTrimAnalysisWarnings> 

and removing the unconditional setting from here:
https://github.com/xamarin/xamarin-macios/blob/5e18eae0cabeef04e10f3c80d5d68a9ec3e7dab4/dotnet/targets/Xamarin.Shared.Sdk.props#L12

@jonathanpeppers @marek-safar

See also #10405.

Activity

  1. marek-safar commented on Apr 20, 2021

    @marek-safar
    Contributor
  2. added
    enhancement
    on Apr 20, 2021
  3. added this to the Future milestone on Apr 20, 2021
  4. modified the milestones: Future, .NET 6 on Apr 20, 2021
  5. removed their assignment
    on Sep 14, 2021
  6. added
    dotnet
    on Feb 9, 2022
  7. modified the milestones: .NET 6, .NET 7 on Feb 9, 2022
  8. modified the milestones: .NET 7, .NET 8 on Aug 26, 2022
  9. added
    good first issue
    on Aug 26, 2022
  10. 2 remaining items

  11. moved this to Technical Debt in .NET 9on Aug 27, 2024
  12. modified the milestones: .NET 9, .NET 10 on Sep 27, 2024
  13. added a commit that references this issue on Sep 27, 2024
    fca4596
  14. modified the milestones: .NET 10, .NET 9 on Oct 1, 2024
  15. moved this to Done in .NET 9on Oct 1, 2024
  16. rolfbjarne commented on Oct 1, 2024

    @rolfbjarne
    Member

    We've implemented this for .NET 9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dotnetenhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions