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

Add VisionOS Support for Carthage #3410

Closed
Tracked by #3362
armcknight opened this issue Nov 14, 2023 · 10 comments · Fixed by #3565
Closed
Tracked by #3362

Add VisionOS Support for Carthage #3410

armcknight opened this issue Nov 14, 2023 · 10 comments · Fixed by #3565
Assignees

Comments

@armcknight
Copy link
Member

armcknight commented Nov 14, 2023

We don't have an xrOS slice in our xcframework deliverable as of Sentry 8.15.2.

Support for VisionOS was added in Carthage 0.39.1 to add xrOS slices to xcframeworks.

The VisionOS SDK is still only delivered in the latest Xcode beta (15.1b3 released 14 Nov) and not the latest GA release version (15.0.1), and we don't currently use betas in our release job. (In fact, we're still running Xcode 14.3 for building the xcframework: #3411.) UPDATE: there is movement on this front, now that Xcode 15.2 is out with GA support for VisionPro/xrOS, and GitHub has a prerelease actions runner with the requisite OS/toolchains: #3410 (comment)

Part of us upgrading to Xcode 15.2 in CI will overlap with #3329

After we support VisionOS for Carthage, we need to update the docs getsentry/sentry-docs#8496.

@brustolin
Copy link
Contributor

brustolin commented Nov 15, 2023

All we need to do is start using a Xcode that has visionOS support, but I don't recommend using a beta version to release our official XCFramework artefact.

@philipphofmann
Copy link
Member

Xcode that has visionOS support

Only Xcode beta has support, which doesn't run on GH actions.

@philipphofmann
Copy link
Member

philipphofmann commented Nov 15, 2023

For now, our users can do the following to build their own XCFramwork with visionOS support by using Xcode beta:

  1. Download Xcode beta
  2. Ensure to have all bet platforms installed you want for Xcode (iOS 17.2, tvOS 17.2, vision 1.0)
  3. Select the Xcode beta version with something like sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer/
  4. Checkout the Sentry Cocoa GH repository
  5. Call make init
  6. Then call make build-xcframework which will compile the XCFramework

@marksands
Copy link

We're trying to build locally, but keep running into this issue:

/path/to/Sources/Sentry/include/SentrySwift.h:4:9: fatal error: module 'SentryPrivate' not found
@import SentryPrivate;
 ~~~~~~~^~~~~~~~~~~~~
1 error generated.

Any advice on how to fix this? We're running the Makefile commands as given in the instructions, with the downloaded source, so there shouldn't be any differential here.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 Dec 11, 2023
@marksands
Copy link

Ok interesting finding...

This succeeds:

xcodebuild -workspace /Users/mark.sands/Downloads/sentry-cocoa-8.3.2/Sentry.xcworkspace -scheme Sentry -configuration Release -sdk iphoneos archive

This fails:

xcodebuild -workspace /Users/mark.sands/Downloads/sentry-cocoa-8.3.2/Sentry.xcworkspace -scheme Sentry -configuration Release -sdk xros archive

So we're currently looking for an incompatibility with some xros setting.

@marksands
Copy link

We figured it out! For some reason, $(SDKROOT__CARTHAGE_$(CARTHAGE)) wasn't being fully defined for us, so we hardcoded SDKROOT = macosx locally to get the intermediate frameworks to build for xros. I'm not sure if this had to do with a Carthage change, since we had to use 0.39.1 to build with it. Hope that helps!

@samwu888
Copy link

samwu888 commented Dec 12, 2023

Mark is out today but this was another issued we encountered

We were able to work around that issue, but another one that came up is when we were trying to link the SentrySwiftUI framework to our app targets.

"ld: linking against a dylib which is not safe for use in application extensions: /Users/jenkins/workspace/ios_Dominguez_PR-14846/build/Build/Products/Debug-appletvsimulator/SentrySwiftUI.framework/SentrySwiftUI"

This error came up for all of our platform targets except visionOS, which was odd. It definitely could be related to how we built it with our workaround above, but just in case, I'm adding that to the discussion. Thanks!

@kahest
Copy link
Member

kahest commented Dec 14, 2023

Hi @marksands & @samwu888 - thank you for the details! To clarify, are you currently blocked, and if so, on which platform(s)? Also, is the version in the snippet above (sentry-cocoa-8.3.2) correct? Did you try using a more recent version of the SDK?

@philipphofmann philipphofmann moved this from Needs Discussion to Blocked in Mobile & Cross Platform SDK Dec 20, 2023
@kahest
Copy link
Member

kahest commented Jan 9, 2024

All we need to do is start using a Xcode that has visionOS support, but I don't recommend using a beta version to release our official XCFramework artefact.

Xcode 15.2 GM has been released yesterday, which is the first official Xcode release with full visionOS support. We can now test and work towards supporting this.

@kahest kahest moved this from Blocked to Needs Discussion in Mobile & Cross Platform SDK Jan 9, 2024
@kahest kahest moved this from Needs Discussion to Todo in Mobile & Cross Platform SDK Jan 10, 2024
@kahest
Copy link
Member

kahest commented Jan 17, 2024

There's a pre-release macos-13 runner-image with Xcode 15.2 available now: https://github.com/actions/runner-images/releases/tag/macos-13%2F20240114.1

@philipphofmann philipphofmann self-assigned this Jan 19, 2024
@philipphofmann philipphofmann moved this from Todo to In Progress in Mobile & Cross Platform SDK Jan 22, 2024
philipphofmann added a commit that referenced this issue Jan 22, 2024
Pre build visionOS for Carthage.

Fixes GH-3410
philipphofmann added a commit that referenced this issue Jan 29, 2024
Fix Sources/Configuration/SDK.xcconfig by removing the workaround added with #491 so CI can build Carthage XCFrameworks to include VisionOS. The workaround seems to be fixed with Carthage/Carthage#3001 in Carthage 0.35.0 released in Jun 2020. Therefore, we can remove the SDKROOT__CARTHAGE settings in Sources/Configuration/SDK.xcconfig, which caused problems when building the SDK for visionOS see #3410 (comment). We never removed the workaround #491, as it didn't cause any problems.

Furthermore, bump pre-commit action https://github.com/python-jsonschema/check-jsonschema to 0.27.3, so it allows macos-13-xlarge as a valid runner.
@github-project-automation github-project-automation bot moved this from In Progress to Done in Mobile & Cross Platform SDK Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants