RustPython: Can't build on windows

   Compiling rustpython-parser v0.1.1 (https://github.com/RustPython/RustPython#a04c19cc)
   Compiling rustpython-compiler v0.1.1 (https://github.com/RustPython/RustPython#a04c19cc)
   Compiling rustpython-derive v0.1.1 (https://github.com/RustPython/RustPython#a04c19cc)
error: Compile error: Got unexpected token '.' at line 1 column 1
##[error]  --> C:\Users\runneradmin\.cargo\git\checkouts\rustpython-f8ef4d934ac33cd8\a04c19c\vm\src\frozen.rs:21:18
   |
21 |     ext_modules!(dir = "Lib/python_builtins/");
   |     -------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^-- in this macro invocation

error: Compile error: Got unexpected token '.' at line 1 column 1
##[error]  --> C:\Users\runneradmin\.cargo\git\checkouts\rustpython-f8ef4d934ac33cd8\a04c19c\vm\src\frozen.rs:27:22
   |
27 |         ext_modules!(dir = "Lib/core_modules/");
   |         -------------^^^^^^^^^^^^^^^^^^^^^^^^^-- in this macro invocation

error: aborting due to 2 previous errors
##[error]aborting due to 2 previous errors
error: could not compile `rustpython-vm`.
##[error]could not compile `rustpython-vm`.
To learn more, run the command again with --verbose.
##[error]The process 'C:\Rust\.cargo\bin\cargo.exe' failed with exit code 101
##[error]Node run failed with exit code 1

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 22 (13 by maintainers)

Most upvoted comments

@coolreader18

Screen Shot 2020-11-11 at 10 49 54 AM

is it safe to close this issue?

Success! I ran:

cargo run --release demo.py

End of log:

Compiling num_enum v0.4.3 Compiling rustpython-parser v0.1.2 (C:\RustPython\parser) Compiling rustpython-compiler v0.1.2 (C:\RustPython\compiler) Compiling rustpython-derive v0.1.2 (C:\RustPython\derive) Compiling rustpython v0.1.2 (C:\RustPython) Finished release [optimized] target(s) in 4m 00s Running target\release\rustpython.exe demo.py Hello, RustPython! PS C:\RustPython>

Hi @bcbqwe,

Are you using rust stable or an old version of nightly? The error is saying that str_strip is an unstable feature. I think you need need update your rust version.

https://doc.rust-lang.org/edition-guide/rust-2018/rustup-for-managing-rust-versions.html

Hi @bcbqwe,

Running Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser and then powershell scripts\symlinks-to-hardlinks.ps1 worked for me. Where you run the ps script from seems to be important, the script must use relative paths. Move one directory higher to the root and then run powershell scripts\symlinks-to-hardlinks.ps1.

Yeah, I thought this might be confusing. You can run scripts/symlinks-to-hardlinks.ps1 to fix it.