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

[illink] Turn on serialization discovery in .NET 7 #7256

Closed
sbomer opened this issue Aug 12, 2022 · 1 comment
Closed

[illink] Turn on serialization discovery in .NET 7 #7256

sbomer opened this issue Aug 12, 2022 · 1 comment
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects. needs-triage Issues that need to be assigned.

Comments

@sbomer
Copy link
Member

sbomer commented Aug 12, 2022

Android application type

Android for .NET (net6.0-android, etc.)

Affected platform version

.NET 7 (rc1 SDK)

Description

dotnet/linker#2929 made serialization heuristics opt-in. To preserve the .NET 6 behavior, the Xamarin SDK should opt in to the old behavior by setting <_ExtraTrimmerArgs>--enable-serialization-discovery</_ExtraTrimmerArgs>. This can be done once using an SDK with dotnet/sdk#26993 (which will be part of rc1).

Steps to Reproduce

n/a

Did you find any workaround?

No response

Relevant log output

No response

@sbomer sbomer added the needs-triage Issues that need to be assigned. label Aug 12, 2022
@jpobst jpobst assigned jonathanpeppers and unassigned jpobst Aug 12, 2022
@jpobst jpobst added the Area: App+Library Build Issues when building Library projects or Application projects. label Aug 12, 2022
@jpobst jpobst added this to the .NET 7 milestone Aug 14, 2022
jonathanpeppers added a commit that referenced this issue 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 jonathanpeppers/xamarin-android that referenced this issue Aug 18, 2022
Fixes: dotnet#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: dotnet#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 <[email protected]>
@jonpryor
Copy link
Member

Fixed via #7255.

@ghost ghost locked as resolved and limited conversation to collaborators Sep 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: App+Library Build Issues when building Library projects or Application projects. needs-triage Issues that need to be assigned.
Projects
None yet
Development

No branches or pull requests

4 participants