Skip to content

Commit 49f53bf

Browse files
committed
Disable zlib on wasm32
1 parent 2752cc4 commit 49f53bf

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

vm/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ libc = "0.2"
6464
nix = "0.14.1"
6565
wtf8 = "0.0.3"
6666
arr_macro = "0.1.2"
67-
crc32fast = "1.2.0"
68-
adler32 = "1.0.3"
69-
flate2 = { version = "1.0", features = ["zlib"], default-features = false }
70-
libz-sys = "1.0.25"
7167

7268
flame = { version = "0.2", optional = true }
7369
flamer = { version = "0.3", optional = true }
@@ -76,5 +72,9 @@ flamer = { version = "0.3", optional = true }
7672
pwd = "1"
7773

7874
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
75+
crc32fast = "1.2.0"
76+
adler32 = "1.0.3"
77+
flate2 = { version = "1.0", features = ["zlib"], default-features = false }
78+
libz-sys = "1.0.25"
7979
gethostname = "0.2.0"
8080
subprocess = "0.1.18"

vm/src/stdlib/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ mod tokenize;
2929
mod unicodedata;
3030
mod warnings;
3131
mod weakref;
32-
mod zlib;
3332
use std::collections::HashMap;
3433

3534
use crate::vm::VirtualMachine;
@@ -44,6 +43,8 @@ mod pwd;
4443
pub mod signal;
4544
#[cfg(not(target_arch = "wasm32"))]
4645
mod subprocess;
46+
#[cfg(not(target_arch = "wasm32"))]
47+
mod zlib;
4748

4849
use crate::pyobject::PyObjectRef;
4950

@@ -73,7 +74,6 @@ pub fn get_module_inits() -> HashMap<String, StdlibInitFunc> {
7374
"_imp".to_string() => Box::new(imp::make_module),
7475
"unicodedata".to_string() => Box::new(unicodedata::make_module),
7576
"_warnings".to_string() => Box::new(warnings::make_module),
76-
"zlib".to_string() => Box::new(zlib::make_module),
7777
};
7878

7979
// Insert parser related modules:
@@ -101,6 +101,7 @@ pub fn get_module_inits() -> HashMap<String, StdlibInitFunc> {
101101
modules.insert("socket".to_string(), Box::new(socket::make_module));
102102
modules.insert("signal".to_string(), Box::new(signal::make_module));
103103
modules.insert("subprocess".to_string(), Box::new(subprocess::make_module));
104+
modules.insert("zlib".to_string(), Box::new(zlib::make_module));
104105
}
105106

106107
// Unix-only

0 commit comments

Comments
 (0)