Open jeffcharles opened 1 year ago
Hi @jeffcharles
from what I know, there are two typical solutions to this:
#[cfg(docsrs)]
) to make the crate compile without the SDK, only for docs.rs I've opened https://github.com/rust-lang/crates-build-env/pull/137 to add a couple packages. I think with those two packages and vendoring the libclang_rt.builtins-wasm32.a
archive in the crate, it should be possible to build the C code. It worked in an Ubuntu 22.02 Docker container. I did have to copy the system LLVM to the crate's OUT_DIR
to install the vendored archive and use that copy of clang and llvm-ar
to build the code but it worked.
Sorry for the delay in responding.
I merged the pr above, though I can only get to deploying the image to our build server next week.
Until then you could try the build using the crates-build-env docker image, when the build is finished.
Affected crates: quickjs-wasm-sys, quickjs-wasm-rs, javy, javy-apis
The four crates above need access to a WASI SDK to compile some vendored C source code to the wasm32-wasi target. Unfortunately I can't find an Ubuntu package for the WASI SDK. There is a
wasi-libc
package but that's not sufficient since Clang also requires an additional runtime archive file to be installed and that archive file is not part of an Ubuntu package.From https://github.com/WebAssembly/wasi-sdk:
The compiled WASI SDK is also too large to vendor given cargo's size limits on crates.
I'm not sure how to proceed.