From cee481407432539d100065ca2d1b434922393a14 Mon Sep 17 00:00:00 2001 From: Jeong Yunwon Date: Sat, 28 May 2022 14:16:29 +0900 Subject: [PATCH] add stdlib to rustpython_wasm and remove threading from vm default --- Cargo.lock | 1 + Cargo.toml | 2 +- stdlib/Cargo.toml | 2 +- vm/Cargo.toml | 2 +- wasm/lib/Cargo.toml | 5 +++-- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eb986773c..2c7ec8382 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1847,6 +1847,7 @@ dependencies = [ "parking_lot", "rustpython-common", "rustpython-parser", + "rustpython-stdlib", "rustpython-vm", "serde", "serde-wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index db7ac4960..8b5dd6e84 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ stdlib = ["rustpython-stdlib"] flame-it = ["rustpython-vm/flame-it", "flame", "flamescope"] freeze-stdlib = ["rustpython-vm/freeze-stdlib"] jit = ["rustpython-vm/jit"] -threading = ["rustpython-vm/threading"] +threading = ["rustpython-vm/threading", "rustpython-stdlib/threading"] pylib = ["rustpython-vm/pylib"] zlib = ["stdlib", "rustpython-stdlib/zlib"] ssl = ["rustpython-stdlib/ssl"] diff --git a/stdlib/Cargo.toml b/stdlib/Cargo.toml index 910c474e8..5e9127866 100644 --- a/stdlib/Cargo.toml +++ b/stdlib/Cargo.toml @@ -71,7 +71,7 @@ termios = "0.3.3" default = ["compile-parse", "pylib"] pylib = ["rustpython-vm/pylib"] compile-parse = ["rustpython-vm/compile-parse", "rustpython-parser"] -threading = ["rustpython-vm/threading"] +threading = ["rustpython-common/threading", "rustpython-vm/threading"] parser = ["rustpython-vm/parser"] ast = ["rustpython-vm/ast"] compiler = ["rustpython-vm/compiler"] diff --git a/vm/Cargo.toml b/vm/Cargo.toml index 4c5c61990..1f22fe1a1 100644 --- a/vm/Cargo.toml +++ b/vm/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" include = ["src/**/*.rs", "Cargo.toml", "build.rs", "Lib/**/*.py"] [features] -default = ["compile-parse", "threading", "pylib"] +default = ["compile-parse", "pylib"] vm-tracing-logging = [] flame-it = ["flame", "flamer"] pylib = ["rustpython-pylib"] diff --git a/wasm/lib/Cargo.toml b/wasm/lib/Cargo.toml index 2b2df24f2..6bd7a9672 100644 --- a/wasm/lib/Cargo.toml +++ b/wasm/lib/Cargo.toml @@ -11,15 +11,16 @@ edition = "2021" crate-type = ["cdylib", "rlib"] [features] -default = ["freeze-stdlib"] +default = ["freeze-stdlib", "rustpython-stdlib"] freeze-stdlib = ["rustpython-vm/freeze-stdlib"] no-start-func = [] [dependencies] rustpython-parser = { path = "../../parser" } rustpython-common = { path = "../../common" } -# no threading feature for rustpython-vm -- doesn't much matter anyway, but it might be more optimized +# make sure no threading! otherwise wasm build will fail rustpython-vm = { path = "../../vm", default-features = false, features = ["compile-parse"] } +rustpython-stdlib = { path = "../../stdlib", default-features = false, features = ["compile-parse"], optional = true } wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" serde-wasm-bindgen = "0.3.1"