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

Enable additional ways to opt in to trimming #16094

Merged
merged 2 commits into from
Mar 1, 2021

Conversation

sbomer
Copy link
Member

@sbomer sbomer commented Feb 26, 2021

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

@dotnet-issue-labeler
Copy link

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.

- 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)"
Copy link
Contributor

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?

Copy link
Member Author

@sbomer sbomer Mar 1, 2021

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.

@sbomer sbomer merged commit b8b3f10 into dotnet:master Mar 1, 2021
sbomer added a commit to dotnet/installer that referenced this pull request Mar 2, 2021
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.
dotnet-maestro bot added a commit to dotnet/installer that referenced this pull request Mar 2, 2021
[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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants