Skip to content

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Sep 9, 2025

This change moves the definition of Swift Testing's version to a new file, VERSION.txt. This file doesn't represent a standard, per se, but it is common for open-source projects to list their version info in such a file. And by putting our version info in this file, we can share it between package builds and CMake builds.

Currently using C23's #embed which is supported in clang as a non-standard extension. C++26 will add support for #embed.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

@grynspan grynspan added this to the Swift 6.x (main) milestone Sep 9, 2025
@grynspan grynspan self-assigned this Sep 9, 2025
@grynspan grynspan added enhancement New feature or request build 🧱 Affects the project's build configuration or process labels Sep 9, 2025
@grynspan
Copy link
Contributor Author

grynspan commented Sep 9, 2025

@swift-ci test

3 similar comments
@grynspan
Copy link
Contributor Author

grynspan commented Sep 9, 2025

@swift-ci test

@grynspan
Copy link
Contributor Author

grynspan commented Sep 9, 2025

@swift-ci test

@grynspan
Copy link
Contributor Author

grynspan commented Sep 9, 2025

@swift-ci test

@grynspan grynspan force-pushed the jgrynspan/version.txt branch 2 times, most recently from 793ed7d to 35e2e06 Compare September 11, 2025 16:31
This change moves the definition of Swift Testing's version to a new file,
version.txt. This file doesn't represent a standard, _per se_, but it is common
for open-source projects to list their version info in such a file. And by
putting our version info in this file, we can share it between package builds
and CMake builds.
@grynspan grynspan force-pushed the jgrynspan/version.txt branch from 2623161 to afa1d9c Compare September 11, 2025 18:29
@grynspan grynspan marked this pull request as ready for review September 11, 2025 19:13
@grynspan grynspan requested a review from shahmishal September 11, 2025 19:13
@stmontgomery
Copy link
Contributor

Also, looks like there's a conflict with my PR #1312 since I touched many CMake files

@grynspan
Copy link
Contributor Author

Will fix the conflict.

@grynspan grynspan changed the title Move the package version to version.txt. Move the package version to VERSION.txt. Sep 14, 2025
@grynspan grynspan merged commit 1be6b35 into main Sep 14, 2025
18 checks passed
@grynspan grynspan deleted the jgrynspan/version.txt branch September 14, 2025 15:42
@3405691582
Copy link
Member

FYI: for OpenBSD, the native platform compiler doesn't support C23 yet, so this causes an error (function-like macro '__has_embed' is not defined). I'll send a pr soon to add an extra __STDC_VERSION__ check around this after some testing.

@grynspan
Copy link
Contributor Author

grynspan commented Sep 16, 2025

We should always be building with (a recent) clang, but if there's an OpenBSD-specific issue, can it be solved by setting the SWT constant at build time?

@3405691582
Copy link
Member

I don't think so, but instead, we could probably also do something like a platform specific -D__has_embed(x)=0 to avoid the issue too, which might be a little neater.

@grynspan
Copy link
Contributor Author

Or just #if defined(__has_embed) && __has_embed(...) ... no?

@3405691582
Copy link
Member

That won't work on older clang versions (see e.g. https://godbolt.org/z/edGb78fbd).

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants