-
Notifications
You must be signed in to change notification settings - Fork 165
install: also install liblucet_wasi #518
install: also install liblucet_wasi #518
Conversation
Similarly, I can't help but wonder how come the |
Hi, thanks for the bug report! We don't use installed cdylibs in any of our tests, so this escaped our notice. In fact, we don't recommend using the lucet-wasi cdylib alongside the lucet-runtime cdylib at all - some complications of how Rust dependencies get exposed in a cdylib makes this work incorrectly. Instead, if you need to use Lucet from C, we recommend using the approach that @shravanrn explains here: #441 (comment) I'll make changes to the repo and the docs to make that approach the canonical one, rather than hidden in a closed issue. |
@pchickey Thank you for sharing! |
@pchickey It seems like liblucet_wasi is already configured to produce something similar to @shravanrn's "fullrt" lib: https://github.com/bytecodealliance/lucet/blob/master/lucet-wasi/Cargo.toml#L17-L21. Debug builds on the current master branch seem to properly export all liblucet_runtime symbols from
However, release builds don't:
|
Lucet is fairly special-purpose compared to our sibling runtime Wasmtime (https://github.com/bytecodealliance/wasmtime), and shares many components. It uses the same code generator (Cranelift), different compilation strategy (AOT vs caching JIT), and caters to different priorities when implementing the runtime (Lucet leaves out a lot of features and is heavily optimized for low startup latency). We believe that most people probably just want to use Wasmtime, especially for a general-purpose embedding engine. The Wasmtime team has put a lot of time into providing a really good C API and there are already bindings to a number of languages available. Furthermore, in the long run (can't commit to timelines) we intend to merge Lucet into the Wasmtime project: https://www.fastly.com/blog/how-lucet-wasmtime-make-stronger-compiler-together. If you do want to use Lucet over Wasmtime, we've been maintaining the C embedding with best effort, but we (the Lucet team at Fastly) don't use it anymore aside from the benchmark suite, so its not really on our radar. We're happy for help maintaining it, though, so I suppose if we can get the liblucet_wasi.so working the way you need, we can accept this PR. It will work unless you decide to expose any additional host functionality to wasm, in which case you'll need to follow the linked approach above.
That is not the expected behavior. I'm not sure when that regression happened, but we did observe some changes to release mode linker garbage collection when we upgraded to rust 1.42.0. |
@pchickey Thanks for the details! I have been experimenting with various runtimes, and Lucet was high on my priority list due to the AOT compilation strategy. I will be giving Wasmtime a try as well, also in the context of embedding into a larger C application, so see you there maybe? Having both projects merge sounds exciting, and potentially less work on my end to have to support multiple runtimes/compilation strategies 👏 Feel free to close this PR as your convenience - or ping me if it is worthy of a merge but needs some changes. Best, |
Thanks! |
The documentation on lucet-wasi specifies:
However, liblucet_wasi isn't available as a library in
$LUCET_PREFIX/lib
.Is this an overlook?