Add Config::without_compiler#12089
Conversation
This provides us an allocation-free path for constructing a `Config`. Why not rely on builds when `cfg(not(any(feature = "cranelift", feature = "winch")))`? Because we need to test our various OOM-handling and allocation-free code paths in this workspace, and without some way to create a config without a compiler otherwise, cargo's feature resolver will enable those features in the workspace, enabling the compiler in the config, but we don't intend to make compiler configurations handle OOM.
alexcrichton
left a comment
There was a problem hiding this comment.
Bikeshed on this: WDYT about:
- Leave
Config::newas the only constructor - Add a
Config::enable_compiler(&mut self, bool)method - Defer the default Cranelift configuration to happening in
build_compiler
That way we keep just a single constructor and this, in theory, would still compose well with other options. (and try_compiler would still remain)
Subscribe to Label Actioncc @fitzgen DetailsThis issue or pull request has been labeled: "fuzzing", "wasmtime:api", "wasmtime:config"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
Label Messager: wasmtime:configIt looks like you are changing Wasmtime's configuration options. Make sure to
DetailsTo modify this label's message, edit the To add new label messages or remove existing label messages, edit the |
This seems kind of difficult since we don't really know if our defaults were overridden with other |
|
Could the defaults be pushed into the Cranelift/Winch compiler builder then? Adding a new constructor is a really heavy hammer I'd prefer to avoid, so I'd ideally like to push pretty hard on solving the problems of using the existing constructor |
Done, want to take another look? |
|
Thanks! |
This provides us an allocation-free path for constructing a
Config.Why not rely on builds when
cfg(not(any(feature = "cranelift", feature = "winch")))? Because we need to test our various OOM-handling and allocation-free code paths in this workspace, and without some way to create a config without a compiler otherwise, cargo's feature resolver will enable those features in the workspace, enabling the compiler in the config, but we don't intend to make compiler configurations handle OOM.