Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

decouple wavm runtime from being required & initial support for platform specific wasm runtimes #7919

Merged
merged 5 commits into from
Sep 16, 2019

Conversation

spoonincode
Copy link
Contributor

Change Description

eosio's code currently assumes that both wabt and wavm wasm runtimes will be built and available. This hasn't been much of a problem except for interfering with unsupported win32 builds where our wavm fork is non functional.

Looking forward to 2.0 though, there will be more diversity in what platforms different runtimes support. It's currently looking like:

runtime platforms operational on
wabt anywhere
wavm 64-bit, POSIX (Linux & macOS)
EOS-VM Interpreter POSIX (Linux & macOS)
EOS-VM JIT x86-64, POSIX (Linux & macOS)
EOS-VM OC x86-64, Linux only

This PR adds some initial basic scaffolding to support central definition of what runtimes are supported. Frankly I don't care much for this approach as it just dumps some #ifdefs around which I'd rather not do. However there are aspects that make something cleaner more challenging: the way we've constructed the intrinsic registration, that we need parts of the wavm intrinsics even when not using wavm (because we use the wavm "linker" for validation), and some runtimes like EOS-VM OC have additional runtime options.

There is a functional issue where if you unittests/unit_test -- --unsupported-runtime all the tests simply fail instead of unit_test stopping early. But ctest is properly set up only register runtimes that are enabled.

If anyone wants to take a go at a better approach before 2.0, no beef here.

As part of the above effort, this PR also makes wavm's runtime enabled only on non-win32 builds. You can experiment with this on any platform by manually changing the if() in the cmakelists, and see that wavm is not allowed as a runtime nor does it show up in ctest

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

#define _ADD_PAREN_1_END
#define _ADD_PAREN_2_END
#define _WRAPPED_SEQ(SEQ) BOOST_PP_CAT(_ADD_PAREN_1 SEQ, _END)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are reserved identifiers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if @b1bart has any thoughts on why there are named that way

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bad habit I suppose. feel free to rename them and properly undefine them it is merely a nod to the idea that they are "internal".

@spoonincode spoonincode merged commit 01fec8c into develop Sep 16, 2019
@spoonincode spoonincode deleted the optional_runtimes branch September 16, 2019 18:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants