swift-foundation: benchmarks failing from main
Describe the bug
Benchmarks are failing to build from main eb084da833b155e2e440d6ca3ae9da32b1fd4cba. It looks related to the changes landed in https://github.com/swiftlang/swift-foundation/pull/1198. We might be missing some version gating in the benchmarks themselves.
Configuration (please complete the following information):
- swift-driver version: swift-driver version: 1.127.5.3 Apple Swift version 6.2 (swiftlang-6.2.0.10.950 clang-1700.3.10.950)
- Target: arm64-apple-macosx15.0
- OS Version: macOS 15.5 (24F74)
Actual behavior
swift package --disable-sandbox -c release benchmark run
warning: 'benchmarks': swift-foundation benchmarks: Using system Foundation.framework
Building for production...
ld: warning: building for macOS-13.0, but linking with dylib '/opt/homebrew/opt/jemalloc/lib/libjemalloc.2.dylib' which was built for newer version 14.0
[7/7] Linking BenchmarkTool-tool
Build of product 'BenchmarkTool' complete! (14.57s)
Build complete!
Building BenchmarkTool in release mode...
Building benchmark targets in release mode for benchmark run...
Building URLBenchmarks
[0/2] Write swift-version-40EA24106824B483.txt
Building for production...
[0/8] Compiling CSystem shims.c
[1/8] Write swift-version-40EA24106824B483.txt
[3/10] Compiling ArgumentParserToolInfo ToolInfo.swift
[4/11] Compiling SystemPackage Errno.swift
[5/11] Compiling ArgumentParser BashCompletionsGenerator.swift
[6/12] Compiling BenchmarkBoilerplateGenerator BenchmarkBoilerplateGenerator.swift
[6/12] Write Objects.LinkFileList
[7/12] Linking BenchmarkBoilerplateGenerator-tool
[8/12] Generating plugin support files
[9/12] Write sources
[11/13] Compiling URLBenchmarks BenchmarkURL.swift
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:250:25: error: 'Template' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
248 | ]
249 |
250 | var variables: [URL.Template.VariableName: URL.Template.Value] = [
| |- error: 'Template' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
251 | .init("count"): ["one", "two", "three"],
252 | .init("dom"): ["example", "com"],
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:250:52: error: 'Template' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
248 | ]
249 |
250 | var variables: [URL.Template.VariableName: URL.Template.Value] = [
| |- error: 'Template' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
251 | .init("count"): ["one", "two", "three"],
252 | .init("dom"): ["example", "com"],
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:236:27: error: 'Template' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
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}")!)
| |- error: 'Template' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
237 | blackHole(URL.Template("/special/{+a}/details")!)
238 | blackHole(URL.Template("/documents/{documentId}{#section,paragraph}")!)
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:236:27: error: 'init(_:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
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}")!)
| |- error: 'init(_:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
237 | blackHole(URL.Template("/special/{+a}/details")!)
238 | blackHole(URL.Template("/documents/{documentId}{#section,paragraph}")!)
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:237:27: error: 'Template' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
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")!)
| |- error: 'Template' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
238 | blackHole(URL.Template("/documents/{documentId}{#section,paragraph}")!)
239 | }
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:237:27: error: 'init(_:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
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")!)
| |- error: 'init(_:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
238 | blackHole(URL.Template("/documents/{documentId}{#section,paragraph}")!)
239 | }
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:238:27: error: 'Template' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
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}")!)
| |- error: 'Template' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
239 | }
240 | }
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:238:27: error: 'init(_:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
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}")!)
| |- error: 'init(_:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
239 | }
240 | }
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:243:13: error: 'Template' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
241 |
242 | let templates = [
243 | URL.Template("/var/{var}/who/{who}/x/{x}{?keys*,count*,list*,y}")!,
| |- error: 'Template' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
244 | URL.Template("/special/{+keys}/details")!,
245 | URL.Template("x/y/{#path:6}/here")!,
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:243:13: error: 'init(_:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
241 |
242 | let templates = [
243 | URL.Template("/var/{var}/who/{who}/x/{x}{?keys*,count*,list*,y}")!,
| |- error: 'init(_:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
244 | URL.Template("/special/{+keys}/details")!,
245 | URL.Template("x/y/{#path:6}/here")!,
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:244:13: error: 'Template' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
242 | let templates = [
243 | URL.Template("/var/{var}/who/{who}/x/{x}{?keys*,count*,list*,y}")!,
244 | URL.Template("/special/{+keys}/details")!,
| |- error: 'Template' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
245 | URL.Template("x/y/{#path:6}/here")!,
246 | URL.Template("a/b{/var,x}/here")!,
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:244:13: error: 'init(_:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
242 | let templates = [
243 | URL.Template("/var/{var}/who/{who}/x/{x}{?keys*,count*,list*,y}")!,
244 | URL.Template("/special/{+keys}/details")!,
| |- error: 'init(_:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
245 | URL.Template("x/y/{#path:6}/here")!,
246 | URL.Template("a/b{/var,x}/here")!,
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:245:13: error: 'Template' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
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")!,
| |- error: 'Template' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
246 | URL.Template("a/b{/var,x}/here")!,
247 | URL.Template("a{?var,y}")!,
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:245:13: error: 'init(_:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
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")!,
| |- error: 'init(_:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
246 | URL.Template("a/b{/var,x}/here")!,
247 | URL.Template("a{?var,y}")!,
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:246:13: error: 'Template' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
244 | URL.Template("/special/{+keys}/details")!,
245 | URL.Template("x/y/{#path:6}/here")!,
246 | URL.Template("a/b{/var,x}/here")!,
| |- error: 'Template' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
247 | URL.Template("a{?var,y}")!,
248 | ]
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:246:13: error: 'init(_:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
244 | URL.Template("/special/{+keys}/details")!,
245 | URL.Template("x/y/{#path:6}/here")!,
246 | URL.Template("a/b{/var,x}/here")!,
| |- error: 'init(_:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
247 | URL.Template("a{?var,y}")!,
248 | ]
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:247:13: error: 'Template' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
245 | URL.Template("x/y/{#path:6}/here")!,
246 | URL.Template("a/b{/var,x}/here")!,
247 | URL.Template("a{?var,y}")!,
| |- error: 'Template' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
248 | ]
249 |
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:247:13: error: 'init(_:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
245 | URL.Template("x/y/{#path:6}/here")!,
246 | URL.Template("a/b{/var,x}/here")!,
247 | URL.Template("a{?var,y}")!,
| |- error: 'init(_:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
248 | ]
249 |
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:251:25: error: 'init(arrayLiteral:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
249 |
250 | var variables: [URL.Template.VariableName: URL.Template.Value] = [
251 | .init("count"): ["one", "two", "three"],
| |- error: 'init(arrayLiteral:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
252 | .init("dom"): ["example", "com"],
253 | .init("dub"): "me/too",
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:252:23: error: 'init(arrayLiteral:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
250 | var variables: [URL.Template.VariableName: URL.Template.Value] = [
251 | .init("count"): ["one", "two", "three"],
252 | .init("dom"): ["example", "com"],
| |- error: 'init(arrayLiteral:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
253 | .init("dub"): "me/too",
254 | .init("hello"): "Hello World!",
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:253:23: error: 'Value' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
251 | .init("count"): ["one", "two", "three"],
252 | .init("dom"): ["example", "com"],
253 | .init("dub"): "me/too",
| |- error: 'Value' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
254 | .init("hello"): "Hello World!",
255 | .init("half"): "50%",
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:253:23: error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
251 | .init("count"): ["one", "two", "three"],
252 | .init("dom"): ["example", "com"],
253 | .init("dub"): "me/too",
| |- error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
254 | .init("hello"): "Hello World!",
255 | .init("half"): "50%",
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:254:25: error: 'Value' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
252 | .init("dom"): ["example", "com"],
253 | .init("dub"): "me/too",
254 | .init("hello"): "Hello World!",
| |- error: 'Value' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
255 | .init("half"): "50%",
256 | .init("var"): "value",
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:254:25: error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
252 | .init("dom"): ["example", "com"],
253 | .init("dub"): "me/too",
254 | .init("hello"): "Hello World!",
| |- error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
255 | .init("half"): "50%",
256 | .init("var"): "value",
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:255:24: error: 'Value' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
253 | .init("dub"): "me/too",
254 | .init("hello"): "Hello World!",
255 | .init("half"): "50%",
| |- error: 'Value' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
256 | .init("var"): "value",
257 | .init("who"): "fred",
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:255:24: error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
253 | .init("dub"): "me/too",
254 | .init("hello"): "Hello World!",
255 | .init("half"): "50%",
| |- error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
256 | .init("var"): "value",
257 | .init("who"): "fred",
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:256:23: error: 'Value' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
254 | .init("hello"): "Hello World!",
255 | .init("half"): "50%",
256 | .init("var"): "value",
| |- error: 'Value' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
257 | .init("who"): "fred",
258 | .init("base"): "http://example.com/home/",
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:256:23: error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
254 | .init("hello"): "Hello World!",
255 | .init("half"): "50%",
256 | .init("var"): "value",
| |- error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
257 | .init("who"): "fred",
258 | .init("base"): "http://example.com/home/",
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:257:23: error: 'Value' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
255 | .init("half"): "50%",
256 | .init("var"): "value",
257 | .init("who"): "fred",
| |- error: 'Value' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
258 | .init("base"): "http://example.com/home/",
259 | .init("path"): "/foo/bar",
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:257:23: error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
255 | .init("half"): "50%",
256 | .init("var"): "value",
257 | .init("who"): "fred",
| |- error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
258 | .init("base"): "http://example.com/home/",
259 | .init("path"): "/foo/bar",
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:258:24: error: 'Value' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
256 | .init("var"): "value",
257 | .init("who"): "fred",
258 | .init("base"): "http://example.com/home/",
| |- error: 'Value' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
259 | .init("path"): "/foo/bar",
260 | .init("list"): ["red", "green", "blue"],
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:258:24: error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
256 | .init("var"): "value",
257 | .init("who"): "fred",
258 | .init("base"): "http://example.com/home/",
| |- error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
259 | .init("path"): "/foo/bar",
260 | .init("list"): ["red", "green", "blue"],
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:259:24: error: 'Value' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
257 | .init("who"): "fred",
258 | .init("base"): "http://example.com/home/",
259 | .init("path"): "/foo/bar",
| |- error: 'Value' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
260 | .init("list"): ["red", "green", "blue"],
261 | .init("keys"): [
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:259:24: error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
257 | .init("who"): "fred",
258 | .init("base"): "http://example.com/home/",
259 | .init("path"): "/foo/bar",
| |- error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
260 | .init("list"): ["red", "green", "blue"],
261 | .init("keys"): [
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:260:24: error: 'init(arrayLiteral:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
258 | .init("base"): "http://example.com/home/",
259 | .init("path"): "/foo/bar",
260 | .init("list"): ["red", "green", "blue"],
| |- error: 'init(arrayLiteral:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
261 | .init("keys"): [
262 | "semi": ";",
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:261:24: error: 'init(dictionaryLiteral:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
259 | .init("path"): "/foo/bar",
260 | .init("list"): ["red", "green", "blue"],
261 | .init("keys"): [
| |- error: 'init(dictionaryLiteral:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
262 | "semi": ";",
263 | "dot": ".",
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:266:21: error: 'Value' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
264 | "comma": ",",
265 | ],
266 | .init("v"): "6",
| |- error: 'Value' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
267 | .init("x"): "1024",
268 | .init("y"): "768",
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:266:21: error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
264 | "comma": ",",
265 | ],
266 | .init("v"): "6",
| |- error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
267 | .init("x"): "1024",
268 | .init("y"): "768",
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:267:21: error: 'Value' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
265 | ],
266 | .init("v"): "6",
267 | .init("x"): "1024",
| |- error: 'Value' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
268 | .init("y"): "768",
269 | .init("empty"): "",
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:267:21: error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
265 | ],
266 | .init("v"): "6",
267 | .init("x"): "1024",
| |- error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
268 | .init("y"): "768",
269 | .init("empty"): "",
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:268:21: error: 'Value' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
266 | .init("v"): "6",
267 | .init("x"): "1024",
268 | .init("y"): "768",
| |- error: 'Value' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
269 | .init("empty"): "",
270 | .init("empty_keys"): [:],
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:268:21: error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
266 | .init("v"): "6",
267 | .init("x"): "1024",
268 | .init("y"): "768",
| |- error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
269 | .init("empty"): "",
270 | .init("empty_keys"): [:],
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:269:25: error: 'Value' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
267 | .init("x"): "1024",
268 | .init("y"): "768",
269 | .init("empty"): "",
| |- error: 'Value' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
270 | .init("empty_keys"): [:],
271 | ]
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:269:25: error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
267 | .init("x"): "1024",
268 | .init("y"): "768",
269 | .init("empty"): "",
| |- error: 'init(stringLiteral:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
270 | .init("empty_keys"): [:],
271 | ]
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:270:30: error: 'init(dictionaryLiteral:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
268 | .init("y"): "768",
269 | .init("empty"): "",
270 | .init("empty_keys"): [:],
| |- error: 'init(dictionaryLiteral:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
271 | ]
272 |
/Users/rick/Developer/swift-foundation-fork/Benchmarks/Benchmarks/URL/BenchmarkURL.swift:276:27: error: 'init(template:variables:)' is only available in macOS 26.0 or newer
20 | #endif
21 |
22 | let benchmarks = {
| `- note: add '@available' attribute to enclosing let
23 |
24 | Benchmark.defaultConfiguration.maxIterations = 1_000_000_000
:
274 | for _ in benchmark.scaledIterations {
275 | for t in templates {
276 | blackHole(URL(template: t, variables: variables))
| |- error: 'init(template:variables:)' is only available in macOS 26.0 or newer
| `- note: add 'if #available' version check
277 | }
278 | }
Benchmark failed to run due to build error.
error: buildFailed
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 24 (24 by maintainers)
I think the dependency on MutableSpan is what @jmschonfeld and @glessard are addressing in a series of PRs about availability (e.g. https://github.com/swiftlang/swift-foundation/pull/1400)
I opened https://github.com/swiftlang/swift-foundation/pull/1393 if you all want to give it a try, and review it if that works
It’s possible I ran those against the framework (Darwin) target.
I would love to be able to get CI to run our benchmarks on demand, like we have for other Swift projects. I’m unsure of the requirement from the CI side. In the meantime we should absolutely make it so that they build correctly in package mode.
Sorry - to clarify, the CI I’m mentioning is the CI that runs unit tests on the swift repo. There is no current job that runs these benchmarks in CI. The
SWIFTCI_USE_LOCAL_DEPSwas an environment variable we used for our packages when running unit tests and we just extended its usage to this package, but there isn’t actually CI for this benchmark sub-package (yet). Since we don’t (yet) have CI that runs these benchmarks it’s possible that there are issues here that need to be corrected that aren’t caught by automation.I suspect enabling the
MemberImportVisibilityflag in the benchmark targets would help with that (theString.Encodingextension is an example of where members previously leaked through private imports but with the flag enabled they should not) - I suspect we likely forgot to add them to the benchmark targets when we added them to the main project.For some added context here:
SWIFTCI_USE_LOCAL_DEPSis set by the swift repo CI when performing a full toolchain test. In that scenario, it needs to use the locally checked out copies rather than fetching from git, and the package manifest assumes that the repos are all in the same parent directory. All of our dependencies (swift-foundation, swift-corelibs-foundation, swift-foundation-icu, etc.) are all set up to respect this flag. When we added the benchmark target, we also expanded it to allow specifying the directory that contains all of these repos, soSWIFTCI_USE_LOCAL_DEPS=1indicates all checkouts are in the..directory andSWIFTCI_USE_LOCAL_DEPS=/foo/barindicates all checkouts are in the/foo/bardirectory. That’s opposed to theUSE_PACKAGE=1configuration where it uses the package but checks outmainfrom GitHub to compare to a known ToT commit. I think we could probably use some documentation to help explain this (and maybe some tweaks to the configuration. I wonder if we could switch to using package traits if there’s better support for listing available configurations with descriptions with those)Good find! I don’t think we can remove that from JSON benchmark without disabling that benchmark test, so not sure what we can do there besides working around it
But even if I remove that import and all places that use
Bundle(and resolve all other minor errors such as missingautoreleasepool)I’m still seeing this thanks to
.unsafeFlags(["-Rmodule-loading"])(thanks @jmschonfeld )I wonder if they switch to internal import would help.
And this
Not sure about this one though.
We can fix this by replacing
NSTemporaryDirectorywithURL.temporaryDirectoryBut this below means we’re still definitely using the toolchain Foundation somewhere:
This is what I figured too. I couldn’t figure out where this env was exported since it’s not set for me either.
Perhaps, but that shouldn’t be required because URL.Template is marked as available for FoundationPreview 6.2. That means it can be used as part of the package on previous builds (of course, not interoperating with the framework version on 26 or later).
That seems wrong, and probably is the root of the issue. See this import at the top of the benchmark files:
I think the benchmarks are supposed to be using the Foundation built from the package here, not the one with availability that comes from the system Foundation.