From 6c1b08fe6afcb5e6dbfbf9de9fa63f0409bf074e Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Mon, 1 Jul 2024 09:14:13 -0800 Subject: [PATCH 01/26] fix: define separate module names for UIKitless configurations --- Sources/Configuration/SDK.xcconfig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sources/Configuration/SDK.xcconfig b/Sources/Configuration/SDK.xcconfig index c94888780f0..0cb4c64e839 100644 --- a/Sources/Configuration/SDK.xcconfig +++ b/Sources/Configuration/SDK.xcconfig @@ -40,3 +40,11 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS_TestCI = TESTCI SWIFT_ACTIVE_COMPILATION_CONDITIONS_Release = SWIFT_ACTIVE_COMPILATION_CONDITIONS_Release_without_UIKit = SENTRY_NO_UIKIT SWIFT_ACTIVE_COMPILATION_CONDITIONS = $(SWIFT_ACTIVE_COMPILATION_CONDITIONS_$(CONFIGURATION)) + +PRODUCT_MODULE_NAME_Debug = Sentry +PRODUCT_MODULE_NAME_Debug_without_UIKit = Sentry_without_UIKit +PRODUCT_MODULE_NAME_Test = Sentry +PRODUCT_MODULE_NAME_TestCI = Sentry +PRODUCT_MODULE_NAME_Release = Sentry +PRODUCT_MODULE_NAME_Release_without_UIKit = Sentry_without_UIKit +PRODUCT_MODULE_NAME = $(PRODUCT_MODULE_NAME_$(CONFIGURATION)) From 5d77c1151ce7929588f2c67f7aa207ba9e56b04a Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Mon, 1 Jul 2024 16:34:29 -0800 Subject: [PATCH 02/26] fix test targets --- Sentry.xcodeproj/project.pbxproj | 4 ++-- Sources/Configuration/SDK.xcconfig | 10 +--------- Sources/Configuration/Sentry.xcconfig | 14 +++++++++----- ...eploymentTargets.xcconfig => Versions.xcconfig} | 2 ++ Tests/Configuration/SentryTests.xcconfig | 8 ++++++-- 5 files changed, 20 insertions(+), 18 deletions(-) rename Sources/Configuration/{DeploymentTargets.xcconfig => Versions.xcconfig} (82%) diff --git a/Sentry.xcodeproj/project.pbxproj b/Sentry.xcodeproj/project.pbxproj index e5d2c9817ab..a9aab21641f 100644 --- a/Sentry.xcodeproj/project.pbxproj +++ b/Sentry.xcodeproj/project.pbxproj @@ -1753,7 +1753,7 @@ 84AF45A429A7FFA500FBB177 /* SentryProfiledTracerConcurrency.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryProfiledTracerConcurrency.h; path = ../include/SentryProfiledTracerConcurrency.h; sourceTree = ""; }; 84AF45A529A7FFA500FBB177 /* SentryProfiledTracerConcurrency.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryProfiledTracerConcurrency.mm; sourceTree = ""; }; 84B7FA3B29B2866200AD93B1 /* SentryTestUtils-ObjC-BridgingHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SentryTestUtils-ObjC-BridgingHeader.h"; sourceTree = ""; }; - 84B7FA4729B2995A00AD93B1 /* DeploymentTargets.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DeploymentTargets.xcconfig; sourceTree = ""; }; + 84B7FA4729B2995A00AD93B1 /* Versions.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Versions.xcconfig; sourceTree = ""; }; 84C47B2B2A09239100DAEB8A /* .codecov.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .codecov.yml; sourceTree = ""; }; 84DEE86A2B686BD400A7BC17 /* SentrySamplerDecision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentrySamplerDecision.h; path = include/SentrySamplerDecision.h; sourceTree = ""; }; 84DEE8752B69AD6400A7BC17 /* SentryLaunchProfiling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryLaunchProfiling.h; path = Sources/Sentry/include/SentryLaunchProfiling.h; sourceTree = SOURCE_ROOT; }; @@ -2536,7 +2536,7 @@ isa = PBXGroup; children = ( D8BD2E27292D1F7300D96C6A /* SDK.xcconfig */, - 84B7FA4729B2995A00AD93B1 /* DeploymentTargets.xcconfig */, + 84B7FA4729B2995A00AD93B1 /* Versions.xcconfig */, 63AA75C51EB8B00100D153DE /* Sentry.xcconfig */, D8199DCF29376FF40074249E /* SentrySwiftUI.xcconfig */, ); diff --git a/Sources/Configuration/SDK.xcconfig b/Sources/Configuration/SDK.xcconfig index 0cb4c64e839..d76217e8c88 100644 --- a/Sources/Configuration/SDK.xcconfig +++ b/Sources/Configuration/SDK.xcconfig @@ -1,4 +1,4 @@ -#include "DeploymentTargets.xcconfig" +#include "Versions.xcconfig" SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator watchos watchsimulator appletvos appletvsimulator xros xrsimulator TARGETED_DEVICE_FAMILY = 1,2,3,4,7 @@ -40,11 +40,3 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS_TestCI = TESTCI SWIFT_ACTIVE_COMPILATION_CONDITIONS_Release = SWIFT_ACTIVE_COMPILATION_CONDITIONS_Release_without_UIKit = SENTRY_NO_UIKIT SWIFT_ACTIVE_COMPILATION_CONDITIONS = $(SWIFT_ACTIVE_COMPILATION_CONDITIONS_$(CONFIGURATION)) - -PRODUCT_MODULE_NAME_Debug = Sentry -PRODUCT_MODULE_NAME_Debug_without_UIKit = Sentry_without_UIKit -PRODUCT_MODULE_NAME_Test = Sentry -PRODUCT_MODULE_NAME_TestCI = Sentry -PRODUCT_MODULE_NAME_Release = Sentry -PRODUCT_MODULE_NAME_Release_without_UIKit = Sentry_without_UIKit -PRODUCT_MODULE_NAME = $(PRODUCT_MODULE_NAME_$(CONFIGURATION)) diff --git a/Sources/Configuration/Sentry.xcconfig b/Sources/Configuration/Sentry.xcconfig index aabef971d4e..3c73c07f4d3 100644 --- a/Sources/Configuration/Sentry.xcconfig +++ b/Sources/Configuration/Sentry.xcconfig @@ -1,11 +1,15 @@ +#include "Versions.xcconfig" + PRODUCT_NAME = Sentry INFOPLIST_FILE = Sources/Resources/Info.plist PRODUCT_BUNDLE_IDENTIFIER = io.sentry.Sentry -CURRENT_PROJECT_VERSION = 8.30.0 - MODULEMAP_FILE = $(SRCROOT)/Sources/Resources/Sentry.modulemap -// This config is required so the test code can access the SentryPrivate module. Removing this setting -// leads to an error: no such module '_SentryPrivate' when including the XCFramework with Carthage -HEADER_SEARCH_PATHS = $(SRCROOT)/Sources/Sentry/include/** +PRODUCT_MODULE_NAME_Debug = Sentry +PRODUCT_MODULE_NAME_Debug_without_UIKit = Sentry_without_UIKit +PRODUCT_MODULE_NAME_Test = Sentry +PRODUCT_MODULE_NAME_TestCI = Sentry +PRODUCT_MODULE_NAME_Release = Sentry +PRODUCT_MODULE_NAME_Release_without_UIKit = Sentry_without_UIKit +PRODUCT_MODULE_NAME = $(PRODUCT_MODULE_NAME_$(CONFIGURATION)) diff --git a/Sources/Configuration/DeploymentTargets.xcconfig b/Sources/Configuration/Versions.xcconfig similarity index 82% rename from Sources/Configuration/DeploymentTargets.xcconfig rename to Sources/Configuration/Versions.xcconfig index d8bdbc678e4..86b4781813a 100644 --- a/Sources/Configuration/DeploymentTargets.xcconfig +++ b/Sources/Configuration/Versions.xcconfig @@ -3,3 +3,5 @@ IPHONEOS_DEPLOYMENT_TARGET = 11.0 WATCHOS_DEPLOYMENT_TARGET = 4.0 TVOS_DEPLOYMENT_TARGET = 11.0 XROS_DEPLOYMENT_TARGET = 1.0 + +CURRENT_PROJECT_VERSION = 8.30.0 diff --git a/Tests/Configuration/SentryTests.xcconfig b/Tests/Configuration/SentryTests.xcconfig index 0a8a870f710..92407a220b7 100644 --- a/Tests/Configuration/SentryTests.xcconfig +++ b/Tests/Configuration/SentryTests.xcconfig @@ -1,5 +1,9 @@ -#include "../../Sources/Configuration/Sentry.xcconfig" -#include "../../Sources/Configuration/DeploymentTargets.xcconfig" +#include "../../Sources/Configuration/Versions.xcconfig" + +// (originally added to Sentry.xcconfig in #3716, but it's only needed in the test targets, not the SDK target) +// This config is required so the test code can access the SentryPrivate module. Removing this setting +// leads to an error: no such module '_SentryPrivate' when including the XCFramework with Carthage +HEADER_SEARCH_PATHS = $(SRCROOT)/Sources/Sentry/include/** PRODUCT_NAME = Tests INFOPLIST_FILE = Tests/SentryTests/Info.plist From 8f510f3c00ebd8888eac099af4696eedfaa0fc9c Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Mon, 1 Jul 2024 16:42:43 -0800 Subject: [PATCH 03/26] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dae12f15062..1da8b57f6c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Deprecate `SentryUser.segment`(#4092). Please remove usages of this property. We will remove it in the next major. - Double-quoted include in framework header (#4115) - Sentry Replay Network details should be available without Tracing (#4091) +- UIKitless configurations now produce a module with a different name (#4140) ## 8.29.1 From d509ee61f01dc6242a803a9e90867814949d2c6f Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Mon, 1 Jul 2024 16:43:39 -0800 Subject: [PATCH 04/26] changelog --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1da8b57f6c9..df073a30b36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +### Fixes + +- UIKitless configurations now produce a module with a different name (#4140) + ## 8.30.0 ### Features @@ -14,7 +20,6 @@ - Deprecate `SentryUser.segment`(#4092). Please remove usages of this property. We will remove it in the next major. - Double-quoted include in framework header (#4115) - Sentry Replay Network details should be available without Tracing (#4091) -- UIKitless configurations now produce a module with a different name (#4140) ## 8.29.1 From e58a5f50d7cf0a99dba0a8cb4efa95a12052d7bb Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Mon, 1 Jul 2024 21:37:12 -0800 Subject: [PATCH 05/26] more changes per UIKit build - also configure product name and bundle ID - rename Debug_without_UIKit and Release_without_UIKit to remove the underscores and capitalize "without" - add a separate modulemap file for SentryWithoutUIKit --- Sentry.xcodeproj/project.pbxproj | 86 ++++++++++--------- Sources/Configuration/SDK.xcconfig | 4 +- Sources/Configuration/Sentry.xcconfig | 20 +++-- .../Resources/SentryWithoutUIKit.modulemap | 6 ++ 4 files changed, 63 insertions(+), 53 deletions(-) create mode 100644 Sources/Resources/SentryWithoutUIKit.modulemap diff --git a/Sentry.xcodeproj/project.pbxproj b/Sentry.xcodeproj/project.pbxproj index a9aab21641f..a454dce8018 100644 --- a/Sentry.xcodeproj/project.pbxproj +++ b/Sentry.xcodeproj/project.pbxproj @@ -1757,6 +1757,7 @@ 84C47B2B2A09239100DAEB8A /* .codecov.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .codecov.yml; sourceTree = ""; }; 84DEE86A2B686BD400A7BC17 /* SentrySamplerDecision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentrySamplerDecision.h; path = include/SentrySamplerDecision.h; sourceTree = ""; }; 84DEE8752B69AD6400A7BC17 /* SentryLaunchProfiling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryLaunchProfiling.h; path = Sources/Sentry/include/SentryLaunchProfiling.h; sourceTree = SOURCE_ROOT; }; + 84EACEBC2C33CA7A009B8753 /* SentryWithoutUIKit.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; name = SentryWithoutUIKit.modulemap; path = Sources/Resources/SentryWithoutUIKit.modulemap; sourceTree = SOURCE_ROOT; }; 84EB21952BF01CEA00EDDA28 /* SentryCrashInstallationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryCrashInstallationTests.swift; sourceTree = ""; }; 84F994E52A6894B500EC0190 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/CoreData.framework; sourceTree = DEVELOPER_DIR; }; 84F994E72A6894BD00EC0190 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = DEVELOPER_DIR; }; @@ -2582,6 +2583,7 @@ 63AA769F1EB9C89800D153DE /* Supporting Files */ = { isa = PBXGroup; children = ( + 84EACEBC2C33CA7A009B8753 /* SentryWithoutUIKit.modulemap */, 7DC27E9823995F97006998B5 /* Sentry.modulemap */, 63AA75C71EB8B06100D153DE /* Info.plist */, ); @@ -5540,7 +5542,7 @@ }; name = TestCI; }; - 841C60C32A69DE6B00E1C00F /* Debug_without_UIKit */ = { + 841C60C32A69DE6B00E1C00F /* DebugWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = D8BD2E27292D1F7300D96C6A /* SDK.xcconfig */; buildSettings = { @@ -5597,9 +5599,9 @@ VERSIONING_SYSTEM = ""; VERSION_INFO_PREFIX = ""; }; - name = Debug_without_UIKit; + name = DebugWithoutUIKit; }; - 841C60C42A69DE6B00E1C00F /* Debug_without_UIKit */ = { + 841C60C42A69DE6B00E1C00F /* DebugWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = 63AA75C51EB8B00100D153DE /* Sentry.xcconfig */; buildSettings = { @@ -5643,9 +5645,9 @@ SWIFT_VERSION = 5.0; USE_HEADERMAP = YES; }; - name = Debug_without_UIKit; + name = DebugWithoutUIKit; }; - 841C60C52A69DE6B00E1C00F /* Debug_without_UIKit */ = { + 841C60C52A69DE6B00E1C00F /* DebugWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */; buildSettings = { @@ -5678,9 +5680,9 @@ SWIFT_VERSION = 5.0; TVOS_DEPLOYMENT_TARGET = 13.0; }; - name = Debug_without_UIKit; + name = DebugWithoutUIKit; }; - 841C60C72A69DE6B00E1C00F /* Debug_without_UIKit */ = { + 841C60C72A69DE6B00E1C00F /* DebugWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = D8199DCF29376FF40074249E /* SentrySwiftUI.xcconfig */; buildSettings = { @@ -5726,9 +5728,9 @@ SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; - name = Debug_without_UIKit; + name = DebugWithoutUIKit; }; - 841C60C82A69DE6B00E1C00F /* Debug_without_UIKit */ = { + 841C60C82A69DE6B00E1C00F /* DebugWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */; buildSettings = { @@ -5757,9 +5759,9 @@ SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_VERSION = 5.0; }; - name = Debug_without_UIKit; + name = DebugWithoutUIKit; }; - 841C60C92A69DE6B00E1C00F /* Debug_without_UIKit */ = { + 841C60C92A69DE6B00E1C00F /* DebugWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */; buildSettings = { @@ -5788,7 +5790,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; }; - name = Debug_without_UIKit; + name = DebugWithoutUIKit; }; 8431EFD529B27B1100D8DC56 /* Debug */ = { isa = XCBuildConfiguration; @@ -6033,7 +6035,7 @@ }; name = Release; }; - 8483D06A2AC7627800143615 /* Release_without_UIKit */ = { + 8483D06A2AC7627800143615 /* ReleaseWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = D8BD2E27292D1F7300D96C6A /* SDK.xcconfig */; buildSettings = { @@ -6089,9 +6091,9 @@ VERSIONING_SYSTEM = ""; VERSION_INFO_PREFIX = ""; }; - name = Release_without_UIKit; + name = ReleaseWithoutUIKit; }; - 8483D06B2AC7627800143615 /* Release_without_UIKit */ = { + 8483D06B2AC7627800143615 /* ReleaseWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = 63AA75C51EB8B00100D153DE /* Sentry.xcconfig */; buildSettings = { @@ -6130,9 +6132,9 @@ SWIFT_VERSION = 5.0; USE_HEADERMAP = YES; }; - name = Release_without_UIKit; + name = ReleaseWithoutUIKit; }; - 8483D06C2AC7627800143615 /* Release_without_UIKit */ = { + 8483D06C2AC7627800143615 /* ReleaseWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */; buildSettings = { @@ -6165,9 +6167,9 @@ SWIFT_VERSION = 5.0; TVOS_DEPLOYMENT_TARGET = 13.0; }; - name = Release_without_UIKit; + name = ReleaseWithoutUIKit; }; - 8483D06E2AC7627800143615 /* Release_without_UIKit */ = { + 8483D06E2AC7627800143615 /* ReleaseWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = D8199DCF29376FF40074249E /* SentrySwiftUI.xcconfig */; buildSettings = { @@ -6211,9 +6213,9 @@ SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; - name = Release_without_UIKit; + name = ReleaseWithoutUIKit; }; - 8483D06F2AC7627800143615 /* Release_without_UIKit */ = { + 8483D06F2AC7627800143615 /* ReleaseWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */; buildSettings = { @@ -6241,9 +6243,9 @@ SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_VERSION = 5.0; }; - name = Release_without_UIKit; + name = ReleaseWithoutUIKit; }; - 8483D0702AC7627800143615 /* Release_without_UIKit */ = { + 8483D0702AC7627800143615 /* ReleaseWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */; buildSettings = { @@ -6270,7 +6272,7 @@ SWIFT_OBJC_BRIDGING_HEADER = "SentryTestUtils/SentryTestUtils-ObjC-BridgingHeader.h"; SWIFT_VERSION = 5.0; }; - name = Release_without_UIKit; + name = ReleaseWithoutUIKit; }; D8079A6727178911004B0F61 /* Test */ = { isa = XCBuildConfiguration; @@ -6650,7 +6652,7 @@ }; name = Debug; }; - D84DAD532B17428D003CF120 /* Debug_without_UIKit */ = { + D84DAD532B17428D003CF120 /* DebugWithoutUIKit */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -6703,7 +6705,7 @@ SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; - name = Debug_without_UIKit; + name = DebugWithoutUIKit; }; D84DAD542B17428D003CF120 /* Test */ = { isa = XCBuildConfiguration; @@ -6864,7 +6866,7 @@ }; name = Release; }; - D84DAD572B17428D003CF120 /* Release_without_UIKit */ = { + D84DAD572B17428D003CF120 /* ReleaseWithoutUIKit */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -6915,7 +6917,7 @@ SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; - name = Release_without_UIKit; + name = ReleaseWithoutUIKit; }; /* End XCBuildConfiguration section */ @@ -6924,11 +6926,11 @@ isa = XCConfigurationList; buildConfigurations = ( 6327C5E51EB8A783004E799B /* Debug */, - 841C60C32A69DE6B00E1C00F /* Debug_without_UIKit */, + 841C60C32A69DE6B00E1C00F /* DebugWithoutUIKit */, D8079A6727178911004B0F61 /* Test */, 7BFC80A8282B736400E83A05 /* TestCI */, 6327C5E61EB8A783004E799B /* Release */, - 8483D06A2AC7627800143615 /* Release_without_UIKit */, + 8483D06A2AC7627800143615 /* ReleaseWithoutUIKit */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -6937,11 +6939,11 @@ isa = XCConfigurationList; buildConfigurations = ( 63AA75A11EB8AEF500D153DE /* Debug */, - 841C60C42A69DE6B00E1C00F /* Debug_without_UIKit */, + 841C60C42A69DE6B00E1C00F /* DebugWithoutUIKit */, D8079A6827178911004B0F61 /* Test */, 7BFC80A9282B736400E83A05 /* TestCI */, 63AA75A21EB8AEF500D153DE /* Release */, - 8483D06B2AC7627800143615 /* Release_without_UIKit */, + 8483D06B2AC7627800143615 /* ReleaseWithoutUIKit */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -6950,11 +6952,11 @@ isa = XCConfigurationList; buildConfigurations = ( 63AA766D1EB8CB2F00D153DE /* Debug */, - 841C60C52A69DE6B00E1C00F /* Debug_without_UIKit */, + 841C60C52A69DE6B00E1C00F /* DebugWithoutUIKit */, D8079A6927178911004B0F61 /* Test */, 7BFC80AA282B736400E83A05 /* TestCI */, 63AA766E1EB8CB2F00D153DE /* Release */, - 8483D06C2AC7627800143615 /* Release_without_UIKit */, + 8483D06C2AC7627800143615 /* ReleaseWithoutUIKit */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -6963,11 +6965,11 @@ isa = XCConfigurationList; buildConfigurations = ( 8431EFD529B27B1100D8DC56 /* Debug */, - 841C60C82A69DE6B00E1C00F /* Debug_without_UIKit */, + 841C60C82A69DE6B00E1C00F /* DebugWithoutUIKit */, 8431EFD629B27B1100D8DC56 /* Test */, 8431EFD729B27B1100D8DC56 /* TestCI */, 8431EFD829B27B1100D8DC56 /* Release */, - 8483D06F2AC7627800143615 /* Release_without_UIKit */, + 8483D06F2AC7627800143615 /* ReleaseWithoutUIKit */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -6976,11 +6978,11 @@ isa = XCConfigurationList; buildConfigurations = ( 8431F01129B284F200D8DC56 /* Debug */, - 841C60C92A69DE6B00E1C00F /* Debug_without_UIKit */, + 841C60C92A69DE6B00E1C00F /* DebugWithoutUIKit */, 8431F01229B284F200D8DC56 /* Test */, 8431F01329B284F200D8DC56 /* TestCI */, 8431F01429B284F200D8DC56 /* Release */, - 8483D0702AC7627800143615 /* Release_without_UIKit */, + 8483D0702AC7627800143615 /* ReleaseWithoutUIKit */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -6989,11 +6991,11 @@ isa = XCConfigurationList; buildConfigurations = ( D8199DAE29376E9B0074249E /* Debug */, - 841C60C72A69DE6B00E1C00F /* Debug_without_UIKit */, + 841C60C72A69DE6B00E1C00F /* DebugWithoutUIKit */, D8199DAF29376E9B0074249E /* Test */, D8199DB029376E9B0074249E /* TestCI */, D8199DB129376E9B0074249E /* Release */, - 8483D06E2AC7627800143615 /* Release_without_UIKit */, + 8483D06E2AC7627800143615 /* ReleaseWithoutUIKit */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -7002,11 +7004,11 @@ isa = XCConfigurationList; buildConfigurations = ( D84DAD522B17428D003CF120 /* Debug */, - D84DAD532B17428D003CF120 /* Debug_without_UIKit */, + D84DAD532B17428D003CF120 /* DebugWithoutUIKit */, D84DAD542B17428D003CF120 /* Test */, D84DAD552B17428D003CF120 /* TestCI */, D84DAD562B17428D003CF120 /* Release */, - D84DAD572B17428D003CF120 /* Release_without_UIKit */, + D84DAD572B17428D003CF120 /* ReleaseWithoutUIKit */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Sources/Configuration/SDK.xcconfig b/Sources/Configuration/SDK.xcconfig index d76217e8c88..cf877dd477e 100644 --- a/Sources/Configuration/SDK.xcconfig +++ b/Sources/Configuration/SDK.xcconfig @@ -34,9 +34,9 @@ CLANG_CXX_LIBRARY = libc++ HEADER_SEARCH_PATHS = $(SRCROOT)/Sources/Sentry/include/** SWIFT_ACTIVE_COMPILATION_CONDITIONS_Debug = DEBUG -SWIFT_ACTIVE_COMPILATION_CONDITIONS_Debug_without_UIKit = DEBUG SENTRY_NO_UIKIT +SWIFT_ACTIVE_COMPILATION_CONDITIONS_DebugWithoutUIKit = DEBUG SENTRY_NO_UIKIT SWIFT_ACTIVE_COMPILATION_CONDITIONS_Test = TEST SWIFT_ACTIVE_COMPILATION_CONDITIONS_TestCI = TESTCI SWIFT_ACTIVE_COMPILATION_CONDITIONS_Release = -SWIFT_ACTIVE_COMPILATION_CONDITIONS_Release_without_UIKit = SENTRY_NO_UIKIT +SWIFT_ACTIVE_COMPILATION_CONDITIONS_ReleaseWithoutUIKit = SENTRY_NO_UIKIT SWIFT_ACTIVE_COMPILATION_CONDITIONS = $(SWIFT_ACTIVE_COMPILATION_CONDITIONS_$(CONFIGURATION)) diff --git a/Sources/Configuration/Sentry.xcconfig b/Sources/Configuration/Sentry.xcconfig index 3c73c07f4d3..8710bc4e098 100644 --- a/Sources/Configuration/Sentry.xcconfig +++ b/Sources/Configuration/Sentry.xcconfig @@ -1,15 +1,17 @@ #include "Versions.xcconfig" -PRODUCT_NAME = Sentry INFOPLIST_FILE = Sources/Resources/Info.plist -PRODUCT_BUNDLE_IDENTIFIER = io.sentry.Sentry -MODULEMAP_FILE = $(SRCROOT)/Sources/Resources/Sentry.modulemap +SENTRY_MODULE_NAME = Sentry +SENTRY_WITHOUT_UIKIT_MODULE_NAME = SentryWithoutUIKit -PRODUCT_MODULE_NAME_Debug = Sentry -PRODUCT_MODULE_NAME_Debug_without_UIKit = Sentry_without_UIKit -PRODUCT_MODULE_NAME_Test = Sentry -PRODUCT_MODULE_NAME_TestCI = Sentry -PRODUCT_MODULE_NAME_Release = Sentry -PRODUCT_MODULE_NAME_Release_without_UIKit = Sentry_without_UIKit +PRODUCT_MODULE_NAME_Debug = $(SENTRY_MODULE_NAME) +PRODUCT_MODULE_NAME_DebugWithoutUIKit = $(SENTRY_WITHOUT_UIKIT_MODULE_NAME) +PRODUCT_MODULE_NAME_Test = $(SENTRY_MODULE_NAME) +PRODUCT_MODULE_NAME_TestCI = $(SENTRY_MODULE_NAME) +PRODUCT_MODULE_NAME_Release = $(SENTRY_MODULE_NAME) +PRODUCT_MODULE_NAME_ReleaseWithoutUIKit = $(SENTRY_WITHOUT_UIKIT_MODULE_NAME) PRODUCT_MODULE_NAME = $(PRODUCT_MODULE_NAME_$(CONFIGURATION)) +PRODUCT_NAME = $(PRODUCT_MODULE_NAME) +PRODUCT_BUNDLE_IDENTIFIER = io.sentry.$(PRODUCT_MODULE_NAME) +MODULEMAP_FILE = $(SRCROOT)/Sources/Resources/$(PRODUCT_MODULE_NAME_$(CONFIGURATION)).modulemap diff --git a/Sources/Resources/SentryWithoutUIKit.modulemap b/Sources/Resources/SentryWithoutUIKit.modulemap new file mode 100644 index 00000000000..e929e43db69 --- /dev/null +++ b/Sources/Resources/SentryWithoutUIKit.modulemap @@ -0,0 +1,6 @@ +framework module SentryWithoutUIKit { + umbrella header "Sentry.h" + + export * + module * { export * } +} From 4cd970dd7101fdddafc98d528425664ac5d28d39 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Mon, 1 Jul 2024 22:21:30 -0800 Subject: [PATCH 06/26] rename _SentryPrivate to _SentryWithoutUIKitPrivate in module.modulemap fixes this error: Module 'SentryWithoutUIKit' in AST file '/Users/andrewmcknight/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/22JF8W0XJRMRE/SentryWithoutUIKit-1Z1Q6V1DCHSHF.pcm' (imported by AST file '/Users/andrewmcknight/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/22JF8W0XJRMRE/_SentryPrivate-23Z4ZY3NE0LI4.pcm') is not defined in any loaded module map file; maybe you need to load '/Users/andrewmcknight/Library/Developer/Xcode/DerivedData/Sentry-gnnqqmcfqpqmmhcjxfzwadgjajnt/Build/Products/DebugWithoutUIKit-iphonesimulator/Sentry.framework/Modules/module.modulemap'? we probably need to rename this from module.modulemap to SentryWithoutUIKitPrivate.modulemap and create the parallel SentryPrivate.modulemap and set those as MODULEMAP_PRIVATE_FILE per config --- Sources/Sentry/include/module.modulemap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Sentry/include/module.modulemap b/Sources/Sentry/include/module.modulemap index 2ddf3ca7c91..c6122cfb169 100644 --- a/Sources/Sentry/include/module.modulemap +++ b/Sources/Sentry/include/module.modulemap @@ -1,3 +1,3 @@ -module _SentryPrivate { +module _SentryWithoutUIKitPrivate { header "SentryPrivate.h" } From 91282722f6207d34b9478b572e6b5cbe0472170f Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Tue, 2 Jul 2024 11:16:25 -0800 Subject: [PATCH 07/26] patch provided from dropbox that fixes the remaining issues --- Sentry.xcodeproj/project.pbxproj | 32 ++------ Sources/Configuration/Sentry.xcconfig | 4 + .../Resources/SentryWithoutUIKit.modulemap | 2 +- Sources/Sentry/Public/Sentry.h | 81 ++++++++++--------- Sources/Sentry/Public/SentryWithoutUIKit.h | 49 +++++++++++ Sources/Sentry/include/SentrySwift.h | 14 +++- Sources/Sentry/include/module.modulemap | 2 +- 7 files changed, 114 insertions(+), 70 deletions(-) create mode 100644 Sources/Sentry/Public/SentryWithoutUIKit.h diff --git a/Sentry.xcodeproj/project.pbxproj b/Sentry.xcodeproj/project.pbxproj index a454dce8018..a369d3504ef 100644 --- a/Sentry.xcodeproj/project.pbxproj +++ b/Sentry.xcodeproj/project.pbxproj @@ -72,6 +72,8 @@ 15E0A8F22411A45A00F044E3 /* SentrySession.m in Sources */ = {isa = PBXBuildFile; fileRef = 15E0A8F12411A45A00F044E3 /* SentrySession.m */; }; 33042A0D29DAF79A00C60085 /* SentryExtraContextProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 33042A0C29DAF79A00C60085 /* SentryExtraContextProvider.m */; }; 33042A1729DC2C4300C60085 /* SentryExtraContextProviderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33042A1629DC2C4300C60085 /* SentryExtraContextProviderTests.swift */; }; + 33EB2A912C3412E4004FED3D /* SentryWithoutUIKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 33EB2A8F2C3411AE004FED3D /* SentryWithoutUIKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 33EB2A922C341300004FED3D /* Sentry.h in Headers */ = {isa = PBXBuildFile; fileRef = 63AA76931EB9C1C200D153DE /* Sentry.h */; settings = {ATTRIBUTES = (Public, ); }; }; 51B15F7E2BE88A7C0026A2F2 /* URLSessionTaskHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51B15F7D2BE88A7C0026A2F2 /* URLSessionTaskHelper.swift */; }; 51B15F802BE88D510026A2F2 /* URLSessionTaskHelperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51B15F7F2BE88D510026A2F2 /* URLSessionTaskHelperTests.swift */; }; 620379DB2AFE1415005AC0C1 /* SentryBuildAppStartSpans.h in Headers */ = {isa = PBXBuildFile; fileRef = 620379DA2AFE1415005AC0C1 /* SentryBuildAppStartSpans.h */; }; @@ -188,7 +190,6 @@ 63AA766A1EB8CB2F00D153DE /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63AA759B1EB8AEF500D153DE /* Sentry.framework */; settings = {ATTRIBUTES = (Required, ); }; }; 63AA76701EB8CB4B00D153DE /* SentryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 63AA75951EB8AEDB00D153DE /* SentryTests.m */; }; 63AA767A1EB8D20500D153DE /* SentryLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 63AA76781EB8D20500D153DE /* SentryLog.m */; }; - 63AA76971EB9C1C200D153DE /* Sentry.h in Headers */ = {isa = PBXBuildFile; fileRef = 63AA76931EB9C1C200D153DE /* Sentry.h */; settings = {ATTRIBUTES = (Public, ); }; }; 63AA76981EB9C1C200D153DE /* SentryClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 63AA76941EB9C1C200D153DE /* SentryClient.h */; settings = {ATTRIBUTES = (Public, ); }; }; 63AA76991EB9C1C200D153DE /* SentryDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 63AA76951EB9C1C200D153DE /* SentryDefines.h */; settings = {ATTRIBUTES = (Public, ); }; }; 63AA769A1EB9C1C200D153DE /* SentryLog.h in Headers */ = {isa = PBXBuildFile; fileRef = 63AA76961EB9C1C200D153DE /* SentryLog.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -1049,6 +1050,7 @@ 33042A0B29DAF5F400C60085 /* SentryExtraContextProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SentryExtraContextProvider.h; sourceTree = ""; }; 33042A0C29DAF79A00C60085 /* SentryExtraContextProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryExtraContextProvider.m; sourceTree = ""; }; 33042A1629DC2C4300C60085 /* SentryExtraContextProviderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryExtraContextProviderTests.swift; sourceTree = ""; }; + 33EB2A8F2C3411AE004FED3D /* SentryWithoutUIKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryWithoutUIKit.h; path = Public/SentryWithoutUIKit.h; sourceTree = ""; }; 51B15F7D2BE88A7C0026A2F2 /* URLSessionTaskHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = URLSessionTaskHelper.swift; sourceTree = ""; }; 51B15F7F2BE88D510026A2F2 /* URLSessionTaskHelperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLSessionTaskHelperTests.swift; sourceTree = ""; }; 620379DA2AFE1415005AC0C1 /* SentryBuildAppStartSpans.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryBuildAppStartSpans.h; path = include/SentryBuildAppStartSpans.h; sourceTree = ""; }; @@ -2560,6 +2562,7 @@ 8ECC673625C23936000E2BF6 /* Transaction */, 8E25C94F25F836AB00DC215B /* Tools */, 63AA76931EB9C1C200D153DE /* Sentry.h */, + 33EB2A8F2C3411AE004FED3D /* SentryWithoutUIKit.h */, D8B665BA2B95F54200BD0E7B /* SentryPrivate.h */, D8BBD32628FD9FBF0011F850 /* SentrySwift.h */, D81A346B291AECC7005A27A9 /* PrivateSentrySDKOnly.h */, @@ -3952,6 +3955,7 @@ 63FE70CD20DA4C1000CDBAE8 /* SentryCrashDoctor.h in Headers */, D8C67E9B28000E24007E326E /* SentryUIApplication.h in Headers */, 7B6438AA26A70F24000D0F65 /* UIViewController+Sentry.h in Headers */, + 33EB2A912C3412E4004FED3D /* SentryWithoutUIKit.h in Headers */, 639FCFAC1EBC811400778193 /* SentryUser.h in Headers */, D8CB74192947285A00A5F964 /* SentryEnvelopeItemHeader.h in Headers */, 7D7F0A5F23DF3D2C00A4629C /* SentryGlobalEventProcessor.h in Headers */, @@ -4025,7 +4029,6 @@ 844EDC6F294143B900C86F34 /* SentryNSProcessInfoWrapper.h in Headers */, D8479328278873A100BE8E99 /* SentryByteCountFormatter.h in Headers */, 63AA76981EB9C1C200D153DE /* SentryClient.h in Headers */, - 63AA76971EB9C1C200D153DE /* Sentry.h in Headers */, 0A9E917128DC7E7000FB4182 /* SentryInternalCDefines.h in Headers */, 63FE711F20DA4C1000CDBAE8 /* SentryCrashObjC.h in Headers */, 7BC3936825B1AB3E004F03D3 /* SentryLevelMapper.h in Headers */, @@ -4034,6 +4037,7 @@ D8ACE3CE2762187D00F5A213 /* SentryNSDataTracker.h in Headers */, 03F84D2427DD414C008FE43F /* SentryCompiler.h in Headers */, 631E6D331EBC679C00712345 /* SentryQueueableRequestManager.h in Headers */, + 33EB2A922C341300004FED3D /* Sentry.h in Headers */, 7B3398632459C14000BD9C96 /* SentryEnvelopeRateLimit.h in Headers */, 6304360A1EC0595B00C4D3FA /* SentryNSDataUtils.h in Headers */, 7BF9EF7C2722B90E00B5BBEF /* SentryDefaultObjCRuntimeWrapper.h in Headers */, @@ -5271,15 +5275,11 @@ "$(inherited)", ); GCC_WARN_SHADOW = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DCARTHAGE_$(CARTHAGE)"; - PRODUCT_BUNDLE_IDENTIFIER = io.sentry.Sentry; - PRODUCT_NAME = Sentry; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; USE_HEADERMAP = YES; @@ -5308,7 +5308,6 @@ GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_OPTIMIZATION_LEVEL = s; GCC_WARN_SHADOW = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; LD_RUNPATH_SEARCH_PATHS = ( @@ -5318,10 +5317,7 @@ ); ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = "-DCARTHAGE_$(CARTHAGE)"; - PRODUCT_BUNDLE_IDENTIFIER = io.sentry.Sentry; - PRODUCT_NAME = Sentry; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; SWIFT_VERSION = 5.0; USE_HEADERMAP = YES; }; @@ -5486,7 +5482,6 @@ "TESTCI=1", ); GCC_WARN_SHADOW = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; LD_RUNPATH_SEARCH_PATHS = ( @@ -5496,10 +5491,7 @@ ); ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DCARTHAGE_$(CARTHAGE)"; - PRODUCT_BUNDLE_IDENTIFIER = io.sentry.Sentry; - PRODUCT_NAME = Sentry; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; USE_HEADERMAP = YES; @@ -5627,7 +5619,6 @@ "$(inherited)", ); GCC_WARN_SHADOW = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; LD_RUNPATH_SEARCH_PATHS = ( @@ -5637,10 +5628,7 @@ ); ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DCARTHAGE_$(CARTHAGE)"; - PRODUCT_BUNDLE_IDENTIFIER = io.sentry.Sentry; - PRODUCT_NAME = Sentry; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; USE_HEADERMAP = YES; @@ -6115,7 +6103,6 @@ GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_OPTIMIZATION_LEVEL = s; GCC_WARN_SHADOW = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; LD_RUNPATH_SEARCH_PATHS = ( @@ -6125,10 +6112,7 @@ ); ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = "-DCARTHAGE_$(CARTHAGE)"; - PRODUCT_BUNDLE_IDENTIFIER = io.sentry.Sentry; - PRODUCT_NAME = Sentry; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; SWIFT_VERSION = 5.0; USE_HEADERMAP = YES; }; @@ -6355,7 +6339,6 @@ GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_SHADOW = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; LD_RUNPATH_SEARCH_PATHS = ( @@ -6365,10 +6348,7 @@ ); ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DCARTHAGE_$(CARTHAGE)"; - PRODUCT_BUNDLE_IDENTIFIER = io.sentry.Sentry; - PRODUCT_NAME = Sentry; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; USE_HEADERMAP = YES; diff --git a/Sources/Configuration/Sentry.xcconfig b/Sources/Configuration/Sentry.xcconfig index 8710bc4e098..b50393e59cb 100644 --- a/Sources/Configuration/Sentry.xcconfig +++ b/Sources/Configuration/Sentry.xcconfig @@ -5,6 +5,10 @@ INFOPLIST_FILE = Sources/Resources/Info.plist SENTRY_MODULE_NAME = Sentry SENTRY_WITHOUT_UIKIT_MODULE_NAME = SentryWithoutUIKit +// This config is required so the test code can access the SentryPrivate module. Removing this setting +// leads to an error: no such module '_SentryPrivate' when including the XCFramework with Carthage +HEADER_SEARCH_PATHS = $(SRCROOT)/Sources/Sentry/include/** + PRODUCT_MODULE_NAME_Debug = $(SENTRY_MODULE_NAME) PRODUCT_MODULE_NAME_DebugWithoutUIKit = $(SENTRY_WITHOUT_UIKIT_MODULE_NAME) PRODUCT_MODULE_NAME_Test = $(SENTRY_MODULE_NAME) diff --git a/Sources/Resources/SentryWithoutUIKit.modulemap b/Sources/Resources/SentryWithoutUIKit.modulemap index e929e43db69..bde8eab8097 100644 --- a/Sources/Resources/SentryWithoutUIKit.modulemap +++ b/Sources/Resources/SentryWithoutUIKit.modulemap @@ -1,5 +1,5 @@ framework module SentryWithoutUIKit { - umbrella header "Sentry.h" + umbrella header "SentryWithoutUIKit.h" export * module * { export * } diff --git a/Sources/Sentry/Public/Sentry.h b/Sources/Sentry/Public/Sentry.h index a42b8f0e23c..713de13d331 100644 --- a/Sources/Sentry/Public/Sentry.h +++ b/Sources/Sentry/Public/Sentry.h @@ -1,4 +1,5 @@ -#import +#ifndef SENTRY_NO_UIKIT +# import //! Project version number for Sentry. FOUNDATION_EXPORT double SentryVersionNumber; @@ -6,41 +7,43 @@ FOUNDATION_EXPORT double SentryVersionNumber; //! Project version string for Sentry. FOUNDATION_EXPORT const unsigned char SentryVersionString[]; -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +#endif diff --git a/Sources/Sentry/Public/SentryWithoutUIKit.h b/Sources/Sentry/Public/SentryWithoutUIKit.h new file mode 100644 index 00000000000..4e0870a9c3a --- /dev/null +++ b/Sources/Sentry/Public/SentryWithoutUIKit.h @@ -0,0 +1,49 @@ +#ifdef SENTRY_NO_UIKIT +# import + +//! Project version number for Sentry. +FOUNDATION_EXPORT double SentryVersionNumber; + +//! Project version string for Sentry. +FOUNDATION_EXPORT const unsigned char SentryVersionString[]; + +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +#endif diff --git a/Sources/Sentry/include/SentrySwift.h b/Sources/Sentry/include/SentrySwift.h index 861a37090c8..f1138539bac 100644 --- a/Sources/Sentry/include/SentrySwift.h +++ b/Sources/Sentry/include/SentrySwift.h @@ -7,10 +7,18 @@ # endif #endif -#if __has_include("Sentry-Swift.h") -# import "Sentry-Swift.h" +#ifdef SENTRY_NO_UIKIT +# if __has_include("SentryWithoutUIKit-Swift.h") +# import "SentryWithoutUIKit-Swift.h" +# else +# import +# endif #else -# import +# if __has_include("Sentry-Swift.h") +# import "Sentry-Swift.h" +# else +# import +# endif #endif #endif diff --git a/Sources/Sentry/include/module.modulemap b/Sources/Sentry/include/module.modulemap index c6122cfb169..2ddf3ca7c91 100644 --- a/Sources/Sentry/include/module.modulemap +++ b/Sources/Sentry/include/module.modulemap @@ -1,3 +1,3 @@ -module _SentryWithoutUIKitPrivate { +module _SentryPrivate { header "SentryPrivate.h" } From e133b18d14eb13681f3a5eabc3f40e6a9bc89f12 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Tue, 2 Jul 2024 11:38:50 -0800 Subject: [PATCH 08/26] rename remaining instances of Debug_without_UIKit to DebugWithoutUIKit etc --- .github/workflows/build.yml | 12 ++++++------ Sources/Sentry/Public/SentryOptions.h | 12 ++++++------ .../include/HybridPublic/PrivateSentrySDKOnly.h | 10 +++++----- .../include/HybridPublic/SentryAppStartMeasurement.h | 2 +- .../Sentry/include/HybridPublic/SentryScreenFrames.h | 2 +- develop-docs/README.md | 2 +- scripts/build-xcframework.sh | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4589ad56069..5086ec90520 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -214,24 +214,24 @@ jobs: shell: sh check-uikit-linkage-debug-UIKitless: - name: Check no UIKit linkage (Debug_without_UIKit) + name: Check no UIKit linkage (DebugWithoutUIKit) runs-on: macos-13 steps: - uses: actions/checkout@v4 - name: Build for Debug - run: ./scripts/xcode-test.sh "iOS" "latest" $GITHUB_REF_NAME ci build "iPhone 14" Debug_without_UIKit uikit-check-build + run: ./scripts/xcode-test.sh "iOS" "latest" $GITHUB_REF_NAME ci build "iPhone 14" DebugWithoutUIKit uikit-check-build - name: Ensure no UIKit - run: ./scripts/check-uikit-linkage.sh Debug_without_UIKit uikit-check-build unlinked + run: ./scripts/check-uikit-linkage.sh DebugWithoutUIKit uikit-check-build unlinked check-uikit-linkage-release-UIKitless: - name: Check no UIKit linkage (Release_without_UIKit) + name: Check no UIKit linkage (ReleaseWithoutUIKit) runs-on: macos-13 steps: - uses: actions/checkout@v4 - name: Build for Release - run: ./scripts/xcode-test.sh "iOS" "latest" $GITHUB_REF_NAME ci build "iPhone 14" Release_without_UIKit uikit-check-build + run: ./scripts/xcode-test.sh "iOS" "latest" $GITHUB_REF_NAME ci build "iPhone 14" ReleaseWithoutUIKit uikit-check-build - name: Ensure no UIKit - run: ./scripts/check-uikit-linkage.sh Release_without_UIKit uikit-check-build unlinked + run: ./scripts/check-uikit-linkage.sh ReleaseWithoutUIKit uikit-check-build unlinked check-uikit-linkage-debug: name: Check UIKit linkage (Debug) diff --git a/Sources/Sentry/Public/SentryOptions.h b/Sources/Sentry/Public/SentryOptions.h index 01cf2c25618..0f91822dbfd 100644 --- a/Sources/Sentry/Public/SentryOptions.h +++ b/Sources/Sentry/Public/SentryOptions.h @@ -252,7 +252,7 @@ NS_SWIFT_NAME(Options) #if SENTRY_UIKIT_AVAILABLE /** * When enabled, the SDK tracks performance for UIViewController subclasses. - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. * @note The default is @c YES . */ @@ -260,7 +260,7 @@ NS_SWIFT_NAME(Options) /** * Automatically attaches a screenshot when capturing an error or exception. - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. * @note Default value is @c NO . */ @@ -270,7 +270,7 @@ NS_SWIFT_NAME(Options) * @warning This is an experimental feature and may still have bugs. * @brief Automatically attaches a textual representation of the view hierarchy when capturing an * error event. - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. * @note Default value is @c NO . */ @@ -279,7 +279,7 @@ NS_SWIFT_NAME(Options) /** * When enabled, the SDK creates transactions for UI events like buttons clicks, switch toggles, * and other ui elements that uses UIControl @c sendAction:to:forEvent: - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. * @note Default value is @c YES . */ @@ -288,7 +288,7 @@ NS_SWIFT_NAME(Options) /** * How long an idle transaction waits for new children after all its child spans finished. Only UI * event transactions are idle transactions. - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. * @note The default is 3 seconds. */ @@ -302,7 +302,7 @@ NS_SWIFT_NAME(Options) * @note You can filter for different app start types in Discover with * @c app_start_type:cold.prewarmed , * @c app_start_type:warm.prewarmed , @c app_start_type:cold , and @c app_start_type:warm . - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. * @note Default value is @c NO . */ diff --git a/Sources/Sentry/include/HybridPublic/PrivateSentrySDKOnly.h b/Sources/Sentry/include/HybridPublic/PrivateSentrySDKOnly.h index 45a8156fd8d..13173b41858 100644 --- a/Sources/Sentry/include/HybridPublic/PrivateSentrySDKOnly.h +++ b/Sources/Sentry/include/HybridPublic/PrivateSentrySDKOnly.h @@ -132,31 +132,31 @@ typedef void (^SentryOnAppStartMeasurementAvailable)( #if SENTRY_UIKIT_AVAILABLE /** * Allows hybrid SDKs to enable frame tracking measurements despite other options. - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. */ @property (class, nonatomic, assign) BOOL framesTrackingMeasurementHybridSDKMode; /** - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. */ @property (class, nonatomic, assign, readonly) BOOL isFramesTrackingRunning; /** - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. */ @property (class, nonatomic, assign, readonly) SentryScreenFrames *currentScreenFrames; /** - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. */ + (NSArray *)captureScreenshots; /** - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. */ + (NSData *)captureViewHierarchy; diff --git a/Sources/Sentry/include/HybridPublic/SentryAppStartMeasurement.h b/Sources/Sentry/include/HybridPublic/SentryAppStartMeasurement.h index 7eb49470c7f..5484f064fb8 100644 --- a/Sources/Sentry/include/HybridPublic/SentryAppStartMeasurement.h +++ b/Sources/Sentry/include/HybridPublic/SentryAppStartMeasurement.h @@ -17,7 +17,7 @@ SENTRY_NO_INIT @end /** - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. */ @interface SentryAppStartMeasurement : NSObject diff --git a/Sources/Sentry/include/HybridPublic/SentryScreenFrames.h b/Sources/Sentry/include/HybridPublic/SentryScreenFrames.h index 9f4f2b8ccd9..9a4bc68d092 100644 --- a/Sources/Sentry/include/HybridPublic/SentryScreenFrames.h +++ b/Sources/Sentry/include/HybridPublic/SentryScreenFrames.h @@ -10,7 +10,7 @@ typedef NSArray *> SentryFrameInfoTimeSerie # endif // SENTRY_TARGET_PROFILING_SUPPORTED /** - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. */ @interface SentryScreenFrames : NSObject diff --git a/develop-docs/README.md b/develop-docs/README.md index 50ec5d4316b..7608a729970 100644 --- a/develop-docs/README.md +++ b/develop-docs/README.md @@ -100,7 +100,7 @@ You can use the `generate-classes.sh` to generate ViewControllers and other clas Some customers would like to not link UIKit for various reasons. Either they simply may not want to use our UIKit functionality, or they actually cannot link to it in certain circumstances, like a File Provider app extension. -There are two build configurations they can use for this: `Debug_without_UIKit` and `Release_without_UIKit`, that are essentially the same as `Debug` and `Release` with the following differences: +There are two build configurations they can use for this: `DebugWithoutUIKit` and `ReleaseWithoutUIKit`, that are essentially the same as `Debug` and `Release` with the following differences: - They set `CLANG_MODULES_AUTOLINK` to `NO`. This avoids a load command being automatically inserted for any UIKit API that make their way into the type system during compilation of SDK sources. - `GCC_PREPROCESSOR_DEFINITIONS` has an additional setting `SENTRY_NO_UIKIT=1`. This is now part of the definition of `SENTRY_HAS_UIKIT` in `SentryDefines.h` that is used to conditionally compile out any code that would otherwise use UIKit API and cause UIKit to be automatically linked as described above. There is another macro `SENTRY_UIKIT_AVAILABLE` defined as `SENTRY_HAS_UIKIT` used to be, meaning simply that compilation is targeting a platform where UIKit is available to be used. This is used in headers we deliver in the framework bundle to compile out declarations that rely on UIKit, and their corresponding implementations are switched over `SENTRY_HAS_UIKIT` to either provide the logic for configurations that link UIKit, or to provide a stub delivering a default value (`nil`, `0.0`, `NO` etc) and a warning log for publicly facing things like SentryOptions, or debug log for internal things like SentryDependencyContainer. diff --git a/scripts/build-xcframework.sh b/scripts/build-xcframework.sh index 45ee21f3a81..ebded154f45 100755 --- a/scripts/build-xcframework.sh +++ b/scripts/build-xcframework.sh @@ -75,4 +75,4 @@ generate_xcframework "Sentry" "" staticlib generate_xcframework "SentrySwiftUI" -generate_xcframework "Sentry" "-WithoutUIKitOrAppKit" mh_dylib Release_without_UIKit +generate_xcframework "Sentry" "-WithoutUIKitOrAppKit" mh_dylib ReleaseWithoutUIKit From d63a8937c71e11c0cfffa70bfcc4e7669cba0699 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Tue, 2 Jul 2024 12:05:34 -0800 Subject: [PATCH 09/26] move GCC_PREPROCESSOR_DEFINITIONS into SDK.xcconfig --- Sentry.xcodeproj/project.pbxproj | 41 ------------------------------ Sources/Configuration/SDK.xcconfig | 8 ++++++ 2 files changed, 8 insertions(+), 41 deletions(-) diff --git a/Sentry.xcodeproj/project.pbxproj b/Sentry.xcodeproj/project.pbxproj index a369d3504ef..0cb7edefab5 100644 --- a/Sentry.xcodeproj/project.pbxproj +++ b/Sentry.xcodeproj/project.pbxproj @@ -5175,10 +5175,6 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -5230,7 +5226,6 @@ ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = "RELEASE=1"; GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -5270,10 +5265,6 @@ ENABLE_STRICT_OBJC_MSGSEND = NO; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); GCC_WARN_SHADOW = YES; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; @@ -5431,13 +5422,6 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - "TEST=1", - "TESTCI=1", - "SENTRY_UIKIT_LINKED=1", - ); GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -5475,12 +5459,6 @@ ENABLE_STRICT_OBJC_MSGSEND = NO; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - "TEST=1", - "TESTCI=1", - ); GCC_WARN_SHADOW = YES; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; @@ -5572,11 +5550,6 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - "SENTRY_NO_UIKIT=1", - ); GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -5614,10 +5587,6 @@ ENABLE_STRICT_OBJC_MSGSEND = NO; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); GCC_WARN_SHADOW = YES; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; @@ -6059,10 +6028,6 @@ ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - "SENTRY_NO_UIKIT=1", - "RELEASE=1", - ); GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -6295,12 +6260,6 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - "TEST=1", - "SENTRY_UIKIT_LINKED=1", - ); GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; diff --git a/Sources/Configuration/SDK.xcconfig b/Sources/Configuration/SDK.xcconfig index cf877dd477e..a504c9c54ad 100644 --- a/Sources/Configuration/SDK.xcconfig +++ b/Sources/Configuration/SDK.xcconfig @@ -40,3 +40,11 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS_TestCI = TESTCI SWIFT_ACTIVE_COMPILATION_CONDITIONS_Release = SWIFT_ACTIVE_COMPILATION_CONDITIONS_ReleaseWithoutUIKit = SENTRY_NO_UIKIT SWIFT_ACTIVE_COMPILATION_CONDITIONS = $(SWIFT_ACTIVE_COMPILATION_CONDITIONS_$(CONFIGURATION)) + +GCC_PREPROCESSOR_DEFINITIONS_Debug = DEBUG=1 +GCC_PREPROCESSOR_DEFINITIONS_DebugWithoutUIKit = DEBUG=1 SENTRY_NO_UIKIT=1 +GCC_PREPROCESSOR_DEFINITIONS_Test = DEBUG=1 TEST=1 +GCC_PREPROCESSOR_DEFINITIONS_TestCI = DEBUG=1 TEST=1 TESTCI=1 +GCC_PREPROCESSOR_DEFINITIONS_Release = RELEASE=1 +GCC_PREPROCESSOR_DEFINITIONS_ReleaseWithoutUIKit = RELEASE=1 SENTRY_NO_UIKIT=1 +GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS_$(CONFIGURATION)) From 1b2a7ca4972df91cd505e603e3be427276a56431 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Tue, 2 Jul 2024 12:11:59 -0800 Subject: [PATCH 10/26] conditionally link either Sentry or SentryWithoutUIKit into SentrySwiftUI --- Sentry.xcodeproj/project.pbxproj | 2 -- Sources/Configuration/SDK.xcconfig | 7 +++++++ Sources/SentrySwiftUI/SentryTracedView.swift | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Sentry.xcodeproj/project.pbxproj b/Sentry.xcodeproj/project.pbxproj index 0cb7edefab5..ea8cc91daef 100644 --- a/Sentry.xcodeproj/project.pbxproj +++ b/Sentry.xcodeproj/project.pbxproj @@ -801,7 +801,6 @@ D8199DBF29376EE20074249E /* SentryInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = D8199DB929376ECC0074249E /* SentryInternal.m */; }; D8199DC029376EE80074249E /* SentrySwiftUI.h in Headers */ = {isa = PBXBuildFile; fileRef = D8199DB529376ECC0074249E /* SentrySwiftUI.h */; }; D8199DC129376EEC0074249E /* SentryTracedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8199DB629376ECC0074249E /* SentryTracedView.swift */; }; - D8199DC229376FC10074249E /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63AA759B1EB8AEF500D153DE /* Sentry.framework */; }; D81A346C291AECC7005A27A9 /* PrivateSentrySDKOnly.h in Headers */ = {isa = PBXBuildFile; fileRef = D81A346B291AECC7005A27A9 /* PrivateSentrySDKOnly.h */; settings = {ATTRIBUTES = (Private, ); }; }; D81FDF12280EA1060045E0E4 /* SentryScreenShotTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81FDF10280EA0080045E0E4 /* SentryScreenShotTests.swift */; }; D820CDB72BB1895F00BA339D /* SentrySessionReplayIntegration.m in Sources */ = {isa = PBXBuildFile; fileRef = D820CDB62BB1895F00BA339D /* SentrySessionReplayIntegration.m */; }; @@ -2038,7 +2037,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D8199DC229376FC10074249E /* Sentry.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Sources/Configuration/SDK.xcconfig b/Sources/Configuration/SDK.xcconfig index a504c9c54ad..a0645281e20 100644 --- a/Sources/Configuration/SDK.xcconfig +++ b/Sources/Configuration/SDK.xcconfig @@ -21,6 +21,13 @@ ONLY_ACTIVE_ARCH[config=Debug] = YES GCC_OPTIMIZATION_LEVEL[config=Debug] = 0 COPY_PHASE_STRIP[config=Debug] = NO +OTHER_LDFLAGS_DebugWithoutUIKit = -framework SentryWithoutUIKit +OTHER_LDFLAGS_ReleaseWithoutUIKit = -framework SentryWithoutUIKit +OTHER_LDFLAGS_Debug = -framework Sentry +OTHER_LDFLAGS_Test = -framework Sentry +OTHER_LDFLAGS_TestCI = -framework Sentry +OTHER_LDFLAGS_Release = -framework Sentry +OTHER_LDFLAGS = $(OTHER_LDFLAGS_$(CONFIGURATION)) OTHER_LDFLAGS[sdk=watch*] = $(inherited) -framework WatchKit SUPPORTS_MACCATALYST = YES diff --git a/Sources/SentrySwiftUI/SentryTracedView.swift b/Sources/SentrySwiftUI/SentryTracedView.swift index 9a4b7087903..c983fea1ae8 100644 --- a/Sources/SentrySwiftUI/SentryTracedView.swift +++ b/Sources/SentrySwiftUI/SentryTracedView.swift @@ -1,5 +1,9 @@ import Foundation +#if SENTRY_NO_UIKIT +import SentryWithoutUIKit +#else import Sentry +#endif #if CARTHAGE || SWIFT_PACKAGE @_implementationOnly import SentryInternal #endif From 623274de159686e79f2a2db8d6a51afa69a148f5 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Tue, 2 Jul 2024 12:15:40 -0800 Subject: [PATCH 11/26] fix UIKit linkage CI workflow --- .github/workflows/build.yml | 24 ++++++++++++------------ scripts/check-uikit-linkage.sh | 3 ++- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5086ec90520..12fee23456b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -213,42 +213,42 @@ jobs: - run: swift build shell: sh - check-uikit-linkage-debug-UIKitless: + check-debug-without-UIKit: name: Check no UIKit linkage (DebugWithoutUIKit) runs-on: macos-13 steps: - uses: actions/checkout@v4 - name: Build for Debug run: ./scripts/xcode-test.sh "iOS" "latest" $GITHUB_REF_NAME ci build "iPhone 14" DebugWithoutUIKit uikit-check-build - - name: Ensure no UIKit - run: ./scripts/check-uikit-linkage.sh DebugWithoutUIKit uikit-check-build unlinked + - name: Ensure UIKit is not linked + run: ./scripts/check-uikit-linkage.sh DebugWithoutUIKit uikit-check-build unlinked SentryWithoutUIKit - check-uikit-linkage-release-UIKitless: + check-release-without-UIKit: name: Check no UIKit linkage (ReleaseWithoutUIKit) runs-on: macos-13 steps: - uses: actions/checkout@v4 - name: Build for Release run: ./scripts/xcode-test.sh "iOS" "latest" $GITHUB_REF_NAME ci build "iPhone 14" ReleaseWithoutUIKit uikit-check-build - - name: Ensure no UIKit - run: ./scripts/check-uikit-linkage.sh ReleaseWithoutUIKit uikit-check-build unlinked + - name: Ensure UIKit is not linked + run: ./scripts/check-uikit-linkage.sh ReleaseWithoutUIKit uikit-check-build unlinked SentryWithoutUIKit - check-uikit-linkage-debug: + check-debug-with-UIKit: name: Check UIKit linkage (Debug) runs-on: macos-13 steps: - uses: actions/checkout@v4 - name: Build for Debug run: ./scripts/xcode-test.sh "iOS" "latest" $GITHUB_REF_NAME ci build "iPhone 14" Debug uikit-check-build - - name: Ensure no UIKit - run: ./scripts/check-uikit-linkage.sh Debug uikit-check-build linked + - name: Ensure UIKit is linked + run: ./scripts/check-uikit-linkage.sh Debug uikit-check-build linked Sentry - check-uikit-linkage-release: + check-release-with-UIKit: name: Check UIKit linkage (Release) runs-on: macos-13 steps: - uses: actions/checkout@v4 - name: Build for Release run: ./scripts/xcode-test.sh "iOS" "latest" $GITHUB_REF_NAME ci build "iPhone 14" Release uikit-check-build - - name: Ensure no UIKit - run: ./scripts/check-uikit-linkage.sh Release uikit-check-build linked + - name: Ensure UIKit is linked + run: ./scripts/check-uikit-linkage.sh Release uikit-check-build linked Sentry diff --git a/scripts/check-uikit-linkage.sh b/scripts/check-uikit-linkage.sh index 329ae77fb64..e414b0b7866 100755 --- a/scripts/check-uikit-linkage.sh +++ b/scripts/check-uikit-linkage.sh @@ -6,8 +6,9 @@ set -eou pipefail CONFIGURATION="${1}" DERIVED_DATA_PATH="${2}" +MODULE_NAME="${3}" -SENTRY_BUILD_PRODUCT_PATH="$DERIVED_DATA_PATH/Build/Products/$CONFIGURATION-iphonesimulator/Sentry.framework/Sentry" +SENTRY_BUILD_PRODUCT_PATH="$DERIVED_DATA_PATH/Build/Products/$CONFIGURATION-iphonesimulator/$MODULE_NAME.framework/$MODULE_NAME" stat $SENTRY_BUILD_PRODUCT_PATH From 0bcec494c90fc49af21676cdaabe65ab2988e625 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Tue, 2 Jul 2024 12:19:16 -0800 Subject: [PATCH 12/26] put OTHER_LDFLAGS only in SwiftUI xcconfig --- Sources/Configuration/SDK.xcconfig | 7 ------- Sources/Configuration/SentrySwiftUI.xcconfig | 8 ++++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Sources/Configuration/SDK.xcconfig b/Sources/Configuration/SDK.xcconfig index a0645281e20..a504c9c54ad 100644 --- a/Sources/Configuration/SDK.xcconfig +++ b/Sources/Configuration/SDK.xcconfig @@ -21,13 +21,6 @@ ONLY_ACTIVE_ARCH[config=Debug] = YES GCC_OPTIMIZATION_LEVEL[config=Debug] = 0 COPY_PHASE_STRIP[config=Debug] = NO -OTHER_LDFLAGS_DebugWithoutUIKit = -framework SentryWithoutUIKit -OTHER_LDFLAGS_ReleaseWithoutUIKit = -framework SentryWithoutUIKit -OTHER_LDFLAGS_Debug = -framework Sentry -OTHER_LDFLAGS_Test = -framework Sentry -OTHER_LDFLAGS_TestCI = -framework Sentry -OTHER_LDFLAGS_Release = -framework Sentry -OTHER_LDFLAGS = $(OTHER_LDFLAGS_$(CONFIGURATION)) OTHER_LDFLAGS[sdk=watch*] = $(inherited) -framework WatchKit SUPPORTS_MACCATALYST = YES diff --git a/Sources/Configuration/SentrySwiftUI.xcconfig b/Sources/Configuration/SentrySwiftUI.xcconfig index 195c7d84616..fb5410ac6f3 100644 --- a/Sources/Configuration/SentrySwiftUI.xcconfig +++ b/Sources/Configuration/SentrySwiftUI.xcconfig @@ -6,3 +6,11 @@ IPHONEOS_DEPLOYMENT_TARGET = 13.0 WATCHOS_DEPLOYMENT_TARGET = 6.0 TVOS_DEPLOYMENT_TARGET = 13.0 MACH_O_TYPE = mh_dylib + +OTHER_LDFLAGS_DebugWithoutUIKit = -framework SentryWithoutUIKit +OTHER_LDFLAGS_ReleaseWithoutUIKit = -framework SentryWithoutUIKit +OTHER_LDFLAGS_Debug = -framework Sentry +OTHER_LDFLAGS_Test = -framework Sentry +OTHER_LDFLAGS_TestCI = -framework Sentry +OTHER_LDFLAGS_Release = -framework Sentry +OTHER_LDFLAGS = $(OTHER_LDFLAGS_$(CONFIGURATION)) From c2da7e3e9f642d3415500459d53cacb9391096a2 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Tue, 2 Jul 2024 12:28:12 -0800 Subject: [PATCH 13/26] fix linkage test args --- scripts/check-uikit-linkage.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/check-uikit-linkage.sh b/scripts/check-uikit-linkage.sh index e414b0b7866..9ee2473a26f 100755 --- a/scripts/check-uikit-linkage.sh +++ b/scripts/check-uikit-linkage.sh @@ -6,7 +6,8 @@ set -eou pipefail CONFIGURATION="${1}" DERIVED_DATA_PATH="${2}" -MODULE_NAME="${3}" +LINKAGE_TEST="${3}" +MODULE_NAME="${4}" SENTRY_BUILD_PRODUCT_PATH="$DERIVED_DATA_PATH/Build/Products/$CONFIGURATION-iphonesimulator/$MODULE_NAME.framework/$MODULE_NAME" @@ -14,7 +15,7 @@ stat $SENTRY_BUILD_PRODUCT_PATH MATCHES=$(otool -L $SENTRY_BUILD_PRODUCT_PATH | grep -c UIKit.framework ||:) -case "${3}" in +case "$LINKAGE_TEST" in "linked") if [ $MATCHES == 0 ]; then echo "UIKit.framework linkage not found." From 0cb91fbd63ca0483941f6c7febf10eefe1f7cd1d Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Tue, 2 Jul 2024 12:41:57 -0800 Subject: [PATCH 14/26] make uikit linkage more strict, because now we have a match for UIKit.framework in @rpath/SentryWithoutUIKit.framework/SentryWithoutUIKit --- scripts/check-uikit-linkage.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/check-uikit-linkage.sh b/scripts/check-uikit-linkage.sh index 9ee2473a26f..8a35759ba8d 100755 --- a/scripts/check-uikit-linkage.sh +++ b/scripts/check-uikit-linkage.sh @@ -13,7 +13,8 @@ SENTRY_BUILD_PRODUCT_PATH="$DERIVED_DATA_PATH/Build/Products/$CONFIGURATION-ipho stat $SENTRY_BUILD_PRODUCT_PATH -MATCHES=$(otool -L $SENTRY_BUILD_PRODUCT_PATH | grep -c UIKit.framework ||:) +# otool will also report linkage of @rpath/libswiftUIKit.dylib but that doesn't imply UIKit is actually linked +MATCHES=$(otool -L $SENTRY_BUILD_PRODUCT_PATH | grep -c "UIKit.framework/UIKit" ||:) case "$LINKAGE_TEST" in "linked") From 392e62a722b863c5e660b3ea790878dabf8a4d5e Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Tue, 2 Jul 2024 12:53:21 -0800 Subject: [PATCH 15/26] actually, libswift dylib is also not allowed --- scripts/check-uikit-linkage.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/check-uikit-linkage.sh b/scripts/check-uikit-linkage.sh index 8a35759ba8d..25355b99a9a 100755 --- a/scripts/check-uikit-linkage.sh +++ b/scripts/check-uikit-linkage.sh @@ -13,8 +13,7 @@ SENTRY_BUILD_PRODUCT_PATH="$DERIVED_DATA_PATH/Build/Products/$CONFIGURATION-ipho stat $SENTRY_BUILD_PRODUCT_PATH -# otool will also report linkage of @rpath/libswiftUIKit.dylib but that doesn't imply UIKit is actually linked -MATCHES=$(otool -L $SENTRY_BUILD_PRODUCT_PATH | grep -c "UIKit.framework/UIKit" ||:) +MATCHES=$(otool -L $SENTRY_BUILD_PRODUCT_PATH | grep -c -e "UIKit.framework/UIKit" -e "libswiftUIKit.dylib" ||:) case "$LINKAGE_TEST" in "linked") From f93f597d3e062bd1d959ddc4b10c367567bdc347 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Tue, 2 Jul 2024 12:58:48 -0800 Subject: [PATCH 16/26] fix accidental reintroduction of implicit UIKit linkage --- .../Integrations/SessionReplay/SentryReplayVideoMaker.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Swift/Integrations/SessionReplay/SentryReplayVideoMaker.swift b/Sources/Swift/Integrations/SessionReplay/SentryReplayVideoMaker.swift index 2661d05e788..571748cb758 100644 --- a/Sources/Swift/Integrations/SessionReplay/SentryReplayVideoMaker.swift +++ b/Sources/Swift/Integrations/SessionReplay/SentryReplayVideoMaker.swift @@ -1,4 +1,4 @@ -#if canImport(UIKit) +#if canImport(UIKit) && !SENTRY_NO_UIKIT import Foundation import UIKit From d6cb350bf30d303421ae9c769d9ea9714092c2fb Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Tue, 2 Jul 2024 13:22:23 -0800 Subject: [PATCH 17/26] typo --- scripts/build-xcframework.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/build-xcframework.sh b/scripts/build-xcframework.sh index ebded154f45..d0de1884a2d 100755 --- a/scripts/build-xcframework.sh +++ b/scripts/build-xcframework.sh @@ -11,7 +11,7 @@ ALL_SDKS=$(xcodebuild -showsdks) generate_xcframework() { local scheme="$1" - local sufix="${2:-}" + local suffix="${2:-}" local MACH_O_TYPE="${3-mh_dylib}" local configuration="${4-Release}" local createxcframework="xcodebuild -create-xcframework " @@ -27,15 +27,15 @@ generate_xcframework() { for sdk in "${sdks[@]}"; do if [[ -n "$(grep "${sdk}" <<< "$ALL_SDKS")" ]]; then - xcodebuild archive -project Sentry.xcodeproj/ -scheme "$scheme" -configuration "$configuration" -sdk "$sdk" -archivePath ./Carthage/archive/${scheme}${sufix}/${sdk}.xcarchive CODE_SIGNING_REQUIRED=NO SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CARTHAGE=YES MACH_O_TYPE=$MACH_O_TYPE ENABLE_CODE_COVERAGE=NO GCC_GENERATE_DEBUGGING_SYMBOLS="$GCC_GENERATE_DEBUGGING_SYMBOLS" + xcodebuild archive -project Sentry.xcodeproj/ -scheme "$scheme" -configuration "$configuration" -sdk "$sdk" -archivePath ./Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive CODE_SIGNING_REQUIRED=NO SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CARTHAGE=YES MACH_O_TYPE=$MACH_O_TYPE ENABLE_CODE_COVERAGE=NO GCC_GENERATE_DEBUGGING_SYMBOLS="$GCC_GENERATE_DEBUGGING_SYMBOLS" - createxcframework+="-framework Carthage/archive/${scheme}${sufix}/${sdk}.xcarchive/Products/Library/Frameworks/${scheme}.framework " + createxcframework+="-framework Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/Products/Library/Frameworks/${scheme}.framework " if [ "$MACH_O_TYPE" = "staticlib" ]; then - local infoPlist="Carthage/archive/${scheme}${sufix}/${sdk}.xcarchive/Products/Library/Frameworks/${scheme}.framework/Info.plist" + local infoPlist="Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/Products/Library/Frameworks/${scheme}.framework/Info.plist" if [ ! -e "$infoPlist" ]; then - infoPlist="Carthage/archive/${scheme}${sufix}/${sdk}.xcarchive/Products/Library/Frameworks/${scheme}.framework/Resources/Info.plist" + infoPlist="Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/Products/Library/Frameworks/${scheme}.framework/Resources/Info.plist" fi # This workaround is necessary to make Sentry Static framework to work # More information in here: https://github.com/getsentry/sentry-cocoa/issues/3769 @@ -43,9 +43,9 @@ generate_xcframework() { plutil -replace "MinimumOSVersion" -string "100.0" "$infoPlist" fi - if [ -d "Carthage/archive/${scheme}${sufix}/${sdk}.xcarchive/dSYMs/${scheme}.framework.dSYM" ]; then + if [ -d "Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/dSYMs/${scheme}.framework.dSYM" ]; then # Has debug symbols - createxcframework+="-debug-symbols $(pwd -P)/Carthage/archive/${scheme}${sufix}/${sdk}.xcarchive/dSYMs/${scheme}.framework.dSYM " + createxcframework+="-debug-symbols $(pwd -P)/Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/dSYMs/${scheme}.framework.dSYM " fi else echo "${sdk} SDK not found" @@ -65,7 +65,7 @@ generate_xcframework() { createxcframework+="-debug-symbols $(pwd -P)/Carthage/DerivedData/Build/Products/"$configuration"-maccatalyst/${scheme}.framework.dSYM " fi - createxcframework+="-output Carthage/${scheme}${sufix}.xcframework" + createxcframework+="-output Carthage/${scheme}${suffix}.xcframework" $createxcframework } From 15aeae18c76e65fba7891de2a4a8457fdd00925a Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Tue, 2 Jul 2024 13:51:00 -0800 Subject: [PATCH 18/26] try using an include test to fix a downstream issue with my bazel build the error starts out as such: ERROR: /Users/andrewmcknight/Code/organization/getsentry/repos/public/sentry-cocoa-bazel/file_provider_extension/BUILD:4:14: Compiling Swift module //file_provider_extension:file_provider_swift_sources failed: (Exit 1): worker failed: error executing SwiftCompile command (from target //file_provider_extension:file_provider_swift_sources) bazel-out/darwin_arm64-opt-exec-ST-13d3ddad9198/bin/external/build_bazel_rules_swift/tools/worker/worker swiftc ... (remaining 1 argument skipped) error: emit-module command failed with exit code 1 (use -v to see invocation) :2:9: note: in file included from :2: ^ vendor/Carthage/Build/SentryWithoutUIKit.xcframework/ios-arm64_x86_64-simulator/SentryWithoutUIKit.framework/Headers/SentryWithoutUIKit-Swift.h:324:29: error: cannot find protocol declaration for 'SentrySerializable' @protocol SentryRRWebEvent ^ :2:9: note: in file included from :2: ^ vendor/Carthage/Build/SentryWithoutUIKit.xcframework/ios-arm64_x86_64-simulator/SentryWithoutUIKit.framework/Headers/SentryWithoutUIKit-Swift.h:640:32: error: cannot find interface declaration for 'SentryEvent', superclass of 'SentryReplayEvent' @interface SentryReplayEvent : SentryEvent ^ :1:9: note: in file included from :1: ^ /private/var/tmp/_bazel_andrewmcknight/1473e8b1ae382f4a9a68831aec4e0587/execroot/_main/vendor/Carthage/Build/SentryWithoutUIKit.xcframework/ios-arm64_x86_64-simulator/SentryWithoutUIKit.framework/Headers/SentryWithoutUIKit.h:50:1: warning: umbrella header for module 'SentryWithoutUIKit' does not include header 'SentryMeasurementUnit.h' ^ :1:9: note: in file included from :1: ^ /private/var/tmp/_bazel_andrewmcknight/1473e8b1ae382f4a9a68831aec4e0587/execroot/_main/vendor/Carthage/Build/SentryWithoutUIKit.xcframework/ios-arm64_x86_64-simulator/SentryWithoutUIKit.framework/Headers/SentryWithoutUIKit.h:50:1: warning: umbrella header for module 'SentryWithoutUIKit' does not include header 'SentryNSError.h' --- Sources/Sentry/Public/SentryWithoutUIKit.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Sentry/Public/SentryWithoutUIKit.h b/Sources/Sentry/Public/SentryWithoutUIKit.h index 4e0870a9c3a..c812ce2b2bc 100644 --- a/Sources/Sentry/Public/SentryWithoutUIKit.h +++ b/Sources/Sentry/Public/SentryWithoutUIKit.h @@ -1,4 +1,4 @@ -#ifdef SENTRY_NO_UIKIT +#if __has_include() # import //! Project version number for Sentry. @@ -46,4 +46,4 @@ FOUNDATION_EXPORT const unsigned char SentryVersionString[]; # import # import # import -#endif +#endif // __has_include() From 72f2ae56c50740d36737068e743d3274c3a00167 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Wed, 3 Jul 2024 10:07:07 -0800 Subject: [PATCH 19/26] fix xcframework script that fails to find the artifacts correctly after module name change --- scripts/build-xcframework.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/build-xcframework.sh b/scripts/build-xcframework.sh index d0de1884a2d..800d6ce8f53 100755 --- a/scripts/build-xcframework.sh +++ b/scripts/build-xcframework.sh @@ -13,10 +13,13 @@ generate_xcframework() { local scheme="$1" local suffix="${2:-}" local MACH_O_TYPE="${3-mh_dylib}" - local configuration="${4-Release}" + local configuration_suffix="${4-}" local createxcframework="xcodebuild -create-xcframework " local GCC_GENERATE_DEBUGGING_SYMBOLS="YES" + local resolved_configuration="Release$configuration_suffix" + local resolved_product_name="Sentry$configuration_suffix" + if [ "$MACH_O_TYPE" = "staticlib" ]; then #For static framework we disabled symbols because they are not distributed in the framework causing warnings. GCC_GENERATE_DEBUGGING_SYMBOLS="NO" @@ -27,15 +30,15 @@ generate_xcframework() { for sdk in "${sdks[@]}"; do if [[ -n "$(grep "${sdk}" <<< "$ALL_SDKS")" ]]; then - xcodebuild archive -project Sentry.xcodeproj/ -scheme "$scheme" -configuration "$configuration" -sdk "$sdk" -archivePath ./Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive CODE_SIGNING_REQUIRED=NO SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CARTHAGE=YES MACH_O_TYPE=$MACH_O_TYPE ENABLE_CODE_COVERAGE=NO GCC_GENERATE_DEBUGGING_SYMBOLS="$GCC_GENERATE_DEBUGGING_SYMBOLS" + xcodebuild archive -project Sentry.xcodeproj/ -scheme "$scheme" -configuration "$resolved_configuration" -sdk "$sdk" -archivePath ./Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive CODE_SIGNING_REQUIRED=NO SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CARTHAGE=YES MACH_O_TYPE=$MACH_O_TYPE ENABLE_CODE_COVERAGE=NO GCC_GENERATE_DEBUGGING_SYMBOLS="$GCC_GENERATE_DEBUGGING_SYMBOLS" - createxcframework+="-framework Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/Products/Library/Frameworks/${scheme}.framework " + createxcframework+="-framework Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/Products/Library/Frameworks/${resolved_product_name}.framework " if [ "$MACH_O_TYPE" = "staticlib" ]; then - local infoPlist="Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/Products/Library/Frameworks/${scheme}.framework/Info.plist" + local infoPlist="Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/Products/Library/Frameworks/${resolved_product_name}.framework/Info.plist" if [ ! -e "$infoPlist" ]; then - infoPlist="Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/Products/Library/Frameworks/${scheme}.framework/Resources/Info.plist" + infoPlist="Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/Products/Library/Frameworks/${resolved_product_name}.framework/Resources/Info.plist" fi # This workaround is necessary to make Sentry Static framework to work # More information in here: https://github.com/getsentry/sentry-cocoa/issues/3769 @@ -43,9 +46,9 @@ generate_xcframework() { plutil -replace "MinimumOSVersion" -string "100.0" "$infoPlist" fi - if [ -d "Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/dSYMs/${scheme}.framework.dSYM" ]; then + if [ -d "Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/dSYMs/${resolved_product_name}.framework.dSYM" ]; then # Has debug symbols - createxcframework+="-debug-symbols $(pwd -P)/Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/dSYMs/${scheme}.framework.dSYM " + createxcframework+="-debug-symbols $(pwd -P)/Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/dSYMs/${resolved_product_name}.framework.dSYM " fi else echo "${sdk} SDK not found" @@ -53,7 +56,7 @@ generate_xcframework() { done #Create framework for mac catalyst - xcodebuild -project Sentry.xcodeproj/ -scheme "$scheme" -configuration "$configuration" -sdk iphoneos -destination 'platform=macOS,variant=Mac Catalyst' -derivedDataPath ./Carthage/DerivedData CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES MACH_O_TYPE=$MACH_O_TYPE SUPPORTS_MACCATALYST=YES ENABLE_CODE_COVERAGE=NO GCC_GENERATE_DEBUGGING_SYMBOLS="$GCC_GENERATE_DEBUGGING_SYMBOLS" + xcodebuild -project Sentry.xcodeproj/ -scheme "$scheme" -configuration "$resolved_configuration" -sdk iphoneos -destination 'platform=macOS,variant=Mac Catalyst' -derivedDataPath ./Carthage/DerivedData CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES MACH_O_TYPE=$MACH_O_TYPE SUPPORTS_MACCATALYST=YES ENABLE_CODE_COVERAGE=NO GCC_GENERATE_DEBUGGING_SYMBOLS="$GCC_GENERATE_DEBUGGING_SYMBOLS" if [ "$MACH_O_TYPE" = "staticlib" ]; then local infoPlist="Carthage/DerivedData/Build/Products/"$configuration"-maccatalyst/${scheme}.framework/Resources/Info.plist" @@ -75,4 +78,4 @@ generate_xcframework "Sentry" "" staticlib generate_xcframework "SentrySwiftUI" -generate_xcframework "Sentry" "-WithoutUIKitOrAppKit" mh_dylib ReleaseWithoutUIKit +generate_xcframework "Sentry" "-WithoutUIKitOrAppKit" mh_dylib WithoutUIKit From d15d002e04b556c56d578c5c5d152d40e2f5cb0a Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Mon, 8 Jul 2024 13:45:59 -0800 Subject: [PATCH 20/26] also use the check for available header instead of user defined setting in Swift.h umbrella header --- Sources/Sentry/include/SentrySwift.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Sentry/include/SentrySwift.h b/Sources/Sentry/include/SentrySwift.h index f1138539bac..fbada579894 100644 --- a/Sources/Sentry/include/SentrySwift.h +++ b/Sources/Sentry/include/SentrySwift.h @@ -7,18 +7,18 @@ # endif #endif -#ifdef SENTRY_NO_UIKIT +#if __has_include() # if __has_include("SentryWithoutUIKit-Swift.h") # import "SentryWithoutUIKit-Swift.h" # else # import # endif -#else +#else // !__has_include() # if __has_include("Sentry-Swift.h") # import "Sentry-Swift.h" # else # import # endif -#endif +#endif // __has_include() #endif From 526adf5b2f5325a561465aad6c63f1bf01cfbc13 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Mon, 8 Jul 2024 14:09:53 -0800 Subject: [PATCH 21/26] fixup! also use the check for available header instead of user defined setting in Swift.h umbrella header --- Sources/Sentry/Public/Sentry.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Sentry/Public/Sentry.h b/Sources/Sentry/Public/Sentry.h index 713de13d331..1d003476e95 100644 --- a/Sources/Sentry/Public/Sentry.h +++ b/Sources/Sentry/Public/Sentry.h @@ -1,4 +1,4 @@ -#ifndef SENTRY_NO_UIKIT +#if __has_include() # import //! Project version number for Sentry. @@ -46,4 +46,4 @@ FOUNDATION_EXPORT const unsigned char SentryVersionString[]; # import # import # import -#endif +#endif // __has_include() From ea61def323aa9149a8d7147693aeca551567ffd0 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Mon, 8 Jul 2024 14:11:53 -0800 Subject: [PATCH 22/26] fixup! fixup! also use the check for available header instead of user defined setting in Swift.h umbrella header --- Sources/Sentry/Public/Sentry.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Sentry/Public/Sentry.h b/Sources/Sentry/Public/Sentry.h index 1d003476e95..4acea737c09 100644 --- a/Sources/Sentry/Public/Sentry.h +++ b/Sources/Sentry/Public/Sentry.h @@ -1,4 +1,4 @@ -#if __has_include() +#if !__has_include() # import //! Project version number for Sentry. From 8728da27b8183723e5f877a418a2518fa6784ef8 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Mon, 8 Jul 2024 16:52:21 -0800 Subject: [PATCH 23/26] some fixes for build-xcframework.sh --- scripts/build-xcframework.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/build-xcframework.sh b/scripts/build-xcframework.sh index 800d6ce8f53..fa7b2a75afd 100755 --- a/scripts/build-xcframework.sh +++ b/scripts/build-xcframework.sh @@ -32,7 +32,7 @@ generate_xcframework() { xcodebuild archive -project Sentry.xcodeproj/ -scheme "$scheme" -configuration "$resolved_configuration" -sdk "$sdk" -archivePath ./Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive CODE_SIGNING_REQUIRED=NO SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CARTHAGE=YES MACH_O_TYPE=$MACH_O_TYPE ENABLE_CODE_COVERAGE=NO GCC_GENERATE_DEBUGGING_SYMBOLS="$GCC_GENERATE_DEBUGGING_SYMBOLS" - createxcframework+="-framework Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/Products/Library/Frameworks/${resolved_product_name}.framework " + createxcframework+="-framework Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/Products/Library/Frameworks/${scheme}.framework " if [ "$MACH_O_TYPE" = "staticlib" ]; then local infoPlist="Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/Products/Library/Frameworks/${resolved_product_name}.framework/Info.plist" @@ -59,16 +59,16 @@ generate_xcframework() { xcodebuild -project Sentry.xcodeproj/ -scheme "$scheme" -configuration "$resolved_configuration" -sdk iphoneos -destination 'platform=macOS,variant=Mac Catalyst' -derivedDataPath ./Carthage/DerivedData CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES MACH_O_TYPE=$MACH_O_TYPE SUPPORTS_MACCATALYST=YES ENABLE_CODE_COVERAGE=NO GCC_GENERATE_DEBUGGING_SYMBOLS="$GCC_GENERATE_DEBUGGING_SYMBOLS" if [ "$MACH_O_TYPE" = "staticlib" ]; then - local infoPlist="Carthage/DerivedData/Build/Products/"$configuration"-maccatalyst/${scheme}.framework/Resources/Info.plist" + local infoPlist="Carthage/DerivedData/Build/Products/"$resolved_configuration"-maccatalyst/${scheme}.framework/Resources/Info.plist" plutil -replace "MinimumOSVersion" -string "100.0" "$infoPlist" fi - createxcframework+="-framework Carthage/DerivedData/Build/Products/"$configuration"-maccatalyst/${scheme}.framework " - if [ -d "Carthage/DerivedData/Build/Products/"$configuration"-maccatalyst/${scheme}.framework.dSYM" ]; then - createxcframework+="-debug-symbols $(pwd -P)/Carthage/DerivedData/Build/Products/"$configuration"-maccatalyst/${scheme}.framework.dSYM " + createxcframework+="-framework Carthage/DerivedData/Build/Products/"$resolved_configuration"-maccatalyst/${resolved_product_name}.framework " + if [ -d "Carthage/DerivedData/Build/Products/"$resolved_configuration"-maccatalyst/${resolved_product_name}.framework.dSYM" ]; then + createxcframework+="-debug-symbols $(pwd -P)/Carthage/DerivedData/Build/Products/"$resolved_configuration"-maccatalyst/${resolved_product_name}.framework.dSYM " fi - createxcframework+="-output Carthage/${scheme}${suffix}.xcframework" + createxcframework+="-output Carthage/${resolved_product_name}.xcframework" $createxcframework } From f772a63634945198e7d534a29b23d1424eecf7de Mon Sep 17 00:00:00 2001 From: Dhiogo Brustolin Date: Tue, 9 Jul 2024 09:39:05 +0200 Subject: [PATCH 24/26] Update build-xcframework.sh --- scripts/build-xcframework.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build-xcframework.sh b/scripts/build-xcframework.sh index fa7b2a75afd..8119fd228fe 100755 --- a/scripts/build-xcframework.sh +++ b/scripts/build-xcframework.sh @@ -32,7 +32,7 @@ generate_xcframework() { xcodebuild archive -project Sentry.xcodeproj/ -scheme "$scheme" -configuration "$resolved_configuration" -sdk "$sdk" -archivePath ./Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive CODE_SIGNING_REQUIRED=NO SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CARTHAGE=YES MACH_O_TYPE=$MACH_O_TYPE ENABLE_CODE_COVERAGE=NO GCC_GENERATE_DEBUGGING_SYMBOLS="$GCC_GENERATE_DEBUGGING_SYMBOLS" - createxcframework+="-framework Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/Products/Library/Frameworks/${scheme}.framework " + createxcframework+="-framework Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/Products/Library/Frameworks/${resolved_product_name}.framework " if [ "$MACH_O_TYPE" = "staticlib" ]; then local infoPlist="Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/Products/Library/Frameworks/${resolved_product_name}.framework/Info.plist" @@ -68,7 +68,7 @@ generate_xcframework() { createxcframework+="-debug-symbols $(pwd -P)/Carthage/DerivedData/Build/Products/"$resolved_configuration"-maccatalyst/${resolved_product_name}.framework.dSYM " fi - createxcframework+="-output Carthage/${resolved_product_name}.xcframework" + createxcframework+="-output Carthage/${scheme}${suffix}.xcframework" $createxcframework } From a6f125fe4843f038fb8701e9cbd959a2f2a8589b Mon Sep 17 00:00:00 2001 From: Dhiogo Brustolin Date: Tue, 9 Jul 2024 11:21:34 +0200 Subject: [PATCH 25/26] Update build-xcframework.sh --- scripts/build-xcframework.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-xcframework.sh b/scripts/build-xcframework.sh index 8119fd228fe..7c1716eb486 100755 --- a/scripts/build-xcframework.sh +++ b/scripts/build-xcframework.sh @@ -18,7 +18,7 @@ generate_xcframework() { local GCC_GENERATE_DEBUGGING_SYMBOLS="YES" local resolved_configuration="Release$configuration_suffix" - local resolved_product_name="Sentry$configuration_suffix" + local resolved_product_name="$scheme$configuration_suffix" if [ "$MACH_O_TYPE" = "staticlib" ]; then #For static framework we disabled symbols because they are not distributed in the framework causing warnings. From 9ad35dfa83c6d8737714ff46e99daf689b47e075 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Tue, 9 Jul 2024 10:06:57 -0800 Subject: [PATCH 26/26] use better test for header presence --- Sources/Sentry/Public/Sentry.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Sentry/Public/Sentry.h b/Sources/Sentry/Public/Sentry.h index 4acea737c09..7971af35a16 100644 --- a/Sources/Sentry/Public/Sentry.h +++ b/Sources/Sentry/Public/Sentry.h @@ -1,4 +1,4 @@ -#if !__has_include() +#if __has_include() # import //! Project version number for Sentry. @@ -46,4 +46,4 @@ FOUNDATION_EXPORT const unsigned char SentryVersionString[]; # import # import # import -#endif // __has_include() +#endif // __has_include()