Skip to content

Run ILC after ComputeResolvedFilesToPublishList#111514

Open
sbomer wants to merge 12 commits intodotnet:mainfrom
sbomer:ilcPublish
Open

Run ILC after ComputeResolvedFilesToPublishList#111514
sbomer wants to merge 12 commits intodotnet:mainfrom
sbomer:ilcPublish

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.

Fixes #118298 (removes CopyNativeBinary logic)

@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

@azure-pipelines
Copy link

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

@ivanpovazan
Copy link
Member

/azp run runtime-extra-platforms

@azure-pipelines
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

@sbomer
Copy link
Member Author

sbomer commented Feb 13, 2026

/azp run runtime-androidemulator

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sbomer
Copy link
Member Author

sbomer commented Feb 13, 2026

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

…sification

Content items that happen to be managed DLLs (e.g. TestAssembly.dll
referenced with OutputItemType=Content) were incorrectly classified as
managed assemblies to compile and removed from publish output. Use the
SDK's PostprocessAssembly metadata to only classify files the SDK has
identified as runtime assemblies, and add ReferenceOutputAssembly=false
to the FileVersionInfo test so the SDK doesn't treat it as one.
Copilot AI review requested due to automatic review settings February 17, 2026 21:40
@sbomer
Copy link
Member Author

sbomer commented Feb 17, 2026

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@sbomer
Copy link
Member Author

sbomer commented Feb 18, 2026

/azp run runtime-android

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sbomer
Copy link
Member Author

sbomer commented Feb 19, 2026

I think this is ready to go - runtime-extra-platforms failures look unrelated (fixing some of them in #124582). PTAL @ivanpovazan @MichalStrehovsky @agocke

-->
<Target Name="ComputeLinkedFilesToPublish"
BeforeTargets="ComputeResolvedFilesToPublishList"
AfterTargets="ComputeResolvedFilesToPublishList"
Copy link
Member

Choose a reason for hiding this comment

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

I think this makes sense in the existing targets, but eventually we want to move into the new CompileNative target that's been provided. Do you know if this is going to work there? Or are we going to need significant surgery for that change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, this moves us in the right direction - this logic should run after ComputeLinkedFilesToPublish which is also where the new CompileNative target is. This change simplifies the work that will be needed to use the new target as a hook.

@agocke
Copy link
Member

agocke commented Feb 19, 2026

Can you also just run this locally and eyeball the target flow in the MSBuild binlog? Not to say that I don't trust CI... but I don't trust CI.

Maybe building the runtime with this change is good enough?

@sbomer
Copy link
Member Author

sbomer commented Feb 19, 2026

Target ordering matches my expectations:

Before:
image
After:
image

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.

NativeAOT targets copies native binary to publish dir twice ILC should run after ComputeResolvedFilesToPublishList

6 participants

Comments