Skip to content

Commit

Permalink
Add VisionOS Support for Carthage (#3565)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
philipphofmann authored Jan 29, 2024
1 parent 008799d commit 8e5919b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 24 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ jobs:
build-xcframework:
name: Build XCFramework
runs-on: macos-13
# The macos-13 uses an Intel processor and doesn't compile the XCFramework for visionOS.
# The large image compiles on arm64 and successfully creates the XCFramework for visionOS.
runs-on: macos-13-xlarge
steps:
- uses: actions/checkout@v4
- run: ./scripts/ci-select-xcode.sh 15.0.1
- run: ./scripts/ci-select-xcode.sh 15.2
- run: make build-xcframework
shell: sh

Expand All @@ -116,14 +118,14 @@ jobs:
validate-xcframework:
name: Validate XCFramework
runs-on: macos-13
runs-on: macos-13-xlarge
needs: build-xcframework
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}
- run: ./scripts/ci-select-xcode.sh 15.0.1
- run: ./scripts/ci-select-xcode.sh 15.2
- run: make build-xcframework-sample
shell: sh

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: no-commit-to-branch

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.23.1
rev: 0.27.3
hooks:
- id: check-github-actions
- id: check-github-workflows
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
### Features

- Send debug meta for app start transactions (#3543)
- Add VisionOS Support for Carthage (#3565)

### Fixes

Expand Down
1 change: 1 addition & 0 deletions Sources/Configuration/DeploymentTargets.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ MACOSX_DEPLOYMENT_TARGET = 10.13
IPHONEOS_DEPLOYMENT_TARGET = 11.0
WATCHOS_DEPLOYMENT_TARGET = 4.0
TVOS_DEPLOYMENT_TARGET = 11.0
XROS_DEPLOYMENT_TARGET = 1.0
19 changes: 0 additions & 19 deletions Sources/Configuration/SDK.xcconfig
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
#include "DeploymentTargets.xcconfig"

SDKROOT = $(SDKROOT__CARTHAGE_$(CARTHAGE)) // basically, iphoneos (unless «CARTHAGE» == «YES»)
// Carthage relies on this assumption, years standing — that SDKROOT is default or explicitly
// set to `macosx` (or equivalent) under the ‘single target, multiple platform’ paradigm
// because of a xcodebuild bug involving the sdk flag and implicit dependency: see «Carthage/Carthage#347».
SDKROOT__CARTHAGE_YES = macosx
// Importantly, the below two lines appease «Xcode.app», and get the UI to show Mac Catalyst destinations.
SDKROOT__CARTHAGE_NO = iphoneos
SDKROOT__CARTHAGE_ = iphoneos
// …in order for ‘single target, multiple platform’ extrapolations to hold true,
// all the above relies on the ability of Xcode GUI, xcodebuild, and Carthage via xcodebuild to
// override «SDKROOT» based on selected destination (particularly for appletv* and watchos* platforms.)
// …if the override behavior ever breaks, expect weird output and the probable need to migrate away from
// the ‘single target, multiple platform’ paradigm.

// …`SUPPORTED_PLATFORMS`, in service of ‘single target, multiple platform’ extrapolation, must never
// engage in dollar-parentheses syntax — unless that dollar-parentheses basis is
// entirely non-platform–derived, e.g. based upon `XCODE_VERSION_MAJOR`.
// Note: Carthage, unfortunately, as current of v0.34.0 queries rather harshly on the platform values below
// ⋯ quite early in the process, queried values not compiled into Carthage will cause hard errors.
SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator watchos watchsimulator appletvos appletvsimulator xros xrsimulator
TARGETED_DEVICE_FAMILY = 1,2,3,4,7
SKIP_INSTALL = YES
Expand Down

0 comments on commit 8e5919b

Please sign in to comment.