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

.NET: Unify the MtouchLink and LinkMode MSBuild properties #12796

Closed
rolfbjarne opened this issue Sep 21, 2021 · 5 comments
Closed

.NET: Unify the MtouchLink and LinkMode MSBuild properties #12796

rolfbjarne opened this issue Sep 21, 2021 · 5 comments
Labels
dotnet An issue or pull request related to .NET (6) dotnet-pri3 .NET 6: wishlist for stable release enhancement The issue or pull request is an enhancement
Milestone

Comments

@rolfbjarne
Copy link
Member

We have the MtouchLink property for Xamarin.iOS and the LinkMode property for Xamarin.Mac.

We should unify these for .NET.

Options:

  1. Use LinkMode for both.
  2. Come up with a different name (ideas? Android uses AndroidLinkMode).

I think LinkMode is good enough for us (we're already using it anyway).

@rolfbjarne rolfbjarne added enhancement The issue or pull request is an enhancement dotnet An issue or pull request related to .NET (6) dotnet-pri3 .NET 6: wishlist for stable release labels Sep 21, 2021
@rolfbjarne rolfbjarne added this to the .NET 6 milestone Sep 21, 2021
@rolfbjarne
Copy link
Member Author

CC @jonathanpeppers: maybe this is something we should coordinate with Android as well?

@jonathanpeppers
Copy link
Member

We still have $(AndroidLinkMode), but then also newer linker settings:

https://github.com/xamarin/xamarin-android/blob/main/Documentation/guides/OneDotNet.md#linker-illink

SdkOnly for Android is the same as:

<PublishTrimmed>true</PublishTrimmed>
<TrimMode>link</TrimMode>

AndroidLinkMode=Full sets TrimMode="link" on every assembly, and there isn't a new linker setting for this.

It seems like Full isn't highly used, but maybe we should ask someone involved with mono/linker if they would add some property for all platforms for this?

@mattleibow
Copy link
Contributor

Even though . NET probably came up with the names after xamarin and mono, we should probably use their names? At least maybe use them as the main public options and then use the platform specific ones for finer or advanced control?

@jonathanpeppers
Copy link
Member

jonathanpeppers commented Jul 1, 2022

They are working on new cross-platform names here:

TrimMode=partial is SdkOnly and TrimMode=link is Full.

I think we should just make it where you could use either the old or new names.

@rolfbjarne
Copy link
Member Author

After a talk about this, I believe this is the path forward:

  • Recommend using TrimMode starting in .NET 7 for everybody.
  • Make the old MtouchLink/LinkMode properties keep working as-is (where TrimMode takes precedence if it's set).

@ghost ghost locked as resolved and limited conversation to collaborators Sep 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dotnet An issue or pull request related to .NET (6) dotnet-pri3 .NET 6: wishlist for stable release enhancement The issue or pull request is an enhancement
Projects
None yet
Development

No branches or pull requests

3 participants