Skip to content
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

[msbuild] Fix calling the GetFileSystemEntries task on Windows when not connected to a Mac. #18287

Merged
merged 1 commit into from May 18, 2023

Conversation

rolfbjarne
Copy link
Member

Given the following truths:

  • A task will (try to) connect to a Mac if its SessionId property isn't empty.
  • The BuildSessionId property is always set on Windows when building from an IDE (even if not connected to a remote Mac).

It stands to reason that we can't use BuildSessionId to distinguish between
connected/not conected status on Windows. Instead introduce a new property,
BuildSessionIdIfConnected, which is only set if connected to a Mac (i.e. if
'IsMacEnabled=true').

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1808448 (second attempt).

…ot connected to a Mac.

Given the following truths:

* A task will (try to) connect to a Mac if its SessionId property isn't empty.
* The BuildSessionId property is always set on Windows when building from an IDE (even if not connected to a remote Mac).

It stands to reason that we can't use BuildSessionId to distinguish between
connected/not conected status on Windows. Instead introduce a new property,
BuildSessionIdIfConnected, which is only set if connected to a Mac (i.e. if
'IsMacEnabled=true').

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1808448 (second attempt).
@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ API diff for current PR / commit

Legacy Xamarin (No breaking changes)
  • iOS (no change detected)
  • tvOS (no change detected)
  • watchOS (no change detected)
  • macOS (no change detected)
NET (empty diffs)
  • iOS: (empty diff detected)
  • tvOS: (empty diff detected)
  • MacCatalyst: (empty diff detected)
  • macOS: (empty diff detected)

✅ API diff vs stable

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)
Legacy Xamarin (stable) vs .NET

✅ Generator diff

Generator diff is empty

Pipeline on Agent
Hash: 7e3297578111dedbf4f7041f8a40bc4285b49fd8 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build] Windows Integration Tests passed 💻

All Windows Integration Tests passed.

Pipeline on Agent
Hash: 7e3297578111dedbf4f7041f8a40bc4285b49fd8 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [PR Build] Tests on macOS M1 - Mac Ventura (13.0) passed 💻

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

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻

All tests on macOS M1 - Mac Big Sur (11.5) passed.

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

📚 [PR Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🚀 [CI Build] Test results 🚀

Test results

✅ All tests passed on VSTS: simulator tests.

🎉 All 227 tests passed 🎉

Tests counts

✅ bcl: All 69 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests: All 1 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 7 tests passed. Html Report (VSDrops) Download
✅ framework: All 8 tests passed. Html Report (VSDrops) Download
✅ generator: All 2 tests passed. Html Report (VSDrops) Download
✅ interdependent_binding_projects: All 7 tests passed. Html Report (VSDrops) Download
✅ install_source: All 1 tests passed. Html Report (VSDrops) Download
✅ introspection: All 8 tests passed. Html Report (VSDrops) Download
✅ linker: All 65 tests passed. Html Report (VSDrops) Download
✅ mac_binding_project: All 1 tests passed. Html Report (VSDrops) Download
✅ mmp: All 2 tests passed. Html Report (VSDrops) Download
✅ mononative: All 12 tests passed. Html Report (VSDrops) Download
✅ monotouch: All 27 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ mtouch: All 1 tests passed. Html Report (VSDrops) Download
✅ xammac: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. Html Report (VSDrops) Download
✅ xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 7e3297578111dedbf4f7041f8a40bc4285b49fd8 [PR build]

@rolfbjarne rolfbjarne requested review from emaf and mauroa May 17, 2023 19:47
@rolfbjarne rolfbjarne merged commit edd0bc4 into xamarin:main May 18, 2023
75 of 77 checks passed
@rolfbjarne rolfbjarne deleted the build-session-id-if-connected branch May 18, 2023 16:21
@rolfbjarne
Copy link
Member Author

/sudo backport release/7.0.2xx-xcode14.3

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Backport Job to branch release/7.0.2xx-xcode14.3 Created! The magic is happening here

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Hooray! Backport succeeded! Please see https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=7789057 for more details.

rolfbjarne pushed a commit that referenced this pull request May 19, 2023
…tries task on Windows when not connected to a Mac. (#18299)

Given the following truths:

* A task will (try to) connect to a Mac if its SessionId property isn't empty.
* The BuildSessionId property is always set on Windows when building from an IDE (even if not connected to a remote Mac).

It stands to reason that we can't use BuildSessionId to distinguish between
connected/not conected status on Windows. Instead introduce a new property,
BuildSessionIdIfConnected, which is only set if connected to a Mac (i.e. if
'IsMacEnabled=true').

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1808448 (second attempt).


Backport of #18287
@mmeissa
Copy link

mmeissa commented Jun 5, 2023

After applying the modifications, Im still getting errors on <GetFileSystemEntries
SessionId="$(BuildSessionId)"
SessionId="$(BuildSessionIdIfConnected)"
DirectoryPath="@(_BindingPackagesFromReferencedAssembliesDirectoriesExists)"
Pattern="*"
Recursive="true"...

This is an example of the errors :
"An error occurred on client Build1647060 while executing a reply for topic xvs/build/16.4.7060/execute-task/XXX/15c29a0002fGetFileSystemEntries
DirectoryNotFoundException: Could not find a part of the path '/Users/XXX/Library/Caches/Xamarin/mtbs/builds/XXX/15c29a0ceb6003645dd5ffd8bccd1d032be35349ee6d12fd8d8f8575e0a1e0db/C:/nuget/packages/xamarin.firebase.ios.cloudmessaging/8.10.0.3/lib/net6.0-ios15.4/Firebase.CloudMessaging.resources'.
XXX C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.4.7060\targets\Xamarin.Shared.Sdk.targets"

I guess the error is caused by the ":" included at the middel of the path which is phisicaly automaticaly removed by Macintoch operating system when the files are being created but trying to read the files with the bad path cases the errors.

I checked that the files do exist on the mac but with the ":" removed so "...15c29a0ceb6003645dd5ffd8bccd1d032be35349ee6d12fd8d8f8575e0a1e0db/C:/nuget/packages/xamarin.firebase.ios.cloudmessaging/8.10.0.3/lib/net6.0-ios15.4/Firebase.CloudMessaging.resources" is found on the Mac at "15c29a0ceb6003645dd5ffd8bccd1d032be35349ee6d12fd8d8f8575e0a1e0db/C/nuget/packages/xamarin.firebase.ios.cloudmessaging/8.10.0.3/lib/net6.0-ios15.4/Firebase.CloudMessaging.resources"

It might be helpfull to remove any ":" inside the path

@rolfbjarne
Copy link
Member Author

@mmeissa it turned out this fix didn't work. We've since implemented a proper fix, and this is the workaround: #18308 (comment)

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.

None yet

7 participants