Commit Graph

250 Commits

Author SHA1 Message Date
Alex Crichton
85ffc8f595 Switch CI back to nightly channel (#2014)
* Switch CI back to nightly channel

I think all upstream issues are now fixed so we should be good to switch
back to nightly from our previously pinned version.

* Fix doc warnings
2020-07-13 18:40:47 -05:00
Nick Fitzgerald
2040a654d6 CI: collect backtraces for example tests 2020-07-10 13:37:24 -07:00
Alex Crichton
d72b330de2 Add support for documenting the C API (#1928)
This commit adds a bit of a skeleton of what it might look like to
document the C API. Today the C API has virtually zero documentation
because the upstream documentation does not exist and we haven't put a
ton of effort into documenting our own extensions. Given that this is
one of the main vectors we expect users to use Wasmtime, we should make
sure it's thoroughly documented!

I've never really done much documentation generation of C myself before,
but I did a bit of searching and Doxygen seems reasonable proficient for
doing this. This commit sets up what it might look like for Doxygen to
be used for the C API. One nice feature of DOxygen is that we can
document the items in `wasm.h` without actually modifying `wasm.h`. For
those purposes a `doc-wasm.h` file was added here which is where we can
put Wasmtime-specific documentation about `wasm.h`.

There's quite a few functions in the C API so I didn't want to get them
all done before getting consensus on this. I've started some skeletons
of documentation for global types in `wasm.h` and also confirmed that
documentation works for our own `wasmtime.h` and such header files. If
this looks good to everyone and it runs reasonable well on CI then I can
spend more time filling out the rest of the documentation.
2020-07-01 14:05:18 -05:00
Alex Crichton
0acd2072c2 Fix doc warnings and link failures (#1948)
Also add configuration to CI to fail doc generation if any links are
broken. Unfortunately we can't blanket deny all warnings in rustdoc
since some are unconditional warnings, but for now this is hopefully
good enough.

Closes #1947
2020-06-30 13:01:49 -05:00
Alex Crichton
a92a31d850 Rename the master branch to main (#1924)
* This PR is against a branch called `main`
* Internally all docs/CI/etc is updated
* The default branch of the repo is now `main`
* All active PRs have been updated to retarget `main`

Closes #1914
2020-06-25 14:03:21 -05:00
Nick Fitzgerald
ab80107dfb CI: use cargo fuzz 0.8.X
It has switched to release+debug assertion builds by default, so pass `--dev` to
avoid compiling with optimizations.
2020-06-25 10:01:23 -07:00
Alex Crichton
06a69d18fa Disable static memory under QEMU on CI (#1895)
* Enable the spec::simd::simd_align test for AArch64

Copyright (c) 2020, Arm Limited.

* Disable static memory under QEMU on CI

This commit disables the usage of "static" memory on CI and instead
forces all memories to be "dynamic" meaning that they reserve much
smaller chunks of memory. This causes the QEMU process's memory to
drastically drop (10GiB -> 600MiB) and should allow us to keep enabling
tests without hitting the OOM killer on CI.

Closes #1871 (includes that)
Closes #1893

* Fix typo

Co-authored-by: Anton Kirilov <anton.kirilov@arm.com>
2020-06-17 21:05:21 -05:00
Alex Crichton
9a1a0abc48 Pin nightlies to previous night (#1873)
* Pin nightlies to previous night

Fixes some upstream breakage in rust-lang/rust which should get fixed
tomorrow.

* fix-0.65

Co-authored-by: Yury Delendik <ydelendik@mozilla.com>
2020-06-12 12:35:08 -05:00
Chris Fallin
cdbe76a1d4 Remove uses of matches!() macro, incompatible with Firefox build.
When we vendor Cranelift into Firefox, we need to be able to build with
the Firefox CI setup (unless we carry patches on top of upstream).
Unfortunately, the Firefox CI currently appears to build with a slightly
older version of Rust: I can't work out which version exactly, but one
without stable support for `matches!()`.

A recent attempt to version-bump Cranelift failed with build errors at
the two locations in this patch:

https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=305994046&repo=autoland&lineNumber=24829

I also see a bunch of uses of `matches!()` in Peepmatic, but those
crates are not built by Firefox, so we can leave them be for now, I
think.
2020-06-11 15:11:10 -07:00
Yury Delendik
70424037c3 Refactor debug library to use object:🧝:* (#1860)
* Add GDB test

* rm stray test resource

* use object:🧝:* structures

* install gdb on CI
2020-06-11 13:53:38 -05:00
Chris Fallin
5c7e6e6e9a Update from qemu 4.2.0 to qemu 5.0.0 for emulation-based CI jobs. 2020-06-05 12:52:00 -07:00
Alex Crichton
5a8afd4540 Pin nightlies to fix lightbeam compilation (#1818)
Looks like lightbeam's nightly dependencies don't compile on the most
recent nightly. For now let's pin nightlies to get CI green.
2020-06-04 11:32:49 -05:00
Alex Crichton
16afca4451 Update the checkout action to v2 (#1791)
I think this pulls in a few nice updates like depth 0 cloning, better
logs, etc. In any case seems good to update while we can!
2020-05-29 16:52:30 -05:00
Nick Fitzgerald
5c39b74eb8 Make the fuzzing CI job faster (#1727)
* CI: Only build fuzz targets, don't run them over the corpora

We've only ever caught a single potential regression by running the fuzz targets
over a sample of their corpora. However, this is also our slowest CI
job. Running the fuzz targets over their corpora simply isn't paying for itself.

Instead, just ensure that we can build the fuzz targets with `cargo fuzz` and
all of the libFuzzer and sanitizer instrumentation that it enables. This will
ensure that we don't break the fuzz targets, and we leave finding regressions in
the fuzz corpora to oss-fuzz.

* fuzz: feature gate peepmatic's fuzz targets

This makes it so that the CI's fuzz target-building job doesn't build peepmatic,
and transitively Z3.
2020-05-19 15:27:52 -05:00
Nick Fitzgerald
463734b002 CI: only test peepmatic in one job (#1714)
* CI: only test `peepmatic` in one job

This avoids building Z3 in most jobs, which saves CI time.

* Fix curl syntax on Windows

Co-authored-by: Alex Crichton <alex@alexcrichton.com>
2020-05-15 21:16:16 -05:00
Alex Crichton
bd0b818900 Default to using bash on Github Actions (#1591)
This updates our github actions configuration with a new feature
released which allows configuring the default shell for the entire
worflow. Here we set that to `bash` since we frequently do that anyway
and it helps keep syntax consistent throughout the configuration file.
2020-05-15 15:08:29 -05:00
Nick Fitzgerald
a9b280ca3a CI: Ensure that the built peepmatic peephole optimizers are up to date
Beyond just ensuring that they can still be built, ensure that rebuilding them
doesn't result in a different built artifact.
2020-05-14 07:52:23 -07:00
Nick Fitzgerald
c2ec1523bc ci: Test rebuilding the peephole optimizers in CI 2020-05-14 07:52:23 -07:00
Nick Fitzgerald
18663fede9 ci: Exercise the peepmatic fuzz targets in CI 2020-05-14 07:51:16 -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
Gabor Greif
9d13871bd4 Perform lldb DWARF-5 test too (#1609)
* perform lldb DWARF-5 test too

* allow test_debug_dwarf5_
2020-04-28 08:54:44 -05:00
Nick Fitzgerald
b4a266bbc9 Merge pull request #1580 from alexcrichton/mingw-ci
Add a MinGW release to our CI
2020-04-24 15:45:18 -07:00
Alex Crichton
85013836cc Remove --nocapture test argument on CI (#1592)
This removes the `--nocapture` argument from Rust tests which enables
capturing the output of tests by default, only printing the output if
the test fails. I've seen that this otherwise seems to largely just dump
a very large amount of information to CI and makes it difficult to
diagnose a failure quickly from CI logs since you have to search
backwards to find the reason something failed.
2020-04-24 16:48:33 -05:00
Alex Crichton
aa7f1757c5 Add a MinGW release to our CI
This commit extends our CI to produce release artifacts for the
x86_64-pc-windows-gnu target. This was originally motivate by the [go
extension] where it looks like the Go toolchain primarily interoperates
with MinGW, not with MSVC natively.

The support here turned out to be quite trivial, largely just adding the
configuration to make the release. I don't think we should necessarily
commit to this being a primary platform for Wasmtime at this time
though. If the support here regresses in the future for a
difficult-to-fix reason I think it would be fine to back out the
platform at least temporarily.

Note that this does not add a full test suite for the MinGW target, only
a release builder. This release builder does run tests, but not with
full debug assertions enabled.

[go extension]: https://github.com/bytecodealliance/wasmtime-go/issues/3

Closes #1535
2020-04-22 15:54:46 -07:00
Alex Crichton
d1aa86f91a Add AArch64 tests to CI (#1526)
* Add AArch64 tests to CI

This commit enhances our CI with an AArch64 builder. Currently we have
no physical hardware to run on so for now we run all tests in an
emulator. The AArch64 build is cross-compiled from x86_64 from Linux.
Tests all happen in release mode with a recent version of QEMU (recent
version because it's so much faster, and in release mode because debug
mode tests take quite a long time in an emulator).

The goal here was not to get all tests passing on CI, but rather to get
AArch64 running on CI and get it green at the same time. To achieve that
goal many tests are now ignored on aarch64 platforms. Many tests fail
due to unimplemented functionality in the aarch64 backend (#1521), and
all wasmtime tests involving compilation are also disabled due to
panicking attempting to generate generate instruction offset information
for trap symbolication (#1523).

Despite this, though, all Cranelift tests and other wasmtime tests
should be runnin on AArch64 through QEMU with this PR. Additionally
we'll have an AArch64 binary release of Wasmtime for Linux, although it
won't be too useful just yet since it will panic on almost all wasm
modules.

* Review comments
2020-04-22 12:56:54 -05: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
Alex Crichton
27bee2a1a8 Switch CI back to nightly channel (#1503)
Looks like `proptest` has been updated so we can move back to the
`nightly` channel rather than pinning.
2020-04-13 15:40:44 -05:00
Andrew Brown
e29c224f24 Pin nightly rust toolchain to 2020-04-07 2020-04-08 10:34:56 -07:00
Peter Huene
9de0ab302c Remove the .NET implementation. (#1477)
This commit removes the .NET implementation from Wasmtime.

It now exists at https://github.com/bytecodealliance/wasmtime-dotnet.

Also updates the Wasmtime book to include information about using Wasmtime from
.NET.
2020-04-06 20:03:49 -05:00
Nick Fitzgerald
a325b62ade Merge pull request #1463 from fitzgen/fix-c-api-tests
Fix wasmtime-c-api tests and run them in CI
2020-04-02 14:45:10 -07:00
Nick Fitzgerald
1d337efa38 Run the C API tests in CI 2020-04-02 10:40:16 -07:00
Artur Jamro
3481e59673 Install rustfmt component for the CI job (#1462) 2020-04-02 12:34:38 -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
Alex Crichton
9d40e1072a Include the Windows DLL import library in binaries
This commit fixes an issue where you couldn't actually link to
`wasmtime.dll` via a C compiler because it was missing its import
library, `wasmtime.dll.lib`
2020-03-27 12:53:03 -07:00
Alex Crichton
4ede98fe0c Make WASI and wat support optional in the C API (#1419)
Add some crate features to compile out support for these features of the
C API. Avoiding these two features if they're not necessary shaves about
2MB off the final shared object in some local tests!
2020-03-27 12:12:48 -05: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
Alex Crichton
853d5f304d Try to only publish crates/releases on wasmtime tags (#1406)
We've got a cranelift-v0.60.0 release made with the recent
cranelift-v0.60.0 tag, but the release infrastructure is intended to
only get used for wasmtime tags. Let's see if we can coerce github
actions to only releasing for wasmtime tags.
2020-03-25 15:40:52 -07:00
Darin Morrison
addb31a266 CI: add cargo audit job (#1314)
Co-authored-by: Darin Morrison <darinmorrison@users.noreply.github.com>
2020-03-24 12:57:15 -05:00
Benjamin Bouvier
139536828a Add non-standard builds of Cranelift in automation;
This adds the following build setups in CI:

- only x86,
- only arm64,
- disable debug assertions.
2020-03-23 12:19:28 +01:00
Dan Gohman
a7d84afeb4 Remove the old wast and wasm2obj commands. (#1372)
* Remove the old wast and wasm2obj commands.

These are subsumed by the `wasmtime wast` and `wasmtime wasm2obj` commands.

Fixes #827.

* Remove wasm2obj install commands.
2020-03-20 16:30:37 -07:00
Alex Crichton
532422a5d9 Fix CI fuzz runners 2020-03-17 11:59:42 -07:00
Alex Crichton
b0cf8c021f Turn off binaryen in fuzzing by default
... but turn it back on in CI by default. The `binaryen-sys` crate
builds binaryen from source, which is a drag on CI for a few reasons:

* This is quite large and takes a good deal of time to build
* The debug build directory for binaryen is 4GB large

In an effort to both save time and disk space on the builders this
commit adds a `binaryen` feature to the `wasmtime-fuzz` crate. This
feature is enabled specifically when running the fuzzers on CI, but it
is disabled during the typical `cargo test --all` command. This means
that the test builders should save an extra 4G of space and be a bit
speedier now that they don't build a giant wad of C++.

We'll need to update the OSS-fuzz integration to enable the `binaryen`
feature when executing `cargo fuzz build`, and I'll do that once this
gets closer to landing.
2020-03-17 09:51:59 -07: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
bd5e71b038 [wasi-common]: add armv7 support to wasi-common (#1269)
* Add armv7 support to wasi-common

This commit enables `target_pointer_width = 32` compatibility for
`wasi-common` (and by transitivity, any crate found inside, e.g., `yanix`).
I've also added a simplistic (bare minimum) check to our CI to ensure
that `wasi-common` cross-compiles to `armv7-unknown-gnueabihf` fine.
While here, I've done the same for `wasm32-unknown-emscripten`.

* Clean arch-specific impls + reuse libc consts

* Make SeekLoc::from_raw platform independent

* Collapse CI cc jobs into one
2020-03-10 19:18:59 +01:00
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
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
8efca7da0d Merge cranelift doc generation CI 2020-02-28 09:17:53 -08:00