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

[dotnet] Don't try to collect RID-specific items to codesign unless we're connected to (or building on) a Mac. #16153

Conversation

rolfbjarne
Copy link
Member

Fixes this problem when building universal Mac Catalyst apps on Windows:

Target Name=_CollectRidSpecificCodesignItems Project=D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\GraphicsTester.Skia.Mac.csproj
    ReadItemsFromFile
        Assembly = D:\a\_work\1\s\bin\dotnet\packs\Microsoft.MacCatalyst.Sdk\15.4.1173-rc.2\tools\msbuild\iOS\..\iOS\Xamarin.iOS.Tasks.dll
        Parameters
            File = obj\Release\net7.0-macos\codesignitems-osx-x64.items
        Errors
            D:\a\_work\1\s\bin\dotnet\packs\Microsoft.macOS.Sdk\12.3.1173-rc.2\targets\Xamarin.Shared.Sdk.targets(1303,3): error MSB4018: The "ReadItemsFromFile" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file 'D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\obj\Release\net7.0-macos\codesignitems-osx-x64.items'.
File name: 'D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\obj\Release\net7.0-macos\codesignitems-osx-x64.items'
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy)
   at System.Xml.XmlTextReaderImpl.FinishInitUriString()
   at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
   at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
   at Xamarin.MacDev.Tasks.ReadItemsFromFileBase.Execute() in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/ReadItemsFromFileBase.cs:line 39
   at Xamarin.MacDev.Tasks.ReadItemsFromFile.Execute() in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/ReadItemsFromFile.cs:line 15
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\GraphicsTester.Skia.Mac.csproj]

…e're connected to (or building on) a Mac.

Fixes this problem when building universal Mac Catalyst apps on Windows:

    Target Name=_CollectRidSpecificCodesignItems Project=D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\GraphicsTester.Skia.Mac.csproj
        ReadItemsFromFile
            Assembly = D:\a\_work\1\s\bin\dotnet\packs\Microsoft.MacCatalyst.Sdk\15.4.1173-rc.2\tools\msbuild\iOS\..\iOS\Xamarin.iOS.Tasks.dll
            Parameters
                File = obj\Release\net7.0-macos\codesignitems-osx-x64.items
            Errors
                D:\a\_work\1\s\bin\dotnet\packs\Microsoft.macOS.Sdk\12.3.1173-rc.2\targets\Xamarin.Shared.Sdk.targets(1303,3): error MSB4018: The "ReadItemsFromFile" task failed unexpectedly.
    System.IO.FileNotFoundException: Could not find file 'D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\obj\Release\net7.0-macos\codesignitems-osx-x64.items'.
    File name: 'D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\obj\Release\net7.0-macos\codesignitems-osx-x64.items'
       at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
       at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
       at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
       at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy)
       at System.Xml.XmlTextReaderImpl.FinishInitUriString()
       at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
       at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
       at Xamarin.MacDev.Tasks.ReadItemsFromFileBase.Execute() in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/ReadItemsFromFileBase.cs:line 39
       at Xamarin.MacDev.Tasks.ReadItemsFromFile.Execute() in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/ReadItemsFromFile.cs:line 15
       at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
       at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\GraphicsTester.Skia.Mac.csproj]
@rolfbjarne rolfbjarne added the not-notes-worthy Ignore for release notes label Sep 27, 2022
@rolfbjarne
Copy link
Member Author

/sudo backport release/7.0.1xx-rc2

@rolfbjarne
Copy link
Member Author

/sudo backport release/7.0.1xx-xcode14-rc2

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Backport Job to branch release/7.0.1xx-rc2 Created! The magic is happening here

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Backport Job to branch release/7.0.1xx-xcode14-rc2 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=6745169 for more details.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [PR Build] Tests on macOS Mac Catalina (10.15) passed 💻

All tests on macOS Mac Catalina (10.15) passed.

Pipeline on Agent
Hash: 933ce16244de93a32d9159b084b4e38f067ca318 [PR build]

@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: 933ce16244de93a32d9159b084b4e38f067ca318 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

📚 [PR Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent XAMBOT-1044.Monterey'
Hash: 933ce16244de93a32d9159b084b4e38f067ca318 [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: 933ce16244de93a32d9159b084b4e38f067ca318 [PR build]

rolfbjarne added a commit that referenced this pull request Sep 27, 2022
…fic items to codesign unless we're connected to (or building on) a Mac. (#16155)

Fixes this problem when building universal Mac Catalyst apps on Windows:

    Target Name=_CollectRidSpecificCodesignItems Project=D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\GraphicsTester.Skia.Mac.csproj
        ReadItemsFromFile
            Assembly = D:\a\_work\1\s\bin\dotnet\packs\Microsoft.MacCatalyst.Sdk\15.4.1173-rc.2\tools\msbuild\iOS\..\iOS\Xamarin.iOS.Tasks.dll
            Parameters
                File = obj\Release\net7.0-macos\codesignitems-osx-x64.items
            Errors
                D:\a\_work\1\s\bin\dotnet\packs\Microsoft.macOS.Sdk\12.3.1173-rc.2\targets\Xamarin.Shared.Sdk.targets(1303,3): error MSB4018: The "ReadItemsFromFile" task failed unexpectedly.
    System.IO.FileNotFoundException: Could not find file 'D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\obj\Release\net7.0-macos\codesignitems-osx-x64.items'.
    File name: 'D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\obj\Release\net7.0-macos\codesignitems-osx-x64.items'
       at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
       at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
       at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
       at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy)
       at System.Xml.XmlTextReaderImpl.FinishInitUriString()
       at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
       at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
       at Xamarin.MacDev.Tasks.ReadItemsFromFileBase.Execute() in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/ReadItemsFromFileBase.cs:line 39
       at Xamarin.MacDev.Tasks.ReadItemsFromFile.Execute() in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/ReadItemsFromFile.cs:line 15
       at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
       at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\GraphicsTester.Skia.Mac.csproj]


Backport of #16153

Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
rolfbjarne added a commit that referenced this pull request Sep 27, 2022
…s to codesign unless we're connected to (or building on) a Mac. (#16154)

Fixes this problem when building universal Mac Catalyst apps on Windows:

    Target Name=_CollectRidSpecificCodesignItems Project=D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\GraphicsTester.Skia.Mac.csproj
        ReadItemsFromFile
            Assembly = D:\a\_work\1\s\bin\dotnet\packs\Microsoft.MacCatalyst.Sdk\15.4.1173-rc.2\tools\msbuild\iOS\..\iOS\Xamarin.iOS.Tasks.dll
            Parameters
                File = obj\Release\net7.0-macos\codesignitems-osx-x64.items
            Errors
                D:\a\_work\1\s\bin\dotnet\packs\Microsoft.macOS.Sdk\12.3.1173-rc.2\targets\Xamarin.Shared.Sdk.targets(1303,3): error MSB4018: The "ReadItemsFromFile" task failed unexpectedly.
    System.IO.FileNotFoundException: Could not find file 'D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\obj\Release\net7.0-macos\codesignitems-osx-x64.items'.
    File name: 'D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\obj\Release\net7.0-macos\codesignitems-osx-x64.items'
       at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
       at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
       at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
       at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy)
       at System.Xml.XmlTextReaderImpl.FinishInitUriString()
       at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
       at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
       at Xamarin.MacDev.Tasks.ReadItemsFromFileBase.Execute() in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/ReadItemsFromFileBase.cs:line 39
       at Xamarin.MacDev.Tasks.ReadItemsFromFile.Execute() in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/ReadItemsFromFile.cs:line 15
       at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
       at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [D:\a\_work\1\s\src\Graphics\samples\GraphicsTester.Skia.Mac\GraphicsTester.Skia.Mac.csproj]


Backport of #16153

Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
@vs-mobiletools-engineering-service2
Copy link
Collaborator

🚀 [CI Build] Test results 🚀

Test results

✅ All tests passed on VSTS: simulator tests.

🎉 All 223 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 23 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: [PR build]

@rolfbjarne rolfbjarne merged commit e9e097c into xamarin:main Sep 27, 2022
@rolfbjarne rolfbjarne deleted the dotnet-codesign-skip-collecting-unless-connected-to-mac branch September 27, 2022 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-notes-worthy Ignore for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants