Commit Graph

417 Commits

Author SHA1 Message Date
Daiki Ueno
2ce2dd0203 wasmtime: add build-time option for parallel compilation (#1903)
When running in embedded environments, threads creation is sometimes
undesirable. This adds a feature to toggle wasmtime's internal thread
creation for parallel compilation.
2020-07-06 11:22:05 -05:00
Till Schneidereit
f80c2abffb Update various crates' object and wast dependencies (#1908)
This somewhat cuts down on duplicate dependencies. `wast` is used in a much older version (`11.0.0`) by `witx`, and can be updated without issues there as well, but this at least gets us from 3 copies to 2.
2020-07-01 09:11:38 -05:00
Pat Hickey
712990191a create wasmtime-wiggle crate, by copying implementation of wig 2020-06-22 17:23:06 -07:00
Benjamin Bouvier
c2692ecb8a Wasmtime: allow using the experimental Cranelift x64 backend in cli;
This introduces two changes:

- first, a Cargo feature is added to make it possible to use the
Cranelift x64 backend directly from wasmtime's CLI.
- second, when passing a `cranelift-flags` parameter, and the given
parameter's name doesn't exist at the target-independent flag level, try
to set it as a target-dependent setting.

These two changes make it possible to try out the new x64 backend with:

    cargo run --features experimental_x64 -- run --cranelift-flags use_new_backend=true -- /path/to/a.wasm

Right now, this will fail because most opcodes required by the
trampolines are actually not implemented yet.
2020-06-17 17:18:46 +02:00
Nick Fitzgerald
7e167cae10 externref: Address review feedback 2020-06-15 15:39:26 -07:00
Nick Fitzgerald
f30ce1fe97 externref: implement stack map-based garbage collection
For host VM code, we use plain reference counting, where cloning increments
the reference count, and dropping decrements it. We can avoid many of the
on-stack increment/decrement operations that typically plague the
performance of reference counting via Rust's ownership and borrowing system.
Moving a `VMExternRef` avoids mutating its reference count, and borrowing it
either avoids the reference count increment or delays it until if/when the
`VMExternRef` is cloned.

When passing a `VMExternRef` into compiled Wasm code, we don't want to do
reference count mutations for every compiled `local.{get,set}`, nor for
every function call. Therefore, we use a variation of **deferred reference
counting**, where we only mutate reference counts when storing
`VMExternRef`s somewhere that outlives the activation: into a global or
table. Simultaneously, we over-approximate the set of `VMExternRef`s that
are inside Wasm function activations. Periodically, we walk the stack at GC
safe points, and use stack map information to precisely identify the set of
`VMExternRef`s inside Wasm activations. Then we take the difference between
this precise set and our over-approximation, and decrement the reference
count for each of the `VMExternRef`s that are in our over-approximation but
not in the precise set. Finally, the over-approximation is replaced with the
precise set.

The `VMExternRefActivationsTable` implements the over-approximized set of
`VMExternRef`s referenced by Wasm activations. Calling a Wasm function and
passing it a `VMExternRef` moves the `VMExternRef` into the table, and the
compiled Wasm function logically "borrows" the `VMExternRef` from the
table. Similarly, `global.get` and `table.get` operations clone the gotten
`VMExternRef` into the `VMExternRefActivationsTable` and then "borrow" the
reference out of the table.

When a `VMExternRef` is returned to host code from a Wasm function, the host
increments the reference count (because the reference is logically
"borrowed" from the `VMExternRefActivationsTable` and the reference count
from the table will be dropped at the next GC).

For more general information on deferred reference counting, see *An
Examination of Deferred Reference Counting and Cycle Detection* by Quinane:
https://openresearch-repository.anu.edu.au/bitstream/1885/42030/2/hon-thesis.pdf

cc #929

Fixes #1804
2020-06-15 09:39:37 -07:00
bjorn3
9788b02dd5 Bump object to 0.19.0 (#1767)
* Bump object to 0.19.0
2020-06-12 15:37:04 -05:00
Dan Gohman
caa87048ab Wasmtime 0.18.0 and Cranelift 0.65.0. 2020-06-11 17:49:56 -07:00
Yury Delendik
e5b81bbc28 Migrating code to object (from faerie) (#1848)
* Using the "object" library everywhere in wasmtime.
* scroll_derive
2020-06-10 11:27:00 -05:00
Dan Gohman
a76639c6fb Wasmtime 0.17.0 and Cranelift 0.64.0. (#1805) 2020-06-02 18:51:59 -07:00
Nick Fitzgerald
38a92d89de Initialize env_logger for our *.wast tests 2020-06-01 14:53:10 -07:00
Nick Fitzgerald
1a4f3fb2df Update deps and tests for anyref --> externref
* Update to using `wasmparser` 0.55.0
* Update wasmprinter to 0.2.5
* Update `wat` to 1.0.18, and `wast` to 17.0.0
2020-05-14 12:47:37 -07:00
Josh Triplett
08983bf39c Move crates/api to crates/wasmtime (#1693)
The `wasmtime` crate currently lives in `crates/api` for historical
reasons, because we once called it `wasmtime-api` crate. This creates a
stumbling block for new contributors.

As discussed on Zulip, rename the directory to `crates/wasmtime`.
2020-05-13 16:04:31 -05:00
Dan Gohman
864cf98c8d Update release notes, wasmtime 0.16, cranelift 0.63. 2020-04-29 17:30:25 -07:00
Alex Crichton
c9a0ba81a0 Implement interrupting wasm code, reimplement stack overflow (#1490)
* Implement interrupting wasm code, reimplement stack overflow

This commit is a relatively large change for wasmtime with two main
goals:

* Primarily this enables interrupting executing wasm code with a trap,
  preventing infinite loops in wasm code. Note that resumption of the
  wasm code is not a goal of this commit.

* Additionally this commit reimplements how we handle stack overflow to
  ensure that host functions always have a reasonable amount of stack to
  run on. This fixes an issue where we might longjmp out of a host
  function, skipping destructors.

Lots of various odds and ends end up falling out in this commit once the
two goals above were implemented. The strategy for implementing this was
also lifted from Spidermonkey and existing functionality inside of
Cranelift. I've tried to write up thorough documentation of how this all
works in `crates/environ/src/cranelift.rs` where gnarly-ish bits are.

A brief summary of how this works is that each function and each loop
header now checks to see if they're interrupted. Interrupts and the
stack overflow check are actually folded into one now, where function
headers check to see if they've run out of stack and the sentinel value
used to indicate an interrupt, checked in loop headers, tricks functions
into thinking they're out of stack. An interrupt is basically just
writing a value to a location which is read by JIT code.

When interrupts are delivered and what triggers them has been left up to
embedders of the `wasmtime` crate. The `wasmtime::Store` type has a
method to acquire an `InterruptHandle`, where `InterruptHandle` is a
`Send` and `Sync` type which can travel to other threads (or perhaps
even a signal handler) to get notified from. It's intended that this
provides a good degree of flexibility when interrupting wasm code. Note
though that this does have a large caveat where interrupts don't work
when you're interrupting host code, so if you've got a host import
blocking for a long time an interrupt won't actually be received until
the wasm starts running again.

Some fallout included from this change is:

* Unix signal handlers are no longer registered with `SA_ONSTACK`.
  Instead they run on the native stack the thread was already using.
  This is possible since stack overflow isn't handled by hitting the
  guard page, but rather it's explicitly checked for in wasm now. Native
  stack overflow will continue to abort the process as usual.

* Unix sigaltstack management is now no longer necessary since we don't
  use it any more.

* Windows no longer has any need to reset guard pages since we no longer
  try to recover from faults on guard pages.

* On all targets probestack intrinsics are disabled since we use a
  different mechanism for catching stack overflow.

* The C API has been updated with interrupts handles. An example has
  also been added which shows off how to interrupt a module.

Closes #139
Closes #860
Closes #900

* Update comment about magical interrupt value

* Store stack limit as a global value, not a closure

* Run rustfmt

* Handle review comments

* Add a comment about SA_ONSTACK

* Use `usize` for type of `INTERRUPTED`

* Parse human-readable durations

* Bring back sigaltstack handling

Allows libstd to print out stack overflow on failure still.

* Add parsing and emission of stack limit-via-preamble

* Fix new example for new apis

* Fix host segfault test in release mode

* Fix new doc example
2020-04-21 11:03:28 -07:00
Alex Crichton
4c82da440a Move most wasmtime tests into one test suite (#1544)
* Move most wasmtime tests into one test suite

This commit moves most wasmtime tests into a single test suite which
gets compiled into one executable instead of having lots of test
executables. The goal here is to reduce disk space on CI, and this
should be achieved by having fewer executables which means fewer copies
of `libwasmtime.rlib` linked across binaries on the system. More
importantly though this means that DWARF debug information should only
be in one executable rather than duplicated across many.

* Share more build caches

Globally set `RUSTFLAGS` to `-Dwarnings` instead of individually so all
build steps share the same value.

* Allow some dead code in cranelift-codegen

Prevents having to fix all warnings for all possible feature
combinations, only the main ones which come up.

* Update some debug file paths
2020-04-17 17:22:12 -05:00
Dan Gohman
fde5ddf159 Fixes for 0.15 (#1449)
* Wasmtime 0.15.0 and Cranelift 0.62.0. (#1398)

* Bump more ad-hoc versions.

* Add build.rs to wasi-common's Cargo.toml.

* Update the env var name in more places.

* Remove a redundant echo.
2020-04-03 13:13:37 -07:00
Johnnie Birch
dff789c7c6 Adds JIT profiling support for VTune (#819)
This patch adds initial support for ittapi which is an open
source profiling api for instrumentation and tracing and profiling
of jitted code. Result files can be read by VTune for analysis

Build:
    cargo build --features=vtune
Profile: // Using amplxe-cl from VTune
    amplxe-cl -v -collect hostpost target/debug/wasmtime --vtune test.wasm
2020-04-02 09:04:08 -05:00
Alex Crichton
1a0325014f Remove the wasmtime Python extension from this repo (#1457)
* Remove the wasmtime Python extension from this repo

This commit removes the `crates/misc/py` folder and all associated
doo-dads like CI. This module has been rewritten to use the C API
natively and now lives at
https://github.com/bytecodealliance/wasmtime-py as discussed on #1390
2020-04-01 13:52:59 -05:00
Dan Gohman
092538cc54 Test 0.14 (#1417)
* Bump Wasmtime to 0.14.0.

* Update the publish script for the wiggle crate wiggle.

* More fixes.

* Fix lightbeam depenency version.

* cargo update

* Cargo update wasi-tests too.

And add cargo update to the version-bump scripts.
2020-03-26 21:53:42 -07:00
Dan Gohman
6c0c9a46f3 Fixes for cargo publish (#1416)
* Publishing fixes.

* Make WASI a symlink.

* More fixes.

* Cargo doesn't allow dev-dependencies to have optional features.

* Remove the symlink.

* Add WASI as another git submodule.
2020-03-26 20:31:12 -07:00
Dan Gohman
6fa9be7767 Wasmtime 0.13.0 and Cranelift 0.61.0. (#1398)
This also updates the publishing scripts to work with newly added
and reorganized crates.
2020-03-26 13:19:02 -07:00
Alex Crichton
e245e6dd9c Add examples of linking and WASI (#1369)
* Add examples of linking and WASI

This commit adds two example programs, one for linking two modules
together and one for instantiating WASI. The linkage example
additionally uses WASI to get some meaningful output at this time.

cc #1272

* Add examples to the book as well

* More links!

* Ignore examples from rustdoc testsing

* More example updates

* More ignored
2020-03-20 18:10:53 -05:00
Alex Crichton
3b7cb6ee64 Enable jitdump profiling support by default (#1310)
* Enable jitdump profiling support by default

This the result of some of the investigation I was doing for #1017. I've
done a number of refactorings here which culminated in a number of
changes that all amount to what I think should result in jitdump support being
enabled by default:

* Pass in a list of finished functions instead of just a range to
  ensure that we're emitting jit dump data for a specific module rather
  than a whole `CodeMemory` which may have other modules.
* Define `ProfilingStrategy` in the `wasmtime` crate to have everything
  locally-defined
* Add support to the C API to enable profiling
* Documentation added for profiling with jitdump to the book
* Split out supported/unsupported files in `jitdump.rs` to avoid having
  lots of `#[cfg]`.
* Make dependencies optional that are only used for `jitdump`.
* Move initialization up-front to `JitDumpAgent::new()` instead of
  deferring it to the first module.
* Pass around `Arc<dyn ProfilingAgent>` instead of
  `Option<Arc<Mutex<Box<dyn ProfilingAgent>>>>`

The `jitdump` Cargo feature is now enabled by default which means that
our published binaries, C API artifacts, and crates will support
profiling at runtime by default. The support I don't think is fully
fleshed out and working but I think it's probably in a good enough spot
we can get users playing around with it!
2020-03-20 11:44:51 -05:00
Alex Crichton
5bd03d282f Update a number of wasmtime's dependencies (#1355)
* Run `cargo update`
* Use `cargo outdated` to guide some manual version bumps
2020-03-18 14:15:33 -05:00
Alex Crichton
4c3c717698 Update the filecheck dependency (#1348)
Removes an edge towards the `synstructure` dependency in our dependency
graph which, if removed entirely, is hoped to reduce build times locally
and on CI as you switch between `cargo build` and `cargo test` because
deep dependencies like `syn` won't have their features alternating back
and forth.
2020-03-17 15:33:54 -05:00
Pat Hickey
2f6172732f wasmtime-cli, obj, debug: upgrade to faerie 0.15
eliminating the faerie 0.14 dep
2020-03-17 09:44:33 -07:00
Alex Crichton
922b49744b Remove no-longer-needed wasm-webidl-bindings dep (#1316)
Forgotten from previous interface types removal!
2020-03-13 17:50:00 -05:00
Alex Crichton
34f768ddd5 Temporarily remove support for interface types (#1292)
* Temporarily remove support for interface types

This commit temporarily removes support for interface types from the
`wasmtime` CLI and removes the `wasmtime-interface-types` crate. An
error is now printed for any input wasm modules that have wasm interface
types sections to indicate that support has been removed and references
to two issues are printed as well:

* #677 - tracking work for re-adding interface types support
* #1271 - rationale for removal and links to other discussions

Closes #1271

* Update the python extension
2020-03-12 15:05:39 -05:00
Alex Crichton
3c51d3adb8 Move all examples to a top-level directory (#1286)
* Move all examples to a top-level directory

This commit moves all API examples (Rust and C) to a top-level
`examples` directory. This is intended to make it more discoverable and
conventional as to where examples are located. Additionally all examples
are now available in both Rust and C to see how to execute the example
in the language you're familiar with. The intention is that as more
languages are supported we'd add more languages as examples here too.

Each example is also accompanied by either a `*.wat` file which is
parsed as input, or a Rust project in a `wasm` folder which is compiled
as input.

A simple driver crate was also added to `crates/misc` which executes all
the examples on CI, ensuring the C and Rust examples all execute
successfully.
2020-03-11 15:37:24 -05:00
Jakub Konka
7bcbf40f1d Fix wiggle's tests 2020-03-11 17:33:29 +01:00
Alex Crichton
3179dcf6f1 Update Cranelift's documentation after the merger. (#1238)
Update the documentation for the merger, and also for various changes in
Cranelift. Remove some old obsolete documentation, and convert the remaining
Sphinx files to Markdown. Some of the remaining content is still out of
date, but this is a step forward.
2020-03-05 15:51:12 -06:00
Alex Crichton
4bd9eb7402 Fix build of cranelift-tools
Accidentally left it out of the workspace members!
2020-02-28 16:08:49 -08:00
Nick Fitzgerald
6d01fd4103 deps: Update wat to 1.0.9 2020-02-26 14:23:33 -08:00
Alex Crichton
33a39ff4f0 Bump to 0.12.0 (#997)
* Bump to 0.12.0

* Another lockfile update
2020-02-26 16:19:12 -06:00
Josh Triplett
48202e0c31 Update dependencies to current versions, reducing duplicate versions (#963)
* Cargo.lock: Update, to no longer use multiple versions of autocfg

* Update wasmtime-debug and wasmtime-profiling to current gimli 0.20.0

This also eliminates duplicate versions of gimli and arrayvec, and
eliminates the nodrop dependency entirely.

* Update wasmtime-profiling to goblin 0.1.3 and object 0.17.0

This also eliminates two duplicate versions of goblin, and duplicate
versions of proc-macro2, quote, syn, scroll_derive, and unicode-xid.

* Update wasmtime-profiling to current scroll 0.10.1

This eliminates duplicate versions of scroll.

* Update wasmtime-profiling to current target-lexicon 0.10.0

This eliminates duplicate versions of target-lexicon.

* Update wasmtime-interface-types to current walrus and wasm-webidl-bindings

This also eliminates the oldest of the three duplicate versions of
wasmparser.

* Update wasmtime-wast to current wast 8.0.0

This eliminates one of the duplicate versions of wast.
2020-02-22 17:10:44 -06:00
Johnnie Birch
9c6150b103 Adds perf jitdump support (#360)
Patch adds support for the perf jitdump file specification.
With this patch it should be possible to see profile data for code
generated and maped at runtime. Specifically the patch adds support
for the JIT_CODE_LOAD and the JIT_DEBUG_INFO record as described in
the specification. Dumping jitfiles is enabled with the --jitdump
flag. When the -g flag is also used there is an attempt to dump file
and line number information where this option would be most useful
when the WASM file already includes DWARF debug information.

The generation of the jitdump files has been tested on only a few wasm
files. This patch is expected to be useful/serviceable where currently
there is no means for jit profiling, but future patches may benefit
line mapping and add support for additional jitdump record types.

Usage Example:
Record
  sudo perf record -k 1 -e instructions:u target/debug/wasmtime -g
  --jitdump test.wasm
Combine
  sudo perf inject -v -j -i perf.data -o perf.jit.data
Report
  sudo perf report -i perf.jit.data -F+period,srcline
2020-02-21 08:30:21 -06:00
Yury Delendik
b96b53eafb Test basic DWARF generation (#931)
* Add obj generation with debug info
* Add simple transform check
2020-02-20 11:42:36 -06:00
Josh Triplett
8affec0896 Don't spend build time optimizing build-time-only crates
Crates used exclusively at build time, such as proc-macro crates and
their dependencies, don't benefit substantially from optimization; they
take far longer to optimize than time saved when running them during the
build. No machine code from these crates will appear in the final
compiled binary.

Use the new profile-overrides mechanism in Rust 1.41
(https://doc.rust-lang.org/cargo/reference/profiles.html#overrides) to
build such crates with opt-level 0.

On a 4-thread laptop, this brings build time from 6m27s to 4m21s, and
CPU time spent from 23m43s to 16m23s.
2020-01-31 11:47:15 -08:00
Yury Delendik
a8cad05e80 Fix 'not enough arguments' during wasmtime run (#858)
* Fix 'not enough arguments' during wasmtime run

* add simple cli smoke tests

* autogenerate wasm
2020-01-30 14:29:50 +01:00
Alex Crichton
21e0a99884 Delete the wasmtime-wasi-c crate (#844)
This commit deletes the old C implementation of the original
`wasi_unstable` module, instead only leaving around our single
`wasmtime-wasi` crate as the implementation for both
`wasi_snapshot_preview1` and `wasi_unstable`.

This hasn't been discussed (AFAIK) up until now, so this is also a
proposal! Some thoughts in favor of this deletion I would have are:

* This has been off-by-default for ages
* We don't build or test any of this on CI
* Published binaries with `wasmtime` do not have this possibility
  enabled
* Future refactorings to the `wasmtime-wasi` crate will either need to
  work around how the C implementation is different or bring it up to
  speed.

This is motivated by the last bullet point where I was working on
getting `wasmtime-wasi` working purely as an implementation detail on
top of the `wasmtime` crate itself, but quickly ran into a case where
the CLI would need to multiplex all sorts of wasi implementations. In
any case I'm curious what others think, is this too soon? Is there
something remaining blocking this? (etc)
2020-01-24 08:54:17 -08:00
Andrew Chin
d81aa203bb Disable rustdoc on the wasmtime cli binary (#834)
Currently the wasmtime binary (src/bin/wasmtime) and the wasmtime API
crate (crates/api) share the same output filename.  This causes the
output files of the wasmtime binary to clobber the output files of the
wasmtime API crate.   So running `cargo doc --all` will often not build
the wasmtime API docs, which is the more useful of the two.

This is a rustdoc bug, and can be worked around by disabling
documentation for the wasmtime binary.
2020-01-16 19:55:08 -06:00
Alex Crichton
364fa994ed Move the C API to a separate crate (#818)
* Move the C API to a separate crate

This commit moves the C API from `crates/api/src/wasm.rs` to
`crates/capi/src/lib.rs` to be located in a separate crate. There's a
number of reasons for this:

* When a Rust program depends on the `wasmtime` crate, there's no need
  to compile in the C API.
* This should improve compile times of the `wasmtime` crate since it's
  not producing artifacts which aren't always used.
* The development of the C API can be guaranteed to only use the public
  API of the `wasmtime` crate itself.

Some CI pieces are tweaked and this overall shouldn't have much impact
on users, it's intended that it's a cleanup/speedup for developers!

* Disable rustdoc/tests for capi

* Review feedback

* Add back in accidentally deleted comment

* More renamings

* Try to fix dotnet build
2020-01-14 11:36:57 -08:00
Dan Gohman
ef2177ed3a Update to the latest spec_testsuite and dependencies. (#803)
* Update to the latest spec_testsuite and dependencies.

Update to target-lexicon 0.10, cranelift 0.54, wast 0.6, faerie 0.14,
and the latest spec_testsuite.

For wast and cranelift-wasm, update the code for API changes.

* Factor out the code for matching f32, f64, and v128.

This takes the idea from #802 to split out `f32_matches`, `f64_matches`,
and `v128_matches` functions, which better factor out the matching
functionality between scalar and vector.
2020-01-10 13:57:38 -08:00
Dan Gohman
336ee94c89 Bump version to 0.9.0 (#790) 2020-01-09 21:57:40 -08:00
Jakub Konka
f83eafd6c2 Add missing dev-dependency: wasmtime-runtime 2020-01-09 22:04:21 +01:00
Peter Huene
e2c351ba18 Disable doc tests for the CLI crate. 2020-01-07 13:15:33 -08:00
Peter Huene
59258730c2 Use structopt instead of docopt.
This commit refactors the Wasmtime CLI tools to use `structopt` instead of
`docopt`.

The `wasmtime` tool now has the following subcommands:

* `config new` - creates a new Wasmtime configuration file.
* `run` - runs a WebAssembly module.
* `wasm2obj` - translates a Wasm module to native object file.
* `wast` - runs a test script file.

If no subcommand is specified, the `run` subcommand is used. Thus,
`wasmtime foo.wasm` should continue to function as expected.

The `wasm2obj` and `wast` tools still exist, but delegate to the same
implementation as the `wasmtime` subcommands.  The standalone `wasm2obj` and
`wast` tools may be removed in the future in favor of simply using `wasmtime`.

Included in this commit is a breaking change to the default Wasmtime
configuration file: it has been renamed from `wasmtime-cache-config.toml` to
simply `config.toml`.  The new name is less specific which will allow for
additional (non-cache-related) settings in the future.

There are some breaking changes to improve command line UX:

* The `--cache-config` option has been renamed to `--config`.
* The `--create-config-file` option has moved to the `config new` subcommand.
As a result, the `wasm2obj` and `wast` tools cannot be used to create a new
config file.
* The short form of the `--optimize` option has changed from
`-o` to `-O` for consistency.
* The `wasm2obj` command takes the output object file as a
required positional argument rather than the former required output *option*
(e.g. `wasmtime wasm2obj foo.wasm foo.obj`).
2020-01-07 13:15:28 -08:00
Alex Crichton
41528c82bc Remove the Flags type from Config API (#769)
* Remove the `Flags` type from `Config` API

This commit removes the final foreign type from the `Config` API in the
`wasmtime` crate. The cranelift `Flags` type is now expanded into
various options on the `Config` structure itself, all prefixed with
`cranelift_` since they're only relevant to the Cranelift backend. The
various changes here were:

* The `avoid_div_traps` feature is enabled by default since it seemed
  that was done anywhere anyway.
* Enabling the wasm SIMD feature enables the requisite features in
  Cranelift as well.
* A method for enabling the debug verifier has been added.
* A method for configuring the Cranelift optimization level, as well as
  a corresponding enumeration, has been added.

* Assert that `Config` is both `Send` and `Sync`
2020-01-07 14:07:48 -06:00
Alex Crichton
7474633cca Remove usage of CompilationStrategy from Config (#764)
* Remove usage of `CompilationStrategy` from `Config`

This commit removes the public API usage of the internal
`CompilationStrategy` enumeration from the `Config` type in the
`wasmtime` crate. To do this the `enum` was copied locally into the
crate and renamed `Strategy`. The high-level description of this change
is:

* The `Config::strategy` method now takes a locally-defined `Strategy`
  enumeration instead of an internal type.

* The contents of `Strategy` are always the same, not relying on Cargo
  features to indicate which variants are present. This avoids
  unnecessary downstream `#[cfg]`.

* A `lightbeam` feature was added to the `wasmtime` crate itself to
  lightbeam compilation support.

* The `Config::strategy` method is now fallible. It returns a runtime
  error if support for the selected strategy wasn't compiled in.

* The `Strategy` enum is listed as `#[non_exhaustive]` so we can safely
  add variants over time to it.

This reduces the public crate dependencies of the `wasmtime` crate
itself, removing the need to reach into internal crates even more!

cc #708

* Fix fuzz targets

* Update nightly used to build releases

* Run rustfmt
2020-01-06 18:08:13 -06:00