-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 does not use default xcode version on hosted macOS agent to build Xamarin.Mac app #8388
Comments
@radical any chance you can point @4or5trees in a direction for this Mono |
cc @mrward |
Not an expert on this so not sure if Xamarin.Mac supports finding Xcode from xcode-select. In VS Mac, when you configure the Xcode path in Preferences it writes a plist file with the path to the Xcode.app, which is used when msbuild builds the project.
Looking at the Xamarin.Mac source code it looks like another way to configure this is via an MD_APPLE_SDK_ROOT environment variable. @rolfbjarne will know the best approach here. |
Just above the code I linked to, it seems to use xcode-select as the last thing it tries. So maybe there is a settings.plist file overriding the default behaviour? |
The order is:
So I'm guessing you have a |
Hi guys, sorry for the late reply. Thank you very much for your detailed responses! Strangely, though, I have not been able to fix the build with them. I have tried a variety of different things, including suggestions from comments above:
I believe there might be a combination of fixes that I have not yet tried that will fix the issue. In case I find it, I will comment it here. Additionally, we have unblocked our builds by manually selecting the macOS version. So the issue is not so urgent to fix for us at the moment. So I think it should be OK to close this issue with this comment. Thanks for your help! |
Issue Description
I have an issue with
msbuild
on my Azure DevOps hosted macOS agents.As described in this Azure DevOps announcement, the way to select the xcode version should be done by performing:
sudo xcode-select -s "/Applications/Xcode_14.0.1.app"
In my pipeline there is an old Xamarin.Mac app that needs to be built with Xcode
14.0.1
, otherwise the build will fail.The
_CoreCompileInterfaceDefinitions
of themsbuild
output anibtool
call with arguments pointing to:I can validate that the Xcode default version is set properly by running the code below after
xcode-select
:I've also tried pointing the Xcode.app symlink to my desired Xcode version but this did not fix the issue.
Steps to Reproduce
Create sample Xamarin.Mac application
Create and run build for hosted
macOS-12
agent on Azure DevOps:sudo xcode-select -s "/Applications/Xcode_14.0.1.app"
msbuild
to build sample Xamarin.MacExpected Behavior
Build succeeds
Build logs show
_CoreCompileInterfaceDefinitions
uses selected Xcode version to buildActual Behavior
Build fails
Build logs show
_CoreCompileInterfaceDefinitions
usesmacOS-12
agent default Xcode version14.2
Ask us questions
How can I force
msbuild
to use a specific Xcode version for building my Xamarin.Mac app?On my local Mac I don't have this issue (
msbuild
honors the selected Xcode version)The text was updated successfully, but these errors were encountered: