-
Notifications
You must be signed in to change notification settings - Fork 549
[msbuild] <WriteItemsToFile/> task creates empty outputs for Windows
#22741
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
Conversation
Context: #19611 Ignoring tasks related to AOT and trimming, one of the slower steps during a remote iOS build from Windows for me is: Task _CoreCompileImageAssets 524ms Building target "_CoreCompileImageAssets" completely. Output file "obj\Debug\net9.0-ios\iossimulator-arm64\actool\_PartialAppManifest.items" does not exist. When building locally on Mac, the same build will say: Target _CoreCompileImageAssets Skipping target "_CoreCompileImageAssets" because all output files are up-to-date with respect to the input files. The MSBuild target has the code: <Target Name="_CoreCompileImageAssets" Inputs="@(ImageAsset);$(_TemporaryAppManifest)" Outputs="$(_ACTool_PartialAppManifestCache);$(_ACTool_BundleResourceCache)" ...> <ACTool ... /> <WriteItemsToFile Items="@(_ACTool_PartialAppManifest)" ... /> <WriteItemsToFile Items="@(_ACTool_BundleResources)" ... /> <ItemGroup> <FileWrites Include="$(_ACTool_PartialAppManifestCache);$(_ACTool_BundleResourceCache)" /> </ItemGroup> </Target> I think all that needs to be done is to implement `ITaskCallback` in the `<WriteItemsToFile/>` MSBuild task: public bool ShouldCreateOutputFile (ITaskItem item) => true; I updated `WindowsTest.cs` to verify that the `_CoreCompileImageAssets` MSBuild target is skipped on incremental builds.
| public bool ShouldCopyToBuildServer (ITaskItem item) => false; | ||
|
|
||
| //We want empty output files to be created in Windows | ||
| public bool ShouldCreateOutputFile (ITaskItem item) => true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remote tasks create empty output files by default for each ITaskItem output property, so this should not be needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emaf is there a deeper problem here? It's not working in this log:
RecipeFinder_Debug_AnyCPU_net9.0-ios_Build_2025-05-05T16_03_13.6534537-05_00.zip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow:
Output file "obj\Debug\net9.0-ios\iossimulator-arm64\actool\_PartialAppManifest.items" does not exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to leave this open and review what my test changes did.
|
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [CI Build #1b69c18] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #1b69c18] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commit.NET ( No breaking changes )✅ API diff vs stable.NET ( No breaking changes )✅ Generator diffGenerator diff is empty Pipeline on Agent |
✅ [CI Build #1b69c18] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
💻 [CI Build #1b69c18] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
💻 [CI Build #1b69c18] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #1b69c18] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
🔥 [CI Build #fda8a09] Test results 🔥Test results❌ Tests failed on VSTS: test results 0 tests crashed, 1 tests failed, 112 tests passed. Failures❌ windows testsDetailsHtml Report (VSDrops) Download Successes✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
jonathanpeppers
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My test works! This part is useful at least:
Xamarin.Tests.WindowsTest.BundleStructureWithRemoteMac(iOS,"ios-arm64",All,"Debug") (Failed): The target '_CoreCompileImageAssets' was unexpectedly executed (_CoreCompileImageAssets Rebuild 1)
💻 [CI Build #1b69c18] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
|
Going to close this one and address this one instead: I'll probably reuse the test. |

Context: #19611
Ignoring tasks related to AOT and trimming, one of the slower steps during a remote iOS build from Windows for me is:
When building locally on Mac, the same build will say:
The MSBuild target has the code:
I think all that needs to be done is to implement
ITaskCallbackin the<WriteItemsToFile/>MSBuild task:I updated
WindowsTest.csto verify that the_CoreCompileImageAssetsMSBuild target is skipped on incremental builds.