-
Notifications
You must be signed in to change notification settings - Fork 131
Various VersionNumber changes of merit.
#1246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
grynspan
merged 7 commits into
main
from
jgrynspan/version-number-upper-cap-and-minutiae
Aug 7, 2025
Merged
Various VersionNumber changes of merit.
#1246
grynspan
merged 7 commits into
main
from
jgrynspan/version-number-upper-cap-and-minutiae
Aug 7, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR does things to `ABI.VersionNumber`: - Renames it to `VersionNumber` as we do have some use cases that aren't related to JSON schema versioning. I initially didn't want to make this type a general version number type, but it's just too useful not to do so. Alas. - Changes the type of the `swiftStandardLibraryVersion` global variable to `VersionNumber?`. - Adds `swiftCompilerVersion` representing the version of the Swift compiler used to compile Swift Testing. We need this value when computing the JSON schema version (see next bullet.) - Clamps the range of supported JSON schema versions to the Swift compiler version _unless_ we've explicitly defined a schema version higher than it: | Compiler | Highest Defined Schema | Requested | Result | |-|-|-|-| | 1.0 | 1.0 | 1.0 | 1.0 | | 2.0 | 1.0 | 1.0 | 1.0 | | 1.0 | 2.0 | 1.0 | 1.0 | | 1.0 | 1.0 | 2.0 | `nil` | | 2.0 | 2.0 | 1.0 | 1.0 | | 2.0 | 1.0 | 2.0 | 1.0 | | 1.0 | 2.0 | 2.0 | 2.0 | | 2.0 | 2.0 | 2.0 | 2.0 | The reasoning here is that, when we're built with a given compiler version, we presumably know about all JSON schema versions up to and including the one aligned with that compiler, so if you ask for the schema version aligned with the compiler, it's equivalent to whatever we support that's less than or equal to the compiler version. But if you ask for something greater than the compiler version, and we haven't defined it, we don't know anything about it and can't provide it. This reasoning breaks down somewhat if you build an old version of the Swift Testing package with a new compiler, but in general we don't support that sort of configuration for very long (and we can't predict the future anyway.)
Contributor
Author
|
@swift-ci test |
Contributor
Author
|
@swift-ci test Linux |
Contributor
Author
|
@swift-ci test |
Contributor
Author
|
@swift-ci test macOS |
…e platforms either, okay then
Contributor
Author
|
@swift-ci test |
Contributor
Author
|
@swift-ci test |
stmontgomery
approved these changes
Aug 6, 2025
Contributor
Author
|
@swift-ci test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
build
🧱 Affects the project's build configuration or process
enhancement
New feature or request
tools integration
🛠️ Integration of swift-testing into tools/IDEs
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR does things to
ABI.VersionNumber:Renames it to
VersionNumberas we do have some use cases that aren't related to JSON schema versioning. I initially didn't want to make this type a general version number type, but it's just too useful not to do so. Alas.Changes the type of the
swiftStandardLibraryVersionglobal variable toVersionNumber?.Changes the type of the
glibcVersionglobal variable toVersionNumber.Adds
swiftCompilerVersionrepresenting the version of the Swift compiler used to compile Swift Testing. We need this value when computing the JSON schema version (see next bullet.)Clamps the range of supported JSON schema versions to the Swift compiler version unless we've explicitly defined a schema version higher than it:
nilThe reasoning here is that, when we're built with a given compiler version, we presumably know about all JSON schema versions up to and including the one aligned with that compiler, so if you ask for the schema version aligned with the compiler, it's equivalent to whatever we support that's less than or equal to the compiler version. But if you ask for something greater than the compiler version, and we haven't defined it, we don't know anything about it and can't provide it.
This reasoning breaks down somewhat if you build an old version of the Swift Testing package with a new compiler, but in general we don't support that sort of configuration for very long (and we can't predict the future anyway.)
Checklist: