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

Run ILC after ComputeResolvedFilesToPublishList #111514

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

sbomer
Copy link
Member

@sbomer sbomer commented Jan 16, 2025

Fixes #108909

Needs more testing, but seems to work with a small repro so far.

@MichalStrehovsky
Copy link
Member

Did you consider using the scheme that ILLink/R2R/SingleFile use right now?

It feels like it would make the sequencing most "standard". We'd probably need to wait for the new SDK to flow to this repo but we just did an upgrade and we could do another one.

@sbomer
Copy link
Member Author

sbomer commented Jan 17, 2025

This moves us in that direction - now this target will be sequenced appropriately - and we can change from AfterTargets to DependsOnTargets in a later change. I'm looking at the native aot targets all-up to see if there's other logic that needs cleanup, but wanted to start with this piece.

Copy link
Member

@MichalStrehovsky MichalStrehovsky left a comment

Choose a reason for hiding this comment

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

Nice!

@MichalStrehovsky
Copy link
Member

(The CI failures look related)

@ivanpovazan
Copy link
Member

/azp run runtime-ioslike

Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@ivanpovazan
Copy link
Member

/azp run runtime-extra-platforms

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@steveisok
Copy link
Member

@ivanpovazan is there going to be any work required in the iOS SDK as a result of this change?

@ivanpovazan
Copy link
Member

@ivanpovazan is there going to be any work required in the iOS SDK as a result of this change?

No, because we opt-out from NativeAOT Publish targets and handle them differently:
https://github.com/xamarin/xamarin-macios/blob/8d57fe69ca1d9d63c8da2c9b5672eda4ea69ab4d/dotnet/targets/Xamarin.Shared.Sdk.props#L189

@ivanpovazan
Copy link
Member

@sbomer ios/tvos test failures seem related, let me know if I can help with those.

@@ -36,6 +36,7 @@
$(_ProcessRuntimeComponentsForLibraryMode);
$(_AotCompileTargetName);
_BuildNativeLibrary;
_PublishNativeBinary;
Copy link
Member

Choose a reason for hiding this comment

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

Remove this change, see my comment below.

@@ -46,6 +46,17 @@
</LibraryBuilderTask>
</Target>

<Target Name="_PublishNativeBinary">
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should put this target here.

LibraryBuilder.props/targets are intended for Mono's library mode support, and none of the MSBuild targets from this file should be needed for NativeAOT (I admit there are other hacks which are advocating against this).

If I understand correctly, you added this target so that NativeAOT library mode has the previous CopyNativeBinary behavior, correct?

If that is the case, then I would:

  1. Move this target into AppleBuild.targets
  2. Remove it from AppleBuildDependsOn (see my comment above)
  3. Add it manually as a last dependency at:
    DependsOnTargets="SetupProperties;ComputeIlcCompileInputs;IlcCompile;$(_IlcLibraryBuildDependsOn)" />
  4. Put a condition on it: Condition="'$(_IsLibraryMode)' == 'true' and '$(UseNativeAOTRuntime)' == 'true'"

This way it does not affect: Mono app or lib builds, and it does not affect NativeAOT app builds. We will eventually clean all of this up in the internal props/targets as we now have experimental CoreCLR support for Apple as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ILC should run after ComputeResolvedFilesToPublishList
6 participants