From 3e74259949617f7638b98c15da3f9cfaf7ef06c9 Mon Sep 17 00:00:00 2001 From: George Barnett Date: Mon, 24 Jun 2024 15:40:44 +0100 Subject: [PATCH 1/3] Disable existential any build setting Motivation: On 5.8, if the experiment existential any setting is enabled and a consuming package holds an existential of a type from swift-log without an explicit 'any' then the build will fail. Modifications: - Disable the setting Result: Users of 5.8 aren't broken --- Package.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index dac0f222..98ba734f 100644 --- a/Package.swift +++ b/Package.swift @@ -16,7 +16,12 @@ import PackageDescription let swiftSettings: [SwiftSetting] = [ - .enableUpcomingFeature("ExistentialAny"), + // TODO: re-enable this when 5.8 is no longer supported. Having this + // enabled propagates to consumers before 5.8 which can result in build + // failures if the caller is using an existential from this package without. + // the explicit 'any'. + // + // .enableUpcomingFeature("ExistentialAny"), ] let package = Package( From 89a51099d39cc5a9e78df956896cdd8e91571de1 Mon Sep 17 00:00:00 2001 From: George Barnett Date: Mon, 24 Jun 2024 16:09:36 +0100 Subject: [PATCH 2/3] Move flags to docker compose --- Package.swift | 15 ++------------- docker/docker-compose.2204.510.yaml | 1 + docker/docker-compose.2204.59.yaml | 1 + docker/docker-compose.2204.main.yaml | 1 + docker/docker-compose.yaml | 2 +- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/Package.swift b/Package.swift index 98ba734f..728b0342 100644 --- a/Package.swift +++ b/Package.swift @@ -15,15 +15,6 @@ import PackageDescription -let swiftSettings: [SwiftSetting] = [ - // TODO: re-enable this when 5.8 is no longer supported. Having this - // enabled propagates to consumers before 5.8 which can result in build - // failures if the caller is using an existential from this package without. - // the explicit 'any'. - // - // .enableUpcomingFeature("ExistentialAny"), -] - let package = Package( name: "swift-log", products: [ @@ -32,13 +23,11 @@ let package = Package( targets: [ .target( name: "Logging", - dependencies: [], - swiftSettings: swiftSettings + dependencies: [] ), .testTarget( name: "LoggingTests", - dependencies: ["Logging"], - swiftSettings: swiftSettings + dependencies: ["Logging"] ), ] ) diff --git a/docker/docker-compose.2204.510.yaml b/docker/docker-compose.2204.510.yaml index 7985c44d..40268c52 100644 --- a/docker/docker-compose.2204.510.yaml +++ b/docker/docker-compose.2204.510.yaml @@ -12,6 +12,7 @@ services: image: swift-log:22.04-5.10 environment: - WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors + - EXISTENTIAL_ANY_ARG=-Xswiftc -enable-upcoming-feature -Xswiftc ExistentialAny #- SANITIZER_ARG=--sanitize=thread shell: diff --git a/docker/docker-compose.2204.59.yaml b/docker/docker-compose.2204.59.yaml index c174f47f..1cc67959 100644 --- a/docker/docker-compose.2204.59.yaml +++ b/docker/docker-compose.2204.59.yaml @@ -13,6 +13,7 @@ services: image: swift-log:22.04-5.9 environment: - WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors + - EXISTENTIAL_ANY_ARG=-Xswiftc -enable-upcoming-feature -Xswiftc ExistentialAny #- SANITIZER_ARG=--sanitize=thread shell: diff --git a/docker/docker-compose.2204.main.yaml b/docker/docker-compose.2204.main.yaml index 46109331..a9d9b053 100644 --- a/docker/docker-compose.2204.main.yaml +++ b/docker/docker-compose.2204.main.yaml @@ -16,6 +16,7 @@ services: - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error - EXPLICIT_SENDABLE_ARG=-Xswiftc -require-explicit-sendable - STRICT_CONCURRENCY_ARG=-Xswiftc -strict-concurrency=complete + - EXISTENTIAL_ANY_ARG=-Xswiftc -enable-upcoming-feature -Xswiftc ExistentialAny shell: image: swift-log:22.04-main diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 8974de91..502696cb 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -28,7 +28,7 @@ services: test: <<: *common - command: /bin/bash -xcl "swift test $${WARN_AS_ERROR_ARG-} $${SANITIZER_ARG-} $${IMPORT_CHECK_ARG-} $${EXPLICIT_SENDABLE_ARG-} $${STRICT_CONCURRENCY_ARG-}" + command: /bin/bash -xcl "swift test $${WARN_AS_ERROR_ARG-} $${SANITIZER_ARG-} $${IMPORT_CHECK_ARG-} $${EXPLICIT_SENDABLE_ARG-} $${STRICT_CONCURRENCY_ARG-} $${EXISTENTIAL_ANY_ARG-}" # util From 379524b468e950984d468837458e81109ce3c05c Mon Sep 17 00:00:00 2001 From: George Barnett Date: Mon, 24 Jun 2024 16:47:30 +0100 Subject: [PATCH 3/3] Disable existential any on main and 5.10 --- docker/docker-compose.2204.510.yaml | 3 ++- docker/docker-compose.2204.main.yaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/docker-compose.2204.510.yaml b/docker/docker-compose.2204.510.yaml index 40268c52..07bd58d8 100644 --- a/docker/docker-compose.2204.510.yaml +++ b/docker/docker-compose.2204.510.yaml @@ -12,8 +12,9 @@ services: image: swift-log:22.04-5.10 environment: - WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors - - EXISTENTIAL_ANY_ARG=-Xswiftc -enable-upcoming-feature -Xswiftc ExistentialAny #- SANITIZER_ARG=--sanitize=thread + # Generated test manifest uses existentials without 'any'. + #- EXISTENTIAL_ANY_ARG=-Xswiftc -enable-upcoming-feature -Xswiftc ExistentialAny shell: image: swift-log:22.04-5.10 diff --git a/docker/docker-compose.2204.main.yaml b/docker/docker-compose.2204.main.yaml index a9d9b053..c3a1358d 100644 --- a/docker/docker-compose.2204.main.yaml +++ b/docker/docker-compose.2204.main.yaml @@ -16,7 +16,8 @@ services: - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error - EXPLICIT_SENDABLE_ARG=-Xswiftc -require-explicit-sendable - STRICT_CONCURRENCY_ARG=-Xswiftc -strict-concurrency=complete - - EXISTENTIAL_ANY_ARG=-Xswiftc -enable-upcoming-feature -Xswiftc ExistentialAny + # Generated test manifest uses existentials without 'any'. + #- EXISTENTIAL_ANY_ARG=-Xswiftc -enable-upcoming-feature -Xswiftc ExistentialAny shell: image: swift-log:22.04-main