felix icon indicating copy to clipboard operation
felix copied to clipboard

Windows Issues

Open zQueal opened this issue 2 years ago • 3 comments

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?

zQueal avatar May 28 '22 01:05 zQueal

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"))].

shirok1 avatar Jul 30 '22 07:07 shirok1

@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.

kyoheiu avatar Jul 31 '22 08:07 kyoheiu

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

zQueal avatar Jul 31 '22 23:07 zQueal

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

kyoheiu avatar Oct 15 '22 21:10 kyoheiu

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. 🤷‍♂️

zQueal avatar Oct 16 '22 07:10 zQueal

~~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 avatar Oct 16 '22 09:10 kyoheiu

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

kyoheiu avatar Nov 05 '22 07:11 kyoheiu