From 342d57b6928a982ab36a43597e252caa529cef8e Mon Sep 17 00:00:00 2001 From: tom doron Date: Mon, 14 Mar 2022 18:57:34 -0700 Subject: [PATCH 1/4] adopt sendable motivation: adjust to swift 5.6 changes: * define sendable shims for protocols and structs that may be used in async context * adjust tests * add a test to make sure no warning are emittted --- Sources/Logging/LogHandler.swift | 2 +- Sources/Logging/Logging.swift | 31 ++++++++++++++---- Sources/Logging/Sendable.swift | 27 ++++++++++++++++ Tests/LoggingTests/LoggingTest.swift | 46 ++++++++++++++++++++++++++- Tests/LoggingTests/TestSendable.swift | 43 +++++++++++++++++++++++++ scripts/soundness.sh | 2 +- 6 files changed, 141 insertions(+), 10 deletions(-) create mode 100644 Sources/Logging/Sendable.swift create mode 100644 Tests/LoggingTests/TestSendable.swift diff --git a/Sources/Logging/LogHandler.swift b/Sources/Logging/LogHandler.swift index 6b52b120..eaafde28 100644 --- a/Sources/Logging/LogHandler.swift +++ b/Sources/Logging/LogHandler.swift @@ -113,7 +113,7 @@ /// Please note that the above `LogHandler` will still pass the 'log level is a value' test above it iff the global log /// level has not been overridden. And most importantly it passes the requirement listed above: A change to the log /// level on one `Logger` should not affect the log level of another `Logger` variable. -public protocol LogHandler { +public protocol LogHandler: _SwiftLogSendableLogHandler { /// This method is called when a `LogHandler` must emit a log message. There is no need for the `LogHandler` to /// check if the `level` is above or below the configured `logLevel` as `Logger` already performed this check and /// determined that a message should be logged. diff --git a/Sources/Logging/Logging.swift b/Sources/Logging/Logging.swift index ab49d21c..5bf3bfbf 100644 --- a/Sources/Logging/Logging.swift +++ b/Sources/Logging/Logging.swift @@ -12,6 +12,19 @@ // //===----------------------------------------------------------------------===// +#if compiler(>=5.6) +#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) +@preconcurrency import Darwin +#elseif os(Windows) +@preconcurrency import CRT +#elseif canImport(Glibc) +@preconcurrency import Glibc +#elseif canImport(WASILibc) +@preconcurrency import WASILibc +#else +#error("Unsupported runtime") +#endif +#else #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) import Darwin #elseif os(Windows) @@ -23,6 +36,7 @@ import WASILibc #else #error("Unsupported runtime") #endif +#endif /// A `Logger` is the central type in `SwiftLog`. Its central function is to emit log messages using one of the methods /// corresponding to a log level. @@ -35,7 +49,7 @@ import WASILibc /// /// logger.info("Hello World!") /// -public struct Logger { +public struct Logger: _SwiftLogSendable { @usableFromInline var handler: LogHandler @@ -713,7 +727,7 @@ extension Logger { /// over `..., metadata: ["colors": .array([.string("\(user.topColor)"), .string("\(user.secondColor)")])` /// - prefer `logger.info("nested info", metadata: ["nested": ["fave-numbers": ["\(1)", "\(2)", "\(3)"], "foo": "bar"]])` /// over `..., metadata: ["nested": .dictionary(["fave-numbers": ...])])` - public enum MetadataValue { + public enum MetadataValue: _SwiftLogSendable { /// A metadata value which is a `String`. /// /// Because `MetadataValue` implements `ExpressibleByStringInterpolation`, and `ExpressibleByStringLiteral`, @@ -721,8 +735,11 @@ extension Logger { case string(String) /// A metadata value which is some `CustomStringConvertible`. + #if compiler(>=5.6) + case stringConvertible(CustomStringConvertible & Sendable) + #else case stringConvertible(CustomStringConvertible) - + #endif /// A metadata value which is a dictionary from `String` to `Logger.MetadataValue`. /// /// Because `MetadataValue` implements `ExpressibleByDictionaryLiteral`, you don't need to type @@ -740,7 +757,7 @@ extension Logger { /// /// Log levels are ordered by their severity, with `.trace` being the least severe and /// `.critical` being the most severe. - public enum Level: String, Codable, CaseIterable { + public enum Level: String, Codable, CaseIterable, _SwiftLogSendable { /// Appropriate for messages that contain information normally of use only when /// tracing the execution of a program. case trace @@ -859,7 +876,7 @@ extension Logger { /// /// logger.info("Hello \(world)") /// - public struct Message: ExpressibleByStringLiteral, Equatable, CustomStringConvertible, ExpressibleByStringInterpolation { + public struct Message: ExpressibleByStringLiteral, Equatable, CustomStringConvertible, ExpressibleByStringInterpolation, _SwiftLogSendable { public typealias StringLiteralType = String private var value: String @@ -1086,7 +1103,7 @@ public struct StreamLogHandler: LogHandler { return StreamLogHandler(label: label, stream: StdioOutputStream.stderr) } - private let stream: TextOutputStream + private let stream: TextOutputStream & _SwiftLogSendable private let label: String public var logLevel: Logger.Level = .info @@ -1108,7 +1125,7 @@ public struct StreamLogHandler: LogHandler { } // internal for testing only - internal init(label: String, stream: TextOutputStream) { + internal init(label: String, stream: TextOutputStream & _SwiftLogSendable) { self.label = label self.stream = stream } diff --git a/Sources/Logging/Sendable.swift b/Sources/Logging/Sendable.swift new file mode 100644 index 00000000..74c5e463 --- /dev/null +++ b/Sources/Logging/Sendable.swift @@ -0,0 +1,27 @@ +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift Logging API open source project +// +// Copyright (c) 2022 Apple Inc. and the Swift Logging API project authors +// Licensed under Apache License v2.0 +// +// See LICENSE.txt for license information +// See CONTRIBUTORS.txt for the list of Swift Logging API project authors +// +// SPDX-License-Identifier: Apache-2.0 +// +//===----------------------------------------------------------------------===// + +// Sendable support helpers + +#if compiler(>=5.6) +@preconcurrency public protocol _SwiftLogSendableLogHandler: Sendable {} +#else +public protocol _SwiftLogSendableLogHandler {} +#endif + +#if compiler(>=5.6) +public typealias _SwiftLogSendable = Sendable +#else +public typealias _SwiftLogSendable = Any +#endif diff --git a/Tests/LoggingTests/LoggingTest.swift b/Tests/LoggingTests/LoggingTest.swift index 3400c8ef..50c157f0 100644 --- a/Tests/LoggingTests/LoggingTest.swift +++ b/Tests/LoggingTests/LoggingTest.swift @@ -262,7 +262,9 @@ class LoggingTest: XCTestCase { // Example of custom "box" which may be used to implement "render at most once" semantics // Not thread-safe, thus should not be shared across threads. - internal class LazyMetadataBox: CustomStringConvertible { + // @unchecked Sendable since not thread-safe by definition + #if compiler(>=5.6) + internal final class LazyMetadataBox: CustomStringConvertible, @unchecked Sendable { private var makeValue: (() -> String)? private var _value: String? @@ -287,6 +289,33 @@ class LoggingTest: XCTestCase { } } + #else + internal final class LazyMetadataBox: CustomStringConvertible { + private var makeValue: (() -> String)? + private var _value: String? + + public init(_ makeValue: @escaping () -> String) { + self.makeValue = makeValue + } + + /// This allows caching a value in case it is accessed via an by name subscript, + // rather than as part of rendering all metadata that a LoggingContext was carrying + public var value: String { + if let f = self.makeValue { + self._value = f() + self.makeValue = nil + } + + assert(self._value != nil, "_value MUST NOT be nil once `lazyValue` has run.") + return self._value! + } + + public var description: String { + return "\(self.value)" + } + } + #endif + func testStringConvertibleMetadata() { let testLogging = TestLogging() LoggingSystem.bootstrapInternal(testLogging.make) @@ -672,6 +701,20 @@ class LoggingTest: XCTestCase { XCTAssertLessThan(Logger.Level.error, Logger.Level.critical) } + #if compiler(>=5.6) + // @unchecked Sendable since non-thread safe by design + final class InterceptStream: TextOutputStream, @unchecked Sendable { + var interceptedText: String? + var strings = [String]() + + func write(_ string: String) { + // This is a test implementation, a real implementation would include locking + self.strings.append(string) + self.interceptedText = (self.interceptedText ?? "") + string + } + } + + #else final class InterceptStream: TextOutputStream { var interceptedText: String? var strings = [String]() @@ -682,6 +725,7 @@ class LoggingTest: XCTestCase { self.interceptedText = (self.interceptedText ?? "") + string } } + #endif func testStreamLogHandlerWritesToAStream() { let interceptStream = InterceptStream() diff --git a/Tests/LoggingTests/TestSendable.swift b/Tests/LoggingTests/TestSendable.swift new file mode 100644 index 00000000..4d92ee27 --- /dev/null +++ b/Tests/LoggingTests/TestSendable.swift @@ -0,0 +1,43 @@ +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift Logging API open source project +// +// Copyright (c) 2018-2019 Apple Inc. and the Swift Logging API project authors +// Licensed under Apache License v2.0 +// +// See LICENSE.txt for license information +// See CONTRIBUTORS.txt for the list of Swift Logging API project authors +// +// SPDX-License-Identifier: Apache-2.0 +// +//===----------------------------------------------------------------------===// +import Dispatch +@testable import Logging +import XCTest + +class SendableTest: XCTestCase { + #if compiler(>=5.6) + func testSendableLogger() async { + let testLogging = TestLogging() + LoggingSystem.bootstrapInternal(testLogging.make) + + let logger = Logger(label: "test") + let message1 = Logger.Message(stringLiteral: "critical 1") + let message2 = Logger.Message(stringLiteral: "critical 2") + let metadata: Logger.Metadata = ["key": "value"] + + let task = Task.detached { + logger.info("info") + logger.critical(message1) + logger.critical(message2) + logger.warning(.init(stringLiteral: "warning"), metadata: metadata) + } + + await task.value + testLogging.history.assertExist(level: .info, message: "info", metadata: [:]) + testLogging.history.assertExist(level: .critical, message: "critical 1", metadata: [:]) + testLogging.history.assertExist(level: .critical, message: "critical 2", metadata: [:]) + testLogging.history.assertExist(level: .warning, message: "warning", metadata: metadata) + } + #endif +} diff --git a/scripts/soundness.sh b/scripts/soundness.sh index 64fb7d14..f2a00dc4 100755 --- a/scripts/soundness.sh +++ b/scripts/soundness.sh @@ -32,7 +32,7 @@ here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" function replace_acceptable_years() { # this needs to replace all acceptable forms with 'YEARS' - sed -e 's/20[12][78901]-20[12][8901]/YEARS/' -e 's/20[12][8901]/YEARS/' + sed -e 's/20[12][789012]-20[12][89012]/YEARS/' -e 's/20[12][89012]/YEARS/' } printf "=> Checking linux tests... " From d6360580e23db7edd967293268a41b85e719b9a2 Mon Sep 17 00:00:00 2001 From: tom doron Date: Wed, 16 Mar 2022 18:02:12 -0700 Subject: [PATCH 2/4] fixup --- Tests/LoggingTests/LoggingTest.swift | 54 ++++++---------------------- docker/docker-compose.2004.56.yaml | 3 ++ 2 files changed, 13 insertions(+), 44 deletions(-) diff --git a/Tests/LoggingTests/LoggingTest.swift b/Tests/LoggingTests/LoggingTest.swift index 50c157f0..50225087 100644 --- a/Tests/LoggingTests/LoggingTest.swift +++ b/Tests/LoggingTests/LoggingTest.swift @@ -262,34 +262,6 @@ class LoggingTest: XCTestCase { // Example of custom "box" which may be used to implement "render at most once" semantics // Not thread-safe, thus should not be shared across threads. - // @unchecked Sendable since not thread-safe by definition - #if compiler(>=5.6) - internal final class LazyMetadataBox: CustomStringConvertible, @unchecked Sendable { - private var makeValue: (() -> String)? - private var _value: String? - - public init(_ makeValue: @escaping () -> String) { - self.makeValue = makeValue - } - - /// This allows caching a value in case it is accessed via an by name subscript, - // rather than as part of rendering all metadata that a LoggingContext was carrying - public var value: String { - if let f = self.makeValue { - self._value = f() - self.makeValue = nil - } - - assert(self._value != nil, "_value MUST NOT be nil once `lazyValue` has run.") - return self._value! - } - - public var description: String { - return "\(self.value)" - } - } - - #else internal final class LazyMetadataBox: CustomStringConvertible { private var makeValue: (() -> String)? private var _value: String? @@ -314,7 +286,6 @@ class LoggingTest: XCTestCase { return "\(self.value)" } } - #endif func testStringConvertibleMetadata() { let testLogging = TestLogging() @@ -701,20 +672,6 @@ class LoggingTest: XCTestCase { XCTAssertLessThan(Logger.Level.error, Logger.Level.critical) } - #if compiler(>=5.6) - // @unchecked Sendable since non-thread safe by design - final class InterceptStream: TextOutputStream, @unchecked Sendable { - var interceptedText: String? - var strings = [String]() - - func write(_ string: String) { - // This is a test implementation, a real implementation would include locking - self.strings.append(string) - self.interceptedText = (self.interceptedText ?? "") + string - } - } - - #else final class InterceptStream: TextOutputStream { var interceptedText: String? var strings = [String]() @@ -725,7 +682,6 @@ class LoggingTest: XCTestCase { self.interceptedText = (self.interceptedText ?? "") + string } } - #endif func testStreamLogHandlerWritesToAStream() { let interceptStream = InterceptStream() @@ -933,3 +889,13 @@ extension Logger { } #endif } + +// Sendable + +#if compiler(>=5.6) +// @unchecked Sendable since not thread-safe by definition +extension LoggingTest.LazyMetadataBox: @unchecked Sendable {} + +// @unchecked Sendable since non-thread safe by design +extension LoggingTest.InterceptStream: @unchecked Sendable {} +#endif diff --git a/docker/docker-compose.2004.56.yaml b/docker/docker-compose.2004.56.yaml index 76366ee8..3fa46fc0 100644 --- a/docker/docker-compose.2004.56.yaml +++ b/docker/docker-compose.2004.56.yaml @@ -16,3 +16,6 @@ services: shell: image: swift-log:20.04-5.6 + + soundness: + image: swift-log:20.04-5.6 From 1aa9e17609bcc3f94113f6cb06b0951d72f93c91 Mon Sep 17 00:00:00 2001 From: tom doron Date: Tue, 28 Jun 2022 11:33:29 -0700 Subject: [PATCH 3/4] fixup --- Sources/Logging/Locks.swift | 6 ++++ Sources/Logging/LogHandler.swift | 8 ++++++ Sources/Logging/Logging.swift | 41 ++++++++++++++-------------- Sources/Logging/Sendable.swift | 27 ------------------ Tests/LoggingTests/LoggingTest.swift | 6 ++-- Tests/LoggingTests/TestLogger.swift | 29 ++++++++++---------- docker/docker-compose.2004.56.yaml | 3 -- docker/docker-compose.yaml | 2 +- 8 files changed, 55 insertions(+), 67 deletions(-) delete mode 100644 Sources/Logging/Sendable.swift diff --git a/Sources/Logging/Locks.swift b/Sources/Logging/Locks.swift index f8ffbcd9..2a83ec31 100644 --- a/Sources/Logging/Locks.swift +++ b/Sources/Logging/Locks.swift @@ -271,3 +271,9 @@ extension ReadWriteLock { try self.withWriterLock(body) } } + +// Sendable + +#if compiler(>=5.6) +extension Lock: Sendable {} +#endif diff --git a/Sources/Logging/LogHandler.swift b/Sources/Logging/LogHandler.swift index eaafde28..48fac76f 100644 --- a/Sources/Logging/LogHandler.swift +++ b/Sources/Logging/LogHandler.swift @@ -186,3 +186,11 @@ extension LogHandler { line: line) } } + +// MARK: - Sendable support helpers + +#if compiler(>=5.6) +@preconcurrency public protocol _SwiftLogSendableLogHandler: Sendable {} +#else +public protocol _SwiftLogSendableLogHandler {} +#endif diff --git a/Sources/Logging/Logging.swift b/Sources/Logging/Logging.swift index 5bf3bfbf..106c5bc9 100644 --- a/Sources/Logging/Logging.swift +++ b/Sources/Logging/Logging.swift @@ -12,19 +12,6 @@ // //===----------------------------------------------------------------------===// -#if compiler(>=5.6) -#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) -@preconcurrency import Darwin -#elseif os(Windows) -@preconcurrency import CRT -#elseif canImport(Glibc) -@preconcurrency import Glibc -#elseif canImport(WASILibc) -@preconcurrency import WASILibc -#else -#error("Unsupported runtime") -#endif -#else #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) import Darwin #elseif os(Windows) @@ -36,7 +23,6 @@ import WASILibc #else #error("Unsupported runtime") #endif -#endif /// A `Logger` is the central type in `SwiftLog`. Its central function is to emit log messages using one of the methods /// corresponding to a log level. @@ -49,7 +35,7 @@ import WASILibc /// /// logger.info("Hello World!") /// -public struct Logger: _SwiftLogSendable { +public struct Logger { @usableFromInline var handler: LogHandler @@ -727,7 +713,7 @@ extension Logger { /// over `..., metadata: ["colors": .array([.string("\(user.topColor)"), .string("\(user.secondColor)")])` /// - prefer `logger.info("nested info", metadata: ["nested": ["fave-numbers": ["\(1)", "\(2)", "\(3)"], "foo": "bar"]])` /// over `..., metadata: ["nested": .dictionary(["fave-numbers": ...])])` - public enum MetadataValue: _SwiftLogSendable { + public enum MetadataValue { /// A metadata value which is a `String`. /// /// Because `MetadataValue` implements `ExpressibleByStringInterpolation`, and `ExpressibleByStringLiteral`, @@ -757,7 +743,7 @@ extension Logger { /// /// Log levels are ordered by their severity, with `.trace` being the least severe and /// `.critical` being the most severe. - public enum Level: String, Codable, CaseIterable, _SwiftLogSendable { + public enum Level: String, Codable, CaseIterable { /// Appropriate for messages that contain information normally of use only when /// tracing the execution of a program. case trace @@ -876,7 +862,7 @@ extension Logger { /// /// logger.info("Hello \(world)") /// - public struct Message: ExpressibleByStringLiteral, Equatable, CustomStringConvertible, ExpressibleByStringInterpolation, _SwiftLogSendable { + public struct Message: ExpressibleByStringLiteral, Equatable, CustomStringConvertible, ExpressibleByStringInterpolation { public typealias StringLiteralType = String private var value: String @@ -1093,6 +1079,12 @@ let systemStdout = WASILibc.stdout! /// `StreamLogHandler` is a simple implementation of `LogHandler` for directing /// `Logger` output to either `stderr` or `stdout` via the factory methods. public struct StreamLogHandler: LogHandler { + #if compiler(>=5.6) + internal typealias _SendableTextOutputStream = TextOutputStream & Sendable + #else + internal typealias _SendableTextOutputStream = TextOutputStream + #endif + /// Factory that makes a `StreamLogHandler` to directs its output to `stdout` public static func standardOutput(label: String) -> StreamLogHandler { return StreamLogHandler(label: label, stream: StdioOutputStream.stdout) @@ -1103,7 +1095,7 @@ public struct StreamLogHandler: LogHandler { return StreamLogHandler(label: label, stream: StdioOutputStream.stderr) } - private let stream: TextOutputStream & _SwiftLogSendable + private let stream: _SendableTextOutputStream private let label: String public var logLevel: Logger.Level = .info @@ -1125,7 +1117,7 @@ public struct StreamLogHandler: LogHandler { } // internal for testing only - internal init(label: String, stream: TextOutputStream & _SwiftLogSendable) { + internal init(label: String, stream: _SendableTextOutputStream) { self.label = label self.stream = stream } @@ -1281,3 +1273,12 @@ extension Logger.MetadataValue: ExpressibleByArrayLiteral { self = .array(elements) } } + +// MARK: - Sendable support helpers + +#if compiler(>=5.6) +extension Logger: Sendable {} +extension Logger.MetadataValue: Sendable {} +extension Logger.Level: Sendable {} +extension Logger.Message: Sendable {} +#endif diff --git a/Sources/Logging/Sendable.swift b/Sources/Logging/Sendable.swift deleted file mode 100644 index 74c5e463..00000000 --- a/Sources/Logging/Sendable.swift +++ /dev/null @@ -1,27 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Swift Logging API open source project -// -// Copyright (c) 2022 Apple Inc. and the Swift Logging API project authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See CONTRIBUTORS.txt for the list of Swift Logging API project authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - -// Sendable support helpers - -#if compiler(>=5.6) -@preconcurrency public protocol _SwiftLogSendableLogHandler: Sendable {} -#else -public protocol _SwiftLogSendableLogHandler {} -#endif - -#if compiler(>=5.6) -public typealias _SwiftLogSendable = Sendable -#else -public typealias _SwiftLogSendable = Any -#endif diff --git a/Tests/LoggingTests/LoggingTest.swift b/Tests/LoggingTests/LoggingTest.swift index 50225087..441b6f94 100644 --- a/Tests/LoggingTests/LoggingTest.swift +++ b/Tests/LoggingTests/LoggingTest.swift @@ -893,9 +893,11 @@ extension Logger { // Sendable #if compiler(>=5.6) -// @unchecked Sendable since not thread-safe by definition +// used to test logging metadata which requires Sendable conformance +// @unchecked Sendable since manages it own state extension LoggingTest.LazyMetadataBox: @unchecked Sendable {} -// @unchecked Sendable since non-thread safe by design +// used to test logging stream which requires Sendable conformance +// @unchecked Sendable since manages it own state extension LoggingTest.InterceptStream: @unchecked Sendable {} #endif diff --git a/Tests/LoggingTests/TestLogger.swift b/Tests/LoggingTests/TestLogger.swift index 984649c1..2e880ac9 100644 --- a/Tests/LoggingTests/TestLogger.swift +++ b/Tests/LoggingTests/TestLogger.swift @@ -31,8 +31,6 @@ internal struct TestLogging { } internal struct TestLogHandler: LogHandler { - private let logLevelLock = NSLock() - private let metadataLock = NSLock() private let recorder: Recorder private let config: Config private var logger: Logger // the actual logger @@ -56,10 +54,10 @@ internal struct TestLogHandler: LogHandler { var logLevel: Logger.Level { get { // get from config unless set - return self.logLevelLock.withLock { self._logLevel } ?? self.config.get(key: self.label) + return self._logLevel ?? self.config.get(key: self.label) } set { - self.logLevelLock.withLock { self._logLevel = newValue } + self._logLevel = newValue } } @@ -72,26 +70,20 @@ internal struct TestLogHandler: LogHandler { public var metadata: Logger.Metadata { get { - // return self.logger.metadata - return self.metadataLock.withLock { self._metadata } + return self._metadata } set { - // self.logger.metadata = newValue - self.metadataLock.withLock { self._metadata = newValue } + self._metadata = newValue } } // TODO: would be nice to delegate to local copy of logger but StdoutLogger is a reference type. why? subscript(metadataKey metadataKey: Logger.Metadata.Key) -> Logger.Metadata.Value? { get { - // return self.logger[metadataKey: metadataKey] - return self.metadataLock.withLock { self._metadata[metadataKey] } + return self._metadata[metadataKey] } set { - // return logger[metadataKey: metadataKey] = newValue - self.metadataLock.withLock { - self._metadata[metadataKey] = newValue - } + self._metadata[metadataKey] = newValue } } } @@ -342,3 +334,12 @@ internal struct TestLibrary { } } } + +// Sendable + +#if compiler(>=5.6) +extension TestLogHandler: @unchecked Sendable {} +extension Recorder: @unchecked Sendable {} +extension Config: @unchecked Sendable {} +extension MDC: @unchecked Sendable {} +#endif diff --git a/docker/docker-compose.2004.56.yaml b/docker/docker-compose.2004.56.yaml index 3fa46fc0..76366ee8 100644 --- a/docker/docker-compose.2004.56.yaml +++ b/docker/docker-compose.2004.56.yaml @@ -16,6 +16,3 @@ services: shell: image: swift-log:20.04-5.6 - - soundness: - image: swift-log:20.04-5.6 diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index cb5a8470..69ab5c73 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -34,4 +34,4 @@ services: shell: <<: *common - entrypoint: /bin/bash + entrypoint: /bin/bash -l From 42bc2a5ca79d51ff5b971957136b028d7b941ceb Mon Sep 17 00:00:00 2001 From: tom doron Date: Wed, 29 Jun 2022 15:43:26 -0700 Subject: [PATCH 4/4] fixup --- Sources/Logging/Locks.swift | 6 ------ Tests/LoggingTests/TestSendable.swift | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Sources/Logging/Locks.swift b/Sources/Logging/Locks.swift index 2a83ec31..f8ffbcd9 100644 --- a/Sources/Logging/Locks.swift +++ b/Sources/Logging/Locks.swift @@ -271,9 +271,3 @@ extension ReadWriteLock { try self.withWriterLock(body) } } - -// Sendable - -#if compiler(>=5.6) -extension Lock: Sendable {} -#endif diff --git a/Tests/LoggingTests/TestSendable.swift b/Tests/LoggingTests/TestSendable.swift index 4d92ee27..9e96e7b7 100644 --- a/Tests/LoggingTests/TestSendable.swift +++ b/Tests/LoggingTests/TestSendable.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Logging API open source project // -// Copyright (c) 2018-2019 Apple Inc. and the Swift Logging API project authors +// Copyright (c) 2022 Apple Inc. and the Swift Logging API project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information