From 7fb7afb429d7dd9a21ae25bcbceb8fd9a684f408 Mon Sep 17 00:00:00 2001 From: Philipp Hofmann Date: Fri, 20 Jan 2023 14:22:16 +0100 Subject: [PATCH] fix: Carthage Xcode 14 compatibility issue (#2636) 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 --- .github/workflows/build.yml | 28 +++++++++++++++++++++++++--- .github/workflows/lint.yml | 1 + CHANGELOG.md | 4 +--- Sentry.xcodeproj/project.pbxproj | 4 ++++ 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 524c41f2918..237d5e1aa84 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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.uint.cloudmunity/t/github-sha-isnt-the-value-expected/17903/17906. diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cdc9073e7cb..8831f07cb58 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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: diff --git a/CHANGELOG.md b/CHANGELOG.md index adc393f9716..dc28294109d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Sentry.xcodeproj/project.pbxproj b/Sentry.xcodeproj/project.pbxproj index ba22f09ab06..7bf4953e7c3 100644 --- a/Sentry.xcodeproj/project.pbxproj +++ b/Sentry.xcodeproj/project.pbxproj @@ -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; @@ -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; @@ -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; @@ -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;