From bde2abe1a1688c37a5ecd3692287b31094b5ed46 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Thu, 18 Dec 2025 17:38:02 +0100 Subject: [PATCH 01/17] Remove framework flattening --- modules/sentry-cocoa.SConscript | 67 --------------------------------- 1 file changed, 67 deletions(-) diff --git a/modules/sentry-cocoa.SConscript b/modules/sentry-cocoa.SConscript index 0d519571..ac0133c6 100644 --- a/modules/sentry-cocoa.SConscript +++ b/modules/sentry-cocoa.SConscript @@ -73,70 +73,6 @@ def detect_xcode(): Exit(1) -def flatten_framework(framework_path): - """Flatten macOS framework by removing symlinks and versioned structure""" - framework_path = Path(framework_path) - if not framework_path.exists(): - print(f"ERROR: Framework not found at {framework_path}") - Exit(1) - - versions_dir = framework_path / "Versions" - if not versions_dir.exists(): - # Framework doesn't need flattening. - return - - print(f"Flattening framework structure: {framework_path}") - - # 1. Remove all symlinks from the root of the framework - for item_path in framework_path.iterdir(): - if item_path.is_symlink(): - print(f" Removing symlink: {item_path.name}") - item_path.unlink() - - # 2. Move Versions/A/* to root of the framework - version_a_dir = versions_dir / "A" - if version_a_dir.exists(): - print(" Moving contents from Versions/A/ to root") - for item_path in version_a_dir.iterdir(): - dest_path = framework_path / item_path.name - - # Handle potential conflicts - if dest_path.exists(): - print(f" WARNING: {item_path.name} already exists at root, removing old version") - remove_if_exists(dest_path) - - shutil.move(str(item_path), str(dest_path)) - print(f" Moved: {item_path.name}") - else: - print(f" WARNING: Versions/A directory not found in {framework_path}") - - # 3. Remove Versions/ directory - print(" Removing Versions directory") - shutil.rmtree(versions_dir) - - # 4. Patch the binary's install name for flattened structure - binary_name = framework_path.name.replace('.framework', '') - binary_path = framework_path / binary_name - - if not binary_path.exists(): - print(f"ERROR: Framework binary not found at {binary_path}") - Exit(1) - - print(f" Patching install name for binary: {binary_name}") - install_name = f"@rpath/{binary_name}.framework/{binary_name}" - cmd = ["install_name_tool", "-id", install_name, str(binary_path)] - - try: - subprocess.run(cmd, capture_output=True, text=True, check=True) - print(f" Successfully updated install name to: {install_name}") - except subprocess.CalledProcessError as e: - print(f" WARNING: Failed to update install name: {e}") - print(f" stdout: {e.stdout}") - print(f" stderr: {e.stderr}") - - print(f"Framework flattening completed: {framework_path}") - - def update_cocoa_framework(): """Updates Sentry Cocoa to the latest version.""" project_root = Path(env.Dir("#").abspath) @@ -184,9 +120,6 @@ def update_cocoa_framework(): print(f"Extracting {zip_path}") extract_zip_with_symlinks(zip_path, cocoa_dir) - # NOTE: We need to flatten macOS slice due to issues with symlinks on Windows. - flatten_framework(cocoa_dir / "Sentry-Dynamic.xcframework" / "macos-arm64_x86_64" / "Sentry.framework") - zip_path.unlink() # delete file version_file.write_text(cocoa_version) From 1614eac202d42b55e5bbdb74d15f2a85b61a2637 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Thu, 18 Dec 2025 22:05:19 +0100 Subject: [PATCH 02/17] Remove macOS framework plist generation --- SConstruct | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/SConstruct b/SConstruct index 2a74004b..0c9411ed 100644 --- a/SConstruct +++ b/SConstruct @@ -230,17 +230,6 @@ elif platform == "macos": library = env.SharedLibrary(lib_path, source=sources) Default(library) - # Create Info.plist - plist_path = f"{out_dir}/{lib_name}.framework/Resources/Info.plist" - plist = env.FrameworkPlist(File(plist_path), File("SConstruct"), - bundle_executable=lib_name, - bundle_identifier=f"io.sentry.SentryForGodot.{build_type}", - bundle_version=VERSION, - bundle_platforms=["MacOSX"] - ) - Depends(plist, library) - Default(plist) - else: # *** Build shared library on other platforms. From 198621f27c3c41f8be84d9efb25ae348a3e39b04 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Thu, 18 Dec 2025 22:05:53 +0100 Subject: [PATCH 03/17] Change macOS library format from framework to dylib --- SConstruct | 4 ++-- src/manifest.gdextension | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SConstruct b/SConstruct index 0c9411ed..905d726c 100644 --- a/SConstruct +++ b/SConstruct @@ -224,8 +224,8 @@ if platform == "ios": elif platform == "macos": # *** Build macOS shared library. - lib_name = f"libsentry.{platform}.{build_type}{extra}" - lib_path = f"{out_dir}/{lib_name}.framework/{lib_name}" + lib_name = f"libsentry.{platform}.{build_type}{extra}.dylib" + lib_path = f"{out_dir}/{lib_name}" library = env.SharedLibrary(lib_path, source=sources) Default(library) diff --git a/src/manifest.gdextension b/src/manifest.gdextension index 0ea5fa82..e6cae62c 100644 --- a/src/manifest.gdextension +++ b/src/manifest.gdextension @@ -5,8 +5,8 @@ compatibility_minimum = "{compatibility_minimum}" [libraries] -macos.debug = "res://addons/sentry/bin/macos/libsentry.macos.debug.framework" -macos.release = "res://addons/sentry/bin/macos/libsentry.macos.release.framework" +macos.debug = "res://addons/sentry/bin/macos/libsentry.macos.debug.dylib" +macos.release = "res://addons/sentry/bin/macos/libsentry.macos.release.dylib" windows.debug.x86_64 = "res://addons/sentry/bin/windows/x86_64/libsentry.windows.debug.x86_64.dll" windows.release.x86_64 = "res://addons/sentry/bin/windows/x86_64/libsentry.windows.release.x86_64.dll" From 279ecec420dfe229310ca7de88990aba382d5d90 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Thu, 18 Dec 2025 22:06:23 +0100 Subject: [PATCH 04/17] Remove lingering deprecated option value from config --- project/project.godot | 1 - 1 file changed, 1 deletion(-) diff --git a/project/project.godot b/project/project.godot index b51ea54e..07d82ffe 100644 --- a/project/project.godot +++ b/project/project.godot @@ -57,4 +57,3 @@ options/dsn="https://3f1e095cf2e14598a0bd5b4ff324f712@o447951.ingest.us.sentry.i options/attach_scene_tree=true logger/include_variables=true experimental/attach_screenshot=true -experimental/enable_logs=true From 122065ed4a68c72f889fabbb1a5ae507f13afd11 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Thu, 18 Dec 2025 22:16:39 +0100 Subject: [PATCH 05/17] Convert macOS Cocoa framework to dylib on build --- modules/sentry-cocoa.SConscript | 92 ++++++++++++++++++++++++------- src/manifest.gdextension | 4 +- src/sentry/cocoa/cocoa_includes.h | 5 +- src/sentry/cocoa/cocoa_sdk.mm | 2 - 4 files changed, 78 insertions(+), 25 deletions(-) diff --git a/modules/sentry-cocoa.SConscript b/modules/sentry-cocoa.SConscript index ac0133c6..5ab99a35 100644 --- a/modules/sentry-cocoa.SConscript +++ b/modules/sentry-cocoa.SConscript @@ -129,6 +129,29 @@ def update_cocoa_framework(): print(f"ERROR: Failed to download Sentry framework: {e}.") Exit(1) + # Prepare headers + print("Preparing headers for macOS...") + headers_dest = cocoa_dir / "macos_include" / "Sentry" + headers_dest.mkdir(parents=True, exist_ok=True) + macos_framework = cocoa_dir / "Sentry-Dynamic.xcframework" / "macos-arm64_x86_64" / "Sentry.framework" + + if macos_framework.exists(): + # Copy Headers + headers_source = macos_framework / "Headers" + if headers_source.exists(): + for header_file in headers_source.glob("*.h"): + shutil.copy2(header_file, headers_dest) + print(f" Copied {len(list(headers_source.glob('*.h')))} headers from {headers_source}") + + # Copy PrivateHeaders + private_headers_source = macos_framework / "PrivateHeaders" + if private_headers_source.exists(): + for header_file in private_headers_source.glob("*.h"): + shutil.copy2(header_file, headers_dest) + print(f" Copied {len(list(private_headers_source.glob('*.h')))} private headers from {private_headers_source}") + else: + print(f"WARNING: macOS framework not found at {macos_framework}") + update_cocoa_framework() @@ -157,29 +180,38 @@ if platform in ["macos", "ios"]: if platform == "macos": framework_dir = xcframework_path / "macos-arm64_x86_64/Sentry.framework" + env.Append( + CPPPATH=f"{project_root}/modules/sentry-cocoa/macos_include/", + LIBPATH=f"{project_root}/project/addons/sentry/bin/macos/", + LIBS=["Sentry"], + LINKFLAGS=[ + # Load libSentry.dylib from same dir as GDExtension. + "-Wl,-rpath,@loader_path/" + ] + ) else: if ios_simulator: framework_dir = xcframework_path / "ios-arm64_x86_64-simulator/Sentry.framework" else: framework_dir = xcframework_path / "ios-arm64/Sentry.framework" - if not framework_dir.exists(): - print(f"ERROR: Sentry.framework is missing at {framework_dir}.") - Exit(1) + if not framework_dir.exists(): + print(f"ERROR: iOS framework slice is missing at {framework_dir}.") + Exit(1) - framework_container_dir = framework_dir.parent.absolute() + framework_container_dir = framework_dir.parent.absolute() - env.Append( - CPPFLAGS=["-F" + str(framework_container_dir)], - LINKFLAGS=[ - "-framework", "Sentry", - "-F" + str(framework_container_dir), - # Allow extension to find framework in addons/sentry/ directory. - "-Wl,-rpath,@loader_path/..", - ] - ) + env.Append( + CPPFLAGS=["-F" + str(framework_container_dir)], + LINKFLAGS=[ + "-framework", "Sentry", + "-F" + str(framework_container_dir), + # Allow extension to find framework in addons/sentry/ directory. + "-Wl,-rpath,@loader_path/..", + ] + ) - print(f"Added {platform} Sentry dynamic framework: {framework_dir}") + print(f"Added {platform} Sentry dynamic framework: {framework_dir}") # *** Export pseudo-builders to create xcframeworks @@ -335,14 +367,34 @@ def DeploySentryCocoa(self, target_dir): elif platform == "macos": source_framework = source_xcframework / "macos-arm64_x86_64/Sentry.framework" - target_framework = target_dir_path / "Sentry.framework" - # Copy only the binary and "Resources" dir -- we don't need to export headers or modules. + # Patch install name after copy + def patch_install_name_action(target, source, env): + lib_path_str = str(target[0]) + print(f" Patching install name for binary: {lib_name}") + try: + new_rpath = "@rpath/libSentry.dylib" + cmd = ["install_name_tool", "-id", new_rpath, lib_path_str] + subprocess.run(cmd, capture_output=True, text=True, check=True) + print(f" Successfully updated install name to: {new_rpath}") + except subprocess.CalledProcessError as e: + print(f" WARNING: Failed to update install name: {e}") + print(f" stdout: {e.stdout}") + print(f" stderr: {e.stderr}") + return 0 + + # Copy the framework binary as dylib, and patch install name. + lib_name = "libSentry.dylib" + lib_path = target_dir_path / lib_name commands.append( - env.Copy(File(target_framework / "Sentry"), File(source_framework / "Sentry")) - ) - commands.append( - env.Copy(Dir(target_framework / "Resources"), Dir(source_framework / "Resources")) + env.Command( + File(lib_path), + File(source_framework / "Versions/A/Sentry"), + [ + Copy("$TARGET", "$SOURCE"), + patch_install_name_action + ] + ) ) # Debug symbols diff --git a/src/manifest.gdextension b/src/manifest.gdextension index e6cae62c..08466f7a 100644 --- a/src/manifest.gdextension +++ b/src/manifest.gdextension @@ -61,11 +61,11 @@ windows.x86_32 = { } macos.debug = { - "res://addons/sentry/bin/macos/Sentry.framework" : "" + "res://addons/sentry/bin/macos/libSentry.dylib" : "" } macos.release = { - "res://addons/sentry/bin/macos/Sentry.framework" : "" + "res://addons/sentry/bin/macos/libSentry.dylib" : "" } ios.debug = { diff --git a/src/sentry/cocoa/cocoa_includes.h b/src/sentry/cocoa/cocoa_includes.h index 8a36bb9e..fd4956e8 100644 --- a/src/sentry/cocoa/cocoa_includes.h +++ b/src/sentry/cocoa/cocoa_includes.h @@ -4,10 +4,13 @@ #ifdef __OBJC__ #import + +#import +#import + #ifdef IOS_ENABLED #import #endif -#import namespace objc { diff --git a/src/sentry/cocoa/cocoa_sdk.mm b/src/sentry/cocoa/cocoa_sdk.mm index 49e998e9..0d773e4e 100644 --- a/src/sentry/cocoa/cocoa_sdk.mm +++ b/src/sentry/cocoa/cocoa_sdk.mm @@ -16,8 +16,6 @@ #include #include -#import - using namespace godot; namespace { From ff7af774f9ea3f5aa4afedb202f635082c52ba80 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Thu, 18 Dec 2025 22:18:06 +0100 Subject: [PATCH 06/17] Move comment into function docstring --- modules/sentry-cocoa.SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/sentry-cocoa.SConscript b/modules/sentry-cocoa.SConscript index 5ab99a35..2e38cb67 100644 --- a/modules/sentry-cocoa.SConscript +++ b/modules/sentry-cocoa.SConscript @@ -368,8 +368,8 @@ def DeploySentryCocoa(self, target_dir): elif platform == "macos": source_framework = source_xcframework / "macos-arm64_x86_64/Sentry.framework" - # Patch install name after copy def patch_install_name_action(target, source, env): + """Patch install name after copy""" lib_path_str = str(target[0]) print(f" Patching install name for binary: {lib_name}") try: From e174c85c1867a8b242535d1acee850788b5a0f52 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Thu, 18 Dec 2025 22:38:04 +0100 Subject: [PATCH 07/17] Fix headers import order --- src/sentry/cocoa/cocoa_includes.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sentry/cocoa/cocoa_includes.h b/src/sentry/cocoa/cocoa_includes.h index fd4956e8..a0f939c7 100644 --- a/src/sentry/cocoa/cocoa_includes.h +++ b/src/sentry/cocoa/cocoa_includes.h @@ -5,13 +5,13 @@ #import -#import -#import - #ifdef IOS_ENABLED #import #endif +#import +#import + namespace objc { // Type aliases for Cocoa SDK types to avoid naming conflicts From f59ff7a5954c90ce69fb524e5058ae0b9dadacc2 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Thu, 18 Dec 2025 23:03:21 +0100 Subject: [PATCH 08/17] Undo changes in headers --- src/sentry/cocoa/cocoa_includes.h | 3 --- src/sentry/cocoa/cocoa_sdk.mm | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sentry/cocoa/cocoa_includes.h b/src/sentry/cocoa/cocoa_includes.h index a0f939c7..8a36bb9e 100644 --- a/src/sentry/cocoa/cocoa_includes.h +++ b/src/sentry/cocoa/cocoa_includes.h @@ -4,12 +4,9 @@ #ifdef __OBJC__ #import - #ifdef IOS_ENABLED #import #endif - -#import #import namespace objc { diff --git a/src/sentry/cocoa/cocoa_sdk.mm b/src/sentry/cocoa/cocoa_sdk.mm index 0d773e4e..49e998e9 100644 --- a/src/sentry/cocoa/cocoa_sdk.mm +++ b/src/sentry/cocoa/cocoa_sdk.mm @@ -16,6 +16,8 @@ #include #include +#import + using namespace godot; namespace { From 7eb3bbbe961e7074df76e57c0d46553e2d19fa4b Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Thu, 18 Dec 2025 23:12:32 +0100 Subject: [PATCH 09/17] GHA: Notarize macOS dylibs --- .github/workflows/package.yml | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index e65f1a82..84972568 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -20,7 +20,8 @@ jobs: env: APPLE_CERT_PATH: /tmp/certs.p12 APPLE_API_KEY_PATH: /tmp/apple_key.json - DO_CODESIGN: ${{ startsWith(github.ref, 'refs/heads/release/') && '1' || '0' }} + # DO_CODESIGN: ${{ startsWith(github.ref, 'refs/heads/release/') && '1' || '0' }} + DO_CODESIGN: 1 steps: - name: Checkout repo @@ -63,36 +64,24 @@ jobs: run: | rcodesign sign --for-notarization \ --p12-file ${{ env.APPLE_CERT_PATH }} --p12-password ${{ secrets.APPLE_CERT_PASSWORD }} \ - artifact/addons/sentry/bin/macos/libsentry.macos.debug.framework + artifact/addons/sentry/bin/macos/libsentry.macos.debug.dylib rcodesign sign --for-notarization \ --p12-file ${{ env.APPLE_CERT_PATH }} --p12-password ${{ secrets.APPLE_CERT_PASSWORD }} \ - artifact/addons/sentry/bin/macos/libsentry.macos.release.framework + artifact/addons/sentry/bin/macos/libsentry.macos.release.dylib rcodesign sign --for-notarization \ --p12-file ${{ env.APPLE_CERT_PATH }} --p12-password ${{ secrets.APPLE_CERT_PASSWORD }} \ - artifact/addons/sentry/bin/macos/Sentry.framework + artifact/addons/sentry/bin/macos/libSentry.dylib - name: Notarize macOS binaries if: env.DO_CODESIGN == '1' run: | cd artifact/addons/sentry/bin/macos/ - zip -r libsentry.macos.debug.zip libsentry.macos.debug.framework + zip -r sentry-godot-dylibs.zip libsentry.macos.debug.dylib libsentry.macos.release.dylib libSentry.dylib rcodesign notary-submit --wait \ --api-key-file ${{ env.APPLE_API_KEY_PATH }} \ - libsentry.macos.debug.zip - rm libsentry.macos.debug.zip - - zip -r libsentry.macos.release.zip libsentry.macos.release.framework - rcodesign notary-submit --wait \ - --api-key-file ${{ env.APPLE_API_KEY_PATH }} \ - libsentry.macos.release.zip - rm libsentry.macos.release.zip - - zip -r Sentry.framework.zip Sentry.framework - rcodesign notary-submit --wait \ - --api-key-file ${{ env.APPLE_API_KEY_PATH }} \ - Sentry.framework.zip - rm Sentry.framework.zip + sentry-godot-dylibs.zip + rm sentry-godot-dylibs.zip - name: Prepare artifact shell: bash From cb8ae348f2d56cacd00e155bd7b9d7d2f9046dad Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Thu, 18 Dec 2025 23:13:48 +0100 Subject: [PATCH 10/17] Remove plist tool from site_scons --- site_scons/site_tools/plist.py | 60 ---------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 site_scons/site_tools/plist.py diff --git a/site_scons/site_tools/plist.py b/site_scons/site_tools/plist.py deleted file mode 100644 index a6a305e7..00000000 --- a/site_scons/site_tools/plist.py +++ /dev/null @@ -1,60 +0,0 @@ -""" -Tool to generate Info.plist. -""" - -import os -from SCons.Script import Builder, Action - - -def generate_framework_plist(target, source, env): - bundle_executable = env.get("bundle_executable", "MyFramework") - bundle_identifier = env.get("bundle_identifier", "com.example.MyFramework") - bundle_name = env.get("bundle_name", bundle_executable) - bundle_version_string = env.get("bundle_version", "1.0") - bundle_version = bundle_version_string.split("-", 1)[0] - bundle_platforms = env.get("bundle_platforms", ["MacOSX"]) - bundle_package_type = env.get("bundle_package_type", "FMWK") # FMWK or BNDL - bundle_min_system = env.get("bundle_min_system", env.get("macos_deployment_target", "10.13")) - - platforms_content = "\n".join(f" {p}" for p in bundle_platforms) - - content = f""" - - - - CFBundleExecutable - {bundle_executable} - CFBundleIdentifier - {bundle_identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - {bundle_name} - CFBundlePackageType - {bundle_package_type} - CFBundleShortVersionString - {bundle_version_string} - CFBundleSupportedPlatforms - -{platforms_content} - - CFBundleVersion - {bundle_version} - LSMinimumSystemVersion - {bundle_min_system} - -""" - - with open(str(target[0]), "w") as f: - f.write(content) - - return None - - -def generate(env): - plist_builder = Builder(action=Action(generate_framework_plist, cmdstr="Generating Info.plist for $TARGET")) - env.Append(BUILDERS={"FrameworkPlist": plist_builder}) - - -def exists(env): - return True From 5f17648d55e03040519547121f6f4e675a559692 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Fri, 19 Dec 2025 00:02:36 +0100 Subject: [PATCH 11/17] Remove unused plist tool registration --- SConstruct | 1 - 1 file changed, 1 deletion(-) diff --git a/SConstruct b/SConstruct index 905d726c..52ebb25e 100644 --- a/SConstruct +++ b/SConstruct @@ -80,7 +80,6 @@ arch = env["arch"] # Register tools env.Tool("copy") env.Tool("separate_debug_symbols") -env.Tool("plist") # Restore original ARGUMENTS and add custom options to environment ARGUMENTS.clear() From b165bab86539dbcf5442ada8c184aacb42288acc Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Fri, 19 Dec 2025 10:36:03 +0100 Subject: [PATCH 12/17] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d228cf7..a20eb92f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Improvements + +- Switched from shipping frameworks to dylibs on macOS to avoid Windows symlink issues and prevent TestFlight rejections caused by malformed framework bundles ([#468](https://github.com/getsentry/sentry-godot/pull/468)) + ### Dependencies - Bump Sentry Android from v8.28.0 to v8.29.0 ([#465](https://github.com/getsentry/sentry-godot/pull/465)) From 55db8227fe76e8ef41703fd13cae82f066c9ace7 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Fri, 19 Dec 2025 11:17:31 +0100 Subject: [PATCH 13/17] Add dependency on Sentry Cocoa deployment --- SConstruct | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index 52ebb25e..a89922d3 100644 --- a/SConstruct +++ b/SConstruct @@ -148,8 +148,8 @@ if internal_sdk == SDK.COCOA: env = SConscript("modules/sentry-cocoa.SConscript", exports=["env"]) # Deploy Sentry Cocoa dependency to project directory. - deploy_cocoa_xcframework = env.DeploySentryCocoa(out_dir) - Default(deploy_cocoa_xcframework) + deploy_cocoa = env.DeploySentryCocoa(out_dir) + Default(deploy_cocoa) # *** Build GDExtension library. @@ -203,6 +203,7 @@ if platform == "ios": lib_path = f"{temp_dir}/{lib_name}.dylib" library = env.SharedLibrary(lib_path, source=sources) + Depends(library, deploy_cocoa) Default(library) # Generate XCFramework for iOS GDExtension libs if requested @@ -227,6 +228,7 @@ elif platform == "macos": lib_path = f"{out_dir}/{lib_name}" library = env.SharedLibrary(lib_path, source=sources) + Depends(library, deploy_cocoa) Default(library) else: From 3854e192bd563fa77431c6f159da342bbda27f1a Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Fri, 19 Dec 2025 11:28:12 +0100 Subject: [PATCH 14/17] Fix dSYM names --- SConstruct | 12 ++++++------ modules/sentry-cocoa.SConscript | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/SConstruct b/SConstruct index a89922d3..acc2ea4e 100644 --- a/SConstruct +++ b/SConstruct @@ -199,8 +199,8 @@ if platform == "ios": extra += ".simulator" temp_dir = "project/addons/sentry/bin/ios/temp" - lib_name = f"libsentry.{platform}.{build_type}.{arch}{extra}" - lib_path = f"{temp_dir}/{lib_name}.dylib" + lib_name = f"libsentry.{platform}.{build_type}.{arch}{extra}.dylib" + lib_path = f"{temp_dir}/{lib_name}" library = env.SharedLibrary(lib_path, source=sources) Depends(library, deploy_cocoa) @@ -238,8 +238,8 @@ else: if env["threads"] is False: extra += ".nothreads" - lib_name = f"libsentry.{platform}.{build_type}.{arch}{extra}" - lib_path = f"{out_dir}/{lib_name}{shlib_suffix}" + lib_name = f"libsentry.{platform}.{build_type}.{arch}{extra}{shlib_suffix}" + lib_path = f"{out_dir}/{lib_name}" library = env.SharedLibrary(lib_path, source=sources) Default(library) @@ -250,10 +250,10 @@ else: if env["debug_symbols"] and env["separate_debug_symbols"]: # Note: Windows/MSVC separates by default. if platform in ["macos", "ios"]: - dsym_path = f"{out_dir}/dSYMs/{lib_name}.framework.dSYM" + dsym_path = f"{out_dir}/dSYMs/{lib_name}.dSYM" env.SeparateDebugSymbols(Dir(dsym_path), library) elif platform in ["linux", "android"]: - symbols_path = f"{lib_path}.debug" + symbols_path = f"{out_dir}/{lib_name}.debug" env.SeparateDebugSymbols(File(symbols_path), library) diff --git a/modules/sentry-cocoa.SConscript b/modules/sentry-cocoa.SConscript index 2e38cb67..989e3353 100644 --- a/modules/sentry-cocoa.SConscript +++ b/modules/sentry-cocoa.SConscript @@ -400,7 +400,7 @@ def DeploySentryCocoa(self, target_dir): # Debug symbols commands.append( env.Copy( - Dir(target_dir_path / "dSYMs" / "Sentry.framework.dSYM"), + Dir(target_dir_path / "dSYMs" / "libSentry.dylib.dSYM"), Dir(source_xcframework / "macos-arm64_x86_64" / "dSYMs" / "Sentry.framework.dSYM") ) ) From 3bc2af12d986aebf7621974b203bd2343df0eb0b Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Fri, 19 Dec 2025 11:31:55 +0100 Subject: [PATCH 15/17] Check for both framework and headers in Cocoa update --- modules/sentry-cocoa.SConscript | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/sentry-cocoa.SConscript b/modules/sentry-cocoa.SConscript index 989e3353..27a37e3d 100644 --- a/modules/sentry-cocoa.SConscript +++ b/modules/sentry-cocoa.SConscript @@ -96,7 +96,8 @@ def update_cocoa_framework(): if stored_version == cocoa_version: # Check if framework actually exists xcframework_path = cocoa_dir / "Sentry-Dynamic.xcframework" - if xcframework_path.exists(): + headers_path = cocoa_dir / "macos_include" / "Sentry" + if xcframework_path.exists() and headers_path.exists(): should_download = False print(f"Detected Sentry Cocoa SDK v{cocoa_version} – up-to-date!") except: From 587555d3bc96d192870f5331b954ddb0e84ca714 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Mon, 22 Dec 2025 14:02:20 +0100 Subject: [PATCH 16/17] Restore code sign flag --- .github/workflows/package.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 84972568..179acf8d 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -20,8 +20,7 @@ jobs: env: APPLE_CERT_PATH: /tmp/certs.p12 APPLE_API_KEY_PATH: /tmp/apple_key.json - # DO_CODESIGN: ${{ startsWith(github.ref, 'refs/heads/release/') && '1' || '0' }} - DO_CODESIGN: 1 + DO_CODESIGN: ${{ startsWith(github.ref, 'refs/heads/release/') && '1' || '0' }} steps: - name: Checkout repo From 970f545831bc85826700c99118a2f2555744c74f Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Mon, 22 Dec 2025 14:13:01 +0100 Subject: [PATCH 17/17] Return error code when install name update fails --- modules/sentry-cocoa.SConscript | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/sentry-cocoa.SConscript b/modules/sentry-cocoa.SConscript index 27a37e3d..f3d5169d 100644 --- a/modules/sentry-cocoa.SConscript +++ b/modules/sentry-cocoa.SConscript @@ -382,6 +382,7 @@ def DeploySentryCocoa(self, target_dir): print(f" WARNING: Failed to update install name: {e}") print(f" stdout: {e.stdout}") print(f" stderr: {e.stderr}") + return 1 return 0 # Copy the framework binary as dylib, and patch install name.