Fix iOS 13-14 crash concurrency-dylib.patch

This commit is contained in:
Kylmakalle 2025-05-21 18:01:15 +03:00
parent f3570387ff
commit 7cd957152e
2 changed files with 31 additions and 0 deletions

View File

@ -14,6 +14,12 @@
# fi
# done
# concurrency-dylib.patch must be applied in build-system/bazel-rules/rules_apple
# cd Swiftgram/FixConcurrencyBackport
# git apply ../../../Swiftgram/FixConcurrencyBackport/concurrency-dylib.patch
# # Make a build
# git apply -R ../../../Swiftgram/FixConcurrencyBackport/concurrency-dylib.patch
# Refs:
# https://stackoverflow.com/questions/79522371/when-building-the-project-with-xcode-16-2-the-app-crashes-due-to-an-incorrect-l
# https://github.com/swiftlang/swift/issues/74303

View File

@ -0,0 +1,25 @@
diff --git a/tools/swift_stdlib_tool/swift_stdlib_tool.py b/tools/swift_stdlib_tool/swift_stdlib_tool.py
index fbb7f4fb..5a2277c5 100644
--- a/tools/swift_stdlib_tool/swift_stdlib_tool.py
+++ b/tools/swift_stdlib_tool/swift_stdlib_tool.py
@@ -134,6 +134,20 @@ def _copy_swift_stdlibs(binaries_to_scan, sdk_platform, destination_path):
if os.path.exists(libswiftcore_path):
os.remove(libswiftcore_path)
+ # MARK: Swiftgram
+ if sdk_platform == "iphoneos":
+ # Copy the concurrency runtime to the destination path.
+ _, stdout, stderr = execute.execute_and_filter_output(
+ [
+ "ditto",
+ f"{developer_dir}/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.5/iphoneos/libswift_Concurrency.dylib",
+ os.path.join(destination_path, "libswift_Concurrency.dylib")
+ ], raise_on_failure=True)
+ if stderr:
+ print(stderr)
+ if stdout:
+ print(stdout)
+
def _lipo_exec_files(exec_files, target_archs, strip_bitcode, source_path,
destination_path):