mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-13 22:25:40 +00:00
remove zbox because wasmer will not build on windows nightly
This commit is contained in:
parent
6ff24a8aa1
commit
3998c9ec17
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -2406,7 +2406,6 @@ dependencies = [
|
|||||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"wasmer-runtime-core 0.3.0",
|
"wasmer-runtime-core 0.3.0",
|
||||||
"zbox 0.6.1 (git+https://github.com/wasmerio/zbox?branch=bundle-libsodium)",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -16,8 +16,3 @@ hashbrown = "0.1.8"
|
|||||||
generational-arena = "0.2.2"
|
generational-arena = "0.2.2"
|
||||||
log = "0.4.6"
|
log = "0.4.6"
|
||||||
byteorder = "1.3.1"
|
byteorder = "1.3.1"
|
||||||
|
|
||||||
[dependencies.zbox]
|
|
||||||
git = "https://github.com/wasmerio/zbox"
|
|
||||||
branch = "bundle-libsodium"
|
|
||||||
features = ["libsodium-bundled"]
|
|
||||||
|
@ -12,42 +12,35 @@ use std::{
|
|||||||
time::SystemTime,
|
time::SystemTime,
|
||||||
};
|
};
|
||||||
use wasmer_runtime_core::debug;
|
use wasmer_runtime_core::debug;
|
||||||
use zbox::init_env as zbox_init_env;
|
|
||||||
|
|
||||||
pub const MAX_SYMLINKS: usize = 100;
|
pub const MAX_SYMLINKS: usize = 100;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum WasiFile {
|
pub enum WasiFile {
|
||||||
#[allow(dead_code)]
|
|
||||||
ZboxFile(zbox::File),
|
|
||||||
HostFile(fs::File),
|
HostFile(fs::File),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Write for WasiFile {
|
impl Write for WasiFile {
|
||||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||||
match self {
|
match self {
|
||||||
WasiFile::ZboxFile(zbf) => zbf.write(buf),
|
|
||||||
WasiFile::HostFile(hf) => hf.write(buf),
|
WasiFile::HostFile(hf) => hf.write(buf),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn flush(&mut self) -> io::Result<()> {
|
fn flush(&mut self) -> io::Result<()> {
|
||||||
match self {
|
match self {
|
||||||
WasiFile::ZboxFile(zbf) => zbf.flush(),
|
|
||||||
WasiFile::HostFile(hf) => hf.flush(),
|
WasiFile::HostFile(hf) => hf.flush(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write_all(&mut self, buf: &[u8]) -> io::Result<()> {
|
fn write_all(&mut self, buf: &[u8]) -> io::Result<()> {
|
||||||
match self {
|
match self {
|
||||||
WasiFile::ZboxFile(zbf) => zbf.write_all(buf),
|
|
||||||
WasiFile::HostFile(hf) => hf.write_all(buf),
|
WasiFile::HostFile(hf) => hf.write_all(buf),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write_fmt(&mut self, fmt: ::std::fmt::Arguments) -> io::Result<()> {
|
fn write_fmt(&mut self, fmt: ::std::fmt::Arguments) -> io::Result<()> {
|
||||||
match self {
|
match self {
|
||||||
WasiFile::ZboxFile(zbf) => zbf.write_fmt(fmt),
|
|
||||||
WasiFile::HostFile(hf) => hf.write_fmt(fmt),
|
WasiFile::HostFile(hf) => hf.write_fmt(fmt),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -56,28 +49,24 @@ impl Write for WasiFile {
|
|||||||
impl Read for WasiFile {
|
impl Read for WasiFile {
|
||||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||||
match self {
|
match self {
|
||||||
WasiFile::ZboxFile(zbf) => zbf.read(buf),
|
|
||||||
WasiFile::HostFile(hf) => hf.read(buf),
|
WasiFile::HostFile(hf) => hf.read(buf),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> io::Result<usize> {
|
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> io::Result<usize> {
|
||||||
match self {
|
match self {
|
||||||
WasiFile::ZboxFile(zbf) => zbf.read_to_end(buf),
|
|
||||||
WasiFile::HostFile(hf) => hf.read_to_end(buf),
|
WasiFile::HostFile(hf) => hf.read_to_end(buf),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_to_string(&mut self, buf: &mut String) -> io::Result<usize> {
|
fn read_to_string(&mut self, buf: &mut String) -> io::Result<usize> {
|
||||||
match self {
|
match self {
|
||||||
WasiFile::ZboxFile(zbf) => zbf.read_to_string(buf),
|
|
||||||
WasiFile::HostFile(hf) => hf.read_to_string(buf),
|
WasiFile::HostFile(hf) => hf.read_to_string(buf),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_exact(&mut self, buf: &mut [u8]) -> io::Result<()> {
|
fn read_exact(&mut self, buf: &mut [u8]) -> io::Result<()> {
|
||||||
match self {
|
match self {
|
||||||
WasiFile::ZboxFile(zbf) => zbf.read_exact(buf),
|
|
||||||
WasiFile::HostFile(hf) => hf.read_exact(buf),
|
WasiFile::HostFile(hf) => hf.read_exact(buf),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -86,7 +75,6 @@ impl Read for WasiFile {
|
|||||||
impl Seek for WasiFile {
|
impl Seek for WasiFile {
|
||||||
fn seek(&mut self, pos: io::SeekFrom) -> io::Result<u64> {
|
fn seek(&mut self, pos: io::SeekFrom) -> io::Result<u64> {
|
||||||
match self {
|
match self {
|
||||||
WasiFile::ZboxFile(zbf) => zbf.seek(pos),
|
|
||||||
WasiFile::HostFile(hf) => hf.seek(pos),
|
WasiFile::HostFile(hf) => hf.seek(pos),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -183,9 +171,6 @@ pub struct WasiFs {
|
|||||||
|
|
||||||
impl WasiFs {
|
impl WasiFs {
|
||||||
pub fn new(preopened_files: &[String]) -> Result<Self, String> {
|
pub fn new(preopened_files: &[String]) -> Result<Self, String> {
|
||||||
debug!("wasi::fs::init");
|
|
||||||
zbox_init_env();
|
|
||||||
debug!("wasi::fs::repo");
|
|
||||||
/*let repo = RepoOpener::new()
|
/*let repo = RepoOpener::new()
|
||||||
.create(true)
|
.create(true)
|
||||||
.open("mem://wasmer-test-fs", "")
|
.open("mem://wasmer-test-fs", "")
|
||||||
|
Loading…
Reference in New Issue
Block a user