Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

[release/6.0.2xx] Add a custom flag to disable marking of copy assemblies - #2437

Merged
agocke merged 1 commit into
dotnet:release/6.0.2xxfrom
vitek-karas:DisableMarkingOfCopyAssemblies6
Jan 6, 2022
Merged

agocke merged 1 commit into
dotnet:release/6.0.2xxfrom
vitek-karas:DisableMarkingOfCopyAssemblies6

Conversation

@vitek-karas

@vitek-karas vitek-karas commented Dec 10, 2021 •

Copy link
Copy Markdown
Member

This is a release/6.0.2xx port of #2370

Enabled by --custom-data DisableMarkingOfCopyAssemblies=true on the command line. Assumes that ALL assemblies on the input are in "copy" action (it doesn't validate this fact).

It disables marking basically fully - linker will go over all assemblies, and process them in "copy" mode (copy the original file over) and will call all the custom steps and so on, but it will do no marking (or very little, depends on descriptors and such which this doesn't disable).

This is intentionally non-discoverable feature, to be used only by the mono AOT toolchain.

Fixes #2089.

Customer impact

Xamarin "notrim" mode (used in AOT scenarios for debug builds for example) regressed with .NET 6 trimmer. The trimmer used to run quickly (several seconds), now it's much slower (5x slower roughly, sometimes worse). The change allows Xamarin SDK to tell the trimmer to avoid doing most of the expensive work as it won't be trimming anything. The speedup is very visible: Hello world app build went from 19s to 7s.

Testing

Validated with Xamarin that the change fixes the problem.

Risk

Low - added new command line option specifically to be used by Xamarin. Undocumented, not to be used by anything else.

Enabled by `--custom-data DisableMarkingOfCopyAssemblies=true` on the command line. Assumes that ALL assemblies on the input are in "copy" action (it doesn't validate this fact).

It disables marking basically fully - linker will go over all assemblies, and process them in "copy" mode (copy the original file over) and will call all the custom steps and so on, but it will do no marking (or very little, depends on descriptors and such which this doesn't disable).

This is intentionally non-discoverable feature, to be used only by the mono AOT toolchain.

@agocke agocke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, approved in email

@agocke
agocke merged commit e28b7f3 into dotnet:release/6.0.2xx Jan 6, 2022
@vitek-karas
vitek-karas deleted the DisableMarkingOfCopyAssemblies6 branch January 7, 2022 10:48
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
…r#2370) (dotnet/linker#2437)

Enabled by `--custom-data DisableMarkingOfCopyAssemblies=true` on the command line. Assumes that ALL assemblies on the input are in "copy" action (it doesn't validate this fact).

It disables marking basically fully - linker will go over all assemblies, and process them in "copy" mode (copy the original file over) and will call all the custom steps and so on, but it will do no marking (or very little, depends on descriptors and such which this doesn't disable).

This is intentionally non-discoverable feature, to be used only by the mono AOT toolchain.

Commit migrated from dotnet/linker@e28b7f3
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants