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
[SR-473] Add version constants to each package #5327
Comments
We should consider the namespace implications of these names. |
Comment by Kostiantyn Koval (JIRA) How about the "metadata" tag? Now SPM support it, should it be also included? public let version: (Int, Int, Int, String) |
Good point. Probably `String?`. Matching the `Version` initializer. |
Worth considering: adding the SHA too. |
what should be the name of the generated swift file? <packagename>.swift can clash some of the name spacing implications : if a global/local is defined with name `url` or `version` it'll take precedence |
Comment by Kostiantyn Koval (JIRA) To generate this file a package must be a git repo. How about local packages? |
For the root package we can generate it if there is a Git repo there, otherwise, not. |
Comment by Kostiantyn Koval (JIRA) I've started initial work on it [PR-122 | #122] |
Can you clarify the intent of this work? Some projects might not want dependency version information embedded inside them. And using the embedded version information for runtime compatibility checks may not be something we really want to encourage (vs. a more explicit mechanism, e.g., real language support for it). |
For example: A web server product provides diagnostics when it fails to connect to its port, part of this diagnostics is a dump of the version information for the socket library it uses. |
What is left here? |
Comment by Kostiantyn Koval (JIRA) I think first would be nice to find a use-case and tune this functionality for it. |
It is not yet possible to use the version constants, they are generated, but not |
We need to revisit this and consider the generated version symbols to be part of the SwiftPM API (since we won't easily be able to change them in the future without breaking anything). |
Comment by Eric Blachère (JIRA) Sorry for reviving this old topic, but is there any plan for this to happen ? Or is there currently already a way to access the version of an SPM module from the code ? We use to access the info.plist but it's not here anymore 😉 Thanks ! |
Additional Detail from JIRA
md5: a3094f8613e66dbff0c75b9857d3ac66
relates to:
Issue Description:
Every package should generate a swift file that contains two public constants:
Ideally this would be part of llbuild’s YAML so it is involved in the build graph. But it will be enough for now to just generate the file every build.
The text was updated successfully, but these errors were encountered: