Try to reduce CI times with a Rust *.wat parser (#1332)

This commit moves the cranelift tests and tools from the `wabt` crate on
crates.io (which compiles the wabt C++ codebase) to the `wat` crate on
crates.io which is a Rust parser for the `*.wat` format. This was
motivated by me noticing that release builds on Windows are ~5 minutes
longer than Linux builds, and local timing graphs showed that `wabt-sys`
was by far the longest build step in the build process.

This commit changes the `clif-util` binary where the `--enable-simd`
flag is no longer respected with the text format as input, since the
`wat` crate has no feature gating. This was already sort of not
respected, though, since `--enable-simd` wasn't consulted for binary
inputs which `clif-util` supports as well. If this isn't ok though then
it should be ok to close this PR!
This commit is contained in:
Alex Crichton
2020-01-10 16:32:16 -06:00
committed by Andrew Brown
parent 582e7942f8
commit 3a13f79b66
6 changed files with 24 additions and 90 deletions

View File

@@ -24,21 +24,6 @@ pub fn read_to_string<P: AsRef<Path>>(path: P) -> io::Result<String> {
Ok(buffer)
}
/// Read an entire file into a vector of bytes.
#[cfg(feature = "wasm")]
pub fn read_to_end<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
let mut buffer = Vec::new();
if path.as_ref() == Path::new("-") {
let stdin = io::stdin();
let mut stdin = stdin.lock();
stdin.read_to_end(&mut buffer)?;
} else {
let mut file = File::open(path)?;
file.read_to_end(&mut buffer)?;
}
Ok(buffer)
}
/// Like `FlagsOrIsa`, but holds ownership.
pub enum OwnedFlagsOrIsa {
Flags(settings::Flags),