File tree Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 1
1
GIT=https://github.com/RustPython/RustPython
2
2
BRANCH=redox
3
3
CARGOFLAGS=--no-default-features
4
+ export BUILDTIME_RUSTPYTHONPATH=/lib/rustpython/
4
5
5
6
function recipe_stage() {
6
7
dest=" $( realpath " $1 " ) "
Original file line number Diff line number Diff line change @@ -69,16 +69,22 @@ fn main() {
69
69
let res = ( || {
70
70
import:: init_importlib ( & vm, true ) ?;
71
71
72
- if cfg ! ( target_os = "redox ") {
72
+ if let Some ( paths ) = option_env ! ( "BUILDTIME_RUSTPYTHONPATH ") {
73
73
let sys_path = vm. get_attribute ( vm. sys_module . clone ( ) , "path" ) ?;
74
- vm. call_method (
75
- & sys_path,
76
- "insert" ,
77
- vec ! [
78
- vm. ctx. new_int( 0 ) ,
79
- vm. ctx. new_str( "/lib/rustpython/" . to_string( ) ) ,
80
- ] ,
81
- ) ?;
74
+ for ( i, path) in std:: env:: split_paths ( paths) . enumerate ( ) {
75
+ vm. call_method (
76
+ & sys_path,
77
+ "insert" ,
78
+ vec ! [
79
+ vm. ctx. new_int( i) ,
80
+ vm. ctx. new_str(
81
+ path. into_os_string( )
82
+ . into_string( )
83
+ . expect( "Invalid UTF8 in BUILDTIME_RUSTPYTHONPATH" ) ,
84
+ ) ,
85
+ ] ,
86
+ ) ?;
87
+ }
82
88
}
83
89
84
90
// Figure out if a -c option was given:
You can’t perform that action at this time.
0 commit comments