-
Notifications
You must be signed in to change notification settings - Fork 202
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
Add version.h
defining WASI_LIBC_VERSION
#534
base: main
Are you sure you want to change the base?
Conversation
CI error should be fixed in #535. |
i wonder if the git requirement can make some people unhappy. |
This change re-imagines [wasi-sdk#487] entirely in `wasi-libc`. Instead of generating a `version.h` header late--in `wasi-sdk`--it is generated immediately when `wasi-libc` is built. This has the disadvantage that we don't know what `wasi-sdk` this will be used in... but almost: when releasing `wasi-sdk`, we _should_ be tagging the `wasi-libc` repository. If we did that more faithfully ([docs]), this commit would generate: ```c // Generated by wasi-lib's `Makefile`. #ifndef VERSION_H #define VERSION_H #define WASI_LIBC_VERSION "wasi-sdk-24" #endif ``` Using the magic of `git-describe`, if someone is using `wasi-libc` directly, they may see a version like: `wasi-sdk-22-19-g5d3c5e9-dirty`. This should be read like: `<wasi-sdk tag>-<# commits since tag>-<current commit>-<is the repository dirty?>`. [wasi-sdk#487]: WebAssembly/wasi-sdk#487 [docs]: https://github.com/WebAssembly/wasi-sdk/blob/754aec3/RELEASING.md?plain=1#L22
Won't this means that the version reported in the wasi-libc that is embedded in wasi-sdk is always at least one version behind because the building happens before the tagging? Or do we tag and then build (which also would seem odd)? |
Normally with this kind of thing the release source archive would have Sadly in the age of github the automatic source snapshot is often used instead of the output of We could switch to a |
Yeah, that's a good point. I'm just exploring what might work with these PRs. Seems like we probably should do the replacement over in WebAssembly/wasi-sdk#487 but maybe wasi-libc could just contain a token value like |
This change re-imagines wasi-sdk#487 entirely in
wasi-libc
. Instead of generating aversion.h
header late--inwasi-sdk
--it is generated immediately whenwasi-libc
is built. This has the disadvantage that we don't know whatwasi-sdk
this will be used in... but almost: when releasingwasi-sdk
, we should be tagging thewasi-libc
repository. If we did that more faithfully (docs), this commit would generate:Using the magic of
git-describe
, if someone is usingwasi-libc
directly, they may see a version like:wasi-sdk-22-19-g5d3c5e9-dirty
. This should be read like:<wasi-sdk tag>-<# commits since tag>-<current commit>-<is the repository dirty?>
.