Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions wasm/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ ruff_python_parser = { workspace = true }
serde = { workspace = true }
wasm-bindgen = { workspace = true }

# remove once getrandom 0.2 is no longer otherwise in the dependency tree
getrandom = { version = "0.2", features = ["js"] }

console_error_panic_hook = "0.1"
js-sys = "0.3"
serde-wasm-bindgen = "0.3.1"
Expand Down
3 changes: 1 addition & 2 deletions wasm/wasm-unknown-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
getrandom = { version = "0.2.12", features = ["custom"] }
getrandom_03 = { package = "getrandom", version = "0.3" }
getrandom = "0.3"
rustpython-vm = { path = "../../vm", default-features = false, features = ["compiler"] }

[workspace]
12 changes: 3 additions & 9 deletions wasm/wasm-unknown-test/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use rustpython_vm::{eval, Interpreter};
use rustpython_vm::{Interpreter, eval};

pub unsafe extern "C" fn eval(s: *const u8, l: usize) -> u32 {
let src = std::slice::from_raw_parts(s, l);
Expand All @@ -9,16 +9,10 @@ pub unsafe extern "C" fn eval(s: *const u8, l: usize) -> u32 {
})
}

fn getrandom_always_fail(_buf: &mut [u8]) -> Result<(), getrandom::Error> {
Err(getrandom::Error::UNSUPPORTED)
}

getrandom::register_custom_getrandom!(getrandom_always_fail);

#[unsafe(no_mangle)]
unsafe extern "Rust" fn __getrandom_v03_custom(
_dest: *mut u8,
_len: usize,
) -> Result<(), getrandom_03::Error> {
Err(getrandom_03::Error::UNSUPPORTED)
) -> Result<(), getrandom::Error> {
Err(getrandom::Error::UNSUPPORTED)
}
Loading