gpace1 opened issue #12301:
Feature
Add serialization or some other form of line-wire data type to support transferring
wasmtime::Configbetween devices.Benefit
(Unless I'm misunderstanding something) In order to cross precompile right now, the
wasmtimeengine must know the target's configuration of itswasmtimeEngine. By providing serialization toConfigthe compiling device can query the target for theirConfigand create anEngineusing what it received.In a simple scenario:
- Device
Ais the compiler- Device
Bis the target1)
AandBconnect but otherwiseAknows nothing aboutBexcept that it's haswasmtime
2)Bsends its configuration toA
3)Acreates an Engine fromB's config and precompiles a component forB
4)Asends the precompiled component toBWithout step 2 device
Awouldn't know how to configure it'sEngineforB. Even when knowing the target forBit seems it still wouldn't fully be aware of everything (not) supported byB(e.g. GC).Implementation
The simplest would be to derive
serdeforConfigand all inner types.
alexcrichton commented on issue #12301:
For this we've historically been hesitant to do this for
Configdirectly due to its unstable-representation-nature, but what we do support iswasmtime_cli_flags::CommonOptionssupports serde and can be used to create aConfig. That means that you can at least deserialize configuration into aConfig. Not everything inConfig, however, can be represented with Serde.Would that work for your use case? Or perhaps something built on and/or adjacent to that would work?
fitzgen commented on issue #12301:
due to its unstable-representation-nature
FWIW, if the
wasmtime_cli_flags::CommonOptionsapproach is not possible, I could potentially be convinced of adding serialization/deserialization towasmtime::Configitself, with the understanding that it would only be binary compatible with that _exact_wasmtimeversion (not something we would make promises about across patch releases) and we would presumably add the version to the encoding and check it on decoding.
gpace1 commented on issue #12301:
I'm in no rush to have what I requested supported, as for now I've got control over devices A & B in my scenario.
The issue is in the future I would like to support B being from an "infinity-pool" of third-party devices. The vast majority of which will probably be embedded, so I'm predicting there to be quite the variety of configurations.
Running into versioning problems is always going to be an issue, let alone
wasmtimewhat I'm doing has its own issues. Device A will support multiple different versions ofwasmtime, and it's perfectly fine for device A to reject B if it doesn't support the version of its configuration.
alexcrichton commented on issue #12301:
My hunch is what you'll want is
wasmtime_cli_flags::CommonOptionsand that should work for your approach. That way you can have a configuration file per-configuration/device which is sent to the central server which dispatches based on wasmtime version which then further loads the configuration for the compilation.
gpace1 closed issue #12301:
Feature
Add serialization or some other form of line-wire data type to support transferring
wasmtime::Configbetween devices.Benefit
(Unless I'm misunderstanding something) In order to cross precompile right now, the
wasmtimeengine must know the target's configuration of itswasmtimeEngine. By providing serialization toConfigthe compiling device can query the target for theirConfigand create anEngineusing what it received.In a simple scenario:
- Device
Ais the compiler- Device
Bis the target1)
AandBconnect but otherwiseAknows nothing aboutBexcept that it's haswasmtime
2)Bsends its configuration toA
3)Acreates an Engine fromB's config and precompiles a component forB
4)Asends the precompiled component toBWithout step 2 device
Awouldn't know how to configure it'sEngineforB. Even when knowing the target forBit seems it still wouldn't fully be aware of everything (not) supported byB(e.g. GC).Implementation
The simplest would be to derive
serdeforConfigand all inner types.
gpace1 commented on issue #12301:
I think you're right and
CommonOptionswill work for what I want to do.
Last updated: Jan 29 2026 at 13:25 UTC