Skip to content

Commit 72eb542

Browse files
committed
WIP
1 parent 041dd30 commit 72eb542

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ ascii = "1.1"
164164
bitflags = "2.9.4"
165165
bstr = "1"
166166
cfg-if = "1.0"
167-
chrono = "0.4.42"
167+
chrono = { version = "0.4.42", default-features = false }
168168
constant_time_eq = "0.4"
169169
criterion = { version = "0.7", features = ["html_reports"] }
170170
crossbeam-utils = "0.8.21"

vm/Cargo.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ bitflags = { workspace = true }
4646
bstr = { workspace = true }
4747
cfg-if = { workspace = true }
4848
crossbeam-utils = { workspace = true }
49-
chrono = { workspace = true, features = ["wasmbind"] }
5049
constant_time_eq = { workspace = true }
5150
flame = { workspace = true, optional = true }
5251
getrandom = { workspace = true }
@@ -97,6 +96,7 @@ exitcode = "1.1.2"
9796
uname = "0.1.1"
9897

9998
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
99+
chrono = { workspace = true }
100100
rustyline = { workspace = true }
101101
which = "8"
102102
errno = "0.3"
@@ -148,8 +148,12 @@ features = [
148148
"Win32_UI_WindowsAndMessaging",
149149
]
150150

151-
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
151+
[target.'cfg(all(target_arch = "wasm32", target_os = "wasi"))'.dependencies]
152+
chrono = { workspace = true, features = ["wasmbind"] }
152153
wasm-bindgen = { workspace = true, optional = true }
154+
155+
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
156+
chrono = { workspace = true, features = ["clock"] }
153157
getrandom = { workspace = true }
154158

155159
[build-dependencies]

wasm/wasm-unknown-test/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use rustpython_vm::{Interpreter, eval};
22

3-
pub unsafe extern "C" fn eval(s: *const u8, l: usize) -> u32 {
3+
#[unsafe(no_mangle)]
4+
pub unsafe extern "Rust" fn eval(s: *const u8, l: usize) -> u32 {
45
let src = std::slice::from_raw_parts(s, l);
56
let src = std::str::from_utf8(src).unwrap();
67
Interpreter::without_stdlib(Default::default()).enter(|vm| {

0 commit comments

Comments
 (0)