Skip to content

Commit

Permalink
fix: Carthage Xcode 14 compatibility issue (#2636)
Browse files Browse the repository at this point in the history
Build XCFramework with Xcode 14.2, use BUILD_LIBRARY_FOR_DISTRIBUTION,
and validate that Xcode 14 and 13 can compile the sample project using
the XCFramework.

Fixes GH-2628
  • Loading branch information
philipphofmann committed Jan 20, 2023
1 parent 9faf217 commit 7fb7afb
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
28 changes: 25 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,20 @@ jobs:
build
build-xcframework:
name: Build & Validate XCFramework
name: Build XCFramework
runs-on: macos-12
steps:
- uses: actions/checkout@v3

# We need to use Xcode 13 to be compatible with Xcode 13. Using Xcode 14 for compiling and building
# the sample with Xcode 13 leads to
#
# this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.7.2
# (swiftlang-5.7.2.135.5 clang-1400.0.29.51)', while this compiler is 'Apple Swift version 5.6.1
# (swiftlang-5.6.0.323.66 clang-1316.0.20.12)'). Please select a toolchain which matches the SDK.
- run: ./scripts/ci-select-xcode.sh 13.4.1
- run: make build-xcframework
shell: sh
- run: make build-xcframework-sample
shell: sh

- name: Archiving XCFramework.zip
uses: actions/upload-artifact@v3
Expand All @@ -98,6 +104,22 @@ jobs:
path: |
${{ github.workspace }}/*.zip
validate-xcframework:
name: Validate XCFramework Xcode ${{ matrix.xcode }}
runs-on: macos-12
needs: build-xcframework
strategy:
matrix:
xcode: ['13.4.1', '14.2']
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: ${{ github.sha }}
- run: ./scripts/ci-select-xcode.sh ${{ matrix.xcode }}
- run: make build-xcframework-sample
shell: sh

# Use github.event.pull_request.head.sha instead of github.sha when available as
# the github.sha is be the pre merge commit id for PRs.
# See https://github.community/t/github-sha-isnt-the-value-expected/17903/17906.
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ on:
- '.github/workflows/lint.yml'
- 'scripts/ci-select-xcode.sh'
- 'scripts/no-changes-in-high-risk-files.sh'
- 'Sentry.xcodeproj/**'

jobs:
swift-lint:
Expand Down
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
### Fixes

- Support uint64 in crash reports (#2631)

### Fixes

- Always fetch view hierarchy on the main thread (#2629)
- Carthage Xcode 14 compatibility issue (#2636)

## 8.0.0

Expand Down
4 changes: 4 additions & 0 deletions Sentry.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -4261,6 +4261,7 @@
baseConfigurationReference = 63AA75C51EB8B00100D153DE /* Sentry.xcconfig */;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_ASSIGN_ENUM = NO;
CLANG_WARN_BOOL_CONVERSION = YES;
Expand Down Expand Up @@ -4297,6 +4298,7 @@
baseConfigurationReference = 63AA75C51EB8B00100D153DE /* Sentry.xcconfig */;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_ASSIGN_ENUM = NO;
CLANG_WARN_BOOL_CONVERSION = YES;
Expand Down Expand Up @@ -4453,6 +4455,7 @@
baseConfigurationReference = 63AA75C51EB8B00100D153DE /* Sentry.xcconfig */;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_ASSIGN_ENUM = NO;
CLANG_WARN_BOOL_CONVERSION = YES;
Expand Down Expand Up @@ -4585,6 +4588,7 @@
baseConfigurationReference = 63AA75C51EB8B00100D153DE /* Sentry.xcconfig */;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_ASSIGN_ENUM = NO;
CLANG_WARN_BOOL_CONVERSION = YES;
Expand Down

0 comments on commit 7fb7afb

Please sign in to comment.