Skip to content

Consider making root behavior more consistent #1541

@sbomer

Description

@sbomer

The SDK's TrimmerRootAssembly maps to -a which will root only the entry point for an app, or everything for a library. If the intermediate assembly is trimmable, we still want to root part of it, but -a would root everything in a library (see dotnet/sdk#13999).

The -a behavior also means that dependencies of unused parts of the app in other assemblies could be removed, which is inconsistent with the root behavior for all other assemblies. The SDK's TrimmerRootAssembly should be made to consistently root the entire assembly as the name suggests.

I think the linker root behavior needs to be fixed. There should be options to:

  • root the entire assembly (what -a does for an assembly without entry point)
  • root the entry point (what -a does for an assembly with entry point)
  • root public surface (like -r)

The last two could be combined into one option since the behavior should depend on whether it's an app or a library.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions