amp icon indicating copy to clipboard operation
amp copied to clipboard

[Windows] Build errors when running clean step

Open Silicasandwhich opened this issue 5 years ago • 10 comments

I get an error when the build process runs "rm" "-rf" ".termbox"

stderr: thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:1009:5

Silicasandwhich avatar Dec 01 '18 16:12 Silicasandwhich

btw this is on windows, sorry. I'll give any other information you need.

Silicasandwhich avatar Dec 01 '18 16:12 Silicasandwhich

That's an issue with the termbox-sys build process, although I find it curious that it hasn't been an issue elsewhere. Can you run the build process with RUST_BACKTRACE=1, so we can see exactly where the unwrap is occurring? That'll help diagnose what file is missing.

As an aside, the focus for v0.6.0 is to move away from termbox, which will remove this "build within a build" process, which has been quite problematic.

jmacdonald avatar Dec 02 '18 17:12 jmacdonald

I'll try when I can. Thank you.

Silicasandwhich avatar Dec 04 '18 18:12 Silicasandwhich

stack backtrace: 0: std::sys::windows::backtrace::set_frames at /rustc/1433507eba7d1a114e4c6f27ae0e1a74f60f20de\src/libstd\sys\windows\backtrace\mod.rs:104 1: std::sys::windows::backtrace::set_frames at /rustc/1433507eba7d1a114e4c6f27ae0e1a74f60f20de\src/libstd\sys\windows\backtrace\mod.rs:104 2: std::sys_common::backtrace::_print at /rustc/1433507eba7d1a114e4c6f27ae0e1a74f60f20de\src/libstd\sys_common\backtrace.rs:71 3: std::sys_common::backtrace::_print at /rustc/1433507eba7d1a114e4c6f27ae0e1a74f60f20de\src/libstd\sys_common\backtrace.rs:71 4: std::panicking::default_hook::{{closure}} at /rustc/1433507eba7d1a114e4c6f27ae0e1a74f60f20de\src/libstd\panicking.rs:211 5: std::panicking::default_hook at /rustc/1433507eba7d1a114e4c6f27ae0e1a74f60f20de\src/libstd\panicking.rs:227 6: std::panicking::rust_panic_with_hook at /rustc/1433507eba7d1a114e4c6f27ae0e1a74f60f20de\src/libstd\panicking.rs:477 7: std::panicking::continue_panic_fmt at /rustc/1433507eba7d1a114e4c6f27ae0e1a74f60f20de\src/libstd\panicking.rs:391 8: std::panicking::rust_begin_panic at /rustc/1433507eba7d1a114e4c6f27ae0e1a74f60f20de\src/libstd\panicking.rs:326 9: core::panicking::panic_fmt at /rustc/1433507eba7d1a114e4c6f27ae0e1a74f60f20de\src/libcore\panicking.rs:77 10: core::result::unwrap_failed 11: core::ptr::drop_in_place 12: core::ptr::drop_in_place 13: core::ptr::drop_in_place 14: main 15: std::rt::lang_start_internal::{{closure}} at /rustc/1433507eba7d1a114e4c6f27ae0e1a74f60f20de\src/libstd\rt.rs:59 16: std::rt::lang_start_internal::{{closure}} at /rustc/1433507eba7d1a114e4c6f27ae0e1a74f60f20de\src/libstd\rt.rs:59 17: panic_unwind::__rust_maybe_catch_panic at /rustc/1433507eba7d1a114e4c6f27ae0e1a74f60f20de\src/libpanic_unwind\lib.rs:103 18: std::panicking::try at /rustc/1433507eba7d1a114e4c6f27ae0e1a74f60f20de\src/libstd\panicking.rs:289 19: std::panicking::try at /rustc/1433507eba7d1a114e4c6f27ae0e1a74f60f20de\src/libstd\panicking.rs:289 20: std::panicking::try at /rustc/1433507eba7d1a114e4c6f27ae0e1a74f60f20de\src/libstd\panicking.rs:289 21: main 22: invoke_main at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:78 23: invoke_main at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:78 24: BaseThreadInitThunk 25: RtlUserThreadStart

Silicasandwhich avatar Dec 04 '18 21:12 Silicasandwhich

@Silicasandwhich That's because you have unsupported version of Python (probably 3.7). Here is workaround. I'm on Manjaro (Arch), here is my output of whereis python

python: /usr/bin/python2.7 /usr/bin/python2.7-config /usr/bin/python /usr/bin/python3.7 /usr/bin/python3.7m /usr/bin/python3.7-config /usr/bin/python3.7m-config /usr/lib/python2.7 /usr/lib/python3.6 /usr/lib/python3.7 /usr/include/python2.7 /usr/include/python /usr/include/python3.7m /usr/share/man/man1/python.1.gz

and i have /home/me/bin in my $PATH So to use python2.7 i did this:

ln -s /usr/bin/python2.7 /home/me/bin/python

That's all, now you can call cargo install amp and it works. Don't forget to delete symlink in /home/me/bin after installation or build.

qthree avatar Dec 18 '18 14:12 qthree

So you have to use python 2.7? Good to know. Thanks.

Silicasandwhich avatar Dec 18 '18 22:12 Silicasandwhich

@Silicasandwhich essentially any version of Python prior to 3.7. For most distros, that's Python 2.x as you don't have much control over point releases, and 3.7 has been out since June.

jmacdonald avatar Dec 19 '18 01:12 jmacdonald

Ok. This particular machine was running Windows, so...

Wait.

Oh, I know why it isn't working now! rm -rf termbox wouldn't work in cmd, so the build failed! Is that maybe what happened?

Silicasandwhich avatar Dec 19 '18 11:12 Silicasandwhich

@Silicasandwhich likely. The termbox-sys crate uses some POSIX-specific commands that will fail on Windows (assuming you're not running this in an Ubuntu WSL shell).

jmacdonald avatar Jan 06 '19 20:01 jmacdonald

Ok. I'll try running it on the wsl and see if it works. Otherwise it'd be fine as I use my laptop for programming primarily, and that's running Linux.

Silicasandwhich avatar Jan 06 '19 22:01 Silicasandwhich