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

Clean up TrimmingTests infrastructure #48848

Closed
eerhardt opened this issue Feb 26, 2021 · 3 comments · Fixed by #53251
Closed

Clean up TrimmingTests infrastructure #48848

eerhardt opened this issue Feb 26, 2021 · 3 comments · Fixed by #53251
Assignees
Labels
area-Meta linkable-framework Issues associated with delivering a linker friendly framework test-enhancement Improvements of test source code
Milestone

Comments

@eerhardt
Copy link
Member

There are a few things in our TrimmingTests that could be cleaned up.

<!-- These can be removed once we get an SDK with https://github.com/mono/linker/pull/1385. -->
<LinkerNoWarn>IL2026</LinkerNoWarn>
<!-- IL2032,IL2055,IL2057-IL2061: Reflection intrinsics with unknown arguments -->
<LinkerNoWarn>$(LinkerNoWarn);IL2032;IL2055;IL2057;IL2058;IL2059;IL2060;IL2061</LinkerNoWarn>
<!-- IL2062-IL2066: Unknown values passed to locations with DynamicallyAccessedMemberTypes -->
<LinkerNoWarn>$(LinkerNoWarn);IL2062;IL2063;IL2064;IL2065;IL2066</LinkerNoWarn>
<!-- IL2067-IL2091: Unsatisfied DynamicallyAccessedMembers requirements -->
<LinkerNoWarn>$(LinkerNoWarn);IL2067;IL2068;IL2069;IL2070;IL2071;IL2072;IL2073;IL2074;IL2075;IL2076;IL2077;IL2078;IL2079;IL2080;IL2081;IL2082;IL2083;IL2084;IL2085;IL2086;IL2087;IL2088;IL2089;IL2090;IL2091</LinkerNoWarn>
<!-- https://github.com/dotnet/runtime/issues/40336 - need to suppress IL2008;IL2009;IL2037 on non-Windows -->
<LinkerNoWarn Condition="!$(RuntimeIdentifier.StartsWith('win'))">$(LinkerNoWarn);IL2008;IL2009;IL2037</LinkerNoWarn>
<_ExtraTrimmerArgs>{ExtraTrimmerArgs} $(_ExtraTrimmerArgs) --nowarn $(LinkerNoWarn)</_ExtraTrimmerArgs>

Also, once we have an SDK with dotnet/sdk#16094 (which I believe will be a 6.0-preview3 sdk), we can remove:

<Target Name="EnsureAllAssembliesAreLinked"
BeforeTargets="PrepareForILLink">
<ItemGroup>
<ManagedAssemblyToLink>
<TrimMode>link</TrimMode>
</ManagedAssemblyToLink>
<!-- Pass the app assembly as a root -->
<TrimmerRootAssembly Include="@(IntermediateAssembly)" />
</ItemGroup>
</Target>

And just generate IsTrimmable=true assembly metadata on the console apps, which will ensure they are fully trimmed.

cc @joperezr

@eerhardt eerhardt added area-Infrastructure-libraries test-enhancement Improvements of test source code labels Feb 26, 2021
@ghost
Copy link

ghost commented Feb 26, 2021

Tagging subscribers to this area: @safern, @ViktorHofer, @Anipik
See info in area-owners.md if you want to be subscribed.

Issue Details

There are a few things in our TrimmingTests that could be cleaned up.

<!-- These can be removed once we get an SDK with https://github.com/mono/linker/pull/1385. -->
<LinkerNoWarn>IL2026</LinkerNoWarn>
<!-- IL2032,IL2055,IL2057-IL2061: Reflection intrinsics with unknown arguments -->
<LinkerNoWarn>$(LinkerNoWarn);IL2032;IL2055;IL2057;IL2058;IL2059;IL2060;IL2061</LinkerNoWarn>
<!-- IL2062-IL2066: Unknown values passed to locations with DynamicallyAccessedMemberTypes -->
<LinkerNoWarn>$(LinkerNoWarn);IL2062;IL2063;IL2064;IL2065;IL2066</LinkerNoWarn>
<!-- IL2067-IL2091: Unsatisfied DynamicallyAccessedMembers requirements -->
<LinkerNoWarn>$(LinkerNoWarn);IL2067;IL2068;IL2069;IL2070;IL2071;IL2072;IL2073;IL2074;IL2075;IL2076;IL2077;IL2078;IL2079;IL2080;IL2081;IL2082;IL2083;IL2084;IL2085;IL2086;IL2087;IL2088;IL2089;IL2090;IL2091</LinkerNoWarn>
<!-- https://github.com/dotnet/runtime/issues/40336 - need to suppress IL2008;IL2009;IL2037 on non-Windows -->
<LinkerNoWarn Condition="!$(RuntimeIdentifier.StartsWith('win'))">$(LinkerNoWarn);IL2008;IL2009;IL2037</LinkerNoWarn>
<_ExtraTrimmerArgs>{ExtraTrimmerArgs} $(_ExtraTrimmerArgs) --nowarn $(LinkerNoWarn)</_ExtraTrimmerArgs>

Also, once we have an SDK with dotnet/sdk#16094 (which I believe will be a 6.0-preview3 sdk), we can remove:

<Target Name="EnsureAllAssembliesAreLinked"
BeforeTargets="PrepareForILLink">
<ItemGroup>
<ManagedAssemblyToLink>
<TrimMode>link</TrimMode>
</ManagedAssemblyToLink>
<!-- Pass the app assembly as a root -->
<TrimmerRootAssembly Include="@(IntermediateAssembly)" />
</ItemGroup>
</Target>

And just generate IsTrimmable=true assembly metadata on the console apps, which will ensure they are fully trimmed.

cc @joperezr

Author: eerhardt
Assignees: -
Labels:

area-Infrastructure-libraries, test enhancement

Milestone: -

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Feb 26, 2021
@ViktorHofer ViktorHofer removed the untriaged New issue has not been triaged by the area owner label Mar 3, 2021
@ViktorHofer ViktorHofer added this to the Future milestone Mar 3, 2021
@ViktorHofer ViktorHofer removed this from the Future milestone Mar 3, 2021
@ViktorHofer ViktorHofer added the untriaged New issue has not been triaged by the area owner label Mar 3, 2021
@ViktorHofer
Copy link
Member

Moving to issues to area-Meta as it this isn't actionable by the infra team.

@joperezr joperezr added linkable-framework Issues associated with delivering a linker friendly framework and removed untriaged New issue has not been triaged by the area owner labels Mar 10, 2021
@ghost
Copy link

ghost commented Mar 10, 2021

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

Issue Details

There are a few things in our TrimmingTests that could be cleaned up.

<!-- These can be removed once we get an SDK with https://github.com/mono/linker/pull/1385. -->
<LinkerNoWarn>IL2026</LinkerNoWarn>
<!-- IL2032,IL2055,IL2057-IL2061: Reflection intrinsics with unknown arguments -->
<LinkerNoWarn>$(LinkerNoWarn);IL2032;IL2055;IL2057;IL2058;IL2059;IL2060;IL2061</LinkerNoWarn>
<!-- IL2062-IL2066: Unknown values passed to locations with DynamicallyAccessedMemberTypes -->
<LinkerNoWarn>$(LinkerNoWarn);IL2062;IL2063;IL2064;IL2065;IL2066</LinkerNoWarn>
<!-- IL2067-IL2091: Unsatisfied DynamicallyAccessedMembers requirements -->
<LinkerNoWarn>$(LinkerNoWarn);IL2067;IL2068;IL2069;IL2070;IL2071;IL2072;IL2073;IL2074;IL2075;IL2076;IL2077;IL2078;IL2079;IL2080;IL2081;IL2082;IL2083;IL2084;IL2085;IL2086;IL2087;IL2088;IL2089;IL2090;IL2091</LinkerNoWarn>
<!-- https://github.com/dotnet/runtime/issues/40336 - need to suppress IL2008;IL2009;IL2037 on non-Windows -->
<LinkerNoWarn Condition="!$(RuntimeIdentifier.StartsWith('win'))">$(LinkerNoWarn);IL2008;IL2009;IL2037</LinkerNoWarn>
<_ExtraTrimmerArgs>{ExtraTrimmerArgs} $(_ExtraTrimmerArgs) --nowarn $(LinkerNoWarn)</_ExtraTrimmerArgs>

Also, once we have an SDK with dotnet/sdk#16094 (which I believe will be a 6.0-preview3 sdk), we can remove:

<Target Name="EnsureAllAssembliesAreLinked"
BeforeTargets="PrepareForILLink">
<ItemGroup>
<ManagedAssemblyToLink>
<TrimMode>link</TrimMode>
</ManagedAssemblyToLink>
<!-- Pass the app assembly as a root -->
<TrimmerRootAssembly Include="@(IntermediateAssembly)" />
</ItemGroup>
</Target>

And just generate IsTrimmable=true assembly metadata on the console apps, which will ensure they are fully trimmed.

cc @joperezr

Author: eerhardt
Assignees: -
Labels:

area-Meta, linkable-framework, test enhancement

Milestone: -

@joperezr joperezr added this to the 6.0.0 milestone Mar 10, 2021
@joperezr joperezr self-assigned this May 11, 2021
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label May 25, 2021
@ghost ghost closed this as completed in #53251 May 26, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label May 26, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 25, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Meta linkable-framework Issues associated with delivering a linker friendly framework test-enhancement Improvements of test source code
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants