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

Cargo clippy is broken on Windows due to rexpect dependency #9387

Open
touilleMan opened this issue Jan 20, 2025 · 0 comments
Open

Cargo clippy is broken on Windows due to rexpect dependency #9387

touilleMan opened this issue Jan 20, 2025 · 0 comments
Labels
A-Client Area: Parsec desktop application A-Windows Area: Window issue C-Bug Issue related to a bug I-CLI Impact: Command-line interface I-Rust Impact: Rust-related stuff

Comments

@touilleMan
Copy link
Member

rexpect doesn't seem to support Windows, however we include it unconditionally in the cli:

rexpect = { workspace = true }

This is pretty annoying since it breaks pre-commit :/

$ cargo clippy --workspace --tests --bins --lib --exclude=libparsec_bindings_android --exclude=libparsec_bindings_web --exclude=libparsec_bindings_electron -- --deny=warnings --deny=clippy::undocumented_unsafe_blocks --deny=clippy::unwrap_used
   Compiling libparsec_serialization_format v3.2.4-a.0+dev (C:\Users\gbleu\source\repos\parsec-cloud\parsec-cloud\libparsec\crates\serialization_format)
   Compiling libparsec_types v3.2.4-a.0+dev (C:\Users\gbleu\source\repos\parsec-cloud\parsec-cloud\libparsec\crates\types)
    Checking libparsec_platform_async v3.2.4-a.0+dev (C:\Users\gbleu\source\repos\parsec-cloud\parsec-cloud\libparsec\crates\platform_async)
    Checking libparsec_zstd v3.2.4-a.0+dev (C:\Users\gbleu\source\repos\parsec-cloud\parsec-cloud\libparsec\crates\zstd)
    Checking libparsec_crypto v3.2.4-a.0+dev (C:\Users\gbleu\source\repos\parsec-cloud\parsec-cloud\libparsec\crates\crypto)
   Compiling libparsec_protocol v3.2.4-a.0+dev (C:\Users\gbleu\source\repos\parsec-cloud\parsec-cloud\libparsec\crates\protocol)
   Compiling libparsec_tests_macros v3.2.4-a.0+dev (C:\Users\gbleu\source\repos\parsec-cloud\parsec-cloud\libparsec\crates\tests_macros)
   Compiling libparsec_platform_mountpoint v3.2.4-a.0+dev (C:\Users\gbleu\source\repos\parsec-cloud\parsec-cloud\libparsec\crates\platform_mountpoint)
   Compiling pyo3-build-config v0.21.2
   Compiling parsec-cli v3.2.4-a.0+dev (C:\Users\gbleu\source\repos\parsec-cloud\parsec-cloud\cli)
   Compiling parsec v3.2.4-a.0+dev (C:\Users\gbleu\source\repos\parsec-cloud\parsec-cloud\server)
    Checking rexpect v0.6.0
error[E0432]: unresolved import `nix::fcntl`
 --> C:\Users\gbleu\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rexpect-0.6.0\src\process.rs:5:10
  |
5 | use nix::fcntl::{open, OFlag};
  |          ^^^^^ could not find `fcntl` in `nix`

error[E0432]: unresolved import `nix::libc`
 --> C:\Users\gbleu\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rexpect-0.6.0\src\process.rs:6:10
  |
6 | use nix::libc::{STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO};
  |          ^^^^ could not find `libc` in `nix`

error[E0432]: unresolved import `nix::pty`
 --> C:\Users\gbleu\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rexpect-0.6.0\src\process.rs:7:10
  |
7 | use nix::pty::{grantpt, posix_openpt, unlockpt, PtyMaster};
  |          ^^^ could not find `pty` in `nix`

error[E0432]: unresolved import `nix::sys`
 --> C:\Users\gbleu\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rexpect-0.6.0\src\process.rs:8:14
  |
8 | pub use nix::sys::{signal, wait};
  |              ^^^ could not find `sys` in `nix`

error[E0432]: unresolved import `nix::sys`
 --> C:\Users\gbleu\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rexpect-0.6.0\src\process.rs:9:10
  |
9 | use nix::sys::{stat, termios};
  |          ^^^ could not find `sys` in `nix`

error[E0433]: failed to resolve: could not find `unix` in `os`
  --> C:\Users\gbleu\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rexpect-0.6.0\src\process.rs:14:14
   |
14 | use std::os::unix::io::{AsRawFd, FromRawFd};
   |              ^^^^ could not find `unix` in `os`
   |
note: found an item that was configured out
  --> C:\Users\gbleu\.rustup\toolchains\1.81.0-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\std\src\os\mod.rs:27:9
   |
27 | pub mod unix {}
   |         ^^^^
note: the item is gated here
  --> C:\Users\gbleu\.rustup\toolchains\1.81.0-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\std\src\os\mod.rs:19:1
   |
19 | / #[cfg(all(
20 | |     doc,
21 | |     any(
22 | |         all(target_arch = "wasm32", not(target_os = "wasi")),
23 | |         all(target_vendor = "fortanix", target_env = "sgx")
24 | |     )
25 | | ))]
   | |___^
note: found an item that was configured out
  --> C:\Users\gbleu\.rustup\toolchains\1.81.0-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\std\src\os\mod.rs:65:9
   |
65 | pub mod unix;
   |         ^^^^
note: the item is gated here
  --> C:\Users\gbleu\.rustup\toolchains\1.81.0-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\std\src\os\mod.rs:64:1
   |
64 | #[cfg(all(not(target_os = "hermit"), any(unix, doc)))]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0433]: failed to resolve: could not find `unix` in `os`
  --> C:\Users\gbleu\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rexpect-0.6.0\src\process.rs:15:14
   |
15 | use std::os::unix::process::CommandExt;
   |              ^^^^ could not find `unix` in `os`
   |
note: found an item that was configured out
  --> C:\Users\gbleu\.rustup\toolchains\1.81.0-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\std\src\os\mod.rs:27:9
   |
27 | pub mod unix {}
   |         ^^^^
note: the item is gated here
  --> C:\Users\gbleu\.rustup\toolchains\1.81.0-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\std\src\os\mod.rs:19:1
   |
19 | / #[cfg(all(
20 | |     doc,
21 | |     any(
22 | |         all(target_arch = "wasm32", not(target_os = "wasi")),
23 | |         all(target_vendor = "fortanix", target_env = "sgx")
24 | |     )
25 | | ))]
   | |___^
note: found an item that was configured out
  --> C:\Users\gbleu\.rustup\toolchains\1.81.0-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\std\src\os\mod.rs:65:9
   |
65 | pub mod unix;
   |         ^^^^
note: the item is gated here
  --> C:\Users\gbleu\.rustup\toolchains\1.81.0-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\std\src\os\mod.rs:64:1
   |
64 | #[cfg(all(not(target_os = "hermit"), any(unix, doc)))]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0432]: unresolved import `nix::unistd`
  --> C:\Users\gbleu\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rexpect-0.6.0\src\process.rs:10:10
   |
10 | use nix::unistd::{close, dup, dup2, fork, setsid, ForkResult, Pid};
   |          ^^^^^^ could not find `unistd` in `nix`

error[E0433]: failed to resolve: could not find `errno` in `nix`
   --> C:\Users\gbleu\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rexpect-0.6.0\src\process.rs:211:26
    |
211 |                 Err(nix::errno::Errno::ESRCH) => {
    |                          ^^^^^ could not find `errno` in `nix`

error[E0412]: cannot find type `Error` in crate `nix`
  --> C:\Users\gbleu\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rexpect-0.6.0\src\error.rs:26:22
   |
26 |     Nix(#[from] nix::Error),
   |                      ^^^^^ not found in `nix`
   |
help: consider importing one of these items
   |
1  + use std::error::Error;
   |
1  + use std::fmt::Error;
   |
1  + use std::io::Error;
   |
1  + use core::error::Error;
   |
     and 2 other candidates
help: if you import `Error`, refer to it directly
   |
26 -     Nix(#[from] nix::Error),
26 +     Nix(#[from] Error),
   |

error[E0433]: failed to resolve: could not find `Error` in `nix`
   --> C:\Users\gbleu\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rexpect-0.6.0\src\process.rs:128:37
    |
128 |                 Err(Error::Nix(nix::Error::last()))
    |                                     ^^^^^ could not find `Error` in `nix`
    |
help: consider importing one of these items
    |
3   + use crate::error::Error;
    |
3   + use crate::process::io::Error;
    |
3   + use crate::process::std::error::Error;
    |
3   + use crate::process::std::fmt::Error;
    |
      and 6 other candidates
help: if you import `Error`, refer to it directly
    |
128 -                 Err(Error::Nix(nix::Error::last()))
128 +                 Err(Error::Nix(Error::last()))
    |

error[E0425]: cannot find function `ptsname_r` in this scope
  --> C:\Users\gbleu\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rexpect-0.6.0\src\process.rs:97:26
   |
97 |         let slave_name = ptsname_r(&master_fd)?;
   |                          ^^^^^^^^^ not found in this scope

error[E0599]: no method named `exec` found for struct `Command` in the current scope
   --> C:\Users\gbleu\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rexpect-0.6.0\src\process.rs:127:25
    |
127 |                 command.exec();
    |                         ^^^^ method not found in `Command`

error[E0599]: no function or associated item named `from_raw_fd` found for struct `File` in the current scope
   --> C:\Users\gbleu\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rexpect-0.6.0\src\process.rs:142:27
    |
142 |         unsafe { Ok(File::from_raw_fd(fd)) }
    |                           ^^^^^^^^^^^ function or associated item not found in `File`
    |
note: if you're trying to build a new `File` consider using one of the following associated functions:
      File::open
      File::create
      File::create_new
   --> C:\Users\gbleu\.rustup\toolchains\1.81.0-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\std\src\fs.rs:374:5
    |
374 |     pub fn open<P: AsRef<Path>>(path: P) -> io::Result<File> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
403 |     pub fn create<P: AsRef<Path>>(path: P) -> io::Result<File> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
437 |     pub fn create_new<P: AsRef<Path>>(path: P) -> io::Result<File> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: there is an associated function `from_raw_handle` with a similar name
    |
142 |         unsafe { Ok(File::from_raw_handle(fd)) }
    |                           ~~~~~~~~~~~~~~~

Some errors have detailed explanations: E0412, E0425, E0432, E0433, E0599.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `rexpect` (lib) due to 14 previous errors
warning: build failed, waiting for other jobs to finish...
@FirelightFlagboy FirelightFlagboy added C-Bug Issue related to a bug A-Windows Area: Window issue I-Rust Impact: Rust-related stuff A-Client Area: Parsec desktop application I-CLI Impact: Command-line interface labels Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Client Area: Parsec desktop application A-Windows Area: Window issue C-Bug Issue related to a bug I-CLI Impact: Command-line interface I-Rust Impact: Rust-related stuff
Projects
None yet
Development

No branches or pull requests

2 participants