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:
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?
(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.)
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.
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
I'll admit though I haven't tested this and I'm probably forgetting something
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