Hi I am new to wasmtime and I am right now trying to implement https://github.com/bytecodealliance/wasmtime/issues/8784.
I am trying to access both wasmtime_cache and wasmt_time_cli_flags at the same time, but no matter what I try, I get a cyclic dependency. For example if I make a new crate wastime-config-loader, which depends on those 2, and try to use it from wasmtime, I get
❯ cargo check
error: cyclic package dependency: package `wasmtime v26.0.0 (/home/azureuser/wasmtime/crates/wasmtime)` depends on itself. Cycle:
package `wasmtime v26.0.0 (/home/azureuser/wasmtime/crates/wasmtime)`
... which satisfies path dependency `wasmtime` (locked to 26.0.0) of package `wasmtime-cli-flags v26.0.0 (/home/azureuser/wasmtime/crates/cli-flags)`
... which satisfies path dependency `wasmtime-cli-flags` (locked to 26.0.0) of package `wasmtime-config-loader v26.0.0 (/home/azureuser/wasmtime/crates/config-loader)`
... which satisfies path dependency `wasmtime-config-loader` (locked to 26.0.0) of package `wasmtime v26.0.0 (/home/azureuser/wasmtime/crates/wasmtime)`
... which satisfies path dependency `wasmtime` (locked to 26.0.0) of package `component-test-util v0.0.0 (/home/azureuser/wasmtime/crates/misc/component-test-util)`
The reason I try to access these 2 crates are because wasmtime-cache
knows how to deserialize cache options, and I added serde_derive::Deserialize to OptimizeOptions, CodegenOptions, DebugOptions, etc inside wasmtime-cli-flags
. Using these crates would allow me to keep the toml settings in sync with the cli settings. How could I solve this?
Hello! I'll caution you in that issue may not be the best issue to take on for a newcomer to Wasmtime and/or Rust. It'll probably require some nontrivial design/planning work to get it integrated in a way that doesn't duplicate lots of bits and pieces across the codebase.
Currently I think we mostly think that the high-level idea is great but we don't have a great idea about how specifically to solve it. In that sense I at least don't have a great answer to your question on-hand.
Thank you very much for the reply ! If I wanted to discuss some options for designing this, how would I best go about this?
Would you be up for a zoom/online call next week perhaps?
yes that would be great!
I think issue #8784 specially is a feature request to support a configuration file for wasmtime Config, such that both wasmtime CLI and SKD can construct a Config from a configuration file.
I hear that you want to make sure there is a single source of truth for configuration, which is not the case at the moment. That would be a nice follow up and refactoring work.
Last updated: Nov 22 2024 at 17:03 UTC