Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Erhardt <eric.erhardt@microsoft.com>2020-08-03 23:08:04 +0300
committerGitHub <noreply@github.com>2020-08-03 23:08:04 +0300
commitfa5a4435966c8899d20959df224cabdee8e6e178 (patch)
tree399af76da70318d7f81ff0aecae47c76dbbaa186 /eng/testing
parenta4c4efcdb8bb3a30e064bb57e617866f367f8e52 (diff)
Fix the trimming tests to link non-app assemblies correctly. (#40246)
The PrepareForILLink target will pass any ManagedAssemblyToLink that isn't marked as IsTrimmable=true to a TrimmerRootAssembly. This will cause the assembly to be passed to the linker with `-a`, which means the asesmbly won't be fully trimmed. So any assembly outside of the runtimepack will be passed with -a (for example Microsoft.Extensions.*). Fix this by moving to BeforeTargets=PrepareForILLink and marking the single application assembly as a root.
Diffstat (limited to 'eng/testing')
-rw-r--r--eng/testing/linker/SupportFiles/Directory.Build.targets5
1 files changed, 4 insertions, 1 deletions
diff --git a/eng/testing/linker/SupportFiles/Directory.Build.targets b/eng/testing/linker/SupportFiles/Directory.Build.targets
index 49422a33b9b..a9dfda8012d 100644
--- a/eng/testing/linker/SupportFiles/Directory.Build.targets
+++ b/eng/testing/linker/SupportFiles/Directory.Build.targets
@@ -20,11 +20,14 @@
</Target>
<Target Name="EnsureAllAssembliesAreLinked"
- AfterTargets="PrepareForILLink">
+ BeforeTargets="PrepareForILLink">
<ItemGroup>
<ManagedAssemblyToLink>
<TrimMode>link</TrimMode>
</ManagedAssemblyToLink>
+
+ <!-- Pass the app assembly as a root -->
+ <TrimmerRootAssembly Include="@(IntermediateAssembly)" />
</ItemGroup>
</Target>