From 1a68f42e18c8caf0271ddb7db9a7a3663cdb85dc Mon Sep 17 00:00:00 2001 From: Lee Dogeon Date: Sat, 15 Nov 2025 22:47:28 +0900 Subject: [PATCH 1/3] Fix wasm32-unknown-unknown --- Cargo.toml | 2 +- crates/vm/Cargo.toml | 6 ++++-- wasm/wasm-unknown-test/src/lib.rs | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 54e4f1b642..5f8f7a5b55 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -162,7 +162,7 @@ ascii = "1.1" bitflags = "2.9.4" bstr = "1" cfg-if = "1.0" -chrono = "0.4.42" +chrono = { version = "0.4.42", default-features = false, features = ["clock", "oldtime", "std"] } constant_time_eq = "0.4" criterion = { version = "0.7", features = ["html_reports"] } crossbeam-utils = "0.8.21" diff --git a/crates/vm/Cargo.toml b/crates/vm/Cargo.toml index ffd5836178..d9c35de1f0 100644 --- a/crates/vm/Cargo.toml +++ b/crates/vm/Cargo.toml @@ -46,7 +46,7 @@ bitflags = { workspace = true } bstr = { workspace = true } cfg-if = { workspace = true } crossbeam-utils = { workspace = true } -chrono = { workspace = true, features = ["wasmbind"] } +chrono = { workspace = true } constant_time_eq = { workspace = true } flame = { workspace = true, optional = true } getrandom = { workspace = true } @@ -148,8 +148,10 @@ features = [ "Win32_UI_WindowsAndMessaging", ] -[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies] +[target.'cfg(target_arch = "wasm32")'.dependencies] wasm-bindgen = { workspace = true, optional = true } + +[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies] getrandom = { workspace = true } [build-dependencies] diff --git a/wasm/wasm-unknown-test/src/lib.rs b/wasm/wasm-unknown-test/src/lib.rs index a3beead890..aae922864d 100644 --- a/wasm/wasm-unknown-test/src/lib.rs +++ b/wasm/wasm-unknown-test/src/lib.rs @@ -1,5 +1,6 @@ use rustpython_vm::{Interpreter, eval}; +#[unsafe(no_mangle)] pub unsafe extern "C" fn eval(s: *const u8, l: usize) -> u32 { let src = std::slice::from_raw_parts(s, l); let src = std::str::from_utf8(src).unwrap(); From e75cc924c5e4a3228f6ba614e7be34a5f54d7c38 Mon Sep 17 00:00:00 2001 From: Lee Dogeon Date: Sun, 16 Nov 2025 22:00:32 +0900 Subject: [PATCH 2/3] Revert unnecessary changes --- crates/vm/Cargo.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/vm/Cargo.toml b/crates/vm/Cargo.toml index d9c35de1f0..adba8570ac 100644 --- a/crates/vm/Cargo.toml +++ b/crates/vm/Cargo.toml @@ -148,10 +148,8 @@ features = [ "Win32_UI_WindowsAndMessaging", ] -[target.'cfg(target_arch = "wasm32")'.dependencies] -wasm-bindgen = { workspace = true, optional = true } - [target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies] +wasm-bindgen = { workspace = true, optional = true } getrandom = { workspace = true } [build-dependencies] From 5d51df6286a4a4bb0d31fabadcd9af51a5a07be0 Mon Sep 17 00:00:00 2001 From: Lee Dogeon Date: Sun, 16 Nov 2025 22:02:36 +0900 Subject: [PATCH 3/3] Dedupe getrandom dependency --- crates/vm/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/vm/Cargo.toml b/crates/vm/Cargo.toml index adba8570ac..1e12454a6b 100644 --- a/crates/vm/Cargo.toml +++ b/crates/vm/Cargo.toml @@ -150,7 +150,6 @@ features = [ [target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies] wasm-bindgen = { workspace = true, optional = true } -getrandom = { workspace = true } [build-dependencies] glob = { workspace = true }