Skip to content

Commit 123e5e4

Browse files
authored
Merge branch 'swiftlang:main' into implementation/progress-reporter
2 parents 5705b9d + 09a0524 commit 123e5e4

File tree

60 files changed

+5522
-4171
lines changed

Some content is hidden

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

60 files changed

+5522
-4171
lines changed

.github/workflows/pull_request.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ jobs:
1414
with:
1515
linux_swift_versions: '["nightly-main"]'
1616
windows_swift_versions: '["nightly-main"]'
17+
enable_macos_checks: false
18+
macos_xcode_versions: '["16.3"]'
19+
macos_versions: '["sequoia"]'
1720

1821
soundness:
1922
name: Soundness

Benchmarks/Benchmarks/Internationalization/BenchmarkLocale.swift

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,20 @@
1313
import Benchmark
1414
import func Benchmark.blackHole
1515

16-
#if FOUNDATION_FRAMEWORK // This test uses CFString
16+
#if os(macOS) && USE_PACKAGE
17+
import FoundationEssentials
18+
import FoundationInternationalization
19+
#else
1720
import Foundation
21+
#endif
1822

1923
let benchmarks = {
2024
Benchmark.defaultConfiguration.maxIterations = 1_000
2125
Benchmark.defaultConfiguration.maxDuration = .seconds(3)
2226
Benchmark.defaultConfiguration.scalingFactor = .kilo
23-
Benchmark.defaultConfiguration.metrics = [.cpuTotal, .wallClock, .mallocCountTotal, .throughput]
27+
Benchmark.defaultConfiguration.metrics = [.cpuTotal, .wallClock, .throughput, .peakMemoryResident, .peakMemoryResidentDelta]
2428

29+
#if FOUNDATION_FRAMEWORK
2530
let string1 = "aaA" as CFString
2631
let string2 = "AAà" as CFString
2732
let range1 = CFRange(location: 0, length: CFStringGetLength(string1))
@@ -34,5 +39,22 @@ let benchmarks = {
3439
CFStringCompareWithOptionsAndLocale(string1, string2, range1, .init(rawValue: 0), nsLocale)
3540
}
3641
}
37-
}
3842
#endif
43+
44+
let identifiers = Locale.availableIdentifiers
45+
let allComponents = identifiers.map { Locale.Components(identifier: $0) }
46+
Benchmark("LocaleInitFromComponents") { benchmark in
47+
for components in allComponents {
48+
let locale = Locale(components: components)
49+
let components2 = Locale.Components(locale: locale)
50+
let locale2 = Locale(components: components2) // cache hit
51+
}
52+
}
53+
54+
Benchmark("LocaleComponentsInitIdentifer") { benchmark in
55+
for identifier in identifiers {
56+
let components = Locale.Components(identifier: identifier)
57+
}
58+
}
59+
}
60+

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,15 @@ list(APPEND _SwiftFoundation_versions
111111
list(APPEND _SwiftFoundation_availability_names
112112
"FoundationPreview"
113113
"FoundationPredicate"
114-
"FoundationPredicateRegex")
114+
"FoundationPredicateRegex"
115+
"FoundationSpan")
115116

116117
# The aligned availability for each name (in the same order)
117118
list(APPEND _SwiftFoundation_availability_releases
118119
${_SwiftFoundation_BaseAvailability}
119120
${_SwiftFoundation_BaseAvailability}
120-
${_SwiftFoundation_BaseAvailability})
121+
${_SwiftFoundation_BaseAvailability}
122+
${_SwiftFoundation_FutureAvailability})
121123

122124
foreach(version ${_SwiftFoundation_versions})
123125
foreach(name release IN ZIP_LISTS _SwiftFoundation_availability_names _SwiftFoundation_availability_releases)

Package.swift

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import CompilerPluginSupport
99
let availabilityTags: [_Availability] = [
1010
_Availability("FoundationPreview"), // Default FoundationPreview availability,
1111
_Availability("FoundationPredicate"), // Predicate relies on pack parameter runtime support
12-
_Availability("FoundationPredicateRegex") // Predicate regexes rely on new stdlib APIs
12+
_Availability("FoundationPredicateRegex"), // Predicate regexes rely on new stdlib APIs
13+
_Availability("FoundationSpan", availability: .future), // Availability of Span types
1314
]
1415
let versionNumbers = ["0.1", "0.2", "0.3", "0.4", "6.0.2", "6.1", "6.2"]
1516

@@ -74,6 +75,11 @@ let wasiLibcCSettings: [CSetting] = [
7475
.define("_WASI_EMULATED_MMAN", .when(platforms: [.wasi])),
7576
]
7677

78+
let testOnlySwiftSettings: [SwiftSetting] = [
79+
// The latest Windows toolchain does not yet have exit tests in swift-testing
80+
.define("FOUNDATION_EXIT_TESTS", .when(platforms: [.macOS, .linux, .openbsd]))
81+
]
82+
7783
let package = Package(
7884
name: "swift-foundation",
7985
platforms: [.macOS("15"), .iOS("18"), .tvOS("18"), .watchOS("11")],
@@ -135,6 +141,18 @@ let package = Package(
135141
] + wasiLibcCSettings,
136142
swiftSettings: [
137143
.enableExperimentalFeature("VariadicGenerics"),
144+
.enableExperimentalFeature("LifetimeDependence"),
145+
.enableExperimentalFeature(
146+
"InoutLifetimeDependence",
147+
.when(platforms: [.macOS, .iOS, .watchOS, .tvOS, .linux])
148+
),
149+
.enableExperimentalFeature(
150+
"LifetimeDependenceMutableAccessors",
151+
.when(platforms: [.macOS, .iOS, .watchOS, .tvOS, .linux])
152+
),
153+
.enableExperimentalFeature("AddressableTypes"),
154+
.enableExperimentalFeature("AllowUnsafeAttribute"),
155+
.enableExperimentalFeature("BuiltinModule"),
138156
.enableExperimentalFeature("AccessLevelOnImport")
139157
] + availabilityMacros + featureSettings,
140158
linkerSettings: [
@@ -150,7 +168,16 @@ let package = Package(
150168
resources: [
151169
.copy("Resources")
152170
],
153-
swiftSettings: availabilityMacros + featureSettings
171+
swiftSettings: [
172+
.enableExperimentalFeature(
173+
"InoutLifetimeDependence",
174+
.when(platforms: [.macOS, .iOS, .watchOS, .tvOS, .linux])
175+
),
176+
.enableExperimentalFeature(
177+
"LifetimeDependenceMutableAccessors",
178+
.when(platforms: [.macOS, .iOS, .watchOS, .tvOS, .linux])
179+
),
180+
] + availabilityMacros + featureSettings + testOnlySwiftSettings
154181
),
155182

156183
// FoundationInternationalization
@@ -184,7 +211,7 @@ let package = Package(
184211
"TestSupport",
185212
"FoundationInternationalization",
186213
],
187-
swiftSettings: availabilityMacros + featureSettings
214+
swiftSettings: availabilityMacros + featureSettings + testOnlySwiftSettings
188215
),
189216

190217
// FoundationMacros
@@ -213,10 +240,9 @@ package.targets.append(contentsOf: [
213240
.testTarget(
214241
name: "FoundationMacrosTests",
215242
dependencies: [
216-
"FoundationMacros",
217-
"TestSupport"
243+
"FoundationMacros"
218244
],
219-
swiftSettings: availabilityMacros + featureSettings
245+
swiftSettings: availabilityMacros + featureSettings + testOnlySwiftSettings
220246
)
221247
])
222248
#endif

Proposals/0007-swift-subprocess.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Status: **Accepted as 0.1**
77
* Bugs: [rdar://118127512](rdar://118127512), [apple/swift-foundation#309](https://github.com/apple/swift-foundation/issues/309)
88
* Review: [Pitch](https://forums.swift.org/t/pitch-swift-subprocess/69805/65), [1st review](https://forums.swift.org/t/review-sf-0007-introducing-swift-subprocess/70337), [2nd review](https://forums.swift.org/t/review-2nd-sf-0007-subprocess/76547), [3rd review](https://forums.swift.org/t/review-3rd-sf-0007-subprocess/78078/64)
9-
9+
* Implementation: https://github.com/swiftlang/swift-subprocess
1010

1111
## Revision History
1212

Proposals/0014-attributed-string-discontiguous-operations.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Review Manager: [Tina Liu](https://github.com/itingliu)
66
* Status: **Accepted**
77
* Review: ([Pitch](https://forums.swift.org/t/pitch-attributedstring-discontiguous-operations/76574))
8+
* Implementation: #1145
89

910
## Introduction
1011

Proposals/0017-expanded-calendar-support.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Expanded calendar support
22

3-
* Proposal: SF-017
3+
* Proposal: SF-0017
44
* Authors: [Dragan Besevic]([email protected])
55
* Review Manager: Tina Liu
6+
* Implementation: https://github.com/swiftlang/swift-foundation/pull/1171
67
* Status: **Accepted**
78

89

Proposals/0021-ISO8601ComponentsStyle.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
* Proposal: SF-0021
44
* Author(s): Tony Parker <[email protected]>
5-
* Status: **Review: March 19, 2025...March 26, 2025**
5+
* Status: **Accepted**
66
* Intended Release: _Swift 6.2_
7+
* Implementation: https://github.com/swiftlang/swift-foundation/pull/1209
78
* Review: ([pitch](https://forums.swift.org/t/pitch-iso8601-components-format-style/77990))
89
*_Related issues_*
910

0 commit comments

Comments
 (0)