Skip to content

[dotnet] Fix handling binding frameworks embedded in binding assemblies remotely.#24518

Merged
rolfbjarne merged 4 commits intomainfrom
dev/rolf/embedded-framework-windows
Jan 22, 2026
Merged

[dotnet] Fix handling binding frameworks embedded in binding assemblies remotely.#24518
rolfbjarne merged 4 commits intomainfrom
dev/rolf/embedded-framework-windows

Conversation

@rolfbjarne
Copy link
Member

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.

…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.
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

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)
{

Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

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.

Copilot generated this review using guidance from repository custom instructions.
Configuration.AssertRuntimeIdentifiersAvailable (platform, runtimeIdentifiers);
Configuration.IgnoreIfNotOnWindows ();

var project_path = GetProjectPath (project, runtimeIdentifiers: runtimeIdentifiers, platform: platform, out var appPath, configuration: configuration);
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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);

Copilot uses AI. Check for mistakes.
Configuration.IgnoreIfNotOnWindows ();

var project_path = GetProjectPath (project, runtimeIdentifiers: runtimeIdentifiers, platform: platform, out var appPath, configuration: configuration);
var project_dir = Path.GetDirectoryName (project_path)!;
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The variable 'project_dir' is declared but never used in this test method. Consider removing this unused variable declaration.

Suggested change
var project_dir = Path.GetDirectoryName (project_path)!;

Copilot uses AI. Check for mistakes.
@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.

@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

✅ [CI Build #633beb1] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 633beb1fc2c0b67b7116df3b5669ad9367c973f3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build #633beb1] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 633beb1fc2c0b67b7116df3b5669ad9367c973f3 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

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

Pipeline on Agent
Hash: 633beb1fc2c0b67b7116df3b5669ad9367c973f3 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #633beb1] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 633beb1fc2c0b67b7116df3b5669ad9367c973f3 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

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

Pipeline on Agent
Hash: 633beb1fc2c0b67b7116df3b5669ad9367c973f3 [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 #633beb1] Tests on macOS M1 - Mac Monterey (12) passed 💻

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

Pipeline on Agent
Hash: 633beb1fc2c0b67b7116df3b5669ad9367c973f3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

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

Pipeline on Agent
Hash: 633beb1fc2c0b67b7116df3b5669ad9367c973f3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

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

Pipeline on Agent
Hash: 633beb1fc2c0b67b7116df3b5669ad9367c973f3 [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
Copy link
Collaborator

💻 [CI Build #633beb1] Tests on macOS arm64 - Mac Tahoe (26) passed 💻

All tests on macOS arm64 - Mac Tahoe (26) passed.

Pipeline on Agent
Hash: 633beb1fc2c0b67b7116df3b5669ad9367c973f3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🚀 [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
✅ 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 6 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 9 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 11 tests passed. [attempt 2] 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: 633beb1fc2c0b67b7116df3b5669ad9367c973f3 [PR build]

@rolfbjarne rolfbjarne merged commit 36c83c7 into main Jan 22, 2026
45 checks passed
rolfbjarne added a commit that referenced this pull request Jan 22, 2026
…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.
rolfbjarne added a commit that referenced this pull request Feb 3, 2026
…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.
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.

5 participants