From 1350fc968ec2915458acc59485c379c8dbfbb5a7 Mon Sep 17 00:00:00 2001 From: Coen ten Thije Boonkkamp Date: Mon, 17 Aug 2026 10:30:21 +0200 Subject: [PATCH] Locate the lock helper by build layout and clear the style residue The macOS leg builds through Swift Build, which writes products to .build/out/Products/Debug rather than the SwiftPM-native .build//debug the Kernel.Lock integration suite hard-coded, so every contention test failed to spawn the helper. Probe each known product directory instead of one layout. Also apply the central swift-format rule set and replace the six force tries in the completion tests with throwing test functions. --- .../Kernel.Completion+IOUring.swift | 3 +- .../Kernel.Completion.Driver.swift | 4 +- .../Kernel Event/Kernel.Event.Driver.swift | 59 +++++++++++--- .../Kernel.Event.Source+Epoll.swift | 41 ++++++++-- .../Kernel.Event.Source+Kqueue.swift | 44 +++++++++-- .../Kernel.File.Clone+CrossPlatform.swift | 12 ++- .../Kernel.File.Direct.Capability.swift | 8 -- .../Kernel Thread/Kernel.Thread.trap.swift | 8 +- .../Kernel.Completion.Driver Tests.swift | 8 +- ...Completion.IOUring.Integration Tests.swift | 6 +- .../Kernel.Completion.Lifecycle Tests.swift | 12 +-- .../Kernel.Copy.Clone Tests.swift | 3 +- .../Kernel.Event.Source Tests.swift | 8 +- .../Kernel Tests/Kernel.File.Copy Tests.swift | 27 +++++-- ...rnel.File.Direct.Error.Syscall Tests.swift | 10 ++- ...ernel.File.Direct.Requirements Tests.swift | 6 +- ...ile.Direct.Requirements.Reason Tests.swift | 3 +- .../Kernel.File.Flush Tests.swift | 4 +- .../Kernel.Lock.Integration Tests.swift | 79 ++++++++++++++----- .../Kernel.Path.String Tests.swift | 3 +- Tests/Kernel Tests/Kernel.Random Tests.swift | 4 +- 21 files changed, 263 insertions(+), 89 deletions(-) diff --git a/Sources/Kernel Completion/Kernel.Completion+IOUring.swift b/Sources/Kernel Completion/Kernel.Completion+IOUring.swift index b5c74f1..2ca3b17 100644 --- a/Sources/Kernel Completion/Kernel.Completion+IOUring.swift +++ b/Sources/Kernel Completion/Kernel.Completion+IOUring.swift @@ -403,7 +403,8 @@ // Each closure is a one-line delegation to State. let driver = Driver( - submit: { (submission: Submission, target: borrowing Kernel.Descriptor) throws(Error) in + submit: { + (submission: Submission, target: borrowing Kernel.Descriptor) throws(Error) in try state.enqueue(submission, target: target) }, flush: { () throws(Error) -> Submission.Count in diff --git a/Sources/Kernel Completion/Kernel.Completion.Driver.swift b/Sources/Kernel Completion/Kernel.Completion.Driver.swift index b1e8b87..f7a164a 100644 --- a/Sources/Kernel Completion/Kernel.Completion.Driver.swift +++ b/Sources/Kernel Completion/Kernel.Completion.Driver.swift @@ -108,7 +108,9 @@ extension Kernel.Completion { // MARK: - Init public init( - submit: @escaping (Kernel.Completion.Submission, borrowing Kernel.Descriptor) throws(Kernel.Completion.Error) -> Void, + submit: + @escaping (Kernel.Completion.Submission, borrowing Kernel.Descriptor) throws(Kernel + .Completion.Error) -> Void, flush: @escaping () throws(Kernel.Completion.Error) -> Submission.Count, drain: @escaping ((Kernel.Completion.Event) -> Void) -> Event.Count, close: @escaping () -> Void, diff --git a/Sources/Kernel Event/Kernel.Event.Driver.swift b/Sources/Kernel Event/Kernel.Event.Driver.swift index c4b6d46..3bb9a94 100644 --- a/Sources/Kernel Event/Kernel.Event.Driver.swift +++ b/Sources/Kernel Event/Kernel.Event.Driver.swift @@ -45,7 +45,9 @@ /// Takes consuming ownership of the descriptor. On success, the /// registration owns the descriptor (closed on deregister/drain). /// On failure, the descriptor is dropped — deinit closes it. - package let _register: (consuming Kernel.Descriptor, Kernel.Event.Interest) throws(Error) -> Kernel.Event.ID + package let _register: + (consuming Kernel.Descriptor, Kernel.Event.Interest) throws(Error) -> + Kernel.Event.ID /// Updates the registration's configured interest set. /// @@ -70,7 +72,8 @@ /// `events` and returns the number written. Backend translation may /// discard backend-local wakeup artifacts; driver filtering may /// discard stale registrations. - package let _poll: (Clock.Continuous.Deadline?, inout [Kernel.Event]) throws(Error) -> Int + package let _poll: + (Clock.Continuous.Deadline?, inout [Kernel.Event]) throws(Error) -> Int /// Drains the registry and cleans up backend resources. package let _close: () -> Void @@ -101,11 +104,30 @@ /// native timeout format (clock access is platform-specific). /// - close: Clean up backend resources. Called after the registry is drained. public init( - add: @escaping (_ fd: borrowing Kernel.Descriptor, _ id: Kernel.Event.ID, _ interest: Kernel.Event.Interest) throws(Error) -> Void, - modify: @escaping (_ fd: borrowing Kernel.Descriptor, _ id: Kernel.Event.ID, _ old: Kernel.Event.Interest, _ new: Kernel.Event.Interest) throws(Error) -> Void, - remove: @escaping (_ fd: borrowing Kernel.Descriptor, _ id: Kernel.Event.ID, _ interest: Kernel.Event.Interest) throws(Error) -> Void, - arm: @escaping (_ fd: borrowing Kernel.Descriptor, _ id: Kernel.Event.ID, _ interest: Kernel.Event.Interest) throws(Error) -> Void, - poll: @escaping (_ deadline: Clock.Continuous.Deadline?, _ output: inout [Kernel.Event]) throws(Error) -> Int, + add: + @escaping ( + _ fd: borrowing Kernel.Descriptor, _ id: Kernel.Event.ID, + _ interest: Kernel.Event.Interest + ) throws(Error) -> Void, + modify: + @escaping ( + _ fd: borrowing Kernel.Descriptor, _ id: Kernel.Event.ID, + _ old: Kernel.Event.Interest, _ new: Kernel.Event.Interest + ) throws(Error) -> Void, + remove: + @escaping ( + _ fd: borrowing Kernel.Descriptor, _ id: Kernel.Event.ID, + _ interest: Kernel.Event.Interest + ) throws(Error) -> Void, + arm: + @escaping ( + _ fd: borrowing Kernel.Descriptor, _ id: Kernel.Event.ID, + _ interest: Kernel.Event.Interest + ) throws(Error) -> Void, + poll: + @escaping ( + _ deadline: Clock.Continuous.Deadline?, _ output: inout [Kernel.Event] + ) throws(Error) -> Int, close: @escaping () -> Void ) { // Thread-confined mutable state captured by all witness closures. @@ -114,7 +136,9 @@ /// The registration column — the move-only ADT-families Dictionary /// over the default ordered hashed entry column, pinned through the /// canonical `Dictionary` front door ([DS-028]). - typealias Registry = Dictionary_Primitives.Dictionary + typealias Registry = Dictionary_Primitives.Dictionary< + Kernel.Event.ID, Registration + > var nextID = Kernel.Event.ID.zero var registry = Registry() } @@ -122,7 +146,10 @@ let shared = Shared() self._register = { - (descriptor: consuming Kernel.Descriptor, interest: Kernel.Event.Interest) throws(Error) -> Kernel.Event.ID in + ( + descriptor: consuming Kernel.Descriptor, + interest: Kernel.Event.Interest + ) throws(Error) -> Kernel.Event.ID in shared.nextID = shared.nextID.map { $0 &+ 1 } let id = shared.nextID @@ -131,7 +158,10 @@ try add(descriptor, id, interest) var box: Kernel.Descriptor? = consume descriptor - shared.registry.insert(key: id, value: Registration(descriptor: box.take()!, interest: interest)) + shared.registry.insert( + key: id, + value: Registration(descriptor: box.take()!, interest: interest) + ) return id } @@ -184,7 +214,10 @@ } self._poll = { - (deadline: Clock.Continuous.Deadline?, buffer: inout [Kernel.Event]) throws(Error) -> Int in + ( + deadline: Clock.Continuous.Deadline?, + buffer: inout [Kernel.Event] + ) throws(Error) -> Int in // Backend fills buffer with normalized events. // The backend converts deadline → native timeout (clock access is platform-specific). @@ -213,7 +246,9 @@ // full-duplex load. for i in 0.. Int in + ( + deadline: Clock.Continuous.Deadline?, + output: inout [Kernel.Event] + ) throws(Kernel.Event.Driver.Error) -> Int in let timeout = deadline.map { $0.remaining(at: Clock.Continuous.now) } @@ -276,7 +296,10 @@ let count: Int do throws(Linux.Kernel.Event.Poll.Error) { if requestCount == state.rawEvents.count { - count = try state.epoll.poll(events: &state.rawEvents, timeout: timeout) + count = try state.epoll.poll( + events: &state.rawEvents, + timeout: timeout + ) } else { var scratch = Array(state.rawEvents[0.. Int in + ( + deadline: Clock.Continuous.Deadline?, + output: inout [Kernel.Event] + ) throws(Kernel.Event.Driver.Error) -> Int in let timeout = deadline.map { $0.remaining(at: Clock.Continuous.now) } @@ -231,7 +253,9 @@ let raw = state.rawEvents[i] if raw.filter == .user { continue } - let id = raw.data.map { UInt(truncatingIfNeeded: $0) }.retag(Kernel.Event.self) + let id = raw.data.map { UInt(truncatingIfNeeded: $0) }.retag( + Kernel.Event.self + ) var interest: Kernel.Event.Interest = [] if raw.filter == .read { interest.insert(.read) } @@ -249,7 +273,11 @@ if raw.flags.contains(.error) { flags.insert(.error) } guard writeIdx < output.count else { break } - output[writeIdx] = Kernel.Event(id: id, interest: interest, flags: flags) + output[writeIdx] = Kernel.Event( + id: id, + interest: interest, + flags: flags + ) writeIdx += 1 } return writeIdx diff --git a/Sources/Kernel File/Kernel.File.Clone+CrossPlatform.swift b/Sources/Kernel File/Kernel.File.Clone+CrossPlatform.swift index 2a604c9..fe2479a 100644 --- a/Sources/Kernel File/Kernel.File.Clone+CrossPlatform.swift +++ b/Sources/Kernel File/Kernel.File.Clone+CrossPlatform.swift @@ -277,7 +277,9 @@ extension Kernel.File.Clone { #if os(Linux) extension Kernel.File.Clone { - private static func openSource(_ path: borrowing Path.Borrowed) throws(Kernel.File.Clone.Error) -> Kernel.Descriptor { + private static func openSource( + _ path: borrowing Path.Borrowed + ) throws(Kernel.File.Clone.Error) -> Kernel.Descriptor { do throws(Kernel.File.Open.Error) { return try Kernel.File.Open.open( path: path, @@ -293,7 +295,9 @@ extension Kernel.File.Clone { } } - private static func createDestination(_ path: borrowing Path.Borrowed) throws(Kernel.File.Clone.Error) -> Kernel.Descriptor { + private static func createDestination( + _ path: borrowing Path.Borrowed + ) throws(Kernel.File.Clone.Error) -> Kernel.Descriptor { do throws(Kernel.File.Open.Error) { return try Kernel.File.Open.open( path: path, @@ -309,7 +313,9 @@ extension Kernel.File.Clone { } } - private static func getSize(_ path: borrowing Path.Borrowed) throws(Kernel.File.Clone.Error) -> Int { + private static func getSize( + _ path: borrowing Path.Borrowed + ) throws(Kernel.File.Clone.Error) -> Int { do throws(Linux.Kernel.File.Clone.Error.Syscall) { return try Linux.Kernel.File.Clone.Metadata.size(at: path) } catch { diff --git a/Sources/Kernel File/Kernel.File.Direct.Capability.swift b/Sources/Kernel File/Kernel.File.Direct.Capability.swift index 0a6dfe2..845113e 100644 --- a/Sources/Kernel File/Kernel.File.Direct.Capability.swift +++ b/Sources/Kernel File/Kernel.File.Direct.Capability.swift @@ -52,10 +52,6 @@ extension Kernel.File.Direct.Capability { /// Direct I/O properties accessor. public struct Direct: Sendable { let capability: Kernel.File.Direct.Capability - - init(capability: Kernel.File.Direct.Capability) { - self.capability = capability - } } } @@ -76,10 +72,6 @@ extension Kernel.File.Direct.Capability { /// Cache bypass properties accessor. public struct Bypass: Sendable { let capability: Kernel.File.Direct.Capability - - init(capability: Kernel.File.Direct.Capability) { - self.capability = capability - } } } diff --git a/Sources/Kernel Thread/Kernel.Thread.trap.swift b/Sources/Kernel Thread/Kernel.Thread.trap.swift index 1c2cee6..2a3cd99 100644 --- a/Sources/Kernel Thread/Kernel.Thread.trap.swift +++ b/Sources/Kernel Thread/Kernel.Thread.trap.swift @@ -48,7 +48,9 @@ extension Kernel.Thread.Trap { public func callAsFunction( _ body: @escaping @Sendable () -> Void ) -> Kernel.Thread.Handle { - do throws(Kernel.Thread.Error) { return try Kernel.Thread.spawn(body) } catch { fatalError(error.description) } + do throws(Kernel.Thread.Error) { return try Kernel.Thread.spawn(body) } catch { + fatalError(error.description) + } } /// Spawns a dedicated OS thread with an explicit value, trapping on failure. @@ -62,6 +64,8 @@ extension Kernel.Thread.Trap { _ value: consuming sending T, _ body: @escaping @Sendable (consuming T) -> Void ) -> Kernel.Thread.Handle { - do throws(Kernel.Thread.Error) { return try Kernel.Thread.spawn(value, body) } catch { fatalError(error.description) } + do throws(Kernel.Thread.Error) { return try Kernel.Thread.spawn(value, body) } catch { + fatalError(error.description) + } } } diff --git a/Tests/Kernel Tests/Kernel.Completion.Driver Tests.swift b/Tests/Kernel Tests/Kernel.Completion.Driver Tests.swift index 77e1c95..a892a27 100644 --- a/Tests/Kernel Tests/Kernel.Completion.Driver Tests.swift +++ b/Tests/Kernel Tests/Kernel.Completion.Driver Tests.swift @@ -20,7 +20,7 @@ extension Kernel.Completion.Driver.Test.Unit { @Test - func `init wires submit closure`() { + func `init wires submit closure`() throws { var called = false let driver = Kernel.Completion.Driver( submit: { _, _ in called = true }, @@ -29,7 +29,7 @@ close: {} ) let sentinel = Kernel.Descriptor.invalid - try! driver._submit( + try driver._submit( Kernel.Completion.Submission(opcode: .noOperation, token: .zero), sentinel ) @@ -37,7 +37,7 @@ } @Test - func `init wires flush closure`() { + func `init wires flush closure`() throws { var called = false let driver = Kernel.Completion.Driver( submit: { _, _ in }, @@ -48,7 +48,7 @@ drain: { _ in .zero }, close: {} ) - _ = try! driver._flush() + _ = try driver._flush() #expect(called) } diff --git a/Tests/Kernel Tests/Kernel.Completion.IOUring.Integration Tests.swift b/Tests/Kernel Tests/Kernel.Completion.IOUring.Integration Tests.swift index 9cd01b9..0bcc199 100644 --- a/Tests/Kernel Tests/Kernel.Completion.IOUring.Integration Tests.swift +++ b/Tests/Kernel Tests/Kernel.Completion.IOUring.Integration Tests.swift @@ -129,7 +129,11 @@ var completion = try Kernel.Completion.iouring() let plain = Kernel.Completion.Submission(opcode: .noOperation, token: .init(10)) - let drained = Kernel.Completion.Submission(opcode: .noOperation, token: .init(11), flags: .drain) + let drained = Kernel.Completion.Submission( + opcode: .noOperation, + token: .init(11), + flags: .drain + ) try completion.submit(plain) try completion.submit(drained) diff --git a/Tests/Kernel Tests/Kernel.Completion.Lifecycle Tests.swift b/Tests/Kernel Tests/Kernel.Completion.Lifecycle Tests.swift index cd6a3d4..2a6f74f 100644 --- a/Tests/Kernel Tests/Kernel.Completion.Lifecycle Tests.swift +++ b/Tests/Kernel Tests/Kernel.Completion.Lifecycle Tests.swift @@ -29,7 +29,7 @@ extension `Completion Lifecycle Tests`.`Full Lifecycle` { @Test - func `create submit flush drain close sequence`() { + func `create submit flush drain close sequence`() throws { var submitLog: [(Kernel.Completion.Submission.Opcode, Kernel.Completion.Token)] = [] var flushCount = 0 var closeCount = 0 @@ -75,8 +75,8 @@ token: 2 ) let sentinel = Kernel.Descriptor.invalid - try! completion.submit(sub1, target: sentinel) - try! completion.submit(sub2, target: sentinel) + try completion.submit(sub1, target: sentinel) + try completion.submit(sub2, target: sentinel) #expect(submitLog.count == 2) if case .read = submitLog[0].0 { @@ -91,7 +91,7 @@ #expect(submitLog[1].1 == 2) // Flush - let flushed = try! completion.flush() + let flushed = try completion.flush() #expect(flushCount == 1) #expect(flushed == 2) @@ -219,7 +219,7 @@ extension `Completion Lifecycle Tests`.`Untargeted Submit` { @Test - func `untargeted submit passes invalid descriptor sentinel`() { + func `untargeted submit passes invalid descriptor sentinel`() throws { var receivedRawDescriptor: Int32? = nil let driver = Kernel.Completion.Driver( submit: { _, descriptor in @@ -236,7 +236,7 @@ capabilities: Kernel.Completion.Capabilities() ) let sub = Kernel.Completion.Submission(opcode: .noOperation, token: .zero) - try! completion.submit(sub) + try completion.submit(sub) let invalidRaw = Kernel.Descriptor.invalid._rawValue #expect(receivedRawDescriptor == invalidRaw) diff --git a/Tests/Kernel Tests/Kernel.Copy.Clone Tests.swift b/Tests/Kernel Tests/Kernel.Copy.Clone Tests.swift index e62238e..d6c4c85 100644 --- a/Tests/Kernel Tests/Kernel.Copy.Clone Tests.swift +++ b/Tests/Kernel Tests/Kernel.Copy.Clone Tests.swift @@ -48,7 +48,8 @@ import Testing @Test func `perform function exists on Linux`() { // Verify the function signature compiles - typealias PerformType = (borrowing Kernel.Descriptor, borrowing Kernel.Descriptor) throws -> Void + typealias PerformType = (borrowing Kernel.Descriptor, borrowing Kernel.Descriptor) + throws -> Void } } #endif diff --git a/Tests/Kernel Tests/Kernel.Event.Source Tests.swift b/Tests/Kernel Tests/Kernel.Event.Source Tests.swift index 4d31a9a..2232e0c 100644 --- a/Tests/Kernel Tests/Kernel.Event.Source Tests.swift +++ b/Tests/Kernel Tests/Kernel.Event.Source Tests.swift @@ -63,7 +63,9 @@ import Testing // event at a time — every registration must eventually be observed // exactly once, never silently discarded by an over-sized kernel // dequeue request. - @Test func `poll with output buffer smaller than ready registrations does not drop events`() throws { + @Test func `poll with output buffer smaller than ready registrations does not drop events`() + throws + { let pipeA = try Kernel.Event.Test.makePipe() let pipeB = try Kernel.Event.Test.makePipe() @@ -121,7 +123,9 @@ import Testing // event at a time — every registration must eventually be observed // exactly once, never silently discarded by an over-sized kernel // dequeue request. - @Test func `poll with output buffer smaller than ready registrations does not drop events`() throws { + @Test func `poll with output buffer smaller than ready registrations does not drop events`() + throws + { let pipeA = try Kernel.Event.Test.makePipe() let pipeB = try Kernel.Event.Test.makePipe() diff --git a/Tests/Kernel Tests/Kernel.File.Copy Tests.swift b/Tests/Kernel Tests/Kernel.File.Copy Tests.swift index ebb6035..de78c6f 100644 --- a/Tests/Kernel Tests/Kernel.File.Copy Tests.swift +++ b/Tests/Kernel Tests/Kernel.File.Copy Tests.swift @@ -60,7 +60,10 @@ extension Kernel.File.Copy { } extension Kernel.File.Copy.Test.Unit { - @Test func `copying a symlink with followSymlinks false recreates the link at the destination`() throws { + @Test + func `copying a symlink with followSymlinks false recreates the link at the destination`() + throws + { let target = Kernel.Temporary.filePath(prefix: "kernel-copy-symlink-target") let source = Kernel.Temporary.filePath(prefix: "kernel-copy-symlink-src") let destination = Kernel.Temporary.filePath(prefix: "kernel-copy-symlink-dst") @@ -86,11 +89,16 @@ extension Kernel.File.Copy { #expect(readBackTarget == target) } - @Test func `copying a symlink to a destination whose parent does not exist throws instead of silently succeeding`() throws { + @Test + func + `copying a symlink to a destination whose parent does not exist throws instead of silently succeeding`() + throws + { let target = Kernel.Temporary.filePath(prefix: "kernel-copy-symlink-target") let source = Kernel.Temporary.filePath(prefix: "kernel-copy-symlink-src") let destination = - Kernel.Temporary.directory + "/kernel-copy-symlink-missing-parent-\(Int.random(in: 0.. Swift.String { /// Opens a file for locking. Returns a consuming descriptor for Lock.Token. private func openForLock(_ pathString: Swift.String) throws -> Kernel.Descriptor { try Path.scope(pathString) { path in - try Kernel.File.Open.open(path: path, mode: .readWrite, options: [], permissions: .ownerReadWrite) + try Kernel.File.Open.open( + path: path, + mode: .readWrite, + options: [], + permissions: .ownerReadWrite + ) } } @@ -103,28 +108,62 @@ extension `Kernel.Lock Integration` { extension `Kernel.Lock Integration` { - /// Path to the lock test helper executable + /// Name of the lock test helper executable. + private static let helperName = "_Lock Test Process" + + /// Path to the lock test helper executable. + /// + /// The product directory differs per build system — SwiftPM's native + /// build writes `.build//`, while Swift Build writes + /// `.build/out/Products/` — so every known product directory + /// is probed instead of one hard-coded layout. private static var helperPath: Swift.String { - if let builtProductsDir = ProcessInfo.processInfo.environment["BUILT_PRODUCTS_DIR"] { - return "\(builtProductsDir)/_Lock Test Process" + let fileManager = FileManager.default + for directory in productDirectories { + let candidate = directory.appendingPathComponent(helperName) + if fileManager.isExecutableFile(atPath: candidate.path) { return candidate.path } } - #if DEBUG - let config = "debug" - #else - let config = "release" - #endif - #if os(macOS) - let buildDir = ".build/arm64-apple-macosx/\(config)" - #elseif os(Linux) - let buildDir = ".build/\(config)" - #else - let buildDir = ".build/\(config)" - #endif - let packageRoot = URL(fileURLWithPath: #filePath) + return packageRoot.appendingPathComponent(helperName).path + } + + private static var packageRoot: URL { + URL(fileURLWithPath: #filePath) .deletingLastPathComponent() // Kernel Tests .deletingLastPathComponent() // Tests .deletingLastPathComponent() // swift-kernel - return packageRoot.appendingPathComponent(buildDir).appendingPathComponent("_Lock Test Process").path + } + + /// Every directory a built product may live in, most specific first. + private static var productDirectories: [URL] { + var directories: [URL] = [] + if let builtProductsDirectory = ProcessInfo.processInfo.environment[ + "BUILT_PRODUCTS_DIR" + ] { + directories.append(URL(fileURLWithPath: builtProductsDirectory)) + } + let buildRoot = packageRoot.appendingPathComponent(".build") + for configuration in ["Debug", "Release"] { + directories.append( + buildRoot + .appendingPathComponent("out") + .appendingPathComponent("Products") + .appendingPathComponent(configuration) + ) + } + for configuration in ["debug", "release"] { + directories.append(buildRoot.appendingPathComponent(configuration)) + } + let contents = + (try? FileManager.default.contentsOfDirectory( + at: buildRoot, + includingPropertiesForKeys: nil + )) ?? [] + for triple in contents { + for configuration in ["debug", "release"] { + directories.append(triple.appendingPathComponent(configuration)) + } + } + return directories } @Test @@ -271,7 +310,9 @@ extension `Kernel.Lock Integration` { let process = Process() process.executableURL = URL(fileURLWithPath: Self.helperPath) - process.arguments = ["try-exclusive", path, "--range", "200-300", "--hold", "0", "--signal-ready"] + process.arguments = [ + "try-exclusive", path, "--range", "200-300", "--hold", "0", "--signal-ready", + ] let pipe = Pipe() process.standardOutput = pipe diff --git a/Tests/Kernel Tests/Kernel.Path.String Tests.swift b/Tests/Kernel Tests/Kernel.Path.String Tests.swift index 8e19e45..d9ad3e0 100644 --- a/Tests/Kernel Tests/Kernel.Path.String Tests.swift +++ b/Tests/Kernel Tests/Kernel.Path.String Tests.swift @@ -119,7 +119,8 @@ extension Path.String { #expect(error.body == nil) }, { () throws(E) in - _ = try Path.scope("\0/tmp/file") { (_: borrowing Path.Borrowed) throws(Dummy) in + _ = try Path.scope("\0/tmp/file") { + (_: borrowing Path.Borrowed) throws(Dummy) in () // never reached } } diff --git a/Tests/Kernel Tests/Kernel.Random Tests.swift b/Tests/Kernel Tests/Kernel.Random Tests.swift index 4f7fdcb..6624efb 100644 --- a/Tests/Kernel Tests/Kernel.Random Tests.swift +++ b/Tests/Kernel Tests/Kernel.Random Tests.swift @@ -24,7 +24,9 @@ extension Random { extension Random.Test.Fill { @Test - func `fill(_:) on a 32-byte buffer produces non-zero bytes on every platform`() throws(Random.Error) { + func `fill(_:) on a 32-byte buffer produces non-zero bytes on every platform`() throws(Random + .Error) + { // 32 bytes of contiguous stack memory — a 4-tuple of UInt64. var buffer: (UInt64, UInt64, UInt64, UInt64) = (0, 0, 0, 0) // Single cross-platform call site — no `#if os(...)`.