Skip to content
This repository was archived by the owner on Sep 12, 2023. It is now read-only.

Commit 8b89127

Browse files
author
wangshishuo
committed
update ssvmc to wasmedgec 0.8.0
1 parent 8e62e13 commit 8b89127

3 files changed

Lines changed: 25 additions & 25 deletions

File tree

src/command/build.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Implementation of the `rustwasmc build` command.
22
33
use crate::wasm_opt;
4-
use crate::ssvmc;
4+
use crate::wasmedgec;
55
use binary_install::{Cache, Download};
66
use bindgen;
77
use build;
@@ -243,7 +243,7 @@ impl Build {
243243
step_install_wasm_bindgen,
244244
step_run_wasm_bindgen,
245245
step_run_wasm_opt,
246-
step_run_ssvmc,
246+
step_run_wasmedgec,
247247
step_create_json,
248248
]);
249249
steps
@@ -431,11 +431,11 @@ impl Build {
431431
})
432432
}
433433

434-
fn step_run_ssvmc(&mut self) -> Result<(), Error> {
434+
fn step_run_wasmedgec(&mut self) -> Result<(), Error> {
435435
if !self.enable_aot {
436436
return Ok(())
437437
}
438-
ssvmc::run(
438+
wasmedgec::run(
439439
&self.cache,
440440
&self.out_dir,
441441
self.mode.install_permitted(),

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub mod progressbar;
4040
pub mod readme;
4141
pub mod target;
4242
pub mod wasm_opt;
43-
pub mod ssvmc;
43+
pub mod wasmedgec;
4444

4545
use progressbar::{LogLevel, ProgressOutput};
4646

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Support for downloading and executing `ssvmc`
1+
//! Support for downloading and executing `wasmedgec`
22
33
use crate::child;
44
use crate::emoji;
@@ -9,17 +9,17 @@ use log::debug;
99
use std::path::{Path, PathBuf};
1010
use std::process::Command;
1111

12-
/// Execute `ssvmc` over wasm binaries found in `out_dir`, downloading if
13-
/// necessary into `cache`. Passes `args` to each invocation of `ssvmc`.
12+
/// Execute `wasmedgec` over wasm binaries found in `out_dir`, downloading if
13+
/// necessary into `cache`. Passes `args` to each invocation of `wasmedgec`.
1414
pub fn run(
1515
cache: &Cache,
1616
out_dir: &Path,
1717
install_permitted: bool,
1818
) -> Result<(), failure::Error> {
19-
let ssvmc = match find_ssvmc(cache, install_permitted)? {
19+
let wasmedgec = match find_wasmedgec(cache, install_permitted)? {
2020
SsvmcOpt::Found(path) => path,
2121
SsvmcOpt::CannotInstall => {
22-
PBAR.info("Skipping ssvmc as no downloading was requested");
22+
PBAR.info("Skipping wasmedgec as no downloading was requested");
2323
return Ok(());
2424
}
2525
SsvmcOpt::PlatformNotSupported => {
@@ -28,7 +28,7 @@ pub fn run(
2828
}
2929
};
3030

31-
PBAR.info("Compiling AOT binaries with `ssvmc`...");
31+
PBAR.info("Compiling AOT binaries with `wasmedgec`...");
3232

3333
for file in out_dir.read_dir()? {
3434
let file = file?;
@@ -38,9 +38,9 @@ pub fn run(
3838
}
3939

4040
let tmp = path.with_extension("so");
41-
let mut cmd = Command::new(&ssvmc);
41+
let mut cmd = Command::new(&wasmedgec);
4242
cmd.arg(&path).arg(&tmp);
43-
if let Err(e) = child::run(cmd, "ssvmc") {
43+
if let Err(e) = child::run(cmd, "wasmedgec") {
4444
PBAR.info("You need Ubuntu 20.04 to compile the AOT binary. Please see https://www.secondstate.io/articles/setup-rust-nodejs/");
4545
return Err(e)
4646
}
@@ -49,27 +49,27 @@ pub fn run(
4949
Ok(())
5050
}
5151

52-
/// Possible results of `find_ssvmc`
52+
/// Possible results of `find_wasmedgec`
5353
pub enum SsvmcOpt {
54-
/// Couldn't install ssvmc because downloads are forbidden
54+
/// Couldn't install wasmedgec because downloads are forbidden
5555
CannotInstall,
5656
/// The current platform doesn't support precompiled binaries
5757
PlatformNotSupported,
58-
/// We found `ssvmc` at the specified path
58+
/// We found `wasmedgec` at the specified path
5959
Found(PathBuf),
6060
}
6161

62-
/// Attempts to find `ssvmc` in `PATH` locally, or failing that downloads a
62+
/// Attempts to find `wasmedgec` in `PATH` locally, or failing that downloads a
6363
/// precompiled binary.
6464
///
6565
/// Returns `Some` if a binary was found or it was successfully downloaded.
6666
/// Returns `None` if a binary wasn't found in `PATH` and this platform doesn't
6767
/// have precompiled binaries. Returns an error if we failed to download the
6868
/// binary.
69-
pub fn find_ssvmc(cache: &Cache, install_permitted: bool) -> Result<SsvmcOpt, failure::Error> {
69+
pub fn find_wasmedgec(cache: &Cache, install_permitted: bool) -> Result<SsvmcOpt, failure::Error> {
7070
// First attempt to look up in PATH. If found assume it works.
71-
if let Ok(path) = which::which("ssvmc") {
72-
debug!("found ssvmc at {:?}", path);
71+
if let Ok(path) = which::which("wasmedgec") {
72+
debug!("found wasmedgec at {:?}", path);
7373
return Ok(SsvmcOpt::Found(path));
7474
}
7575

@@ -80,17 +80,17 @@ pub fn find_ssvmc(cache: &Cache, install_permitted: bool) -> Result<SsvmcOpt, fa
8080
return Ok(SsvmcOpt::PlatformNotSupported);
8181
};
8282
let url = format!(
83-
"https://github.com/second-state/SSVM/releases/download/{vers}/ssvm-{vers}-linux-x64.tar.gz",
84-
vers = "0.7.0",
83+
"https://github.com/WasmEdge/WasmEdge/releases/download/{vers}/WasmEdge-{vers}-manylinux2014_x86_64.tar.gz",
84+
vers = "0.8.0",
8585
);
8686

87-
let download = |permit_install| cache.download(permit_install, "ssvmc", &["ssvmc"], &url);
87+
let download = |permit_install| cache.download(permit_install, "wasmedgec", &["wasmedgec"], &url);
8888

8989
let dl = match download(false)? {
9090
Some(dl) => dl,
9191
None if !install_permitted => return Ok(SsvmcOpt::CannotInstall),
9292
None => {
93-
let msg = format!("{}Installing ssvmc...", emoji::DOWN_ARROW);
93+
let msg = format!("{}Installing wasmedgec...", emoji::DOWN_ARROW);
9494
PBAR.info(&msg);
9595

9696
match download(install_permitted)? {
@@ -100,5 +100,5 @@ pub fn find_ssvmc(cache: &Cache, install_permitted: bool) -> Result<SsvmcOpt, fa
100100
}
101101
};
102102

103-
Ok(SsvmcOpt::Found(dl.binary("ssvmc")?))
103+
Ok(SsvmcOpt::Found(dl.binary("wasmedgec")?))
104104
}

0 commit comments

Comments
 (0)