-
Notifications
You must be signed in to change notification settings - Fork 816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multiple heterogeneous backends at the same time #5243
base: main
Are you sure you want to change the base?
Support multiple heterogeneous backends at the same time #5243
Conversation
Adds a function to retrieve a unique identifier (backed by an `AtomicU64`) for the top-level `Engine` type. The `id` is saved in the `Engine` struct itself rather than types down the line. This fits better with the current structure of the `sys` rt engines, which are defined in the `wasmer_compiler` crate.
…r-with-native-ones
impl Default for RuntimeEngine { | ||
#[allow(unreachable_code)] | ||
fn default() -> Self { | ||
#[cfg(feature = "sys")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing is enabling a sys
runtime, and other a default runtime being sys
. I think we need a new feature that let you choose the default (eg: sys-default
), that can't be activated when other default runtime (eg: js-default
) or similar are activated (compiler error)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have a feature called sys-default
. What would happen if sys
is enabled but not sys-default
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, we should not have default for RuntimeEngine
if there's no default defined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't want to have that because is a breaking change, then I'd have what you have now as a fallback, not as the main path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add the js-default
, jsc-default
, v8-default
, wamr-default
and wasmi-default
features. The Engine::default()
function will be just as it is in this PR, but before the feature = "sys"
cfg
s I'll add a
#[cfg(feature = "sys-default")]
for each runtime. Sounds good? Is this what you meant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup
What's missing:
mangle-symbols
feature wasmi-labs/wasmi#1312, Addprefix-symbols
feature wasmi-labs/wasmi#1315)