termusic icon indicating copy to clipboard operation
termusic copied to clipboard

Unable to run `termusic.exe` on Windows

Open hydrobeam opened this issue 4 years ago • 8 comments

Hello! After going through the installation instructions and installing lots of packages, I was able to compile an exe for Windows. Although when trying to run it, the program panics. I'll attach the terminal output from when the program finishes compiling:

    Finished release [optimized] target(s) in 7m 24s
mkdir -p ~/.local/share/cargo/bin/
process_begin: CreateProcess(NULL, mkdir -p ~/.local/share/cargo/bin/, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [Makefile:32: post] Error 2

C:\Users\laith\Music\terminalplayer\termusic>cd target

C:\Users\laith\Music\terminalplayer\termusic\target>cd release

C:\Users\laith\Music\terminalplayer\termusic\target\release>termusic
thread 'main' panicked at 'Original console mode not set: TryFromIntError(())', C:\Users\laith\.cargo\registry\src\github.com-1ecc6299db9ec823\crossterm-0.20.0\src\event\sys\windows.rs:36:10
stack backtrace:
   0:           0xb85bef - std::backtrace_rs::backtrace::dbghelp::trace::ha1342f348cead49b
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src\..\..\backtrace\src\backtrace/dbghelp.rs:98:5
   1:           0xb85bef - std::backtrace_rs::backtrace::trace_unsynchronized::h431f895d4d021a9e
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src\..\..\backtrace\src\backtrace/mod.rs:66:5
   2:           0xb85bef - std::sys_common::backtrace::_print_fmt::h268587549249780b
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src\sys_common/backtrace.rs:67:5
   3:           0xb85bef - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf0b5d7043737f5c1
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src\sys_common/backtrace.rs:46:22
   4:           0xbdb4da - core::fmt::write::h262c3fb713ffc6d3
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\core\src\fmt/mod.rs:1163:17
   5:           0xb780a2 - std::io::Write::write_fmt::h3a73c72ba1aaaf37
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src\io/mod.rs:1696:15
   6:           0xb88f00 - std::sys_common::backtrace::_print::h0c4a0674492a7fe1
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src\sys_common/backtrace.rs:49:5
   7:           0xb88f00 - std::sys_common::backtrace::print::h4fd6a700cd528c38
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src\sys_common/backtrace.rs:36:9
   8:           0xb88f00 - std::panicking::default_hook::{{closure}}::h2c0cb277fc1fc478
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src/panicking.rs:210:50
   9:           0xb88a90 - std::panicking::default_hook::h43b1dff01235db8a
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src/panicking.rs:227:9
  10:           0xb89687 - std::panicking::rust_panic_with_hook::he603728c8a0f9941
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src/panicking.rs:624:17
  11:           0xb892b3 - std::panicking::begin_panic_handler::{{closure}}::h4eda58867cacc520
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src/panicking.rs:521:13
  12:           0xb865d7 - std::sys_common::backtrace::__rust_end_short_backtrace::h1e07124d6f9f5e69
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src\sys_common/backtrace.rs:139:18
  13:           0xb89219 - rust_begin_unwind
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src/panicking.rs:517:5
  14:           0xbd7fc0 - core::panicking::panic_fmt::h86526a8d509aa4f5
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\core\src/panicking.rs:100:14
  15:           0xbd8313 - core::result::unwrap_failed::hf0f66878199e7508
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\core\src/result.rs:1616:5
  16:           0x763593 - crossterm::event::sys::windows::disable_mouse_capture::hdd9c1d62907fe3ec
  17:           0x439fe3 - <termusic::ui::context::Context as core::ops::drop::Drop>::drop::ha8e96111a47a3b9d
  18:           0x46577e - core::ptr::drop_in_place<termusic::ui::context::Context>::h7646e7f97875a310
  19:           0x47aa3a - termusic::main::h8d3373a4ebe30e09
  20:           0x430a26 - std::sys_common::backtrace::__rust_begin_short_backtrace::h59382bbb3745bad2
  21:           0x4aca5c - std::rt::lang_start::{{closure}}::h102e30f6d15915ba
  22:           0xb856a7 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h08b52bd93a4f7206
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\library\core\src\ops/function.rs:259:13
  23:           0xb856a7 - std::panicking::try::do_call::h7323e80cc68cfbc2
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src/panicking.rs:403:40
  24:           0xb856a7 - std::panicking::try::heae7fdcd350d3730
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src/panicking.rs:367:19
  25:           0xb856a7 - std::panic::catch_unwind::h6733449c632e5a90
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src/panic.rs:133:14
  26:           0xb856a7 - std::rt::lang_start_internal::{{closure}}::hd5fb97a1ef9fd5f1
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src/rt.rs:128:48
  27:           0xb856a7 - std::panicking::try::do_call::h378ed81a4337e1b9
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src/panicking.rs:403:40
  28:           0xb856a7 - std::panicking::try::hfe02d0606e509701
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src/panicking.rs:367:19
  29:           0xb856a7 - std::panic::catch_unwind::h27f08792bbecab6c
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src/panic.rs:133:14
  30:           0xb856a7 - std::rt::lang_start_internal::h55e005787b69f69a
                               at /rustc/c1026539bd22e9d070988deaa47b1360cbc76436\/library\std\src/rt.rs:128:20
  31:           0x47ab08 - main
  32:           0x4013c7 - __tmainCRTStartup
  33:           0x4014fb - mainCRTStartup
  34:     0x7ffc26db6ab0 - <unknown>
  35:     0x7ffc27a51dbb - <unknown>
thread panicked while panicking. aborting.

I'm on Windows 11 and using the default cmd terminal. If you need any more information, please let me know!

hydrobeam avatar Oct 16 '21 15:10 hydrobeam

Thanks for the feedback. I don't have windows 11 installed(or windows 10), but I think I could install it in a virtual machine and test it.

tramhao avatar Oct 18 '21 02:10 tramhao

I just tried to compile it under windows 10(vm), and cannot install glib2.0. Are you using windows subsystem for linux? Thanks.

tramhao avatar Oct 19 '21 06:10 tramhao

Sorry for the late response, I missed this notification in my inbox!

Are you using windows subsystem for linux

Nope, I used msys2 (https://www.msys2.org/) to install the dependencies (glib, gstreamer, etc...) and had to switch to the gnu toolchain for rust to make it work.

hydrobeam avatar Oct 24 '21 19:10 hydrobeam

If I'm right I had the same issue with termscp at the beginning. I had to make UNIX-only the two leave_alternate_screen and enter_alternate_screen as I did in my Context: https://github.com/veeso/termscp/blob/main/src/ui/context.rs.

Luckily all these things are going to be automatized starting from tui-realm 1.0.0 😅

veeso avatar Nov 02 '21 08:11 veeso

Thanks vesso:) I've update it in 4fcce039550b112edbc53655038694d5eb186aa2, as my toolchain still have problems in windows, I cannot test if it's working.

tramhao avatar Nov 03 '21 02:11 tramhao

Now it works! Thanks! Just thought that I should say that I was using the nightly gnu toolchain since you mentioned you were having trouble with the windows install. IIRC there was a default override for the msvc toolchain which I had to overturn.

Just curious, is there a key that can be pressed to pause/unpause the active song? Also, I noticed that the songs I download with s key download as webms and an error message always pops up (even when the download succeeded). I'm not sure if these are Windows-specific issues or not 🤔

hydrobeam avatar Nov 04 '21 00:11 hydrobeam

space can pause the song. About the download, you'll need ffmpeg installed. Perhaps there are some issues with windows and I need to finish my toolchain to build it on windows for further debug.

tramhao avatar Nov 05 '21 01:11 tramhao

Now by default termusic doesn't need gstreamer. Is there someone building successfully under windows? Thanks.

tramhao avatar Jul 26 '22 06:07 tramhao