Skip to content

Commit 597ad01

Browse files
committed
Fix pylib dependency for binary
1 parent f51b130 commit 597ad01

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

pylib/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
// so build.rs sets this env var
77
pub const LIB_PATH: &str = match option_env!("win_lib_path") {
88
Some(s) => s,
9-
None => concat!(env!("CARGO_MANIFEST_DIR"), "/../Lib"),
9+
None => concat!(env!("CARGO_MANIFEST_DIR"), "/Lib"),
1010
};
1111

1212
#[cfg(feature = "freeze-stdlib")]
1313
pub fn frozen_stdlib() -> impl Iterator<Item = (String, rustpython_compiler_core::FrozenModule)> {
14-
rustpython_derive::py_freeze!(dir = "../Lib", crate_name = "rustpython_compiler_core")
14+
rustpython_derive::py_freeze!(dir = "./Lib", crate_name = "rustpython_compiler_core")
1515
}

src/lib.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ extern crate env_logger;
4343
#[macro_use]
4444
extern crate log;
4545

46+
use rustpython_pylib;
47+
4648
mod shell;
4749

4850
use clap::{App, AppSettings, Arg, ArgMatches};
@@ -257,25 +259,24 @@ fn add_stdlib(vm: &mut VirtualMachine) {
257259
{
258260
use rustpython_vm::common::rc::PyRc;
259261
let state = PyRc::get_mut(&mut vm.state).unwrap();
262+
let settings = &mut state.settings;
260263

261264
#[allow(clippy::needless_collect)] // false positive
262-
let path_list: Vec<_> = state.settings.path_list.drain(..).collect();
265+
let path_list: Vec<_> = settings.path_list.drain(..).collect();
263266

264267
// BUILDTIME_RUSTPYTHONPATH should be set when distributing
265268
if let Some(paths) = option_env!("BUILDTIME_RUSTPYTHONPATH") {
266-
state
267-
.settings
269+
settings
268270
.path_list
269271
.extend(split_paths(paths).map(|path| path.into_os_string().into_string().unwrap()))
270272
} else {
271273
#[cfg(feature = "rustpython-pylib")]
272-
state
273-
.settings
274+
settings
274275
.path_list
275276
.push(rustpython_pylib::LIB_PATH.to_owned())
276277
}
277278

278-
state.settings.path_list.extend(path_list.into_iter());
279+
settings.path_list.extend(path_list.into_iter());
279280
}
280281
}
281282

wasm/lib/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ edition = "2021"
1111
crate-type = ["cdylib", "rlib"]
1212

1313
[features]
14-
default = ["stdlib"]
15-
stdlib = ["freeze-stdlib", "rustpython-pylib", "rustpython-stdlib"]
16-
freeze-stdlib = ["rustpython-vm/freeze-stdlib", "rustpython-pylib?/freeze-stdlib"]
14+
default = ["freeze-stdlib"]
15+
freeze-stdlib = ["rustpython-vm/freeze-stdlib", "rustpython-pylib/freeze-stdlib", "rustpython-stdlib"]
1716
no-start-func = []
1817

1918
[dependencies]

0 commit comments

Comments
 (0)