proxy-wasm / proxy-wasm-cpp-host

WebAssembly for Proxies (C++ host implementation)
Apache License 2.0
84 stars 69 forks source link

Wasmtime default features disabled #313

Open rahulchaphalkar opened 2 years ago

rahulchaphalkar commented 2 years ago

Hi there, I'm curious why the default features for wasmtime are disabled? https://github.com/proxy-wasm/proxy-wasm-cpp-host/blob/b0a0594e8ab4023857393fab349170fb487ec5a9/bazel/cargo/wasmtime/Cargo.toml#L13

I tried to look when this change was made, but looks like default features were disabled from the time wasmtime was added as a runtime. I changed it to true for wasmtime 1.0.1 version, and I was able to build it without much issue (had to resolve one duplicate dependency conflict in BUILD.cpufeatures-xxx similar to rustix crate). Particularly interested since several newer optimizations for wasmtime-1.0.0 (as well as helpful features, e.g. related to profiling) seem to be included in default features.

Or is there a different place to implement these features that I've missed? Thanks!

PiotrSikora commented 2 years ago

Those dependencies are from https://github.com/bytecodealliance/wasmtime/blob/v0.39.1/crates/c-api/Cargo.toml, which is the root crate that we use to generate Bazel rules.

rahulchaphalkar commented 2 years ago

Ah, thanks! So apart from optional features like cranelift, other features which are enabled in wasmtime crate (pooling-allocator for example below) will be applied as well right? pooling-allocator = ["wasmtime-runtime/pooling-allocator"] https://github.com/bytecodealliance/wasmtime/blob/19b5436ac346b8e61230baeaf18e802db6f0b858/crates/wasmtime/Cargo.toml#L93

PiotrSikora commented 2 years ago

So apart from optional features like cranelift, other features which are enabled in wasmtime crate (pooling-allocator for example below) will be applied as well right?

No, I believe that default-features = false disables those.

rahulchaphalkar commented 1 year ago

The default-features=false has been removed in the v9.0.3 version of wasmtime, https://github.com/bytecodealliance/wasmtime/blob/271b605e8d3d44c5d0a39bb4e65c3efb3869ff74/crates/c-api/Cargo.toml#L23 Would it be appropriate to make the corresponding change in this repo as well? Remove default-features=false here https://github.com/proxy-wasm/proxy-wasm-cpp-host/blob/b7e690703c7f26707438a2f1ebd7c197bc8f0296/bazel/cargo/wasmtime/Cargo.toml#L14