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

[net5/illink] Add ApplyPreserveAttribute substep #5126

Merged

Conversation

radekdoulik
Copy link
Member

The ApplyPreserveAttribute susbtep was not (yet?) upstreamed, so
make it build and add it to the pipeline and run it before other
substeps to not break ac5269d fix.

@radekdoulik radekdoulik marked this pull request as draft September 17, 2020 09:49
@radekdoulik
Copy link
Member Author

Let add a test for it as well.

Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

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

We should check is if they can actually support [Preserve] in .NET 6 for us, so we wouldn't have to bring this over.

@@ -8,6 +8,10 @@

using Mono.Cecil;

#if NET5_LINKER
Copy link
Member

Choose a reason for hiding this comment

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

Should we change this #if to NETCOREAPP3_1 and we could remove this $(DefineConstants)?

https://github.com/xamarin/xamarin-android/blob/eadd3bda8e2a81c6ca997f05d3faac7040b29a7b/src/Microsoft.Android.Sdk.ILLink/Microsoft.Android.Sdk.ILLink.csproj#L5

If we change this .csproj to TargetFramework=net5.0 later on, then NETCOREAPP3_1 will still be defined.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this was just changed recently (dotnet/sdk#13615). So NETCOREAPP3_1 will not work. I think we should use #if NET instead. I will try to use it.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is not defined yet in the version we are using, so I will keep NET5_LINKER around until we have the NET define.

@rolfbjarne
Copy link
Member

For reference, this is xamarin-macios' implementation: dotnet/macios#9529

@radekdoulik
Copy link
Member Author

We should check is if they can actually support [Preserve] in .NET 6 for us, so we wouldn't have to bring this over.

I would like to get this in so that we have it now. It looks like the [Preserve] might not land in upstream, at least not soon?

Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

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

I think we should go ahead and bring this in, and we can remove it if it makes it upstream.

The ApplyPreserveAttribute susbtep  was not (yet?) upstreamed, so
make it build and add it to the pipeline and run it before other
substeps to not break ac5269d fix.
@radekdoulik radekdoulik force-pushed the pr-illink-add-applypreserveattribute branch from 59bf1d0 to bbbb5d2 Compare September 17, 2020 20:12
@radekdoulik radekdoulik marked this pull request as ready for review September 18, 2020 07:49
@radekdoulik radekdoulik merged commit 2ec56b7 into dotnet:master Sep 18, 2020
@radekdoulik
Copy link
Member Author

I will wait with adding test until the Full linker mode works, noted in #5132 to not forget it.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2024
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.

4 participants