KEMBAR78
[Windows] Fix _CompileNativeExecutable inputs/outputs by emaf · Pull Request #23533 · dotnet/macios · GitHub
Skip to content

Conversation

@emaf
Copy link
Contributor

@emaf emaf commented Aug 9, 2025

_CompileNativeExecutable was always being executed from Windows being its inputs and outputs were never generated:

  • ILLink: we were not creating outputs for the linker-cache directory. Also, the previous behavior would always create an output file for all the Macs for the analyzed directories, but not all of them actually changed on each run, making the Windows side outputs to be incorrectly updated (and forcing other targets execution).
  • CompileNativeCode: was not reporting the compiled output files, forcing _CompileNativeExecutable to always run.

Finally, removed the Xamarin.MacDev.Tasks.ILLink output parameters we don't use from the targets. The task contains those outputs mainly to create the empty output files on Windows.

I'll add a test for this in an upcoming PR.

Fixes #19609

`_CompileNativeExecutable` was always being executed from Windows being its inputs and outputs were never generated:
- **ILLink**: we were not creating outputs for the `linker-cache` directory. Also, the previous behavior would always create an output file for all the Macs for the analyzed directories, but not all of them actually changed on each run, making the Windows side outputs to be incorrectly updated (and forcing other targets execution).
- **CompileNativeCode**: was not reporting the compiled output files, forcing `_CompileNativeExecutable` to always run.

Finally, removed the `Xamarin.MacDev.Tasks.ILLink` output parameters we don't use from the targets. The task contains those outputs mainly to create the empty output files on Windows.

I'll add a test for this in an upcoming PR.

Fixes #19609
@emaf emaf requested review from mauroa and rolfbjarne as code owners August 9, 2025 00:26
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

emaf added a commit that referenced this pull request Aug 11, 2025
The `_LinkNativeExecutable` always runs because its inputs/outputs are
not created on Windows. Its own output file was never created because
the task was not configured to do so.

Also, the `_MtouchSymbolsList` was being written remotely so it was
never found on Windows when checking the outputs. It's safe to write
this locally as it will be copied as part of running this task as it is
one of its declared dependencies.

For the target to be fully skipped this fix depends on
#23533, which makes the compiled
native executable output file to exist on Windows.

Fixes #19610
emaf added 2 commits August 11, 2025 15:09
We do this after analyzing the outputFile path, because if the metadata is not set it will be inferred from src and for remote builds we need relative paths.
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build #494715e] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 494715ee21620d35f87409451811e873fc5a4abf [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #494715e] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 494715ee21620d35f87409451811e873fc5a4abf [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ API diff for current PR / commit

.NET ( No breaking changes )

✅ API diff vs stable

.NET ( No breaking changes )

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 494715ee21620d35f87409451811e873fc5a4abf [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #494715e] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 494715ee21620d35f87409451811e873fc5a4abf [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #494715e] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: 494715ee21620d35f87409451811e873fc5a4abf [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #494715e] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: 494715ee21620d35f87409451811e873fc5a4abf [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #494715e] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: 494715ee21620d35f87409451811e873fc5a4abf [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #494715e] Tests on macOS arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: 494715ee21620d35f87409451811e873fc5a4abf [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🚀 [CI Build #494715e] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 115 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 8 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 8 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 494715ee21620d35f87409451811e873fc5a4abf [PR build]

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@emaf emaf merged commit f742188 into main Aug 12, 2025
44 checks passed
@emaf emaf deleted the dev/ema/compile-native-executable branch August 12, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows build perf] _CompileNativeExecutable is always executed

3 participants