Skip to content

Commit

Permalink
Merge branch 'master' into backend-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
syrusakbary authored Jan 7, 2020
2 parents dab133c + 94bcea9 commit 1cf7ab0
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 4 deletions.
1 change: 1 addition & 0 deletions examples/plugin-for-example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "plugin-for-example"
version = "0.1.0"
authors = ["The Wasmer Engineering Team <[email protected]>"]
license = "MIT"
edition = "2018"

[dependencies]
1 change: 1 addition & 0 deletions lib/kernel-loader/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "wasmer-kernel-loader"
version = "0.1.0"
authors = ["Heyang Zhou <[email protected]>"]
license = "MIT"
edition = "2018"

[dependencies]
Expand Down
1 change: 1 addition & 0 deletions lib/kernel-net/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "kernel-net"
version = "0.1.0"
authors = ["Heyang Zhou <[email protected]>"]
license = "MIT"
edition = "2018"

[dependencies]
Expand Down
1 change: 1 addition & 0 deletions lib/llvm-backend-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "wasmer-llvm-backend-tests"
version = "0.10.2"
authors = ["Nick Lewycky <[email protected]>"]
license = "MIT"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
10 changes: 10 additions & 0 deletions lib/llvm-backend-tests/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
#![deny(
dead_code,
nonstandard_style,
unused_imports,
unused_mut,
unused_variables,
unused_unsafe,
unreachable_patterns
)]

pub use wabt::wat2wasm;
use wasmer_llvm_backend::LLVMCompiler;
use wasmer_runtime_core::backend::Compiler;
Expand Down
2 changes: 1 addition & 1 deletion lib/llvm-backend-tests/tests/compile.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use wasmer_llvm_backend::{InkwellMemoryBuffer, InkwellModule, LLVMBackendConfig, LLVMCallbacks};
use wasmer_llvm_backend::{InkwellModule, LLVMBackendConfig, LLVMCallbacks};
use wasmer_llvm_backend_tests::{get_compiler, wat2wasm};
use wasmer_runtime::{imports, CompilerConfig};
use wasmer_runtime_core::{backend::BackendCompilerConfig, compile_with, compile_with_config};
Expand Down
2 changes: 1 addition & 1 deletion lib/runtime-c-api/src/import/wasi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub enum Version {
Unknown = 0,

/// Latest version. See `wasmer_wasi::WasiVersion::Latest` to
/// leran more.
/// learn more.
Latest = 1,

/// `wasi_unstable`.
Expand Down
1 change: 1 addition & 0 deletions lib/wasi-experimental-io-devices/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ edition = "2018"
repository = "https://github.com/wasmerio/wasmer"
publish = true
description = "An experimental non-standard WASI extension for graphics"
license = "MIT"

[badges]
maintenance = { status = "experimental" }
Expand Down
19 changes: 17 additions & 2 deletions src/bin/wasmer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ extern crate structopt;

use std::collections::HashMap;
use std::env;
use std::error::Error;
use std::fs::{read_to_string, File};
use std::io;
use std::io::Read;
Expand Down Expand Up @@ -630,8 +631,22 @@ fn execute_wasm(options: &Run) -> Result<(), String> {

if !utils::is_wasm_binary(&wasm_binary) {
let features = options.features.into_wabt_features();
wasm_binary = wabt::wat2wasm_with_features(wasm_binary, features)
.map_err(|e| format!("Can't convert from wast to wasm: {:?}", e))?;
wasm_binary = wabt::wat2wasm_with_features(wasm_binary, features).map_err(|e| {
format!(
"Can't convert from wast to wasm because \"{}\"{}",
e.description(),
match e.kind() {
wabt::ErrorKind::Deserialize(s)
| wabt::ErrorKind::Parse(s)
| wabt::ErrorKind::ResolveNames(s)
| wabt::ErrorKind::Validate(s) => format!(":\n\n{}", s),
wabt::ErrorKind::Nul
| wabt::ErrorKind::WriteText
| wabt::ErrorKind::NonUtf8Result
| wabt::ErrorKind::WriteBinary => "".to_string(),
}
)
})?;
}

let compiler: Box<dyn Compiler> = get_compiler_by_backend(options.backend, options)
Expand Down

0 comments on commit 1cf7ab0

Please sign in to comment.