wasi-sdk
wasi-sdk copied to clipboard
Publish header with toolchain versions
This change is an attempt to resolve wasi-libc#490 but at the wasi-sdk level. It adds a version.h header file to
share/wasi-sysroot/include/<target>/wasi so that users have programmatic access to some extra information to output better error messages, e.g. This version.h looks something like:
// Generated by wasi-sdk's `version.py` script.
#ifndef VERSION_H
#define VERSION_H
#define WASI_SDK_VERSION "24.6g754aec3d6f58+m"
#define WASI_LIBC_VERSION "b9ef79d7dbd4"
#endif
It is a bit strange that we're adding to wasi-libc's include files from wasi-sdk (it would be cleaner if it happened in wasi-libc directly) but wasi-sdk actually has the information available.
Thanks very much for looking into this! This would solve our problem very neatly!
To be clear, would I want to include <version.h> or would it be located elsewhere?
Thanks very much for looking into this! This would solve our problem very neatly!
To be clear, would I want to include
<version.h>or would it be located elsewhere?
I think you would include <wasi/version.h>. We certainly wouldn't want to call the file version.h if it was in the default include path, as that would be asking for trouble.
To be clear, would I want to include <version.h> or would it be located elsewhere?
@grynspan, I think it would be <wasi/version.h>?
It is a bit strange that we're adding to wasi-libc's include files from wasi-sdk (it would be cleaner if it happened in wasi-libc directly)
yes. i'm against this because it introduces an incompatibility between wasi-sdk and direct use of wasi-libc. (programs including this header won't build for the latter)
If we did this exclusively in wasi-libc it could look like: https://github.com/WebAssembly/wasi-libc/pull/534.
Could the two be combined? Such that -libc provides its version and -sdk provides its version?
I'm not really working on this any more.