Skip to content

Commit ca5fb4d

Browse files
committed
refactor: remove @sendable to fix Linux runtime issue
Remove the @sendable attribute from the operation in withBatchContext to resolve a Swift runtime crash on Linux caused by deeply nested @sendable closures. The change aims to simplify the execution context setup without affecting the original functionality.
1 parent 019743f commit ca5fb4d

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

Sources/ExFig/Subcommands/Batch.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -487,14 +487,12 @@ extension ExFigCommand {
487487

488488
/// Wraps execution with TaskLocal context for pre-fetched data and shared granular cache.
489489
///
490-
/// Uses explicit switch-case instead of nested helper closures to avoid Swift runtime crash
491-
/// on Linux with deeply nested @Sendable closures.
492-
/// See: https://github.com/swiftlang/swift/issues/75501
493-
private func withBatchContext<T: Sendable>(
490+
/// Wraps execution with TaskLocal context for pre-fetched data and shared granular cache.
491+
private func withBatchContext<T>(
494492
preFetchedVersions: PreFetchedFileVersions?,
495493
preFetchedComponents: PreFetchedComponents?,
496494
sharedGranularCache: SharedGranularCache?,
497-
operation: @Sendable () async -> T
495+
operation: () async -> T
498496
) async -> T {
499497
switch (preFetchedVersions, preFetchedComponents, sharedGranularCache) {
500498
// All three contexts

0 commit comments

Comments
 (0)