Skip to content

Commit 6c1b547

Browse files
authored
Merge pull request #1300 from swiftlang/automerge/merge-main-2025-05-19_09-00
Merge `main` into `release/6.2`
2 parents 320c583 + 7002497 commit 6c1b547

File tree

81 files changed

+9920
-2635
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+9920
-2635
lines changed

.github/workflows/automerge.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Create PR to merge main into release branch
2+
# In the first period after branching the release branch, we typically want to include many changes from `main` in the release branch. This workflow automatically creates a PR every Monday to merge main into the release branch.
3+
# Later in the release cycle we should stop this practice to avoid landing risky changes by disabling this workflow. To do so, disable the workflow as described in https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/disabling-and-enabling-a-workflow
4+
on:
5+
schedule:
6+
- cron: '0 9 * * MON'
7+
workflow_dispatch:
8+
jobs:
9+
create_merge_pr:
10+
name: Create PR to merge main into release branch
11+
uses: swiftlang/github-workflows/.github/workflows/create_automerge_pr.yml@main
12+
with:
13+
base_branch: release/6.2
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
if: (github.event_name == 'schedule' && github.repository == 'swiftlang/swift-foundation') || (github.event_name != 'schedule') # Ensure that we don't run this on a schedule in a fork

.github/workflows/pull_request.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Pull request
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
7+
jobs:
8+
tests:
9+
name: Test
10+
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
11+
with:
12+
linux_swift_versions: '["nightly-main"]'
13+
windows_swift_versions: '["nightly-main"]'
14+
15+
soundness:
16+
name: Soundness
17+
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
18+
with:
19+
license_header_check_project_name: "Swift.org"
20+
license_header_check_enabled: false
21+
docs_check_enabled: false
22+
format_check_enabled: false
23+
unacceptable_language_check_enabled: false
24+
api_breakage_check_enabled: false

Benchmarks/Benchmarks/Formatting/BenchmarkFormatting.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ let benchmarks = {
4545

4646
let preformatted = formats.map { ($0, $0.format(date)) }
4747

48-
Benchmark("iso860-format", configuration: .init(scalingFactor: .kilo)) { benchmark in
48+
Benchmark("iso8601-format", configuration: .init(scalingFactor: .kilo)) { benchmark in
4949
for _ in benchmark.scaledIterations {
5050
for fmt in formats {
5151
blackHole(fmt.format(date))
5252
}
5353
}
5454
}
5555

56-
Benchmark("iso860-parse", configuration: .init(scalingFactor: .kilo)) { benchmark in
56+
Benchmark("iso8601-parse", configuration: .init(scalingFactor: .kilo)) { benchmark in
5757
for _ in benchmark.scaledIterations {
5858
for fmt in preformatted {
5959
let result = try? fmt.0.parse(fmt.1)

Benchmarks/Benchmarks/URL/BenchmarkURL.swift

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,4 +231,50 @@ let benchmarks = {
231231
}
232232
}
233233

234+
Benchmark("URL-Template-parsing") { benchmark in
235+
for _ in benchmark.scaledIterations {
236+
blackHole(URL.Template("/api/{version}/accounts/{accountId}/transactions/{transactionId}{?expand*,fields*,embed*,format}")!)
237+
blackHole(URL.Template("/special/{+a}/details")!)
238+
blackHole(URL.Template("/documents/{documentId}{#section,paragraph}")!)
239+
}
240+
}
241+
242+
let templates = [
243+
URL.Template("/var/{var}/who/{who}/x/{x}{?keys*,count*,list*,y}")!,
244+
URL.Template("/special/{+keys}/details")!,
245+
URL.Template("x/y/{#path:6}/here")!,
246+
URL.Template("a/b{/var,x}/here")!,
247+
URL.Template("a{?var,y}")!,
248+
]
249+
250+
var variables: [URL.Template.VariableName: URL.Template.Value] = [
251+
.init("count"): ["one", "two", "three"],
252+
.init("dom"): ["example", "com"],
253+
.init("dub"): "me/too",
254+
.init("hello"): "Hello World!",
255+
.init("half"): "50%",
256+
.init("var"): "value",
257+
.init("who"): "fred",
258+
.init("base"): "http://example.com/home/",
259+
.init("path"): "/foo/bar",
260+
.init("list"): ["red", "green", "blue"],
261+
.init("keys"): [
262+
"semi": ";",
263+
"dot": ".",
264+
"comma": ",",
265+
],
266+
.init("v"): "6",
267+
.init("x"): "1024",
268+
.init("y"): "768",
269+
.init("empty"): "",
270+
.init("empty_keys"): [:],
271+
]
272+
273+
Benchmark("URL-Template-expansion") { benchmark in
274+
for _ in benchmark.scaledIterations {
275+
for t in templates {
276+
blackHole(URL(template: t, variables: variables))
277+
}
278+
}
279+
}
234280
}

Package.swift

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ let availabilityMacros: [SwiftSetting] = versionNumbers.flatMap { version in
3535
}
3636
}
3737

38-
let concurrencyChecking: [SwiftSetting] = [
38+
let featureSettings: [SwiftSetting] = [
3939
.enableExperimentalFeature("StrictConcurrency"),
40-
.enableUpcomingFeature("InferSendableFromCaptures")
40+
.enableUpcomingFeature("InferSendableFromCaptures"),
41+
.enableUpcomingFeature("MemberImportVisibility")
4142
]
4243

4344
var dependencies: [Package.Dependency] {
@@ -98,7 +99,7 @@ let package = Package(
9899
"FoundationInternationalization",
99100
],
100101
cSettings: wasiLibcCSettings,
101-
swiftSettings: availabilityMacros + concurrencyChecking
102+
swiftSettings: availabilityMacros + featureSettings
102103
),
103104

104105
// FoundationEssentials
@@ -134,7 +135,7 @@ let package = Package(
134135
swiftSettings: [
135136
.enableExperimentalFeature("VariadicGenerics"),
136137
.enableExperimentalFeature("AccessLevelOnImport")
137-
] + availabilityMacros + concurrencyChecking,
138+
] + availabilityMacros + featureSettings,
138139
linkerSettings: [
139140
.linkedLibrary("wasi-emulated-getpid", .when(platforms: [.wasi])),
140141
]
@@ -148,7 +149,7 @@ let package = Package(
148149
resources: [
149150
.copy("Resources")
150151
],
151-
swiftSettings: availabilityMacros + concurrencyChecking
152+
swiftSettings: availabilityMacros + featureSettings
152153
),
153154

154155
// FoundationInternationalization
@@ -172,7 +173,7 @@ let package = Package(
172173
cSettings: wasiLibcCSettings,
173174
swiftSettings: [
174175
.enableExperimentalFeature("AccessLevelOnImport")
175-
] + availabilityMacros + concurrencyChecking
176+
] + availabilityMacros + featureSettings
176177
),
177178

178179
.testTarget(
@@ -181,7 +182,7 @@ let package = Package(
181182
"TestSupport",
182183
"FoundationInternationalization",
183184
],
184-
swiftSettings: availabilityMacros + concurrencyChecking
185+
swiftSettings: availabilityMacros + featureSettings
185186
),
186187

187188
// FoundationMacros
@@ -198,7 +199,7 @@ let package = Package(
198199
exclude: ["CMakeLists.txt"],
199200
swiftSettings: [
200201
.enableExperimentalFeature("AccessLevelOnImport")
201-
] + availabilityMacros + concurrencyChecking
202+
] + availabilityMacros + featureSettings
202203
),
203204
]
204205
)
@@ -213,7 +214,7 @@ package.targets.append(contentsOf: [
213214
"FoundationMacros",
214215
"TestSupport"
215216
],
216-
swiftSettings: availabilityMacros + concurrencyChecking
217+
swiftSettings: availabilityMacros + featureSettings
217218
)
218219
])
219220
#endif

0 commit comments

Comments
 (0)