Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Conversation

@filipnavara
Copy link
Contributor

Gets the basics working. It's missing the default items and I haven't been able to fix that but that's already missing on iOS.

@jonathanpeppers
Copy link
Member

Let me open a different PR to see if this is happening with main:

  C:\Program Files\dotnet\packs\Microsoft.iOS.Windows.Sdk\14.5.100-preview.4.638\tools\msbuild\iOS\Xamarin.Messaging.Build.targets(109,7): error MSB4064: The "ServerPort" parameter is not supported by the "SayHello" task loaded from assembly: Xamarin.iOS.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null from the path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Tasks.dll. Verify that the parameter exists on the task, the <UsingTask> points to the correct assembly, and it is a settable public instance property. [D:\a\1\s\samples\tests\VsInstallRoot\VsInstallRoot.csproj]
  C:\Program Files\dotnet\packs\Microsoft.iOS.Windows.Sdk\14.5.100-preview.4.638\tools\msbuild\iOS\Xamarin.Messaging.Build.targets(107,3): error MSB4063: The "SayHello" task could not be initialized with its input parameters.  [D:\a\1\s\samples\tests\VsInstallRoot\VsInstallRoot.csproj]

@filipnavara
Copy link
Contributor Author

The test failures seemed unrelated but would be nice to fix. Default item inclusion will be unblocked by dotnet/macios#11991.

@jonathanpeppers
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jonathanpeppers
Copy link
Member

@filipnavara sorry for the delay, it's been busy for me lately.

If this is green, do you think it's working enough to merge?

We probably shouldn't add this to `samples.sln`, because it would fail CI phases on Windows.
@filipnavara filipnavara marked this pull request as ready for review July 1, 2021 06:03
@filipnavara
Copy link
Contributor Author

If this is green, do you think it's working enough to merge?

It should be on par with the iOS code. I'll submit another PR to fix the automatic file inclusions once the next workload previews are shipped.

@jonathanpeppers
Copy link
Member

An error came up when I setup the HelloMac project to build:

Main.storyboard : error : The file 'Main.storyboard' conflicts with 'Main.storyboard'. [/Users/runner/work/1/s/samples/HelloMac/HelloMac.csproj]
Main.storyboard : error :          [/Users/runner/work/1/s/samples/HelloMac/HelloMac.csproj]
    2 Warning(s)
    1 Error(s)

@filipnavara
Copy link
Contributor Author

Thanks, I will check.

@filipnavara
Copy link
Contributor Author

@jonathanpeppers I cannot see the AzDO pages and the build log. Can you post the failing part please? Local build seems to work just fine for me with the same command as in azure-pipelines.yml.

@jonathanpeppers
Copy link
Member

The latest error is new:

/usr/local/share/dotnet/sdk/6.0.100-preview.5.21302.13/NuGet.targets(131,5): The local source '/Users/runner/work/1/s/bin/Debug/' doesn't exist. [/Users/runner/work/1/s/samples/HelloMac/HelloMac.csproj]

.binlog: HelloMac.zip

I'm not immediately seeing what is wrong...

@filipnavara
Copy link
Contributor Author

filipnavara commented Jul 6, 2021

It seems to be a mismatch between the Debug/Release of the projects being built. I cannot quite reproduce the same error but I have very similar one reproduced locally.

@filipnavara
Copy link
Contributor Author

I'm kinda surprised that it doesn't error out on the other samples. Maybe it behaves differently when compiled through .sln.

@jonathanpeppers
Copy link
Member

I added a step creating the directory.

These sources are static, doesn't make sense why samples.sln can build, but your new sample doesn't?

<add key="debug" value="../bin/Debug/" />
<add key="release" value="../bin/Release/" />

@jonathanpeppers
Copy link
Member

Ok, now we have a real error:

/usr/local/share/dotnet/sdk/6.0.100-preview.5.21302.13/Microsoft.Common.CurrentVersion.targets(2202,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Drawing.Common.dll". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/Users/runner/work/1/s/samples/HelloMac/HelloMac.csproj]
ILLINK : warning MM0079: The recommended Xcode version for Microsoft.macOS 11.3.100 is Xcode 12.5 or later. The current Xcode version (found in /Applications/Xcode_12.4.app/Contents/Developer) is 12.4. [/Users/runner/work/1/s/samples/HelloMac/HelloMac.csproj]
MMP : warning MM5220: Skipping framework 'QTKit'. It is prohibited (rejected) by the Mac App Store [/Users/runner/work/1/s/samples/HelloMac/HelloMac.csproj]
ILLink : unknown error IL6999: Failed to execute the custom steps. [/Users/runner/work/1/s/samples/HelloMac/HelloMac.csproj]
ILLINK : error MM2301: The linker step 'Setup' failed during processing: This version of Microsoft.macOS requires the macOS 11.3 SDK (shipped with Xcode 12.5). Either upgrade Xcode to get the required header files or use the dynamic registrar or set the managed linker behaviour to Link Platform or Link Framework SDKs Only in your project's Mac Build Options > Linker Behavior) (to try to avoid the new APIs). [/Users/runner/work/1/s/samples/HelloMac/HelloMac.csproj]
/usr/local/share/dotnet/sdk/6.0.100-preview.5.21302.13/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.ILLink.targets(77,5): error NETSDK1144: Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false. [/Users/runner/work/1/s/samples/HelloMac/HelloMac.csproj]
    3 Warning(s)
    3 Error(s)

Let me check on what Xcode I can get -- or could we change the sample project to a class library? We wouldn't need the linker in that case?

@filipnavara
Copy link
Contributor Author

Let me check on what Xcode I can get -- or could we change the sample project to a class library?

I tried to make it as close as possible to the actual usage which is why I chose to use an app as a sample. It also allows to verify easily if all the assets were embedded correctly because the app would not build or run. That said, I am fine with temporarily changing it to a class library if it can unblock the PR.

…into macOS

Conflicts:
	azure-pipelines.yml
	src/Xamarin.Legacy.Sdk/Sdk/Sdk.props
@jonathanpeppers
Copy link
Member

I was checking if we could do this now, you can get Big Sur (with Xcode 12.5) on Github Actions now:

https://github.blog/changelog/2021-08-16-github-actions-macos-11-big-sur-is-generally-available-on-github-hosted-runners/

Still not available on Azure DevOps:

https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted

Let's see if this is any closer now.

@jonathanpeppers
Copy link
Member

Ugh, seems like we need Xcode 13 now...

ILLINK : error MM2301: The linker step 'Setup' failed during processing: This version of Microsoft.macOS requires the macOS 12.0 SDK (shipped with Xcode 13.0). Either upgrade Xcode to get the required header files or use the dynamic registrar or set the managed linker behaviour to Link Platform or Link Framework SDKs Only in your project's Mac Build Options > Linker Behavior) (to try to avoid the new APIs). [/Users/runner/work/Xamarin.Legacy.Sdk/Xamarin.Legacy.Sdk/samples/HelloMac/HelloMac.csproj]

@filipnavara
Copy link
Contributor Author

The Xcode 13 beta should be in the image (https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md) and there's a GH Action to install/switch it. I am out on vacation now but I can take a look when I return.

@jonathanpeppers
Copy link
Member

This seems to be using Xcode 13 now, but we get:

 In file included from /Users/runner/work/Xamarin.Legacy.Sdk/Xamarin.Legacy.Sdk/samples/HelloMac/obj/Release/net6.0-macos/osx-x64/linker-cache/registrar.mm:2:
  /Users/runner/work/Xamarin.Legacy.Sdk/Xamarin.Legacy.Sdk/samples/HelloMac/obj/Release/net6.0-macos/osx-x64/linker-cache/registrar.h:1124:80: error: 'CMHeadphoneMotionManagerDelegate' is unavailable: not available on macOS
  @interface Xamarin_Mac__CoreMotion_CMHeadphoneMotionManagerDelegate : NSObject<CMHeadphoneMotionManagerDelegate> {
                                                                                 ^
  /Applications/Xcode_13.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneMotionManagerDelegate.h:22:11: note: 'CMHeadphoneMotionManagerDelegate' has been explicitly marked unavailable here
  @protocol CMHeadphoneMotionManagerDelegate<NSObject>
            ^
  1 error generated.
  
/Users/runner/.dotnet/packs/Microsoft.macOS.Sdk/12.0.100-preview.7.230/targets/Xamarin.Shared.Sdk.targets(805,3): error : clang exited with code 1 [/Users/runner/work/Xamarin.Legacy.Sdk/Xamarin.Legacy.Sdk/samples/HelloMac/HelloMac.csproj]
/Users/runner/.dotnet/packs/Microsoft.macOS.Sdk/12.0.100-preview.7.230/targets/Xamarin.Shared.Sdk.targets(805,3): error :          [/Users/runner/work/Xamarin.Legacy.Sdk/Xamarin.Legacy.Sdk/samples/HelloMac/HelloMac.csproj]

Build FAILED.

/Users/runner/.dotnet/sdk/6.0.100-preview.7.21379.14/Microsoft.Common.CurrentVersion.targets(2205,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Drawing.Common.dll". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/Users/runner/work/Xamarin.Legacy.Sdk/Xamarin.Legacy.Sdk/samples/HelloMac/HelloMac.csproj]
MMP : warning MM5220: Skipping framework 'QTKit'. It is prohibited (rejected) by the Mac App Store [/Users/runner/work/Xamarin.Legacy.Sdk/Xamarin.Legacy.Sdk/samples/HelloMac/HelloMac.csproj]
/Users/runner/.dotnet/packs/Microsoft.macOS.Sdk/12.0.100-preview.7.230/targets/Xamarin.Shared.Sdk.targets(805,3): error : clang exited with code 1 [/Users/runner/work/Xamarin.Legacy.Sdk/Xamarin.Legacy.Sdk/samples/HelloMac/HelloMac.csproj]
/Users/runner/.dotnet/packs/Microsoft.macOS.Sdk/12.0.100-preview.7.230/targets/Xamarin.Shared.Sdk.targets(805,3): error :          [/Users/runner/work/Xamarin.Legacy.Sdk/Xamarin.Legacy.Sdk/samples/HelloMac/HelloMac.csproj]
    2 Warning(s)
    1 Error(s)

@filipnavara
Copy link
Contributor Author

filipnavara commented Aug 26, 2021

Xcode 13 beta 5 (as available on the GH Actions macOS image) removed CMHeadphoneMotionManagerDelegate from macOS where it was previously available. This was already updated on Xamarin side but the Preview 7 packages predate that.

@jonathanpeppers
Copy link
Member

I'll probably come back to this when .NET 6 RC 1 ships, thanks.

@filipnavara do you need this in quicker than that? We could also just not build the Mac sample on CI yet and ship it?

@filipnavara
Copy link
Contributor Author

No rush here. Let's revisit it once RC1 ships.

@filipnavara
Copy link
Contributor Author

I wanted to re-run the GitHub Actions / Azure Pipelines but apparently I don't have enough rights to do so.

@jonathanpeppers
Copy link
Member

I think the general CI also broke when RC1 shipped.

Let me update .NET 6 in this repo.

@filipnavara
Copy link
Contributor Author

Thanks for the merge. Looks like the macOS image was updated with Xcode 13 RC already (which dropped macOS 12 SDK at last minute) :-(

@filipnavara
Copy link
Contributor Author

Looks like there's some attempt to bring back Xcode 13 beta 5 back into the images. Not sure if it's deployed already.

@filipnavara
Copy link
Contributor Author

Looks like a new macOS 11 image went live around ~8 hours ago. Hopefully the Xcode step should succeed now.

@filipnavara
Copy link
Contributor Author

🎉

@jonathanpeppers jonathanpeppers merged commit 7bc810c into xamarin:main Sep 21, 2021
@jonathanpeppers
Copy link
Member

@filipnavara we shipped this:

https://www.nuget.org/packages/Xamarin.Legacy.Sdk/0.1.1-alpha5

Sorry, I forgot to actually publish the release on this one.

@filipnavara
Copy link
Contributor Author

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants