Open
Description
Motivation
Swift Testing needs to be able to report the full Swift version (as reported by swift --version
) for diagnostic purposes, e.g. when reading logs produced by a CI job or another engineer or in a different configuration. This version information is immensely useful when filing bug reports because it allows us to immediately see "oh, it was the [e.g.] August 9th nightly main-branch toolchain where the bug occurred" and so on.
Proposed solution
I'd like to propose we add API to the Swift standard library that vends a "human-readable" string equivalent to the aforementioned one. Something like this would be sufficient:
/// The human-readable version of the standard library.
///
/// Rabble rabble details details nuances nuances.
public var standardLibraryVersion: String { get }
Alternatives considered
- An internal-only, C/C++, or SPI function could also work, but as it wouldn't be API, developers not working on the Swift project wouldn't be able to use it.
- A more complex interface with configuration options is probably overkill.
Additional information
No response