Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ os:
- osx
language: rust
rust:
- 1.32.0
- 1.34.0
- beta
- nightly
matrix:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ utility or as a library embedded in a larger application.
[![Travis Status](https://travis-ci.org/CraneStation/wasmtime.svg?branch=master)](https://travis-ci.org/CraneStation/wasmtime)
[![Appveyor Status](https://ci.appveyor.com/api/projects/status/vxvpt2plriy5s0mc?svg=true)](https://ci.appveyor.com/project/CraneStation/cranelift)
[![Gitter chat](https://badges.gitter.im/CraneStation/CraneStation.svg)](https://gitter.im/CraneStation/Lobby)
![Minimum rustc 1.32](https://img.shields.io/badge/rustc-1.32+-green.svg)
![Minimum rustc 1.34](https://img.shields.io/badge/rustc-1.34+-green.svg)

Wasmtime passes the WebAssembly spec testsuite, and supports a new system
API proposal called [WebAssembly System Interface], or WASI.
Expand Down
35 changes: 10 additions & 25 deletions src/wasmtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ use cranelift_codegen::settings;
use cranelift_codegen::settings::Configurable;
use cranelift_native;
use docopt::Docopt;
use errno::errno;
use file_per_thread_logger;
use pretty_env_logger;
use std::error::Error;
use std::ffi::{CString, OsStr};
use std::ffi::OsStr;
use std::fs::File;
use std::io;
use std::io::prelude::*;
Expand Down Expand Up @@ -114,22 +113,15 @@ fn read_wasm(path: PathBuf) -> Result<Vec<u8>, String> {
})
}

fn compute_preopen_dirs(flag_dir: &[String], flag_mapdir: &[String]) -> Vec<(String, libc::c_int)> {
fn compute_preopen_dirs(flag_dir: &[String], flag_mapdir: &[String]) -> Vec<(String, File)> {
let mut preopen_dirs = Vec::new();

for dir in flag_dir {
let fd = unsafe {
libc::open(
CString::new(dir.as_bytes()).unwrap().as_ptr(),
libc::O_RDONLY | libc::O_DIRECTORY,
)
};
if fd < 0 {
println!("error while pre-opening directory {}: {}", dir, errno());
let preopen_dir = File::open(dir).unwrap_or_else(|err| {
println!("error while pre-opening directory {}: {}", dir, err);
exit(1);
}

preopen_dirs.push((dir.clone(), fd));
});
preopen_dirs.push((dir.clone(), preopen_dir));
}

for mapdir in flag_mapdir {
Expand All @@ -139,18 +131,11 @@ fn compute_preopen_dirs(flag_dir: &[String], flag_mapdir: &[String]) -> Vec<(Str
exit(1);
}
let (key, value) = (parts[0], parts[1]);
let fd = unsafe {
libc::open(
CString::new(value.as_bytes()).unwrap().as_ptr(),
libc::O_RDONLY | libc::O_DIRECTORY,
)
};
if fd < 0 {
println!("error while pre-opening directory {}: {}", value, errno());
let preopen_dir = File::open(value).unwrap_or_else(|err| {
println!("error while pre-opening directory {}: {}", value, err);
exit(1);
}

preopen_dirs.push((key.to_string(), fd));
});
preopen_dirs.push((key.to_string(), preopen_dir));
}

preopen_dirs
Expand Down
8 changes: 1 addition & 7 deletions wasmtime-wasi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,12 @@ readme = "README.md"
wasmtime-runtime = { path = "../wasmtime-runtime" }
wasmtime-environ = { path = "../wasmtime-environ" }
wasmtime-jit = { path = "../wasmtime-jit" }
wasi-common = { git = "https://github.com/CraneStation/wasi-common" }
cranelift-codegen = "0.30.0"
cranelift-entity = "0.30.0"
cranelift-wasm = "0.30.0"
target-lexicon = "0.3.0"
cast = { version = "0.2.2", default-features = false }
log = { version = "0.4.6", default-features = false }
libc = "0.2.50"
errno = "0.2.4"

[build-dependencies]
cmake = "0.1.35"
bindgen = "0.49.0"

[badges]
maintenance = { status = "experimental" }
Expand Down
116 changes: 0 additions & 116 deletions wasmtime-wasi/build.rs

This file was deleted.

8 changes: 0 additions & 8 deletions wasmtime-wasi/sandboxed-system-primitives/CMakeLists.txt

This file was deleted.

7 changes: 0 additions & 7 deletions wasmtime-wasi/sandboxed-system-primitives/LICENSE

This file was deleted.

9 changes: 0 additions & 9 deletions wasmtime-wasi/sandboxed-system-primitives/README.md

This file was deleted.

121 changes: 0 additions & 121 deletions wasmtime-wasi/sandboxed-system-primitives/include/LICENSE

This file was deleted.

Loading