Skip to content

Benchmarks: default to local swift-foundation branch#1981

Open
itingliu wants to merge 2 commits into
swiftlang:release/6.4.xfrom
itingliu:benchmark-local-benchmark
Open

Benchmarks: default to local swift-foundation branch#1981
itingliu wants to merge 2 commits into
swiftlang:release/6.4.xfrom
itingliu:benchmark-local-benchmark

Conversation

@itingliu
Copy link
Copy Markdown
Contributor

With no environment variable set, benchmarks now build against the local swift-foundation branch with other package dependencies fetched from remote. Previously the default was the system Foundation / toolchain, which is rarely useful for everyday work at desk.

USE_TOOLCHAIN=1 opts back in to the old default (Foundation.framework on macOS, toolchain Foundation on Linux).

Adds Benchmarks/README.md documenting prerequisites, run commands, and all four configurations (local default, SWIFTCI_USE_LOCAL_DEPS, USE_PACKAGE, USE_TOOLCHAIN). Condenses the Benchmarks section in Foundation_Build_Process.md to a pointer to that README.

@itingliu itingliu requested a review from a team as a code owner May 15, 2026 02:49
@itingliu itingliu marked this pull request as draft May 15, 2026 04:24
With no environment variable set, benchmarks now build against the local
swift-foundation branch with other package dependencies fetched from remote.
Previously the default was the system Foundation / toolchain, which is rarely
useful for everyday work at desk.

USE_TOOLCHAIN=1 opts back in to the old default (Foundation.framework on
macOS, toolchain Foundation on Linux).

Adds Benchmarks/README.md documenting prerequisites, run commands, and all
four configurations (local default, SWIFTCI_USE_LOCAL_DEPS, USE_PACKAGE,
USE_TOOLCHAIN). Condenses the Benchmarks section in Foundation_Build_Process.md
to a pointer to that README.
@itingliu itingliu force-pushed the benchmark-local-benchmark branch from 9870784 to 70acaaf Compare May 15, 2026 04:59
@itingliu itingliu requested a review from jrflat May 15, 2026 22:47
@itingliu itingliu marked this pull request as ready for review May 15, 2026 22:49
@itingliu
Copy link
Copy Markdown
Contributor Author

@swift-ci please test

Comment thread Benchmarks/Package.swift
case .useLocalPackage(let root), .useLocalPackageRemoteDeps(let root):
#if os(macOS)
packageDependency.append(.package(name: "foundation-local", path: "\(root)/swift-foundation"))
targetDependency.append(.product(name: "FoundationEssentials", package: "foundation-local"))
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This foundation-local is set at the main Package.swift. Its value depends on whether SWIFTCI_USE_LOCAL_DEPS is set. When it is set it's using local check, and remote one if unset.

@jrflat
Copy link
Copy Markdown
Contributor

jrflat commented May 16, 2026

There are 2 obstacles to how swift-foundation benchmarks are currently built and run through swift-corelibs-foundation:

  1. swift-corelibs-foundation requires the "SWIFTCI_USE_LOCAL_DEPS" env var to be set in order to use the local copy of swift-foundation, so we'll need to update that Package.swift, too (or find a way to define an env var automatically so that it knows to use the local copy of swift-foundation). Otherwise, we depend on the local swift-corelibs-foundation by default, but SCL-F still pulls in the remote swift-foundation dependency and doesn't pick up local changes.
  2. The default swift package benchmark still requires a local checkout of swift-corelibs-foundation in the same directory as swift-foundation. I think this is OK but should be documented.

To solve both, maybe we can figure out a way to avoid re-exporting the packages through swift-corelibs-foundation, at least for running benchmarks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants