[dotnet] Fix handling binding frameworks embedded in binding assemblies remotely.#24518
[dotnet] Fix handling binding frameworks embedded in binding assemblies remotely.#24518rolfbjarne merged 4 commits intomainfrom
Conversation
…es remotely. Adjust the FilterStaticFrameworks and GetFullPaths tasks to not copy any empty files from Windows to Mac, because that would most likely overwrite an existing non-empty file on the Mac. Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2679691.
There was a problem hiding this comment.
Pull request overview
This pull request fixes handling of binding frameworks embedded in binding assemblies when building remotely on Windows with a Mac build server. The fix prevents empty placeholder files created on Windows from being copied to the Mac, which would overwrite the actual non-empty framework files.
Changes:
- Modified MSBuild tasks to check file size before copying to build server and skip empty files
- Added new test projects to validate the fix for embedded frameworks in binding projects
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| msbuild/Xamarin.MacDev.Tasks/Tasks/GetFullPaths.cs | Added empty file check in ShouldCopyToBuildServer to prevent overwriting Mac files |
| msbuild/Xamarin.MacDev.Tasks/Tasks/FilterStaticFrameworks.cs | Added empty file check in GetAdditionalItemsToBeCopied to skip copying empty framework files |
| tests/dotnet/UnitTests/WindowsTest.cs | Added test case to verify building embedded framework in binding project on Windows |
| tests/dotnet/BindingWithEmbeddedFramework/* | New binding project with embedded XTest.framework for testing |
| tests/dotnet/EmbeddedFrameworkInBindingProjectApp/* | New test app consuming the binding project with embedded framework |
| tests/bindings-framework-test/dotnet/shared.csproj | Made NoBindingEmbedding conditional to allow override in tests |
| public bool ShouldCopyToBuildServer (ITaskItem item) => true; | ||
| public bool ShouldCopyToBuildServer (ITaskItem item) | ||
| { | ||
|
|
There was a problem hiding this comment.
There is an extra blank line at the beginning of this method. According to the repository's coding guidelines, diffs should be as small as possible and preserve existing code formatting. This extra blank line should be removed.
| Configuration.AssertRuntimeIdentifiersAvailable (platform, runtimeIdentifiers); | ||
| Configuration.IgnoreIfNotOnWindows (); | ||
|
|
||
| var project_path = GetProjectPath (project, runtimeIdentifiers: runtimeIdentifiers, platform: platform, out var appPath, configuration: configuration); |
There was a problem hiding this comment.
The variable 'appPath' is declared but never used in this test method. Consider removing the 'out var appPath' parameter from the GetProjectPath call if it's not needed.
| var project_path = GetProjectPath (project, runtimeIdentifiers: runtimeIdentifiers, platform: platform, out var appPath, configuration: configuration); | |
| var project_path = GetProjectPath (project, runtimeIdentifiers: runtimeIdentifiers, platform: platform, configuration: configuration); |
| Configuration.IgnoreIfNotOnWindows (); | ||
|
|
||
| var project_path = GetProjectPath (project, runtimeIdentifiers: runtimeIdentifiers, platform: platform, out var appPath, configuration: configuration); | ||
| var project_dir = Path.GetDirectoryName (project_path)!; |
There was a problem hiding this comment.
The variable 'project_dir' is declared but never used in this test method. Consider removing this unused variable declaration.
| var project_dir = Path.GetDirectoryName (project_path)!; |
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.
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.
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.
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.
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.
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.
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.
This reverts commit d79b463. wrong branch
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [CI Build #633beb1] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #633beb1] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [CI Build #633beb1] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
💻 [CI Build #633beb1] 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.
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 #633beb1] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #633beb1] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
💻 [CI Build #633beb1] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. 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 #633beb1] Tests on macOS arm64 - Mac Tahoe (26) passed 💻✅ All tests on macOS arm64 - Mac Tahoe (26) passed. Pipeline on Agent |
🚀 [CI Build #633beb1] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 121 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
…in binding assemblies remotely. (#24538) Adjust the FilterStaticFrameworks and GetFullPaths tasks to not copy any empty files from Windows to Mac, because that would most likely overwrite an existing non-empty file on the Mac. Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2679691. Backport of #24518.
…n binding assemblies remotely. (#24548) Adjust the FilterStaticFrameworks and GetFullPaths tasks to not copy any empty files from Windows to Mac, because that would most likely overwrite an existing non-empty file on the Mac. Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2679691. Backport of #24518.
Adjust the FilterStaticFrameworks and GetFullPaths tasks to not copy any empty files
from Windows to Mac, because that would most likely overwrite an existing non-empty
file on the Mac.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2679691.