Conversation
|
📝 Documentation updates detected! A separate PR for documentation updates has been made here: wasmerio/docs.wasmer.io#118 |
syrusakbary
reviewed
Feb 28, 2025
syrusakbary
reviewed
Feb 28, 2025
syrusakbary
reviewed
Feb 28, 2025
syrusakbary
reviewed
Feb 28, 2025
syrusakbary
reviewed
Feb 28, 2025
syrusakbary
reviewed
Feb 28, 2025
syrusakbary
reviewed
Feb 28, 2025
syrusakbary
reviewed
Feb 28, 2025
syrusakbary
approved these changes
Mar 3, 2025
…efault backend ... so that we don't have to build an engine to find out which engine is the default one per the enabled features.
…epass` and `llvm` in `wasmer-api`
…use `is_engine_available` to match
…e::get_exports()` in c_api backends
…ckendKind::default()`
57cdaef to
6fe4229
Compare
syrusakbary
reviewed
Mar 10, 2025
syrusakbary
reviewed
Mar 10, 2025
syrusakbary
reviewed
Mar 10, 2025
.. and move target/middleware functions to top level, out of the implicit `sys` namespace.
syrusakbary
approved these changes
Mar 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(fixes #5224)
This PR adds to the
wasm_engine_tenum the kindsV8,WAMR,WASMIandJSCto reflect the different possible kinds of engine that can actually be used in the underlying implementation. These enum variants can be by users used as a means to set the wanted engine in the underlying implementation.Together with this addition, this PR changes the
wasm_config_ttype to (internally) hold an engine-specific configuration:where
wasmer_engine_config_tis an enumeration of all the configurations for all the available engines:The two separate fields are needed because one,
wasmer_engine_t, is public and users can set it; the other is definitely private and users cannot interact directly with it. This PR also introduces the relevant features to enable each of the backends cited above, with the matchingX-defaultfeatures to chose one as default.Note: this PR produces a number of breaking changes in the API. Most notably, functions that were implicitly tied to the
sysengine only, are now scoped with thesysname:wasm_config_canonicalize_nansis nowwasm_config_sys_canonicalize_nans. Same goes forwasm_config_set_sys_target(previouslywasm_config_set_target),wasm_config_sys_push_middleware(previouslywasm_config_push_middleware), andwasm_config_set_sys_compiler(previouslywasm_config_set_compiler).Furthermore, a chage in the semantics of these functions is (debatably) introduced: what does it mean to call
wasm_config_sys_push_middlewareon a config whose selectedwasmer_engine_tis notsys? In this PR the introduced behaviour is that of regardlessly change the selected engine tosys:On one hand, this behaviour is transparent to the user - which should nonetheless expect the underlying engine to be the
sysone, while on the other this function does not return a value, so we can't signal the user that the an error occurred in the case the currentconfig.engine != sys.Notice, also, that to maintain a bit of backwards compatibility, the enum constructor in the
wasmer_engine_tcorresponding tosysis stillUNIVERSAL.-- edit
In the process of testing these additions, I discovered the following bugs which are now fixed:
Instance::exports()--
Missing bits: