Commit Graph

5592 Commits

Author SHA1 Message Date
Alex Crichton
986f9f79e1 Merge the CONTRIBUTING.md files 2020-02-28 09:22:06 -08:00
Alex Crichton
8efca7da0d Merge cranelift doc generation CI 2020-02-28 09:17:53 -08:00
Alex Crichton
0c33696731 Remove cranelift scripts, we'll merge them into scripts eventually 2020-02-28 09:17:53 -08:00
Alex Crichton
7beea5ee88 Move determinism check to wasmtime's CI 2020-02-28 09:17:53 -08:00
Alex Crichton
435735d13c Remove fuzzit integration
wasmtime is covered by oss-fuzz which should cover large swaths of
cranelift as well, so let's remove that from CI and add it back later if
it's necessary.
2020-02-28 09:16:05 -08:00
Alex Crichton
3e2cdc3ded Merge cranelift/wasmtime fuzzing 2020-02-28 09:16:05 -08:00
Alex Crichton
9fe459bf38 Delete some cranelift CI already covered by wasmtime 2020-02-28 09:16:05 -08:00
Alex Crichton
701b419a12 Merge gitignore files 2020-02-28 09:16:05 -08:00
Alex Crichton
79fa4d1a94 Merge clippy configs 2020-02-28 09:16:05 -08:00
Alex Crichton
5f1cba0b7f Hook up all crates via path dependencies 2020-02-28 09:16:05 -08:00
Alex Crichton
1c78f03bf3 Remove redundant files 2020-02-28 09:07:00 -08:00
Alex Crichton
abae4ca46d Merge remote-tracking branch 'origin/master' into cranelift-master-rewrite 2020-02-28 09:05:28 -08:00
Peter Huene
121bbd3656 Merge pull request #1014 from peterhuene/c-api-module-new
Change `wasm_module_new` to use `Module::from_binary`.
2020-02-27 21:39:20 -08:00
Johnnie Birch
3e4509fd6a Update usage of target_lexicon to be consistent with v0.10 (#1003)
Jitdump was using an api consisent v0.04 for target_lexicon instead
of the version v0.10. This updates calls to target_lexicon to be
consistent with v0.10.
2020-02-27 20:43:20 -08:00
Alex Crichton
8caa5a9476 Spice up the project README, fill out more docs (#1010)
* Spice up the project README, fill out more docs

This is an attempt to spruce up wasmtime's README.md file as well as
fill out more of the missing documentation in the `docs/` folder.
There's still a long way to go but I hoped here to mostly move around
existing information and add new information. As always happy to have
feedback!

* Tweak CLI wording

* Remove no-longer relevant clause

* Update sandboxing docs

* Handle comments
2020-02-27 17:28:08 -06:00
Peter Huene
b942bdbfe9 Be explicit when marshalling bool. 2020-02-27 14:12:15 -08:00
Joshua Nelson
6a61bba39e Allow modules to have names of arbitrary bytes (#1410)
This is useful for me because I name the module after the file, which
comes from the filesystem and may not be valid UTF8.

This change is backwards-compatible.
2020-02-27 13:45:18 -08:00
Peter Huene
7dfb6ebdb6 Change wasm_module_new to use Module::from_binary.
This commit changes the C API function `wasm_module_new` to use the Rust API
`Module::from_binary` which performs verification of the module, as per the C
API spec.

This also introduces a `EngineBuilder` type to the C# API that can be used to
construct an `Engine` with the various Wasmtime configuration options.  This
is required to get the C# tests passing since they use reference types and
multi-value.

Fixes #859.
2020-02-27 13:38:08 -08:00
Alex Crichton
35d5c6bdde Add a RELEASES.md file to track release notes (#1011)
This is intended to be a form of release notes for wasmtime where we can
keep track of what's changed over time in a more dense way than `git
log` that should be interesting for most users.
2020-02-27 13:00:13 -06:00
Alex Crichton
e47dcc1b37 Handle errors when stringifying errors in uploads (#1008)
Should hopefully fix a failed publication at
https://github.com/bytecodealliance/wasmtime/runs/471153746. I really am
truly bad at JS.
2020-02-27 11:29:52 -06:00
Alex Crichton
febc475d8d Set a more reasonable LC_ID_DYLIB entry on macOS (#1009)
This should make our build slightly more deterministic but also a bit
more usable at runtime if you're dynamically or statically linking
against the artifact since it won't go probing in the CI's build
directory locally (failing to do so inevitably).

Closes #984
2020-02-27 11:29:22 -06:00
Peter Huene
1b28bade16 Merge pull request #1006 from peterhuene/update-dotnet-package-ver
Bump .NET NuGet package version to 0.12.0
2020-02-27 09:02:31 -08:00
Peter Huene
709fe0af6b Bump .NET NuGet package version to 0.12.0 2020-02-27 00:19:38 -08:00
Dan Gohman
588cdd47f9 Add dependency versions and a README.md (#1004)
* Add a version to a path dependeency for publishing on crates.io.

* Add a README.md for wasmtime-profiling.

* Add versions to the wasmtime-profiling dependencies.
2020-02-26 18:13:50 -06:00
Alex Crichton
ead53b3f23 Always delete previous releases, not only for dev (#1001)
This will delete a same-name of a previous release for all tags, not
just the dev tag. That way if we need to retry a tagged release we'll
delete it and recreate it as usual.

Closes #978
2020-02-26 17:09:49 -06:00
Nick Fitzgerald
76e08d60d4 Merge pull request #976 from fitzgen/implement-most-of-bulk-memory
Implement most of bulk memory
2020-02-26 15:08:09 -08:00
Dan Gohman
8568732f41 Update the list of crates to publish. (#1002) 2020-02-26 14:40:56 -08:00
Nick Fitzgerald
66634cc796 Do not allow partial segment initialization for tables and memories 2020-02-26 14:38:56 -08:00
Nick Fitzgerald
235833ab97 Ignore a doc test 2020-02-26 14:37:28 -08:00
Nick Fitzgerald
ef0cabf8b4 Address review feedback 2020-02-26 14:37:28 -08:00
Nick Fitzgerald
39307b2b36 Fix comments about bulk memory that incorrectly referenced "multi-value" 2020-02-26 14:35:09 -08:00
Nick Fitzgerald
aec8cc1904 List the bulk-memory tests that don't pass, rather than the ones that do
We've crossed the threshold where this is easier :)
2020-02-26 14:35:09 -08:00
Nick Fitzgerald
81227892da Implement bulk memory's partial failure instantiation semantics
Essentially, table and memory out of bounds errors are no longer link errors,
but traps after linking. This means that the partail writes / inits are visible.
2020-02-26 14:35:09 -08:00
Nick Fitzgerald
44c28612fb Implement the memory.fill instruction from the bulk memory proposal 2020-02-26 14:35:09 -08:00
Nick Fitzgerald
98ecef1700 Implement the memory.copy instruction from the bulk memory proposal 2020-02-26 14:35:09 -08:00
Nick Fitzgerald
cb97e4ec8e Implement table.init and elem.drop from the bulk memory proposal 2020-02-26 14:35:09 -08:00
Nick Fitzgerald
33b4a37bcb Add support for table.copy
This adds support for the `table.copy` instruction from the bulk memory
proposal. It also supports multiple tables, which were introduced by the
reference types proposal.

Part of #928
2020-02-26 14:30:43 -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
Alex Crichton
c8ab1e293e Improve robustness of cache loading/storing (#974)
* Improve robustness of cache loading/storing

Today wasmtime incorrectly loads compiled compiled modules from the
global cache when toggling settings such as optimizations. For example
if you execute `wasmtime foo.wasm` that will cache globally an
unoptimized version of the wasm module. If you then execute `wasmtime -O
foo.wasm` it would then reload the unoptimized version from cache, not
realizing the compilation settings were different, and use that instead.
This can lead to very surprising behavior naturally!

This commit updates how the cache is managed in an attempt to make it
much more robust against these sorts of issues. This takes a leaf out of
rustc's playbook and models the cache with a function that looks like:

    fn load<T: Hash>(
        &self,
        data: T,
        compute: fn(T) -> CacheEntry,
    ) -> CacheEntry;

The goal here is that it guarantees that all the `data` necessary to
`compute` the result of the cache entry is hashable and stored into the
hash key entry. This was previously open-coded and manually managed
where items were hashed explicitly, but this construction guarantees
that everything reasonable `compute` could use to compile the module is
stored in `data`, which is itself hashable.

This refactoring then resulted in a few workarounds and a few fixes,
including the original issue:

* The `Module` type was split into `Module` and `ModuleLocal` where only
  the latter is hashed. The previous hash function for a `Module` left
  out items like the `start_func` and didn't hash items like the imports
  of the module. Omitting the `start_func` was fine since compilation
  didn't actually use it, but omitting imports seemed uncomfortable
  because while compilation didn't use the import values it did use the
  *number* of imports, which seems like it should then be put into the
  cache key. The `ModuleLocal` type now derives `Hash` to guarantee that
  all of its contents affect the hash key.

* The `ModuleTranslationState` from `cranelift-wasm` doesn't implement
  `Hash` which means that we have a manual wrapper to work around that.
  This will be fixed with an upstream implementation, since this state
  affects the generated wasm code. Currently this is just a map of
  signatures, which is present in `Module` anyway, so we should be good
  for the time being.

* Hashing `dyn TargetIsa` was also added, where previously it was not
  fully hashed. Previously only the target name was used as part of the
  cache key, but crucially the flags of compilation were omitted (for
  example the optimization flags). Unfortunately the trait object itself
  is not hashable so we still have to manually write a wrapper to hash
  it, but we likely want to add upstream some utilities to hash isa
  objects into cranelift itself. For now though we can continue to add
  hashed fields as necessary.

Overall the goal here was to use the compiler to expose what we're not
hashing, and then make sure we organize data and write the right code to
ensure everything is hashed, and nothing more.

* Update crates/environ/src/module.rs

Co-Authored-By: Peter Huene <peterhuene@protonmail.com>

* Fix lightbeam

* Fix compilation of tests

* Update the expected structure of the cache

* Revert "Update the expected structure of the cache"

This reverts commit 2b53fee426a4e411c313d8c1e424841ba304a9cd.

* Separate the cache dir a bit

* Add a test the cache is busted with opt levels

* rustfmt

Co-authored-by: Peter Huene <peterhuene@protonmail.com>
2020-02-26 16:18:02 -06:00
Alex Crichton
2d268f49c9 More debug fixes for the upload script (#999)
It really would be great if I could test this :(
2020-02-26 15:33:18 -06:00
Peter Huene
0c23c2e5e0 Merge pull request #988 from peterhuene/default-opt-level
Change default opt-level for Config to `speed`.
2020-02-26 11:03:17 -08:00
Alex Crichton
427fc9a732 Update the wat and wast crates (#998)
Now with support for annotations, plus a few minor bug fixes
2020-02-26 12:36:00 -06:00
Peter Huene
9ffa19ca64 Disable optimizations for SIMD testsuite tests. 2020-02-26 10:16:25 -08:00
Peter Huene
70275a2a1d Change default opt-level for Config to speed.
This commit changes the default opt-level for a new `Config` to `speed`.

Fixes #981.
2020-02-26 09:59:45 -08:00
Dan Gohman
d55a9967b1 Remove some obsolete re-exports in wasmtime-jit. (#992)
These were from when wasmtime-jit was trying to present a different API;
now they're not needed.
2020-02-26 05:13:28 -08:00
Dan Gohman
e41cae7db9 Fix the WASI-tutorial to handle short writes properly. (#991)
If write doesn't write the full buffer, start the next write at the
point where the write left off.

Also, usize `ssize_t` for the return types of `read` and `write`.
2020-02-25 23:12:43 -06:00
bjorn3
0a1bb3ba6c Add TLS support for ELF and MachO (#1174)
* Add TLS support
* Add binemit and legalize tests
* Spill all caller-saved registers when necessary
2020-02-25 17:50:04 -08:00
Alex Crichton
4b2c56e655 Retry the entire release process, not just uploading one asset (#989)
Another attempt to mitigate #978
2020-02-25 19:46:41 -06:00
Alex Crichton
ab213780cd Fix a syntax error in deployment (#987)
I have no idea how to test this code other than run it live :(
2020-02-25 18:33:11 -06:00