diff --git a/build-system/Make/Make.py b/build-system/Make/Make.py index 94fd2921ec..971c8c2d80 100644 --- a/build-system/Make/Make.py +++ b/build-system/Make/Make.py @@ -100,13 +100,14 @@ class BazelCommandLine: # https://github.com/bazelbuild/rules_swift # Use -Osize instead of -O when building swift modules. - #'--features=swift.opt_uses_osize', + '--features=swift.opt_uses_osize', # --num-threads 0 forces swiftc to generate one object file per module; it: # 1. resolves issues with the linker caused by the swift-objc mixing. # 2. makes the resulting binaries significantly smaller (up to 9% for this project). - '--swiftcopt=-num-threads', '--swiftcopt=1', + #'--swiftcopt=-num-threads', '--swiftcopt=1', '--swiftcopt=-j1', + '--features=swift._num_threads_0_in_swiftcopts', # Strip unsused code. '--features=dead_strip', diff --git a/build-system/bazel-rules/rules_swift b/build-system/bazel-rules/rules_swift index 25bc63e827..86dc0f0462 160000 --- a/build-system/bazel-rules/rules_swift +++ b/build-system/bazel-rules/rules_swift @@ -1 +1 @@ -Subproject commit 25bc63e827951bd67376cd0f811a29d0c3924009 +Subproject commit 86dc0f046269b3001f6f20cec38342c03120a209 diff --git a/submodules/Camera/Sources/VideoRecorder.swift b/submodules/Camera/Sources/VideoRecorder.swift index f205d95c72..acfc8ef8c9 100644 --- a/submodules/Camera/Sources/VideoRecorder.swift +++ b/submodules/Camera/Sources/VideoRecorder.swift @@ -123,7 +123,9 @@ private final class VideoRecorderImpl { private var previousAppendTime: Double? public func appendVideoSampleBuffer(_ sampleBuffer: CMSampleBuffer) { + #if canImport(SwiftData) // Xcode 16 nonisolated(unsafe) let sampleBuffer = sampleBuffer + #endif self.queue.async { guard self.hasError() == nil && !self.stopped else { @@ -248,7 +250,9 @@ private final class VideoRecorderImpl { } public func appendAudioSampleBuffer(_ sampleBuffer: CMSampleBuffer) { + #if canImport(SwiftData) // Xcode 16 nonisolated(unsafe) let sampleBuffer = sampleBuffer + #endif self.queue.async { guard self.hasError() == nil && !self.stopped else { diff --git a/submodules/StatisticsUI/Sources/ChannelStatsController.swift b/submodules/StatisticsUI/Sources/ChannelStatsController.swift index 8380bb77fb..1d4d97a683 100644 --- a/submodules/StatisticsUI/Sources/ChannelStatsController.swift +++ b/submodules/StatisticsUI/Sources/ChannelStatsController.swift @@ -2500,7 +2500,11 @@ public func channelStatsController(context: AccountContext, updatedPresentationD })) } var tooltipScreen: UndoOverlayController? + #if canImport(SwiftData) // Xcode 16 nonisolated(unsafe) var timer: Foundation.Timer? + #else + var timer: Foundation.Timer? + #endif showTimeoutTooltipImpl = { cooldownUntilTimestamp in let remainingCooldownSeconds = cooldownUntilTimestamp - Int32(Date().timeIntervalSince1970) diff --git a/submodules/TelegramUI/Components/Chat/ChatQrCodeScreen/Sources/ChatQrCodeScreen.swift b/submodules/TelegramUI/Components/Chat/ChatQrCodeScreen/Sources/ChatQrCodeScreen.swift index ced42108a1..a1d219eb7e 100644 --- a/submodules/TelegramUI/Components/Chat/ChatQrCodeScreen/Sources/ChatQrCodeScreen.swift +++ b/submodules/TelegramUI/Components/Chat/ChatQrCodeScreen/Sources/ChatQrCodeScreen.swift @@ -2481,7 +2481,11 @@ private func renderVideo(context: AccountContext, backgroundImage: UIImage, user completion(nil) return } + #if canImport(SwiftData) // Xcode 16 nonisolated(unsafe) let export = exportValue + #else + let export = exportValue + #endif let videoName = UUID().uuidString let exportURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(videoName).appendingPathExtension("mp4")