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

Make serialization discovery opt-in #2929

Merged
merged 2 commits into from
Aug 1, 2022
Merged

Conversation

sbomer
Copy link
Member

@sbomer sbomer commented Jul 29, 2022

Fixes #2924

Serialization discovery is an undocumented quirk that exists for back-compat in xamarin scenarios. We turned it on by default in .NET 6, but would like to remove such quirks from the default options in .NET 7.

This changes the (undocumented) command-line option to be opt-in. Xamarin SDKs will be expected to pass this option by setting <_ExtraTrimmerArgs>--enable-serialization-discovery</_ExtraTrimmerArgs>.

Copy link
Member

@vitek-karas vitek-karas left a comment

Choose a reason for hiding this comment

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

Assuming we will go and set this in Xamarin repos ASAP, to make sure we don't break them...

@sbomer sbomer merged commit d0ca2a6 into dotnet:main Aug 1, 2022
jonathanpeppers added a commit to dotnet/android that referenced this pull request Aug 15, 2022
Context: dotnet/linker#2929
Context: https://github.com/dotnet/linker/blob/6e8e139a484f74c524c821c7a4a08287d77257a4/src/ILLink.Tasks/build/Microsoft.NET.ILLink.targets#L227-L229
Fixes: #7256

Serialization heuristics in the .NET 7 linker is now opt-in.

We now need to pass a new flag to the linker by default:

    <_ExtraTrimmerArgs>--enable-serialization-discovery $(_ExtraTrimmerArgs)</_ExtraTrimmerArgs>

This might also solve project builds in `Release` mode that appear to
hang:

    Task "ILLink" (TaskId:272)

Builds appear to be running this task and never exit. Let's hope this
also solves this?
jonathanpeppers added a commit to dotnet/android that referenced this pull request Aug 18, 2022
Fixes: #7256
Changes: dotnet/installer@716bd17...f3da421
Changes: dotnet/linker@f09bacf...6252a21
Changes: dotnet/runtime@26a71c6...f52d8c5

Updates:

* Microsoft.Dotnet.Sdk.Internal: from 7.0.100-rc.1.22409.23 to 7.0.100-rc.2.22417.1
* Microsoft.NET.ILLink.Tasks: from 7.0.100-1.22377.1 to 7.0.100-1.22415.4
* Microsoft.NETCore.App.Ref: from 7.0.0-rc.1.22403.8 to 7.0.0-rc.1.22411.12

~~ Other Changes ~~

* Revert `export DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=true`, as the
original issue is fixed.

* [illink] enable serialization discovery for the linker

Context: dotnet/linker#2929
Context: https://github.com/dotnet/linker/blob/6e8e139a484f74c524c821c7a4a08287d77257a4/src/ILLink.Tasks/build/Microsoft.NET.ILLink.targets#L227-L229
Fixes: #7256

Serialization heuristics in the .NET 7 linker is now opt-in.

We now need to pass a new flag to the linker by default:

    <_ExtraTrimmerArgs>--enable-serialization-discovery $(_ExtraTrimmerArgs)</_ExtraTrimmerArgs>

* Update `.apkdesc` files for the new `marshal-ilgen` Mono component

* [tests] ignore `WarnAboutAppDomains(true)`

Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
Serialization discovery is an undocumented quirk that exists for
back-compat in xamarin scenarios. We turned it on by default in .NET
6, but would like to remove such quirks from the default options in
.NET 7.

This changes the (undocumented) command-line option to be
opt-in. Xamarin SDKs will be expected to pass this option by setting
<_ExtraTrimmerArgs>--enable-serialization-discovery</_ExtraTrimmerArgs>.


Commit migrated from dotnet/linker@d0ca2a6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider turning off serialization discovery by default
2 participants