Skip to content

Commit

Permalink
Swift 6 preparedness (#54)
Browse files Browse the repository at this point in the history
Motivation

We should feel confident that we compile clean under the strict
checks of Swift 6. As this is a data-processing-only framework
it's not a surprise that it turns out to be fine, but this patch
adds the necessary docker-compose steps to ensure it continues
to work.

Modifications

- Add docker-compose file for Swift 6 nightlies
- Extend docker-compose to pass explicit sendable and strict
    concurrency checks
- Add those checks to 6.0 and main nightlies

Result

Better confidence that we don't break our downstreams in Swift 6
support.
  • Loading branch information
Lukasa authored Jun 10, 2024
1 parent 7b2855e commit 9702323
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 23 deletions.
2 changes: 0 additions & 2 deletions Benchmarks/Benchmarks/SwiftASN1Benchmark/Benchmarks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ let benchmarks = {
.readSyscalls,
.writeSyscalls,
.memoryLeaked,
.retainCount,
.releaseCount,
]
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"mallocCountTotal" : 960,
"mallocCountTotal" : 976,
"memoryLeaked" : 0,
"readSyscalls" : 0,
"releaseCount" : 13983,
"retainCount" : 12200,
"writeSyscalls" : 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
"mallocCountTotal" : 967,
"memoryLeaked" : 0,
"readSyscalls" : 0,
"releaseCount" : 12900,
"retainCount" : 11382,
"writeSyscalls" : 0
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"mallocCountTotal" : 960,
"mallocCountTotal" : 976,
"memoryLeaked" : 0,
"readSyscalls" : 0,
"releaseCount" : 17688,
"retainCount" : 15905,
"writeSyscalls" : 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
"mallocCountTotal" : 967,
"memoryLeaked" : 0,
"readSyscalls" : 0,
"releaseCount" : 16605,
"retainCount" : 15087,
"writeSyscalls" : 0
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"mallocCountTotal" : 960,
"mallocCountTotal" : 976,
"memoryLeaked" : 0,
"readSyscalls" : 0,
"releaseCount" : 13846,
"retainCount" : 12063,
"writeSyscalls" : 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
"mallocCountTotal" : 967,
"memoryLeaked" : 0,
"readSyscalls" : 0,
"releaseCount" : 12763,
"retainCount" : 11245,
"writeSyscalls" : 0
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"mallocCountTotal" : 960,
"mallocCountTotal" : 976,
"memoryLeaked" : 0,
"readSyscalls" : 0,
"releaseCount" : 13983,
"retainCount" : 12200,
"writeSyscalls" : 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
"mallocCountTotal" : 967,
"memoryLeaked" : 0,
"readSyscalls" : 0,
"releaseCount" : 12900,
"retainCount" : 11382,
"writeSyscalls" : 0
}
28 changes: 28 additions & 0 deletions docker/docker-compose.2204.60.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: "3"

services:

runtime-setup:
image: swift-asn1:22.04-6.0
build:
args:
base_image: "swiftlang/swift:nightly-6.0-jammy"

test:
image: swift-asn1:22.04-6.0
environment:
- SWIFT_VERSION=6.0
- WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors
- IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
- EXPLICIT_SENDABLE_ARG=-Xswiftc -require-explicit-sendable
- STRICT_CONCURRENCY_ARG=-Xswiftc -strict-concurrency=complete
# - SANITIZER_ARG=--sanitize=thread # TSan broken still

shell:
image: swift-asn1:22.04-6.0

update-benchmark-baseline:
image: swift-asn1:22.04-6.0
environment:
- SWIFT_VERSION=6.0

2 changes: 2 additions & 0 deletions docker/docker-compose.2204.main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ services:
- SWIFT_VERSION=main
- WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors
- IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
- EXPLICIT_SENDABLE_ARG=-Xswiftc -require-explicit-sendable
- STRICT_CONCURRENCY_ARG=-Xswiftc -strict-concurrency=complete
# - SANITIZER_ARG=--sanitize=thread # TSan broken still

shell:
Expand Down
3 changes: 2 additions & 1 deletion docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:

test:
<<: *common
command: /bin/bash -xcl "swift $${SWIFT_TEST_VERB-test} $${WARN_AS_ERROR_ARG-} $${SANITIZER_ARG-} $${IMPORT_CHECK_ARG-} && cd Benchmarks && swift package benchmark baseline check --check-absolute-path Thresholds/$${SWIFT_VERSION-}/"
command: /bin/bash -xcl "swift $${SWIFT_TEST_VERB-test} $${WARN_AS_ERROR_ARG-} $${SANITIZER_ARG-} $${IMPORT_CHECK_ARG-} $${EXPLICIT_SENDABLE_ARG-} $${STRICT_CONCURRENCY_ARG} && cd Benchmarks && swift package benchmark baseline check --check-absolute-path Thresholds/$${SWIFT_VERSION-}/"

update-benchmark-baseline:
<<: *common
Expand All @@ -36,3 +36,4 @@ services:
shell:
<<: *common
entrypoint: /bin/bash

0 comments on commit 9702323

Please sign in to comment.