Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion for Compiling on Windows: could not find sys in nix #27

Open
2ndmax opened this issue Feb 7, 2024 · 0 comments
Open

Suggestion for Compiling on Windows: could not find sys in nix #27

2ndmax opened this issue Feb 7, 2024 · 0 comments

Comments

@2ndmax
Copy link

2ndmax commented Feb 7, 2024

Hello :-)

I tried compiling showcase-dl on Windows. Yes, I read that it might fail to compile - which it did. I received the error "could not find sys in nix".

After a bit of tinkering (not high level, since this is my first time using Rust), I managed to resolve this issue by adding "#[cfg(unix)]" in several places. I thought I might share this with you - if it does not break the code in Linux or other systems, this fix might be included to enable Windows compiling per se.

I included this small piece of code before three lines of

showcase-dl\src\state\video.rs

Lines 7 and 8 (new):

#[cfg(unix)]
use nix::sys::signal::{self, Signal};

#[cfg(unix)]
use nix::unistd::Pid;

Line 398 (new)

#[cfg(unix)]
signal::kill(Pid::from_raw(raw_pid), Signal::SIGINT)?;

Lastly, thanks for sharing your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant