-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Enable additional ways to opt in to trimming #16094
Conversation
This implements the SDK side of the behavior described at https://github.com/mono/linker/blob/main/docs/design/trimmed-assemblies.md#net-6. This includes a linker update with dotnet/linker#1839.
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets
Outdated
Show resolved
Hide resolved
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets
Outdated
Show resolved
Hide resolved
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets
Outdated
Show resolved
Hide resolved
- use JoinItems task :) - always set _TrimmerDefaultAction
@@ -118,6 +118,7 @@ Copyright (c) .NET Foundation. All rights reserved. | |||
ReferenceAssemblyPaths="@(ReferencePath)" | |||
RootAssemblyNames="@(TrimmerRootAssembly)" | |||
TrimMode="$(TrimMode)" | |||
DefaultAction="$(_TrimmerDefaultAction)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should _TrimmerDefaultAction
use underscore? This is the only property the developers would need to change to make their apps fully linker, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - I would like it to be public - but in the discussions about a similar TrimAllAssemblies
opt-in there were concerns about making it too easy to trim everything. I restarted the discussion in #16140.
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets
Show resolved
Hide resolved
These assemblies now opt into trimming using AssemblyMetadata: dotnet/runtime#48428. The SDK side of the change was made in dotnet/sdk#16094. For more context, see https://github.com/mono/linker/blob/main/docs/design/trimmed-assemblies.md#net-6.
[master] Update dependencies from dotnet/sdk - Coherency Updates: - Microsoft.NET.ILLink.Tasks: from 6.0.100-preview.2.21124.3 to 6.0.100-preview.2.21125.1 (parent: Microsoft.NET.Sdk) - Don't set IsTrimmable on netcoreapp in 6.0 These assemblies now opt into trimming using AssemblyMetadata: dotnet/runtime#48428. The SDK side of the change was made in dotnet/sdk#16094. For more context, see https://github.com/mono/linker/blob/main/docs/design/trimmed-assemblies.md#net-6.
This implements the SDK side of the behavior described at https://github.com/mono/linker/blob/main/docs/design/trimmed-assemblies.md#net-6.
This includes a linker update with dotnet/linker#1839.
The last step will be to remove https://github.com/dotnet/installer/blob/master/src/redist/targets/GenerateBundledVersions.targets#L253 when this flows to installer.
@pranavkm