Giter Club home page Giter Club logo

wasmedge-nodejs-starter's Introduction

Info

This project is no longer updated. If you are interested in using javascript, please refer to the wasmedge-quickjs repo

Getting started

Build and test

Fork this project to create your own Rust functions as a web service.

How it works

  • The Rust function source code is in the src/lib.rs file.
  • Use the rustwasmc tool to compile the Rust function into a WebAssembly module in the pkg directory.
  • Optional: Use the node node/app.js command to test the function locally in Node.js.
  • Upload the pkg/*.wasm file to the Second State FaaS service, OR to a Node.js server, to turn it into a web service.

Setup

It is easy to use our appdev Docker image to run the dev environment. You can choose from x86_64 or aarch64 versions of the image. Alternatively, you could also use Github Codespaces to run the following example.

$ docker pull wasmedge/appdev_x86_64
$ docker run -p 3000:3000 --rm -it -v $(pwd):/app wasmedge/appdev_x86_64
(docker) #

Build

Use the rustwasmc command to build the Rust function into a WebAssembly bytecode file.

(docker) # cd /app
(docker) # rustwasmc build

Test and debug

From the first terminal window, start the Node.js application.

(docker) # node node/app.js

From a second terminal window, you can test the local server.

$ curl http://localhost:3000/?name=WasmEdge
hello WasmEdge

Optional: Upload to the FaaS and test

Upload the wasm file in the pkg folder to the FaaS. Double check the .wasm file name before you upload.

(docker) # curl --location --request POST 'https://rpc.ssvm.secondstate.io:8081/api/executables' \
--header 'Content-Type: application/octet-stream' \
--header 'SSVM-Description: say hello' \
--data-binary '@pkg/hello_lib_bg.wasm'

The FaaS returns

{"wasm_id":161,"wasm_sha256":"0xfb413547a8aba56d0349603a7989e269f3846245e51804932b3e02bc0be4b665","usage_key":"00000000-0000-0000-0000-000000000000","admin_key":"00xxxxxx-xxxx-xxxx-xxxx-4adc960fd2b8"}

Make a function call via the web.

(docker) # curl --location --request POST 'https://rpc.ssvm.secondstate.io:8081/api/run/161/say' \
--header 'Content-Type: text/plain' \
--data-raw 'Second State FaaS'
hello Second State FaaS

You can easily incorporate this web service into your HTML web pages. See how

More exercises

Now, you can copy and paste code from this project.

Read more:

Resources

  • The WasmEdge Runtime is a high performance WebAssembly virtual machine designed for edge computing (including Edge Cloud) applications.
  • The rustwasmc is a toolchain for compiling Rust programs into WebAssembly, and then make them accessible from JavaScripts via the WasmEdge Runtime.
  • The Second State FaaS is an open source FaaS engine based on WebAssembly and Node.js.

Brought to you by the Open source dev team at Second State. Follow us on Twitter, Facebook, LinkedIn, YouTube, or Medium

wasmedge-nodejs-starter's People

Contributors

alabulei1 avatar hydai avatar juntao avatar vrixyz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wasmedge-nodejs-starter's Issues

Protocol buffers

What about protobuf support? Wouldn't this be better/faster than json? We already have protobufjs, and ts-proto for javascript/typescript side of things, right?

TypeError: wasmedge.VM is not a constructor

I'm using the docker env (on macos if it matters) described here.

I shell into the docker container, and rustwasmc build builds fine.

When running node node/app.js, I get an error running the node app:

root@ad8ee9327daf:/app# node node/app.js 
WasmEdge temporary package. Please ping [email protected] for more info while we publish the final package
/app/pkg/wasmedge_nodejs_starter_lib.js:14
vm = new wasmedge.VM(path, { args:process.argv, env:process.env, preopens:{'/': __dirname} });
     ^

TypeError: wasmedge.VM is not a constructor
    at Object.<anonymous> (/app/pkg/wasmedge_nodejs_starter_lib.js:14:6)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/app/node/app.js:1:17)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
root@ad8ee9327daf:/app# cat pkg/wasmedge_nodejs_starter_lib.js 

ssvmup build error

error info

[INFO]: Installing wasm-bindgen...
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { description: "Couldn\'t connect to server", code: 7, extra: None }', src/install/mod.rs:182:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Well, this is embarrassing.

ssvmup had a problem and crashed. To help us diagnose the problem you can send us a crash report.

We have generated a report file at "/tmp/report-38176822-26b0-464a-b688-81828a90d116.toml". Submit an issue or email with the subject of "ssvmup Crash Report" and include the report as an attachment.

- Authors: wangshishuo

We take privacy seriously, and do not perform any automated error collection. In order to improve the software, we rely on people to submit reports.

Thank you kindly!

report-84f344ff-48ef-4390-afc3-3d30f0f7102e.toml info:

"/tmp/report-84f344ff-48ef-4390-afc3-3d30f0f7102e.toml" 43L, 2495C                 1,1           All
name = 'ssvmup'
operating_system = 'unix:Ubuntu'
crate_version = '0.1.15'
explanation = '''
Panic occurred in file 'src/install/mod.rs' at line 182
'''
method = 'Panic'
backtrace = '''
   0:     0x55d6b1483b77 - backtrace::backtrace::trace::hfa6632c98169b3df
   1:     0x55d6b1482035 - backtrace::capture::Backtrace::new::h6549c5ab38a641f2
   2:     0x55d6b13d8bd9 - human_panic::report::Report::new::h38f5494317fd2945
   3:     0x55d6b13d8383 - human_panic::handle_dump::h0275ab777b783238
   4:     0x55d6b11392bc - ssvmup::setup_panic_hooks::{{closure}}::h35111d1bc1653272
   5:     0x55d6b14b585c - std::panicking::rust_panic_with_hook::h8dd35d3cd11497d7
                               at src/libstd/panicking.rs:490
   6:     0x55d6b14b543b - rust_begin_unwind
                               at src/libstd/panicking.rs:388
   7:     0x55d6b14de711 - core::panicking::panic_fmt::hdf118db3fcd2d481
                               at src/libcore/panicking.rs:101
   8:     0x55d6b14de513 - core::option::expect_none_failed::h2982f0b1b6ba4b49
                               at src/libcore/option.rs:1272
   9:     0x55d6b1169168 - ssvmup::install::download_prebuilt::hfcf236b732371f41
  10:     0x55d6b116761f - ssvmup::install::download_prebuilt_or_cargo_install::h0e6b3aa2ef0ab5d5
  11:     0x55d6b1174c0c - ssvmup::command::build::Build::step_install_wasm_bindgen::h23079e71a00ce89f
  12:     0x55d6b117348f - ssvmup::command::build::Build::run::hebf401cb495b7a76
  13:     0x55d6b1141986 - ssvmup::command::run_ssvmup::h3b6eb04e11b9316e
  14:     0x55d6b1138f45 - ssvmup::main::h48876b40163d25d7
  15:     0x55d6b1139de3 - std::rt::lang_start::{{closure}}::ha243d93f29a11dd4
  16:     0x55d6b14b5cc8 - std::rt::lang_start_internal::{{closure}}::hfca5b90b4b1ebb0e
                               at src/libstd/rt.rs:52
                           std::panicking::try::do_call::hfc9c880ab92e6248
                               at src/libstd/panicking.rs:297
                           std::panicking::try::h2ed6f772c4dd6273
                               at src/libstd/panicking.rs:274
                           std::panic::catch_unwind::hc6028b0fc71765c5
                               at src/libstd/panic.rs:394
                           std::rt::lang_start_internal::heb6c9d57f3355ded
                               at src/libstd/rt.rs:51
  17:     0x55d6b1139362 - main
  18:     0x7f1e9dcf20b3 - __libc_start_main
  19:     0x55d6b113371a - _start
  20:                0x0 - <unknown>

Launch the Node.js app error about libLLVM-10.so.1

Launch the Node.js app and then it crash:

root@8a292042ecf0:/workspaces/ssvm-nodejs-starter# node node/app.js
internal/modules/cjs/loader.js:1122
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: libLLVM-10.so.1: cannot open shared object file: No such file or directory
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/node_modules/ssvm/index.js:4:15)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
root@8a292042ecf0:/workspaces/ssvm-nodejs-starter# 

What I can do to resolve it.

Installation issue with Rexiv2 package.

Description
on adding rexiv2 = "0.9.1" to cargo.toml.
command : ssvmup build is failing.
But cargo build is working fine

Error Output

root@1eafb19a4f45:/workspaces/ssvm-nodejs-starter# ssvmup build
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
   Compiling gexiv2-sys v1.1.2
error: failed to run custom build command for `gexiv2-sys v1.1.2`

Caused by:
  process didn't exit successfully: `/workspaces/ssvm-nodejs-starter/target/release/build/gexiv2-sys-12fc9f29c3be5e22/build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=GEXIV2_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_wasm32-wasi
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_wasm32_wasi
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_wasm32-wasi
  cargo:rerun-if-env-changed=PKG_CONFIG_wasm32_wasi
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_wasm32-wasi
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_wasm32_wasi
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  The gexiv2 library was not found by pkg-config on your system.

  Consult the README.md file for suggestions on how to acquire it.

  --- stderr
  thread 'main' panicked at 'Cross compilation detected. Use PKG_CONFIG_ALLOW_CROSS=1 to override', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/gexiv2-sys-1.1.2/build.rs:28:13
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
Error: Compiling your crate to WebAssembly failed
Caused by: failed to execute `cargo build`: exited with exit code: 101

No code changes can not run through?

os: ubuntu18.0 x86
rustc 1.43.0 (4fb7144ed 2020-04-20)

wangy@mv-ubuntu-006:~/Github/RUST/ssvm-nodejs-starter$ ssvmup build
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
    Finished release [optimized] target(s) in 0.01s
[INFO]: Installing wasm-bindgen...
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { description: "Couldn\'t connect to server", code: 7, extra: None }', src/install/mod.rs:182:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Well, this is embarrassing.

ssvmup had a problem and crashed. To help us diagnose the problem you can send us a crash report.

We have generated a report file at "/tmp/report-03fda0f6-97e4-4a25-871f-86c7a5aaac2f.toml". Submit an issue or email with the subject of "ssvmup Crash Report" and include the report as an attachment.

- Authors: wangshishuo

We take privacy seriously, and do not perform any automated error collection. In order to improve the software, we rely on people to submit reports.

Thank you kindly!
name = 'ssvmup'
operating_system = 'unix:Ubuntu'
crate_version = '0.1.14'
explanation = '''
Panic occurred in file 'src/install/mod.rs' at line 182
'''
method = 'Panic'
backtrace = '''
   0:     0x563895865617 - backtrace::backtrace::trace::h1918625399014455
   1:     0x5638958639f5 - backtrace::capture::Backtrace::new::h1caa2b4438e7e3d1
   2:     0x5638957ba609 - human_panic::report::Report::new::h8373d669f137c710
   3:     0x5638957b9db3 - human_panic::handle_dump::h840eec528f13a739
   4:     0x56389551b1fc - ssvmup::setup_panic_hooks::{{closure}}::h41bcb094516de9f6
   5:     0x56389589721c - std::panicking::rust_panic_with_hook::h88a1f16ec8a7bb20
                               at src/libstd/panicking.rs:490
   6:     0x563895896dfb - rust_begin_unwind
                               at src/libstd/panicking.rs:388
   7:     0x5638958c00d1 - core::panicking::panic_fmt::hbddb7fe6f399b81a
                               at src/libcore/panicking.rs:101
   8:     0x5638958bfed3 - core::option::expect_none_failed::h60849c4323f09783
                               at src/libcore/option.rs:1272
   9:     0x56389554a8a3 - ssvmup::install::download_prebuilt::h58bbb15c8877719a
  10:     0x563895548cff - ssvmup::install::download_prebuilt_or_cargo_install::h46501dde5634f700
  11:     0x56389555648c - ssvmup::command::build::Build::step_install_wasm_bindgen::h003d6ff043b675e7
  12:     0x563895554d0f - ssvmup::command::build::Build::run::he02babaf9bc75f04
  13:     0x563895523696 - ssvmup::command::run_ssvmup::h4a6426c2818fe4de
  14:     0x56389551ae85 - ssvmup::main::h745c576c2d1f7193
  15:     0x56389551bd23 - std::rt::lang_start::{{closure}}::h36a8e63f91640e1c
  16:     0x563895897688 - std::rt::lang_start_internal::{{closure}}::h6d21eebfa4beaf70
                               at src/libstd/rt.rs:52
                           std::panicking::try::do_call::h560a27b87db38b9c
                               at src/libstd/panicking.rs:297
                           std::panicking::try::h453d4afd696011f9
                               at src/libstd/panicking.rs:274
                           std::panic::catch_unwind::h211d02671f23030f
                               at src/libstd/panic.rs:394
                           std::rt::lang_start_internal::h464df2bbf46c7e7c
                               at src/libstd/rt.rs:51
  17:     0x56389551b2a2 - main
  18:     0x7f0d42293b97 - __libc_start_main
  19:     0x56389551565a - _start
  20:                0x0 - <unknown>
'''

[secondstate/ssvm-nodejs-starter Error] Error response from daemon

my window 7 :

C:\>docker pull secondstate/ssvm-nodejs-starter:v1

v1: Pulling from secondstate/ssvm-nodejs-starter
e6ca3592b144: Already exists
534a5505201d: Already exists
990916bd23bb: Already exists
f6ca06dad480: Pull complete
21d3647ab116: Pull complete
3cdfe5aeeed1: Pull complete
Digest: sha256:cc0faaf7e5a5435602a03be41b5f286afcfdf5aa2f34339c1f9a0aaa85b31bf6
Status: Downloaded newer image for secondstate/ssvm-nodejs-starter:v1


C:\>docker run -p 3000:3000 --rm -it -v $(pwd):/app secondstate/ssvm-nodejs-starter:v1

docker: Error response from daemon: create $(pwd): "$(pwd)" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.
See 'docker run --help'.

Sorry I'm using Rust for the first time, why this error?

open file error

Following rust code will throw error, it look like this issue wasmerio/wasmer#356

   let mut input: Box<dyn std::io::Read> = match File::open(path) {
        Ok(f) => Box::new(f),
        Err(e) => {
            let mut estr = String::from(path);
            estr.push_str(": ");
            estr.push_str(&e.to_string());
            return Err(estr);
        }
    };
 failed to find a pre-opened file descriptor through which "/workspaces/ssvm-nodejs-starter/2020-10-19-11-50-19.json" could be opened

Docs could be better

in ubuntu

Installation needed

  1. ssvmup
npm i -g ssvmup
  1. wasm-opt
npm i -g wasm-opt
  1. node-pre-gyp
npm i -g  node-pre-gyp

Errors

// this is the file ssvm_nodejs_starter_lib.js generated by ssvmup build

let vm;

/**
* @param {string} s
* @returns {string}
*/
module.exports.say = function(s) {
    if (typeof s === 'object') s = JSON.stringify(s);
    return vm.RunString('say', s);
};

const path = require('path').join(__dirname, 'ssvm_nodejs_starter_lib_bg.wasm');
const ssvm = require('ssvm'); 
vm = new ssvm.VM(path, { args:process.argv, env:process.env, preopens:{'/': __dirname} });

ssvm is a node module? but when installed globally, then run node node/app.js

Error: Cannot find module 'ssvm'

I tried several times, it still failed.

If ssvm is only available from source code/docker. The node module ssvm should be deprecated/deleted.

It's not easy to use it for newbies

Giveaway google form doesn't seem to be working

I finished the challenge and tried to submit it but my form doesn't seem to have worked and I haven't received any confirmation of my submission. Could you please check it out? I really want the Raspberry Pi as I need a computer.

Error while launching from codespace

I've tried checking the libstdc++ but still unable to get GLIBCXX_3.4.26 in

/usr/bin/node --inspect-brk=9286 app.js
Debugger listening on ws://127.0.0.1:9286/14f711e4-597f-4539-82fe-0444cf31345b
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
internal/modules/cjs/loader.js:807
return process.dlopen(module, path.toNamespacedPath(filename));
^

Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version GLIBCXX_3.4.26' not found (required by /root/workspace/ssvm-nodejs-starter/node_modules/ssvm/lib/binding/linux-x64/ssvm.node) at Object.Module._extensions..node (internal/modules/cjs/loader.js:807:18) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (/root/workspace/ssvm-nodejs-starter/node_modules/ssvm/index.js:4:15) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) Waiting for the debugger to disconnect... Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version GLIBCXX_3.4.26' not found (required by /root/workspace/ssvm-nodejs-starter/node_modules/ssvm/lib/binding/linux-x64/ssvm.node)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:807:18)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/root/workspace/ssvm-nodejs-starter/node_modules/ssvm/index.js:4:15)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)

Problem while ssvmup build

I got this:

report-8b07f8e5-1661-4aea-ad5f-7a74411660f1.toml.txt

dylan@mars-abc
:~/hello$ ssvmup build
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
    Finished release [optimized] target(s) in 0.06s
:-) [WARN]: origin crate has no README
[INFO]: Installing wasm-bindgen...
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ErrorMessage { msg: "no ssvm mapping for bindgen 0.2.65" }', src/install/mod.rs:149:20
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Well, this is embarrassing.

ssvmup had a problem and crashed. To help us diagnose the problem you can send us a crash report.

We have generated a report file at "/tmp/report-8b07f8e5-1661-4aea-ad5f-7a74411660f1.toml". Submit an issue or email with the subject of "ssvmup Crash Report" and include the report as an attachment.

- Authors: wangshishuo

We take privacy seriously, and do not perform any automated error collection. In order to improve the software, we rely on people to submit reports.

Thank you kindly!

Docker: rustwasmc build fails on rustc v.1.5.0

Hi,
I'm following your tutorial using your provided Docker container.

When I use wasmedge/appdev_x86_64:0.8.2 Docker image the rustwasmc build command fails when trying to compile a bumpalo-3.9.1 package:

root@740af9646213:/app# rustwasmc build
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
   Compiling bumpalo v3.9.1
error[E0658]: arbitrary expressions in key-value attributes are unstable
 --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/bumpalo-3.9.1/src/lib.rs:1:10
  |
1 | #![doc = include_str!("../README.md")]
  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #78835 <https://github.com/rust-lang/rust/issues/78835> for more information

error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
error: could not compile `bumpalo`

To learn more, run the command again with --verbose.
Error: Compiling your crate to WebAssembly failed
Caused by: failed to execute `cargo build`: exited with exit status: 101
  full command: "cargo" "build" "--all-targets" "--release" "--target" "wasm32-wasi"

I suspect the build fails because of outdated rustc version used by wasmedge. It's 1.5.0 version in that Docker image.

When I try a more recent Docker image (wasmedge/appdev_x86_64:0.9.0) and run the same command I get the following:

root@c2ace0eecbc4:/app# rustwasmc build
Error: At this time, we can only support Rust compiler version 1.50 and below in order to support WASI features in WasmEdge. Please use this command to set Rust version:
$ rustup override set 1.50.0
If you do not need WASI features, you can use the —no-wasi flag to override this behavior. See more here: https://github.com/WasmEdge/WasmEdge/issues/264
root@c2ace0eecbc4:/app# rustc --version
rustc 1.57.0 (f1edd0429 2021-11-29)

So what is the right version to use? And what can I do to build your example code?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.