Skip to content

Commit d7d0ab4

Browse files
bors[bot]xmclarkMarkMcCaskey
committed
Merge #390
390: pin wapm version r=xmclark a=xmclark This PR pins the version of wapm-cli that gets distributed during releases. We can re-create the release, and will always install the same version of wapm-cli (until we update on a new wapm-cli release). Co-authored-by: Mackenzie Clark <mackenzie.a.z.c@gmail.com> Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2 parents 9f8bbb7 + 8eb6a0a commit d7d0ab4

File tree

7 files changed

+11
-25
lines changed

7 files changed

+11
-25
lines changed

.circleci/config.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
- run:
104104
name: Install Rust
105105
command: |
106-
curl https://sh.rustup.rs -sSf | sh -s -- -y
106+
curl -sSf https://sh.rustup.rs | sh -s -- -y
107107
export PATH="$HOME/.cargo/bin:$PATH"
108108
cargo --version
109109
- run:
@@ -153,7 +153,8 @@ jobs:
153153
- run:
154154
name: "Pull dependencies"
155155
command: |
156-
git clone git@github.com:wasmerio/wapm-cli.git
156+
git submodule init
157+
git submodule update --remote
157158
- restore_cache:
158159
keys:
159160
- v8-cargo-cache-linux-nightly-{{ arch }}-{{ checksum "Cargo.lock" }}
@@ -220,7 +221,8 @@ jobs:
220221
- run:
221222
name: "Pull dependencies"
222223
command: |
223-
git clone git@github.com:wasmerio/wapm-cli.git
224+
git submodule init
225+
git submodule update --remote
224226
- restore_cache:
225227
keys:
226228
- v8-cargo-cache-darwin-nightly-{{ arch }}-{{ checksum "Cargo.lock" }}
@@ -238,7 +240,7 @@ jobs:
238240
- run:
239241
name: Install Rust
240242
command: |
241-
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly-2019-04-11
243+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
242244
export PATH="$HOME/.cargo/bin:$PATH"
243245
cargo --version
244246
# Use rust nightly (for singlepass, for now)

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "wapm-cli"]
2+
path = wapm-cli
3+
url = git@github.com:wasmerio/wapm-cli.git

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ All PRs to the Wasmer repository must add to this file.
55
Blocks of changes will separated by version increments.
66

77
## **[Unreleased]**
8+
- [#390](https://github.com/wasmerio/wasmer/pull/390) Pin released wapm version and add it as a git submodule
89
- [#383](https://github.com/wasmerio/wasmer/pull/383) Hook up wasi exit code to wasmer cli.
910
- [#382](https://github.com/wasmerio/wasmer/pull/382) Improve error message on `--backend` flag to only suggest currently enabled backends
1011
- [#381](https://github.com/wasmerio/wasmer/pull/381) Allow retrieving propagated user errors.

Cargo.lock

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/wasi/Cargo.toml

-5
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,3 @@ hashbrown = "0.1.8"
1616
generational-arena = "0.2.2"
1717
log = "0.4.6"
1818
byteorder = "1.3.1"
19-
20-
[dependencies.zbox]
21-
git = "https://github.com/wasmerio/zbox"
22-
branch = "bundle-libsodium"
23-
features = ["libsodium-bundled"]

lib/wasi/src/state.rs

-15
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,35 @@ use std::{
1212
time::SystemTime,
1313
};
1414
use wasmer_runtime_core::debug;
15-
use zbox::init_env as zbox_init_env;
1615

1716
pub const MAX_SYMLINKS: usize = 100;
1817

1918
#[derive(Debug)]
2019
pub enum WasiFile {
21-
#[allow(dead_code)]
22-
ZboxFile(zbox::File),
2320
HostFile(fs::File),
2421
}
2522

2623
impl Write for WasiFile {
2724
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
2825
match self {
29-
WasiFile::ZboxFile(zbf) => zbf.write(buf),
3026
WasiFile::HostFile(hf) => hf.write(buf),
3127
}
3228
}
3329

3430
fn flush(&mut self) -> io::Result<()> {
3531
match self {
36-
WasiFile::ZboxFile(zbf) => zbf.flush(),
3732
WasiFile::HostFile(hf) => hf.flush(),
3833
}
3934
}
4035

4136
fn write_all(&mut self, buf: &[u8]) -> io::Result<()> {
4237
match self {
43-
WasiFile::ZboxFile(zbf) => zbf.write_all(buf),
4438
WasiFile::HostFile(hf) => hf.write_all(buf),
4539
}
4640
}
4741

4842
fn write_fmt(&mut self, fmt: ::std::fmt::Arguments) -> io::Result<()> {
4943
match self {
50-
WasiFile::ZboxFile(zbf) => zbf.write_fmt(fmt),
5144
WasiFile::HostFile(hf) => hf.write_fmt(fmt),
5245
}
5346
}
@@ -56,28 +49,24 @@ impl Write for WasiFile {
5649
impl Read for WasiFile {
5750
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
5851
match self {
59-
WasiFile::ZboxFile(zbf) => zbf.read(buf),
6052
WasiFile::HostFile(hf) => hf.read(buf),
6153
}
6254
}
6355

6456
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> io::Result<usize> {
6557
match self {
66-
WasiFile::ZboxFile(zbf) => zbf.read_to_end(buf),
6758
WasiFile::HostFile(hf) => hf.read_to_end(buf),
6859
}
6960
}
7061

7162
fn read_to_string(&mut self, buf: &mut String) -> io::Result<usize> {
7263
match self {
73-
WasiFile::ZboxFile(zbf) => zbf.read_to_string(buf),
7464
WasiFile::HostFile(hf) => hf.read_to_string(buf),
7565
}
7666
}
7767

7868
fn read_exact(&mut self, buf: &mut [u8]) -> io::Result<()> {
7969
match self {
80-
WasiFile::ZboxFile(zbf) => zbf.read_exact(buf),
8170
WasiFile::HostFile(hf) => hf.read_exact(buf),
8271
}
8372
}
@@ -86,7 +75,6 @@ impl Read for WasiFile {
8675
impl Seek for WasiFile {
8776
fn seek(&mut self, pos: io::SeekFrom) -> io::Result<u64> {
8877
match self {
89-
WasiFile::ZboxFile(zbf) => zbf.seek(pos),
9078
WasiFile::HostFile(hf) => hf.seek(pos),
9179
}
9280
}
@@ -183,9 +171,6 @@ pub struct WasiFs {
183171

184172
impl WasiFs {
185173
pub fn new(preopened_files: &[String]) -> Result<Self, String> {
186-
debug!("wasi::fs::init");
187-
zbox_init_env();
188-
debug!("wasi::fs::repo");
189174
/*let repo = RepoOpener::new()
190175
.create(true)
191176
.open("mem://wasmer-test-fs", "")

wapm-cli

Submodule wapm-cli added at c9399f3

0 commit comments

Comments
 (0)