bytecodealliance / wasmtime

A fast and secure runtime for WebAssembly
https://wasmtime.dev/
Apache License 2.0
14.81k stars 1.24k forks source link

wasmtime Config: debug impl now iterates complete WasmFeatures flag set #8843

Closed pchickey closed 1 week ago

pchickey commented 1 week ago

I noticed that the wasm_memory64 flag was left out of Config's debug impl, so rather than add it, I decided to use the bitflags::Flags::FLAGS const to iterate the complete set of flags.

THe downside of this change is that it will print flags which do not have a setter in Config, e.g. wasm_component_model_nested_names.

An alternative to this change is, rather than expanding out the single features: WasmFeatures member into many different debug_struct fields, the debug impl of WasmFeatures is used.

Here is a sample debug of Config with this change:

Config { debug_info: None, wasm_mutable_global: true, wasm_saturating_float_to_int: true, wasm_sign_extension: true, wasm_reference_types: true, wasm_multi_value: true, wasm_bulk_memory: true, wasm_simd: true, wasm_relaxed_simd: false, wasm_threads: false, wasm_shared_everything_threads: false, wasm_tail_call: false, wasm_floats: true, wasm_multi_memory: false, wasm_exceptions: false, wasm_memory64: false, wasm_extended_const: false, wasm_component_model: false, wasm_function_references: false, wasm_memory_control: false, wasm_gc: false, wasm_custom_page_sizes: false, wasm_component_model_values: false, wasm_component_model_nested_names: false, parallel_compilation: true, compiler_config: CompilerConfig { strategy: Some(Cranelift), target: None, settings: {"opt_level": "speed", "enable_verifier": "true"}, flags: {}, cache_store: None, clif_dir: None, wmemcheck: false }, parse_wasm_debuginfo: false }
github-actions[bot] commented 1 week ago

Label Messager: wasmtime:config

It looks like you are changing Wasmtime's configuration options. Make sure to complete this check list:


To modify this label's message, edit the .github/label-messager/wasmtime-config.md file. To add new label messages or remove existing label messages, edit the .github/label-messager.json configuration file. [Learn more.](https://github.com/bytecodealliance/label-messager-action)