Commit Graph

173 Commits

Author SHA1 Message Date
Yury Delendik
7ce10191df Add lldb smoke test (#1241)
* add lldb runner

* don't build wasmtime

* use brew's lldb

* disable for macos

* set LLDB on linux

* re-org gh actions and cfg

* address feedback
2020-03-09 08:06:13 -05:00
Till Schneidereit
0afa334f3e Update issue templates
- Include the `cranelift` label for Cranelift bug reports
- Add a Wasmtime bug report template
2020-03-08 00:19:22 +01:00
Alex Pyrgiotis
07212780d3 CI: Use an HTTPS download link for LLVM (#1254) 2020-03-07 12:16:50 +01:00
Nick Fitzgerald
ab317bc0dd CI: Run fuzzer corpora with RUST_BACKTRACE=1
This way if we get regression panics -- like in
https://github.com/bytecodealliance/wasmtime/pull/1192 -- then we actually have
some hope of debugging them properly.
2020-03-05 10:00:48 -08:00
Yury Delendik
6f88fd9af1 Disable/ignore debug_dwarf tests in "cargo test" (#1233) 2020-03-05 11:53:39 -06:00
Alex Crichton
19d8ff2bf5 Remove reader_parse_test/translate_module fuzz targets (#1212)
This commit removes the two fuzz targets that we imported from cranelift
when cranelift merged in. These have both uncovered a few issues in the
fuzz targets themselves, for example:

* `translate_module` - this doesn't verify the wasm is valid a head of
  time and cranelift is known to panic on translating invalid wasm
  modules. We also already do a lot of fuzzing of translation of wasm
  modules, so this isn't necessarily buying us anything over what we're
  already fuzzing.

* `reader_parse_test` - discovered in #1205 we already found some "bugs"
  in this but it may not necessarily rise to the level of "needs to be
  run on oss-fuzz for us to find more bugs" yet. It looks like this is
  still somewhat internal so we can re-enable when we've got folks to
  fix the fuzz bugs coming in.

Closes #1205
2020-03-04 13:54:11 -06:00
Alex Crichton
87757965f4 Merge pull request/issue templates 2020-02-28 12:15:14 -08:00
Alex Crichton
8efca7da0d Merge cranelift doc generation CI 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
3e2cdc3ded Merge cranelift/wasmtime fuzzing 2020-02-28 09:16:05 -08: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
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
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
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
Alex Crichton
5bed47631a Retry uploading release assets if they fail (#982)
This is an attempt to mitigate #978. I'm not really sure if it'll work,
but seems like it's worth trying!
2020-02-25 17:14:36 -06:00
Alex Crichton
345db5b194 Install submodules as well 2020-02-25 09:28:28 -08:00
Alex Crichton
c7fb135452 Test book documentation on CI
Make sure the embedding API follows what's currently implemented!
2020-02-25 08:52:43 -08:00
Alex Crichton
13523e6312 Attempt to fix publication to Pypi (#971)
This commit is an attempt to fix the issue pointed out at
https://github.com/bytecodealliance/wasmtime/issues/312#issuecomment-576429580
where our publication to pypi is failing (and causes our binary release
process to also fail). By updating the dependency here we should pull in
the necessary support to support the `packages_dir` option.
2020-02-24 13:20:38 -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
Yury Delendik
c9dce98ba2 Test wasmtime-c-api crate (#904)
* Test c-api
2020-02-05 14:14:07 -06:00
Alex Crichton
43c2da04b6 Try to fix Python wheel management on CI (#874)
We've been getting some errors on Linux which seem like they might be
related to a pinned `wheel` dependency. Apparently I originally added
this dependency to CI and I have no idea why I wrote down a `==`
dependency for it, so let's try not pinning and see what happens.
2020-01-30 18:23:40 +01:00
Alex Crichton
16804673a2 Support parsing the text format in wasmtime crate (#813)
* Support parsing the text format in `wasmtime` crate

This commit adds support to the `wasmtime::Module` type to parse the
text format. This is often quite convenient to support in testing or
tinkering with the runtime. Additionally the `wat` parser is pretty
lightweight and easy to add to builds, so it's relatively easy for us to
support as well!

The exact manner that this is now supported comes with a few updates to
the existing API:

* A new optional feature of the `wasmtime` crate, `wat`, has been added.
  This is enabled by default.
* The `Module::new` API now takes `impl AsRef<[u8]>` instead of just
  `&[u8]`, and when the `wat` feature is enabled it will attempt to
  interpret it either as a wasm binary or as the text format. Note that
  this check is quite cheap since you just check the first byte.
* A `Module::from_file` API was added as a convenience to parse a file
  from disk, allowing error messages for `*.wat` files on disk to be a
  bit nicer.
* APIs like `Module::new_unchecked` and `Module::validate` remain
  unchanged, they require the binary format to be called.

The intention here is to make this as convenient as possible for new
developers of the `wasmtime` crate. By changing the default behavior
though this has ramifications such as, for example, supporting the text
format implicitly through the C API now.

* Handle review comments

* Update more tests to avoid usage of `wat` crate

* Go back to unchecked for now in wasm_module_new

Looks like C# tests rely on this?
2020-01-24 14:20:51 -06:00
Nick Fitzgerald
1667c462c5 CI: run a sample of our differential fuzz test corpus in CI 2020-01-17 16:19:38 -08:00
Nick Fitzgerald
adcc047f4a Update fuzz crates (#826)
* deps: Update to arbitrary 0.3.x and libfuzzer-sys 0.2.0

* ci: Use cargo-fuzz 0.7.x in CI
2020-01-15 23:05:37 -06:00
Alex Crichton
b4dccc0486 Assert on CI wasi-tests workspace is locked (#795)
Similar to the main workspace, assert that CI doesn't need to change the
manifest to ensure that PRs reflect any manifest updates necessary.
2020-01-15 15:44:26 -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
Alex Crichton
d142a39113 Tweak some API doc generation (#772)
* Build docs with the nightly toolchain so [foo::bar] links work by
  default. This is a relatively new feature of rustdoc and I thought it
  was stabilized at this point but apparently it's not!

* Tweak some API docs on `wasmtime::Strategy`

* Use `--all` to build all local crate documentation instead of trying
  to list the number of local crates

* Tweak some documentation configuration to avoid warnings generated by
  Cargo.
2020-01-07 14:42:35 -06:00
Alex Crichton
f68bfdeedb Go back to testing true nightlies (#765)
Now that all the wasi fixes are upstream in nightlies I think we're good
to go to test the `nightly` channel again.
2020-01-07 10:14:41 -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
Auke Willem Oosterhoff
ad7d48479e Publish Python packages on pypi on every git tag (#761)
* Publish Python wheels on pypi on every git tag

* Remove config required for testing

* Pin workflow version & remove duplicate dependency
2020-01-06 13:46:43 -06:00
Jakub Konka
a5823896b7 Disable Emscripten job
This commit disables the Emscripten CI job until a regression
in rustc for `wasm32-unknown-emscripten` target is fixed.
Tracking issue: [rust-lang/rust 66308](https://github.com/rust-lang/rust/issues/66308).
2019-12-20 23:52:05 +01:00
Nick Fitzgerald
4d83cc347f ci: don't run full fuzz corpora
Our corpora are too large to run in full on every pull request, they just take
too long. Instead, we sample some of them and make sure that running our fuzzers
over the sampled inputs still works OK.
2019-12-20 10:47:25 -08:00
Alex Crichton
dd0a937d79 Fail CI if the lock file needs an update (#730)
This uses `--locked` on CI to ensure that if the lock file needs
changing it's reflected in the PR instead of letting CI accidentally and
silently update the lock file for us.
2019-12-17 13:31:07 -06:00
Nick Fitzgerald
e21016f773 Merge pull request #726 from alexcrichton/fuzz-in-workspace
Move the `fuzz` directory into main workspace
2019-12-16 10:51:04 -08:00
Alex Crichton
89b1e913d5 Check out submodules 2019-12-16 09:12:52 -08:00
Alex Crichton
5d399d48ab Disable some tests for crates in their manifest (#725)
Instead of passing `--exclude` in CI disable them in the manifest so
`--all` can work with fewer flags locally as well.
2019-12-16 11:00:50 -06:00
Jakub Konka
95c2addf15 Compile wasi-common to Emscripten (#688)
* Compile wasi-common to Emscripten

This commit enables cross-compiling of `wasi-common` to Emscripten. To achieve
this, this commit does quite a bit reshuffling in the existing codebase. Namely,
* rename `linux` modules in `wasi-common` and `yanix` to `linux_like` -- this is
  needed so that we can separate out logic specific to Linux and Emscripten out
* tweak `dir` module in `yanix` to support Emscripten -- in particular, the main
  change involves `SeekLoc::from_raw` which has to be now host-specific, and is now
  fallible
* tweak `filetime` so that in Emscripten we never check for existence of `utimensat`
  at runtime since we are guaranteed for it to exist by design
* since `utimes` and `futimes` are not present in Emscripten, move them into a separate
  module, `utimesat`, and tag it cfg-non-emscripten only
* finally, `to_timespec` is now fallible since on Emscripten we have to cast number of
  seconds, `FileTime::seconds` from `i64` to `libc::c_long` which resolves to `i32`
  unlike on other nixes

* Fix macos build

* Verify wasi-common compiles to Emscripten

This commit adds `emscripten` job to Github Actions which installs
`wasm32-unknown-emscripten` target, and builds `wasi-common` crate.

* Use #[path] to cherry-pick mods for Emscripten

This commit effectively reverses the reorg introduced in 145f4a5
in that it ditches `linux_like` mod for separate mods `linux` and
`emscripten` which are now on the same crate level, and instead,
pulls in common bits from `linux` using the `#[path = ..]` proc
macro.
2019-12-11 16:25:13 -08:00
Nick Fitzgerald
0cc8c6c867 ci: run the api_calls fuzz target in CI and with opts and assertions (#695)
We were previously not running the fuzz targets in release mode, but now we are.
2019-12-11 10:25:53 -08:00
Alex Crichton
e134505b90 Refactor the types.rs types and structures (#681)
* Refactor the `types.rs` types and structures

A few changes applied along the way:

* Documentation added to most methods and types.
* Limits are now stored with the maximum as optional rather than a
  sentinel u32 value for `None`.
* The `Name` type was removed in favor of just using a bare `String`.
* The `Extern` prefix in the varaints of `ExternType` has been removed
  since it was redundant.
* Accessors of `ExternType` variants no longer panic, and unwrapping
  versions were added with "unwrap" in the name.
* Fields and methods named `r#type` were renamed to `ty` to avoid
  requiring a raw identifier to use them.

* Remove `fail-fast: false`

This was left around since the development of GitHub Actions for
wasmtime, but they're no longer needed!

* Fix compilation of the test-programs code

* Fix compilation of wasmtime-py package

* Run rustfmt
2019-12-06 16:19:55 -06:00
Peter Huene
b7c8408978 Merge pull request #676 from peterhuene/fix-dotnet-interop
Fix .NET interop issue for Windows release builds.
2019-12-05 13:32:46 -08:00
Peter Huene
cc02214084 Fix .NET interop issue for Windows release builds.
For Windows release builds, the `wasm_valtype_kind` C API return value
is being returned as a single byte.

The .NET interop signature for this function was expecting an
integer-sized return, resulting in three extra bytes being used on
Windows.

The fix is to limit the corresponding C# enum to a byte representation,
which will properly mask the return value from `wasm_valtype_kind`.

CI has also been updated to test both debug and release configurations
(previously it was only testing debug, hence why this was missed).

Also fixed a cast bug in the `declare_vec!` macro in the C API when the
element types were pointers to values.  The `as_slice` implementation
was incorrectly casting away a level of pointer indirection, resulting
in corrupted data when accessing the slice's elements.
2019-12-05 12:44:47 -08:00
Alex Crichton
8a4693ef05 Pin an older nightly to fix wasi tests (#671)
Rust's recent update to libstd of the wasm32-wasi target turned out to
be buggy with respect to fetching the process arguments, so we'll need
to wait on a fix there before we can run these tests with nightly again.
2019-12-05 13:51:32 -06:00
Jakub Konka
45f41b3c8e Deny warnings in the CI by default (#616)
* Deny warnings in the CI by default

This commit passes `-D warnings` flag to `rustc` in the Test stage
of the CI in order to deny warnings on _all_ tested platforms.

* Fix warnings

* Fix warnings
2019-12-04 17:43:36 +01:00
Nick Fitzgerald
75c8ad6685 CI: Run our fuzz targets on our corpora
This doesn't have libFuzzer generate new inputs in CI, only verifies that we can
still successfully process our existing seed inputs in each of our targets'
corpora.
2019-12-03 13:52:14 -08:00
Jakub Konka
4fd56de4df Use actions/checkout@v1 to support submodules: true
This commit fixes the CI by setting `actions/checkout` at version `v1`.
The current master of `actions/checkout` now obsoleted the
`with: submodules: true` input.
See [actions/checkout/releases/tag/v2-beta] for more info.

[actions/checkout/releases/tag/v2-beta]: https://github.com/actions/checkout/releases/tag/v2-beta
2019-12-03 17:43:28 +01:00
Luiz Irber
e87a489535 Build py38 wheels (#648)
- update setup script for python 3.7 and 3.8 installation
2019-12-02 09:27:01 -06:00
Peter Huene
3e7bc745a2 Merge pull request #624 from peterhuene/wasmtime-for-dotnet
Move Wasmtime for .NET to the Wasmtime repo.
2019-11-26 12:47:04 -08:00
Luiz Irber
5cdae1d394 use setuptools_scm for python version management (#627)
* use setuptools_scm for python version management

* add git dep for python wheel building

* if no tag is defined, default to dev

* any untagged version default to 0.0.1
2019-11-26 08:56:51 -06:00