You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.p("Swift 6 brings with it the ability to check your code for concurrency and data race issues. If switched on, the Swift compiler will produce errors where you could have data races."),
42
-
.p(.text("For help migrating your code, see the "),
43
-
.a(
44
-
.href("https://example.com"),
45
-
.text("Swift 6 language mode migration guide")
46
-
),
47
-
.text(" or the "),
48
-
.a(
49
-
.href("https://example.com"),
50
-
.text("Swift 6 release blog post")
51
-
)),
41
+
.p("The Swift 6 language mode prevents data-races at compile time. When you opt into Swift 6 mode, the compiler will produce errors when your code has a risk of concurrent access, turning hard-to-debug runtime failures into compiler errors."),
52
42
.p("To track the progress of the Swift package ecosystem, the Swift Package Index is running regular package compatibility checks across all packages in the index."),
43
+
// TODO: Comment back in when the URLs to the migration guide and/or launch post are available.
44
+
// .p(
45
+
// .text("For help migrating your code, see the "),
46
+
// .a(
47
+
// .href("https://example.com"),
48
+
// .text("Swift 6 language mode migration guide")
49
+
// ),
50
+
// .text(" or the "),
51
+
// .a(
52
+
// .href("https://example.com"),
53
+
// .text("Swift 6 release blog post")
54
+
// )
55
+
// ),
53
56
.h3("Total packages compatible with Swift 6"),
57
+
.p("Packages with zero data-race safety compiler diagnostics during a successful build on at least one tested platform."),
.text("The total number of all data-race safety diagnostics across "),
62
+
.em("all"),
63
+
.text(" packages.")
64
+
),
56
65
model.readyForSwift6Chart(kind:.totalErrors),
57
66
.h3("Frequently asked questions"),
58
67
.p(
@@ -66,6 +75,42 @@ extension ReadyForSwift6Show {
66
75
.hr(
67
76
.class("minor")
68
77
),
78
+
.p(
79
+
.strong(.text("Q: ")),
80
+
.text("Are additional parameters added to the build command for these tests compared to the “standard” Swift Package Index builds that determine Swift version compatibility on package pages?")
81
+
),
82
+
.p(
83
+
.strong(.text("A: ")),
84
+
.text("Yes. The builds that produce the results on this page have strict concurrency checking set to "),
85
+
.code("complete"),
86
+
.text(" to check for data race safety in Swift 6 language mode. We pass "),
87
+
.code("-strict-concurrency=complete"),
88
+
.text(" to either "),
89
+
.code("swift build"),
90
+
.text(" or "),
91
+
.code("xcodebuild"),
92
+
.text(".")
93
+
),
94
+
.hr(
95
+
.class("minor")
96
+
),
97
+
.p(
98
+
.strong(.text("Q: ")),
99
+
.text("Why use "),
100
+
.code("-strict-concurrency=complete"),
101
+
.text(" instead of "),
102
+
.code("-swift-version 6"),
103
+
.text("?")
104
+
),
105
+
.p(
106
+
.strong(.text("A: ")),
107
+
.text("Data-race safety diagnostics are determined in different stages of the compiler. For example, type checking produces some data-race safety errors, and others are diagnosed during control-flow analysis after code generation. If type checking produces errors, the compiler will not proceed to code generation, so testing with "),
108
+
.code("-swift-version 6"),
109
+
.text(" would show fewer errors than really exist across the package ecosystem.")
110
+
),
111
+
.hr(
112
+
.class("minor")
113
+
),
69
114
.p(
70
115
.strong(.text("Q: ")),
71
116
.text("What does “total concurrency errors” mean?")
Copy file name to clipboardExpand all lines: Tests/AppTests/__Snapshots__/WebpageSnapshotTests/test_ReadyForSwift6Show.1.html
+26-5Lines changed: 26 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -78,15 +78,15 @@ <h1>
78
78
<main>
79
79
<divclass="inner">
80
80
<h2>Ready for Swift 6</h2>
81
-
<p>Swift 6 brings with it the ability to check your code for concurrency and data race issues. If switched on, the Swift compiler will produce errors where you could have data races.</p>
82
-
<p>For help migrating your code, see the
83
-
<ahref="https://example.com">Swift 6 language mode migration guide</a> or the
84
-
<ahref="https://example.com">Swift 6 release blog post</a>
85
-
</p>
81
+
<p>The Swift 6 language mode prevents data-races at compile time. When you opt into Swift 6 mode, the compiler will produce errors when your code has a risk of concurrent access, turning hard-to-debug runtime failures into compiler errors.</p>
86
82
<p>To track the progress of the Swift package ecosystem, the Swift Package Index is running regular package compatibility checks across all packages in the index.</p>
87
83
<h3>Total packages compatible with Swift 6</h3>
84
+
<p>Packages with zero data-race safety compiler diagnostics during a successful build on at least one tested platform.</p>
88
85
<p>Couldn’t load chart data.</p>
89
86
<h3>Total Swift 6 concurrency errors</h3>
87
+
<p>The total number of all data-race safety diagnostics across
<strong>A: </strong>We define compatibility in the same way we do on package pages. If any build of the package completes successfully on any of our tested platforms (macOS via SwiftPM, macOS via XcodeBuild, iOS, visionOS, watchOS, tvOS, or Linux) then that build is deemed compatible with the Swift version.
97
97
</p>
98
98
<hrclass="minor"/>
99
+
<p>
100
+
<strong>Q: </strong>Are additional parameters added to the build command for these tests compared to the “standard” Swift Package Index builds that determine Swift version compatibility on package pages?
101
+
</p>
102
+
<p>
103
+
<strong>A: </strong>Yes. The builds that produce the results on this page have strict concurrency checking set to
104
+
<code>complete</code> to check for data race safety in Swift 6 language mode. We pass
105
+
<code>-strict-concurrency=complete</code> to either
106
+
<code>swift build</code> or
107
+
<code>xcodebuild</code>.
108
+
</p>
109
+
<hrclass="minor"/>
110
+
<p>
111
+
<strong>Q: </strong>Why use
112
+
<code>-strict-concurrency=complete</code> instead of
113
+
<code>-swift-version 6</code>?
114
+
</p>
115
+
<p>
116
+
<strong>A: </strong>Data-race safety diagnostics are determined in different stages of the compiler. For example, type checking produces some data-race safety errors, and others are diagnosed during control-flow analysis after code generation. If type checking produces errors, the compiler will not proceed to code generation, so testing with
117
+
<code>-swift-version 6</code> would show fewer errors than really exist across the package ecosystem.
118
+
</p>
119
+
<hrclass="minor"/>
99
120
<p>
100
121
<strong>Q: </strong>What does “total concurrency errors” mean?
0 commit comments