From cc8735a6e21e1021c7213551b7808ecb53317d04 Mon Sep 17 00:00:00 2001 From: Jeong Yunwon Date: Mon, 18 Apr 2022 21:31:46 +0900 Subject: [PATCH] Fixi wasm32 build for workspace --- .github/workflows/ci.yaml | 2 +- Cargo.toml | 2 +- src/shell/helper.rs | 12 +++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6116f1da7..56cd0ba70 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -115,7 +115,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: check - args: --target wasm32-unknown-unknown --manifest-path vm/Cargo.toml + args: --target wasm32-unknown-unknown --no-default-features - uses: actions-rs/toolchain@v1 with: diff --git a/Cargo.toml b/Cargo.toml index 9bec9d950..db7ac4960 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ libc = "0.2.123" flame = { version = "0.2.2", optional = true } flamescope = { version = "0.1.2", optional = true } -[target.'cfg(not(target_os = "wasi"))'.dependencies] +[target.'cfg(not(target_arch = "wasm32"))'.dependencies] rustyline = "9.1.2" [dev-dependencies] diff --git a/src/shell/helper.rs b/src/shell/helper.rs index 33b584a0d..4cb18e0bd 100644 --- a/src/shell/helper.rs +++ b/src/shell/helper.rs @@ -1,7 +1,9 @@ -#![cfg_attr(target_os = "wasi", allow(dead_code))] -use rustpython_vm::builtins::{PyDictRef, PyStrRef}; -use rustpython_vm::VirtualMachine; -use rustpython_vm::{function::ArgIterable, PyResult, TryFromObject}; +#![cfg_attr(target_arch = "wasm32", allow(dead_code))] +use rustpython_vm::{ + builtins::{PyDictRef, PyStrRef}, + function::ArgIterable, + PyResult, TryFromObject, VirtualMachine, +}; pub struct ShellHelper<'vm> { vm: &'vm VirtualMachine, @@ -140,7 +142,7 @@ impl<'vm> ShellHelper<'vm> { } cfg_if::cfg_if! { - if #[cfg(not(target_os = "wasi"))] { + if #[cfg(not(target_arch = "wasm32"))] { use rustyline::{ completion::Completer, highlight::Highlighter, hint::Hinter, validate::Validator, Context, Helper,