rust-subprocess icon indicating copy to clipboard operation
rust-subprocess copied to clipboard

Build errors when using the crate v0.2.9

Open phodina opened this issue 9 months ago • 1 comments

Hi @hniksic , I'm attempting to build depthai-viewer but it has a dependency on subprocess crate and during the compilation I get the following errors:

https://github.com/luxonis/depthai-viewer/blob/main/crates/re_viewer/Cargo.toml#L74

   Compiling subprocess v0.2.9
error[E0432]: unresolved import `self::os`
  --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/builder.rs:14:15
   |
14 | pub use self::os::*;
   |               ^^ could not find `os` in `self`

error[E0432]: unresolved import `raw`
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/communicate.rs:417:5
    |
417 | use raw::RawCommunicator;
    |     ^^^ use of undeclared crate or module `raw`

error[E0432]: unresolved import `self::os`
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:17:15
    |
17  | pub use self::os::ext as os_ext;
    |               ^^ could not find `os` in `self`
    |
note: found an item that was configured out
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:687:5
    |
687 | mod os {
    |     ^^
note: the item is gated here
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:686:1
    |
686 | #[cfg(unix)]
    | ^^^^^^^^^^^^
note: found an item that was configured out
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:974:5
    |
974 | mod os {
    |     ^^
note: the item is gated here
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:973:1
    |
973 | #[cfg(windows)]
    | ^^^^^^^^^^^^^^^

error[E0432]: unresolved import `self::os`
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:18:15
    |
18  | pub use self::os::make_pipe;
    |               ^^ could not find `os` in `self`
    |
note: found an item that was configured out
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:687:5
    |
687 | mod os {
    |     ^^
note: the item is gated here
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:686:1
    |
686 | #[cfg(unix)]
    | ^^^^^^^^^^^^
note: found an item that was configured out
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:974:5
    |
974 | mod os {
    |     ^^
note: the item is gated here
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:973:1
    |
973 | #[cfg(windows)]
    | ^^^^^^^^^^^^^^^

error[E0432]: unresolved import `super::os`
  --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/builder.rs:35:16
   |
35 |     use super::os::*;
   |                ^^ could not find `os` in `super`

error[E0599]: no method named `os_start` found for struct `Popen` in the current scope
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:348:14
    |
51  | pub struct Popen {
    | ---------------- method `os_start` not found for this struct
...
348 |         inst.os_start(argv, config)?;
    |              ^^^^^^^^ method not found in `Popen`
    |
    = help: items from traits can only be used if the trait is implemented and in scope
note: `PopenOs` defines an item `os_start`, perhaps you need to implement it
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:678:1
    |
678 | trait PopenOs {
    | ^^^^^^^^^^^^^

error[E0599]: no method named `os_wait` found for mutable reference `&mut Popen` in the current scope
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:638:14
    |
638 |         self.os_wait()
    |              ^^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
note: `PopenOs` defines an item `os_wait`, perhaps you need to implement it
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:678:1
    |
678 | trait PopenOs {
    | ^^^^^^^^^^^^^
help: there is a method `wait` with a similar name
    |
638 |         self.wait()
    |              ~~~~

error[E0599]: no method named `os_wait_timeout` found for mutable reference `&mut Popen` in the current scope
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:651:14
    |
651 |         self.os_wait_timeout(dur)
    |              ^^^^^^^^^^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
note: `PopenOs` defines an item `os_wait_timeout`, perhaps you need to implement it
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:678:1
    |
678 | trait PopenOs {
    | ^^^^^^^^^^^^^
help: there is a method `wait_timeout` with a similar name
    |
651 |         self.wait_timeout(dur)
    |              ~~~~~~~~~~~~

error[E0599]: no method named `os_terminate` found for mutable reference `&mut Popen` in the current scope
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:661:14
    |
661 |         self.os_terminate()
    |              ^^^^^^^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
note: `PopenOs` defines an item `os_terminate`, perhaps you need to implement it
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:678:1
    |
678 | trait PopenOs {
    | ^^^^^^^^^^^^^
help: there is a method `terminate` with a similar name
    |
661 |         self.terminate()
    |              ~~~~~~~~~

error[E0599]: no method named `os_kill` found for mutable reference `&mut Popen` in the current scope
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:674:14
    |
674 |         self.os_kill()
    |              ^^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
note: `PopenOs` defines an item `os_kill`, perhaps you need to implement it
   --> /home/pethod/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subprocess-0.2.9/src/popen.rs:678:1
    |
678 | trait PopenOs {
    | ^^^^^^^^^^^^^
help: there is a method `kill` with a similar name
    |
674 |         self.kill()
    |              ~~~~

Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `subprocess` (lib) due to 10 previous errors
warning: build failed, waiting for other jobs to finish...
thread 'main' panicked at crates/re_build_web_viewer/src/lib.rs:95:5:
Failed to build Wasm
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped)

Using cargo 1.84.0 on Nixos 25.05.

Linux vision 6.13.4 #1-NixOS SMP PREEMPT_DYNAMIC Fri Feb 21 13:11:21 UTC 2025 x86_64 GNU/Linux

phodina avatar Mar 13 '25 09:03 phodina

If I fetch and build the crate itself there are no errors.

phodina avatar Mar 13 '25 09:03 phodina