actions / runner-images

GitHub Actions runner images
MIT License
10.13k stars 3.05k forks source link

visionOS SDK not installed on macOS 13 runner when using Xcode 15 #8144

Closed calda closed 11 months ago

calda commented 1 year ago

Description

When using the macOS 13 runner with Xcode 15, the visionOS SDK is not installed.

When attempting to run a command like xcodebuild build -scheme MyScheme -destination generic/platform=visionOS, it fails with the following error (example failure):

{ platform:visionOS, id:dvtdevice-DVTiOSDevicePlaceholder-xros:placeholder, name:Any visionOS Device, error:visionOS 1.0 is not installed. To use with Xcode, first download and install the platform }

This is because the visionOS SDK is not included by default in Xcode 15, and has to be downloaded separately (like the iOS and tvOS SDKs).

Platforms affected

Runner images affected

Image version and build link

Image: macos-13 Version: 20230821.3 Included Software: https://github.com/actions/runner-images/blob/macos-13/20230821.3/images/macos/macos-13-Readme.md Image Release: https://github.com/actions/runner-images/releases/tag/macos-13%2F20230821.3

Is it regression?

No

Expected behavior

I expect the visionOS SDK to be installed by default on the macOS 13 runner when using Xcode 15, like other Apple platform SDKs (iOS, tvOS, watchOS).

Actual behavior

I expect the visionOS SDK to be installed by default on the macOS 13 runner when using Xcode 15, like the other Apple platform SDKs.

Repro steps

Attempt to build an Xcode project for the visionOS destination (-destination generic/platform=visionOS), for example:

xcodebuild build -scheme "Lottie (visionOS)" -destination generic/platform=visionOS -workspace Lottie.xcworkspace

https://github.com/airbnb/lottie-ios/actions/runs/5956146043/job/16156293405?pr=2152

Alexey-Ayupov commented 1 year ago

Hello @calda, we will take a look.

ilia-shipitsin commented 1 year ago

we install SDKs as xcodebuild -downloadAllPlatforms, seems visionOS needs to be downloaded separately as xcodebuild -downloadPlatform visionOS

also, XCode 15 Beta 7 was released. Hopefully, we'll release visionOS SDK together with Beta 7

ilia-shipitsin commented 1 year ago

@calda ,can you help me to check ?

I created test image with visionOS SDK.

git clone https://github.com/airbnb/lottie-ios
cd lottie-ios/
xcodebuild build -scheme MyScheme -destination generic/platform=visionOS

output

Command line invocation:
    /Applications/Xcode-15.0.0-Beta.7.app/Contents/Developer/usr/bin/xcodebuild build -scheme MyScheme -destination generic/platform=visionOS

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Resolve Package Graph

Fetching from https://github.com/pointfreeco/swift-snapshot-testing.git

Fetching from https://github.com/krzysztofzablocki/Difference

Creating working copy of package ‘Difference’

Checking out 1.0.2 of package ‘Difference’

Creating working copy of package ‘swift-snapshot-testing’

Checking out 0c2826f26d00ff5ddf2de92cb6b2139b0dd3d1ee of package ‘swift-snapshot-testing’

Resolved source packages:
  swift-snapshot-testing: https://github.com/pointfreeco/swift-snapshot-testing.git @ 0c2826f
  Difference: https://github.com/krzysztofzablocki/Difference @ 1.0.2

2023-08-25 08:53:39.219 xcodebuild[5652:28389] Writing error result bundle to /var/folders/rt/x00qb5ls0zb9nhklqtxg4qy40000gn/T/ResultBundle_2023-25-08_08-53-0039.xcresult
xcodebuild: error: The project named "Lottie" does not contain a scheme named "MyScheme". The "-list" option can be used to find the names of the schemes in the project.

did I miss some build step ?

ilia-shipitsin commented 1 year ago

nevermind, I built using bundle exec rake build:package:all

calda commented 1 year ago

Yeah, that one works. Other options include:

mikhailkoliada commented 1 year ago

Hi all, given that the xcodebuild -downloadAllPlatform invocations seems yet to be buggy in Xcode 15.0 the only alternative would be to install it via xcodes utility in runtime (beware that it is a 3rd party package so nobody guarantees its overall stability).

1 brew install xcodesorg/made/xcodes 2 xcodes runtimes install 'visionOS 1.0 Beta 2'

we will continue tracking Xcode changes to make vision OS a part of the image (hopefully before macOS 13 goes GA)

calda commented 1 year ago

I see the Xcode 15.0 release candidate has been published. Unlike the betas, the RC doesn't include the visionOS SDK. Perhaps this is why the behavior of xcodebuild -downloadAllPlatform hasn't been updated yet.

In the meantime, we've started using the xcodes runtimes install workaround @mikhailkoliada suggested.

To enable folks to continue using the visionOS SDK in GitHub actions jobs, could the team leave an Xcode 15 beta available on the macOS 13 image, in addition to the Xcode 15 RC / production version? That would be very helpful for us.

ilia-shipitsin commented 1 year ago

some news from our side, we've found better way of installing visionOS, currently we are going to release updated image with visionOS added.

thanks for bringing that to attention, Apple indeed says

Xcode 15 Release Candidate enables you to develop, test, and distribute apps for all Apple platforms. You can download the platforms you would like to develop for directly from Xcode. For development with the visonOS 1 SDK, continue to use Xcode 15 beta 8.
ilia-shipitsin commented 1 year ago

@calda, as for software policy we install only three latest avaiable versions. sorry, no "rc" is possible together with "beta 8"

calda commented 1 year ago

As of https://github.com/actions/runner-images/issues/8282 it is no longer possible to build for the visionOS SDK using the above workaround

vfilyakov commented 1 year ago

Any updates here? Maybe we can have Xcode-beta.app deployed alongside Xcode 15 so we can still build for visionOS?

ilia-shipitsin commented 1 year ago

@vfilyakov , do you know what is the official Apple support for visionOS ? will it eventually be added to XCode 15 ?

ilia-shipitsin commented 1 year ago

Any updates here? Maybe we can have Xcode-beta.app deployed alongside Xcode 15 so we can still build for visionOS?

I would ask @mikhailkoliada if that is possible or not

mikhailkoliada commented 1 year ago

We are going to provide Xcode versions according to our software policy, eventually visioonOS will be included in the release too by apple

vfilyakov commented 1 year ago

Looks like Xcode 15.1 Beta has support for visionOS: https://developer.apple.com/documentation/xcode-release-notes/xcode-15_1-release-notes

Considering that Apple plans to release Vision Pro in Q1 2024, we should have the release version of visionOS 1.0 in some release version of Xcode 15.x before that (hopefully). But for now we will have to deal with betas, looks like.

We are going to provide Xcode versions according to our software policy

@mikhailkoliada What is the official policy here in regard to Xcode betas? Would be beneficial to hear the plan for this...

ilia-shipitsin commented 1 year ago

btw, I installed XCode 15.1, visionOS was installed together with XCode.

calda commented 1 year ago

We can't predict with certainty what Apple will release in the future, but my expectation currently (based on the Xcode 15.0 release) is that:

Adding the Xcode 15.1 beta to GitHub actions would allow us to use the visionOS SDK again, up until when that beta is removed from the macOS runner.

vfilyakov commented 1 year ago

@mikhailkoliada Now that you guys decided not to deal with Xcode 15.1 betas, what is a path forward to be able to build visionOS code? Can we have Xcode 15.0 beta instead to cover this for now?

mikhailkoliada commented 11 months ago

Due to Xcode 15.x performance degradation there is no plans to add any new betas to the image until at least 15.2 beta is out, we are aware of the fact that visionOS sdk is missing right now but try not to make the situation worse for customers. Generally I am going to close the issue as there is nothing actable for us to do, but we will keep the images updated as soon as we can.

saagarjha commented 9 months ago

For those who stumble upon this in the future:

defaults write com.apple.dt.Xcode AllowUnsupportedVisionOSHost -bool YES
defaults write com.apple.CoreSimulator AllowUnsupportedVisionOSHost -bool YES
xcodebuild -downloadPlatform visionOS

Shove this in your script before you do anything and it'll work, at least it did when I tested against Xcode 15.2.

calda commented 9 months ago

Wow, thank you @saagarjha! This works for us: https://github.com/airbnb/lottie-ios/pull/2287

Although there's a typo in your comment -- cxcodebuildt.Xcode should be com.apple.dt.Xcode:

defaults write com.apple.dt.Xcode AllowUnsupportedVisionOSHost -bool YES
defaults write com.apple.CoreSimulator AllowUnsupportedVisionOSHost -bool YES
xcodebuild -downloadPlatform visionOS
saagarjha commented 9 months ago

Oops, yes. Not sure how I messed that up…

dreampiggy commented 8 months ago

This saves for me.

But oneday I'll consider to move to paid macos-13-xlarge runner...Currently no any free arm64 based runner to run visionOS for open-source project (I actually don't care about time or performance)