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.
This commit is contained in:
Alex Crichton
2020-03-17 09:29:48 -07:00
parent ec90509387
commit b0cf8c021f
6 changed files with 22 additions and 12 deletions

View File

@@ -110,7 +110,7 @@ pub fn compile(wasm: &[u8], strategy: Strategy) {
/// or aren't enabled for different configs, we should get the same results when
/// we call the exported functions for all of our different configs.
pub fn differential_execution(
ttf: &crate::generators::WasmOptTtf,
wasm: &[u8],
configs: &[crate::generators::DifferentialConfig],
) {
crate::init_fuzzing();
@@ -131,13 +131,13 @@ pub fn differential_execution(
};
let mut export_func_results: HashMap<String, Result<Box<[Val]>, Trap>> = Default::default();
log_wasm(&ttf.wasm);
log_wasm(wasm);
for config in &configs {
let engine = Engine::new(config);
let store = Store::new(&engine);
let module = match Module::new(&store, &ttf.wasm) {
let module = match Module::new(&store, wasm) {
Ok(module) => module,
// The module might rely on some feature that our config didn't
// enable or something like that.
@@ -283,6 +283,7 @@ fn assert_same_export_func_result(
}
/// Invoke the given API calls.
#[cfg(feature = "binaryen")]
pub fn make_api_calls(api: crate::generators::api::ApiCalls) {
use crate::generators::api::ApiCall;