kyoheiu / felix

tui file manager with vim-like key mapping
https://kyoheiu.dev/felix/
MIT License
729 stars 26 forks source link

Windows Issues #75

Closed zQueal closed 1 year ago

zQueal commented 2 years ago

I don't have an environment conducive to building rust applications. It's possible the file encoding errors that happen under windows has something to do with this thread. I would like to test it, but I don't have a windows build.

Anyone willing to build one for me so I can test to see that this works?

shirok1 commented 2 years ago

I failed to build this crate on Windows because termion don't support Windows. There is a fork by Jezza, but the merge request has been ignored since 3 years ago, and it doesn't support termion::terminal_size_pixels. The only reference to it lies in State::get_sixel_image_preview_size, which I guess is for displaying image in terminal using libsixel? However, common terminals on Windows don't support libsixel, so I think corresponding code can be temporarily disabled with #[cfg(not(target_os = "windows"))].

kyoheiu commented 2 years ago

@zQueal Sorry for not touching this issue, I don't have a Windows environment. @shirok1 Thank you for the suggestion. That makes sense, I'll give it a try.

zQueal commented 2 years ago

It's my own fault. I really don't know how to cross compile rust applications.

kyoheiu commented 2 years ago

FYI, thanks to the migration from termion to crossterm, the crossterm branch can now be compiled on Windows. There may be some bugs though.

zQueal commented 2 years ago

Buidling for windows on a linux machine;

git clone https://github.com/kyoheiu/felix.git
cargo build --target x86_64-pc-windows-gnu
[...]
Some errors have detailed explanations: E0405, E0412, E0433, E0463.
For more information about an error, try `rustc --explain E0405`.
error: could not compile `itoa` due to 43 previous errors
warning: build failed, waiting for other jobs to finish...

Tried to build for linux using the same repository;

cargo build
[...]
Compiling felix v1.2.0 (/tmp/felix)
    Finished dev [unoptimized + debuginfo] target(s) in 1m 09s

Seems to still work fine on *nix. 🤷‍♂️

kyoheiu commented 2 years ago

Sorry for the ambiguity, please try develop branch (Not merged to main yet)

https://github.com/japaric/rust-cross#i-want-to-build-binaries-for-linux-mac-and-windows-how-do-i-cross-compile-from-linux-to-mac

Seems you have to set up linker and more for cross-compiling Rust. FYI, I added the following lines to cargo.toml and installed some packages (https://archlinux.org/groups/x86_64/mingw-w64/)

[target.x86_64-pc-windows-gnu]
linker = "x86_64-w64-mingw32-gcc"
ar = "x86_64-w64-mingw32-gcc-ar"

but cargo build --target x86_64-pc-windows-gnu failed. Anyway, now that felix does not use termion on develop branch, and there is a report that it was compiled on native Windows, if you can, try a build on native. Cross-compiling is hard.

kyoheiu commented 1 year ago

Seems at least Windows build has no issue, so will close this.