Skip to content

Commit 84b7c67

Browse files
authored
Removing unnecessary nowarns from trimming tests (#53251)
* Removing unnecessary nowarns from trimming tests * Also change the way we mark managedassemblies to link * Remove target and instead use TrimmerDefaultAction * Adding the suppression of warnings from the linker
1 parent 5f15498 commit 84b7c67

File tree

3 files changed

+3
-23
lines changed

3 files changed

+3
-23
lines changed

eng/testing/linker/SupportFiles/Directory.Build.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<UseDefaultiOSFeatureSwitches>false</UseDefaultiOSFeatureSwitches>
77
<PublishTrimmed>true</PublishTrimmed>
88
<SkipImportRepoLinkerTargets>true</SkipImportRepoLinkerTargets>
9+
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
10+
<TrimmerDefaultAction>link</TrimmerDefaultAction>
911
<TrimMode>link</TrimMode>
1012
<TrimmerRemoveSymbols>false</TrimmerRemoveSymbols>
1113
<SelfContained>true</SelfContained>

eng/testing/linker/SupportFiles/Directory.Build.targets

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,6 @@
2424
</ItemGroup>
2525
</Target>
2626

27-
<Target Name="EnsureAllAssembliesAreLinked"
28-
BeforeTargets="PrepareForILLink">
29-
<ItemGroup>
30-
<ManagedAssemblyToLink>
31-
<TrimMode>link</TrimMode>
32-
</ManagedAssemblyToLink>
33-
34-
<!-- Pass the app assembly as a root -->
35-
<TrimmerRootAssembly Include="@(IntermediateAssembly)" />
36-
</ItemGroup>
37-
</Target>
38-
3927
<Target Name="CreateTestWasmAppBundle"
4028
AfterTargets="Publish"
4129
DependsOnTargets="BundleTestWasmApp"

eng/testing/linker/project.csproj.template

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,7 @@
1414
<NETCoreAppMaximumVersion>{NetCoreAppMaximumVersion}</NETCoreAppMaximumVersion>
1515
<MicrosoftNETCoreAppVersion>{MicrosoftNETCoreAppVersion}</MicrosoftNETCoreAppVersion>
1616

17-
<!-- These can be removed once we get an SDK with https://github.com/mono/linker/pull/1385. -->
18-
<LinkerNoWarn>IL2026</LinkerNoWarn>
19-
<!-- IL2032,IL2055,IL2057-IL2061: Reflection intrinsics with unknown arguments -->
20-
<LinkerNoWarn>$(LinkerNoWarn);IL2032;IL2055;IL2057;IL2058;IL2059;IL2060;IL2061</LinkerNoWarn>
21-
<!-- IL2062-IL2066: Unknown values passed to locations with DynamicallyAccessedMemberTypes -->
22-
<LinkerNoWarn>$(LinkerNoWarn);IL2062;IL2063;IL2064;IL2065;IL2066</LinkerNoWarn>
23-
<!-- IL2067-IL2091: Unsatisfied DynamicallyAccessedMembers requirements -->
24-
<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>
25-
<!-- https://github.com/dotnet/runtime/issues/40336 - need to suppress IL2008;IL2009;IL2037 on non-Windows -->
26-
<LinkerNoWarn Condition="!$(RuntimeIdentifier.StartsWith('win'))">$(LinkerNoWarn);IL2008;IL2009;IL2037</LinkerNoWarn>
27-
<_ExtraTrimmerArgs>{ExtraTrimmerArgs} $(_ExtraTrimmerArgs) --nowarn $(LinkerNoWarn)</_ExtraTrimmerArgs>
17+
<_ExtraTrimmerArgs>{ExtraTrimmerArgs} $(_ExtraTrimmerArgs)</_ExtraTrimmerArgs>
2818
</PropertyGroup>
2919

3020
<ItemGroup>

0 commit comments

Comments
 (0)