Stream: wasi

Topic: using a freshly-built wasi-sdk


view this post on Zulip Andy Wingo (Aug 13 2025 at 15:21):

Good day! Question, can one use a freshly-built wasi-sdk from its local build/install dir, without merging the sysroot and toolchain? I try running WASI_SDK_PATH=~/src/wasip3/wasi-sdk/build/install cc --sysroot=$WASI_SDK_PATH/share/wasi-sysroot -resource-dir $WASI_SDK_PATH but there is always some kind of path problem. Any tips are welcome :sweat_smile:

view this post on Zulip Joel Dice (Aug 13 2025 at 15:31):

I haven't build the latest version of wasi-sdk, but earlier versions put an opt/wasi-sdk directory under build/install, in which case you'd use e.g. WASI_SDK_PATH=~/src/wasip3/wasi-sdk/build/install/opt/wasi-sdk. What do you see under the build/install directory?

view this post on Zulip Joel Dice (Aug 13 2025 at 15:36):

(That may have changed since Alex switched from make to cmake for building. I'm building the main branch locally now to see what's different.)

view this post on Zulip Joel Dice (Aug 13 2025 at 16:03):

Ok, looks like the cmake-based build uses a different directory structure, with the toolchain and sysroot using separate build steps and directories. I think you'll need to follow all the instructions in the Build section of the README.md -- up to and including the ./ci/merge-artifacts.shstep -- and then untar the resulting tarball and use that. @Alex Crichton might know if there are any shortcuts.

view this post on Zulip Alex Crichton (Aug 13 2025 at 17:38):

I think what you'll want to do is specify -DCMAKE_INSTALL_PREFIX=... and use make install (or the equivalent) to produce a working toolchain -- the installation step can be anywhere on your system but otherwise it'll be a bit painful as you've seen trying to use the artifacts from where they reside in the build directory

view this post on Zulip Alex Crichton (Aug 13 2025 at 17:39):

I'll admit though I haven't tested this and I'm probably forgetting something

view this post on Zulip Alex Crichton (Aug 13 2025 at 17:41):

Ok sort of paging this back in, I think if you install the toolchain/sysroot to the same location that's the "merge" operation. Would that work well enough for what you're doing? (I realize running the ./ci/merge-* script is funky, but the "install both" is in theory a simpler merge)


Last updated: Dec 06 2025 at 06:05 UTC