Skip to content
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

Enhancement request: interface to get the wasi-libc version at runtime #490

Open
grynspan opened this issue Apr 22, 2024 · 2 comments
Open

Comments

@grynspan
Copy link

I work on a Swift testing library, swift-testing (https://github.com/apple/swift-testing). I'm looking at adding Wasm/WASI support using the SwiftWasm toolchain (https://www.swiftwasm.org/). One of the things we do when starting a test run is log some diagnostic info including the OS version so that developers can say "oh, this test always fails on Ubuntu 23 (or macOS 30 or Windows 12 etc.), I'd better fix that."

For WASI, I'm told that the platform has a concept of a "current version" and I see that wasi-libc internally knows its own version, but there's no interface to read it at runtime. So I'm hoping such an interface could be added. I don’t have a particular interface design in mind.

Thanks!

@abrown
Copy link
Collaborator

abrown commented May 2, 2024

How about this? Much like Emscripten does, we generate a version.h file containing #define WASI_LIBC_VERSION "<version string>". I'm just not really sure what version you are seeing when you say "wasi-libc internally knows its own version" (MUSL's version.c is filtered out in the Makefile) and I'm not exactly sure what version we would insert here anyways: the wasi-sdk-* tag? Does that make sense?

@grynspan
Copy link
Author

grynspan commented May 2, 2024

That would work for my needs, yeah. I don't have any constraints on the format of the string, but having something here would allow us to better-triage bug reports when devs are using WASI.

Are you saying the header is already available, or would need to be added?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants