You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
Attempting to install nsh v0.4.2 using cargo install nsh results in multiple compilation errors. The errors are related to unresolved imports and mismatched types, primarily due to missing features in the nix crate.
Steps to Reproduce:
Run cargo install nsh.
Observe the compilation errors.
Error Log:
error[E0432]: unresolved imports nix::unistd::{fork, setpgid, ForkResult, Pid}
error[E0432]: unresolved imports nix::sys::signal::{kill, sigaction, SaFlags, SigAction, SigHandler, SigSet, Signal}
error[E0433]: failed to resolve: could not find termios in sys
error[E0432]: unresolved import nix::sys::termios
error[E0432]: unresolved import nix::sys::wait
error[E0432]: unresolved imports nix::unistd::{dup2, execv, fork, getpid, setpgid, tcsetpgrp, ForkResult, Pid}
error[E0425]: cannot find function isatty in module nix::unistd
error[E0425]: cannot find function gethostname in module unistd
error[E0425]: cannot find function fsync in module unistd
error[E0308]: mismatched types (expected i32, found OwnedFd)
error[E0277]: the trait bound i32: AsFd is not satisfied
Possible Solution:
Enable the required features in the nix crate dependencies. For example:
[dependencies]
nix = { version = "0.29.0", features = ["process", "signal", "term", "fs", "hostname"] }
Thank!
1817 |13.535|02:49:20 βββ~βββ uname -a
Linux wyun 6.17.0-14-generic #14~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Jan 15 15:52:10 UTC 2 x86_64 x86_64 x86_64 GNU/Linux# /home/w495
1817 |2.513|02:49:23 βββ~βββ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04.4 LTS
Release: 24.04
Codename: noble
# /home/w495
1818 |9.218|02:49:32 βββ~βββ cargo install nsh
Updating crates.io index
Installing nsh v0.4.2
Updating crates.io index
Locking 107 packages to latest compatible versions
Adding crossterm v0.18.2 (available: v0.29.0)
Adding dirs v1.0.5 (available: v6.0.0)
Adding generic-array v0.14.7 (available: v0.14.9)
Adding signal-hook v0.2.3 (available: v0.4.3)
Compiling libc v0.2.182
Compiling proc-macro2 v1.0.106
Compiling unicode-ident v1.0.24
Compiling quote v1.0.45
Compiling version_check v0.9.5
Compiling syn v1.0.109
Compiling cfg-if v1.0.4
Compiling ucd-trie v0.1.7
Compiling parking_lot_core v0.8.6
Compiling memchr v2.8.0
Compiling object v0.37.3
Compiling log v0.4.29
Compiling siphasher v1.0.2
Compiling lazy_static v1.5.0
Compiling unicode-xid v0.2.6
Compiling failure_derive v0.1.8
Compiling gimli v0.32.3
Compiling unicode-width v0.1.14
Compiling adler2 v2.0.1
Compiling smallvec v1.15.1
Compiling cfg_aliases v0.2.1
Compiling instant v0.1.13
Compiling fastrand v2.3.0
Compiling unicode-segmentation v1.12.0
Compiling scopeguard v1.2.0
Compiling bitflags v1.3.2
Compiling nix v0.31.2
Compiling lock_api v0.4.14
Compiling miniz_oxide v0.8.9
Compiling ansi_term v0.12.1
Compiling phf_shared v0.13.1
Compiling vec_map v0.8.2
Compiling textwrap v0.11.0
Compiling rustc-demangle v0.1.27
Compiling strsim v0.8.0
Compiling colored v2.2.0
Compiling bitflags v2.11.0
Compiling glob v0.3.3
Compiling proc-macro-error-attr v1.0.4
Compiling proc-macro-error v1.0.4
Compiling fern v0.7.1
Compiling heck v0.3.3
Compiling phf_generator v0.13.1
Compiling pest v2.8.6
Compiling syn v2.0.117
Compiling errno v0.3.14
Compiling atty v0.2.14
Compiling mio v0.7.14
Compiling dirs v1.0.5
Compiling clap v2.34.0
Compiling signal-hook-registry v1.4.8
Compiling parking_lot v0.11.2
Compiling signal-hook v0.1.17
Compiling signal-hook v0.2.3
Compiling crossterm v0.18.2
Compiling pest_meta v2.8.6
Compiling addr2line v0.25.1
Compiling synstructure v0.12.6
Compiling pest_generator v2.8.6
Compiling phf_macros v0.13.1
Compiling structopt-derive v0.4.18
Compiling pest_derive v2.8.6
Compiling backtrace v0.3.76
Compiling phf v0.13.1
Compiling structopt v0.3.26
Compiling failure v0.1.8
Compiling nsh v0.4.2
error[E0432]: unresolved imports `nix::unistd::fork`, `nix::unistd::setpgid`, `nix::unistd::ForkResult`, `nix::unistd::Pid`
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/eval.rs:13:26
|
13 | use nix::unistd::{close, fork, pipe, setpgid, ForkResult, Pid};| ^^^^ ^^^^^^^ ^^^^^^^^^^ ^^^ no `Pid`in`unistd`||||||| no `ForkResult`in`unistd`|| no `setpgid`in`unistd`| no `fork`in`unistd`|
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/unistd.rs:278:15
|
159 |#![feature = "process"]| ------------------- the item is gated behind the `process` feature
...
278 | pub unsafe fn fork() -> Result<ForkResult> {
| ^^^^
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/unistd.rs:318:8
|
159 |#![feature = "process"]| ------------------- the item is gated behind the `process` feature
...
318 | pub fn setpgid(pid: Pid, pgid: Pid) ->Result<()> {
| ^^^^^^^
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/unistd.rs:209:10
|
159 |#![feature = "process"]| ------------------- the item is gated behind the `process` feature
...
209 | pub enum ForkResult {
| ^^^^^^^^^^
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/unistd.rs:165:12
|
159 |#![feature = "process"]| ------------------- the item is gated behind the `process` feature
...
165 | pub struct Pid(pid_t);| ^^^
error[E0432]: unresolved imports `nix::sys::signal::kill`, `nix::sys::signal::sigaction`, `nix::sys::signal::SaFlags`, `nix::sys::signal::SigAction`, `nix::sys::signal::SigHandler`, `nix::sys::signal::SigSet`, `nix::sys::signal::Signal`
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/process.rs:10:24
|
10 | use nix::sys::signal::{kill, sigaction, SaFlags, SigAction, SigHandler, SigSet, Signal};| ^^^^ ^^^^^^^^^ ^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^ ^^^^^^ ^^^^^^ no `Signal`in`sys::signal`||||||||||||| no `SigSet`in`sys::signal`||||| no `SigHandler`in`sys::signal`|||| no `SigAction`in`sys::signal`||| no `SaFlags`in`sys::signal`|| no `sigaction`in`sys::signal`| no `kill`in`sys::signal`|
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/sys/signal.rs:1042:8
|
487 |#![feature = "signal"]| ------------------ the item is gated behind the `signal` feature
...
1042 | pub fn kill<T: Into<Option<Signal>>>(pid: Pid, signal: T) ->Result<()> {
| ^^^^
= help: consider importing this struct instead:
libc::sigaction
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/sys/signal.rs:880:15
|
487 |#![feature = "signal"]| ------------------ the item is gated behind the `signal` feature
...
880 | pub unsafe fn sigaction(signal: Signal, sigaction: &SigAction) -> Result<SigAction> {
| ^^^^^^^^^
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/sys/signal.rs:773:12
|
487 |#![feature = "signal"]| ------------------ the item is gated behind the `signal` feature
...
773 | pub struct SigAction {
| ^^^^^^^^^
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/sys/signal.rs:757:10
|
487 |#![feature = "signal"]| ------------------ the item is gated behind the `signal` feature
...
757 | pub enum SigHandler {
| ^^^^^^^^^^
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/sys/signal.rs:499:12
|
487 |#![feature = "signal"]| ------------------ the item is gated behind the `signal` feature
...
499 | pub struct SigSet {
| ^^^^^^
= help: consider importing this variant instead:
signal_hook::iterator::backend::PollResult::Signal
error[E0433]: failed to resolve: could not find `termios`in`sys`
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/process.rs:11:15
|
11 | use nix::sys::termios::{tcgetattr, tcsetattr, SetArg::TCSADRAIN, Termios};| ^^^^^^^ could not find `termios`in`sys`|
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/sys/mod.rs:163:13
|
161 |#![feature = "term"]| ---------------- the item is gated behind the `term` feature
162 |#[allow(missing_docs)]
163 | pub mod termios;| ^^^^^^^
error[E0432]: unresolved import `nix::sys::termios`
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/process.rs:11:15
|
11 | use nix::sys::termios::{tcgetattr, tcsetattr, SetArg::TCSADRAIN, Termios};| ^^^^^^^ could not find `termios`in`sys`|
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/sys/mod.rs:163:13
|
161 |#![feature = "term"]| ---------------- the item is gated behind the `term` feature
162 |#[allow(missing_docs)]
163 | pub mod termios;| ^^^^^^^
error[E0432]: unresolved import `nix::sys::wait`
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/process.rs:12:15
|
12 | use nix::sys::wait::{waitpid, WaitPidFlag, WaitStatus};| ^^^^ could not find `wait`in`sys`|
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/sys/mod.rs:181:13
|
180 |#![feature = "process"]| ------------------- the item is gated behind the `process` feature
181 | pub mod wait;| ^^^^
error[E0432]: unresolved imports `nix::unistd::dup2`, `nix::unistd::execv`, `nix::unistd::fork`, `nix::unistd::getpid`, `nix::unistd::setpgid`, `nix::unistd::tcsetpgrp`, `nix::unistd::ForkResult`, `nix::unistd::Pid`
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/process.rs:13:26
|
13 | use nix::unistd::{close, dup2, execv, fork, getpid, setpgid, tcsetpgrp, ForkResult, Pid};| ^^^^ ^^^^^ ^^^^ ^^^^^^ ^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^ ^^^ no `Pid`in`unistd`||||||||||||||| no `ForkResult`in`unistd`|||||| no `tcsetpgrp`in`unistd`||||| no `setpgid`in`unistd`|||| no `getpid`in`unistd`||| no `fork`in`unistd`|| no `execv`in`unistd`| no `dup2`in`unistd`|
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/unistd.rs:543:8
|
417 |#![feature = "fs"]| -------------- the item is gated behind the `fs` feature
...
543 | pub fn dup2<Fd: std::os::fd::AsFd>(oldfd: Fd, newfd: &mut std::os::fd::OwnedFd) ->Result<()> {
| ^^^^
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/unistd.rs:1105:8
|
1089 |#![feature = "process"]| ------------------- the item is gated behind the `process` feature
...
1105 | pub fn execv<S: AsRef<CStr>>(path: &CStr, argv: &[S]) -> Result<Infallible> {
| ^^^^^
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/unistd.rs:278:15
|
159 |#![feature = "process"]| ------------------- the item is gated behind the `process` feature
...
278 | pub unsafe fn fork() -> Result<ForkResult> {
| ^^^^
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/unistd.rs:294:8
|
159 |#![feature = "process"]| ------------------- the item is gated behind the `process` feature
...
294 | pub fn getpid() -> Pid {
| ^^^^^^
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/unistd.rs:318:8
|
159 |#![feature = "process"]| ------------------- the item is gated behind the `process` feature
...
318 | pub fn setpgid(pid: Pid, pgid: Pid) ->Result<()> {
| ^^^^^^^
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/unistd.rs:371:8
|
352 |#![all(feature = "process", feature = "term")]| ------------------- the item is gated behind the `process` feature
...
371 | pub fn tcsetpgrp<F: std::os::fd::AsFd>(fd: F, pgrp: Pid) ->Result<()> {
| ^^^^^^^^^
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/unistd.rs:209:10
|
159 |#![feature = "process"]| ------------------- the item is gated behind the `process` feature
...
209 | pub enum ForkResult {
| ^^^^^^^^^^
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/unistd.rs:165:12
|
159 |#![feature = "process"]| ------------------- the item is gated behind the `process` feature
...
165 | pub struct Pid(pid_t);| ^^^
error[E0432]: unresolved import `nix::sys::termios`
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/shell.rs:8:15
|
8 | use nix::sys::termios::{tcgetattr, Termios};| ^^^^^^^ could not find `termios`in`sys`|
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/sys/mod.rs:163:13
|
161 |#![feature = "term"]| ---------------- the item is gated behind the `term` feature
162 |#[allow(missing_docs)]
163 | pub mod termios;| ^^^^^^^
error[E0432]: unresolved imports `nix::unistd::getpid`, `nix::unistd::Pid`
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/shell.rs:9:19
|
9 | use nix::unistd::{getpid, Pid};| ^^^^^^ ^^^ no `Pid`in`unistd`||| no `getpid`in`unistd`|
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/unistd.rs:294:8
|
159 |#![feature = "process"]| ------------------- the item is gated behind the `process` feature
...
294 | pub fn getpid() -> Pid {
| ^^^^^^
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/unistd.rs:165:12
|
159 |#![feature = "process"]| ------------------- the item is gated behind the `process` feature
...
165 | pub struct Pid(pid_t);| ^^^
error[E0432]: unresolved imports `nix::sys::signal::sigaction`, `nix::sys::signal::SaFlags`, `nix::sys::signal::SigAction`, `nix::sys::signal::SigHandler`, `nix::sys::signal::SigSet`, `nix::sys::signal::Signal`
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/main.rs:48:24
|
48 | use nix::sys::signal::{sigaction, SaFlags, SigAction, SigHandler, SigSet, Signal};| ^^^^^^^^^ ^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^ ^^^^^^ ^^^^^^ no `Signal`in`sys::signal`||||||||||| no `SigSet`in`sys::signal`|||| no `SigHandler`in`sys::signal`||| no `SigAction`in`sys::signal`|| no `SaFlags`in`sys::signal`| no `sigaction`in`sys::signal`|
= help: consider importing this struct instead:
libc::sigaction
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/sys/signal.rs:880:15
|
487 |#![feature = "signal"]| ------------------ the item is gated behind the `signal` feature
...
880 | pub unsafe fn sigaction(signal: Signal, sigaction: &SigAction) -> Result<SigAction> {
| ^^^^^^^^^
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/sys/signal.rs:773:12
|
487 |#![feature = "signal"]| ------------------ the item is gated behind the `signal` feature
...
773 | pub struct SigAction {
| ^^^^^^^^^
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/sys/signal.rs:757:10
|
487 |#![feature = "signal"]| ------------------ the item is gated behind the `signal` feature
...
757 | pub enum SigHandler {
| ^^^^^^^^^^
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/sys/signal.rs:499:12
|
487 |#![feature = "signal"]| ------------------ the item is gated behind the `signal` feature
...
499 | pub struct SigSet {
| ^^^^^^
= help: consider importing this variant instead:
signal_hook::iterator::backend::PollResult::Signal
error[E0425]: cannot find function`isatty`in module `nix::unistd`
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/macros.rs:4:22
|
4 |nix::unistd::isatty(std::io::stdout().as_raw_fd()).unwrap_or(false)
| ^^^^^^ not found in`nix::unistd`|
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/unistd.rs:1543:8
|
1480 |#![feature = "fs"]| -------------- the item is gated behind the `fs` feature
...
1543 | pub fn isatty<Fd: std::os::fd::AsFd>(fd: Fd) -> Result<bool> {
| ^^^^^^
help: consider importing this function
|
1 + use libc::isatty;|
help: if you import `isatty`, refer to it directly
|
4 - nix::unistd::isatty(std::io::stdout().as_raw_fd()).unwrap_or(false)
4 + isatty(std::io::stdout().as_raw_fd()).unwrap_or(false)
|
error[E0425]: cannot find function`gethostname`in module `unistd`
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/prompt.rs:131:33
|
131 |let hostname_cstr = unistd::gethostname(&mut hostname_buf).expect("failed to get hostname");| ^^^^^^^^^^^ not found in`unistd`|
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/unistd.rs:1332:8
|
1286 |#![feature = "hostname"]| -------------------- the item is gated behind the `hostname` feature
...
1332 | pub fn gethostname() -> Result<OsString> {
| ^^^^^^^^^^^
help: consider importing one of these functions
|
1 + use crate::prompt::libc::gethostname;|
1 + use libc::gethostname;|
help: if you import `gethostname`, refer to it directly
|
131 - let hostname_cstr = unistd::gethostname(&mut hostname_buf).expect("failed to get hostname");
131 + let hostname_cstr = gethostname(&mut hostname_buf).expect("failed to get hostname");|
error[E0425]: cannot find function`fsync`in module `unistd`
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/utils.rs:57:17
|
57 |unistd::fsync(self.fd).ok();
| ^^^^^ not found in`unistd`|
note: found an item that was configured out
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/unistd.rs:1708:8
|
1480 |#![feature = "fs"]| -------------- the item is gated behind the `fs` feature
...
1708 | pub fn fsync<Fd: std::os::fd::AsFd>(fd: Fd) ->Result<()> {
| ^^^^^
help: consider importing this function
|
1 + use libc::fsync;|
help: if you import `fsync`, refer to it directly
|
57 - unistd::fsync(self.fd).ok();
57 + fsync(self.fd).ok();
|
error[E0308]: mismatched types
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/eval.rs:105:42
|
105 |let mut file = File::from_raw_fd(pipe_in);| ----------------- ^^^^^^^ expected `i32`, found `OwnedFd`||| arguments to this functionare incorrect
|
note: associated functiondefined here
--> /rustc/01f6ddf7588f42ae2d7eb0a2f21d44e8e96674cf/library/std/src/os/fd/raw.rs:113:15
error[E0308]: mismatched types
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/eval.rs:111:8
|
111 | Ok(pipe_out)
| -- ^^^^^^^^ expected `i32`, found `OwnedFd`||| arguments to this enum variant are incorrect
|
help: the type constructed contains `OwnedFd` due to the type of the argument passed
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/eval.rs:111:5
|
111 | Ok(pipe_out)
| ^^^--------^
||| this argument influences the type of `Ok`
note: tuple variant defined here
--> /rustc/01f6ddf7588f42ae2d7eb0a2f21d44e8e96674cf/library/core/src/result.rs:561:5
error[E0308]: mismatched types
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/eval.rs:429:17
|
429 | stdout: pipe_in,
| ^^^^^^^ expected `i32`, found `OwnedFd`
error[E0308]: mismatched types
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/eval.rs:439:17
|
439 | Ok((status, pipe_out))| ^^^^^^^^ expected `i32`, found `OwnedFd`
error[E0308]: mismatched types
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/eval.rs:482:22
|
473 |let stdout;| ------ expected due to the type of this binding
...
482 | stdout = pipeline_stdout;| ^^^^^^^^^^^^^^^ expected `OwnedFd`, found `i32`
error[E0308]: mismatched types
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/eval.rs:491:17
|
491 | stdout,
| ^^^^^^ expected `i32`, found `OwnedFd`
error[E0308]: mismatched types
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/eval.rs:500:21
|
470 |let mut stdin = pipeline_stdin;| -------------- expected due to this value
...
500 | stdin = pipe_out;| ^^^^^^^^ expected `i32`, found `OwnedFd`
error[E0277]: the trait bound `i32: AsFd` is not satisfied
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/utils.rs:19:32
|
19 | match unistd::read(self.fd, &mut ch) {
| ------------ ^^^^^^^ the trait `AsFd` is not implemented for`i32`||| required by a bound introduced by this call
|
= help: the following other types implement trait `AsFd`:
&T
&mut T
Arc<T>
BorrowedFd<'_> Box<T> ChildStderr ChildStdin ChildStdout and 23 othersnote: required by a bound in `nix::unistd::read` --> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/unistd.rs:1362:17 |1362 | pub fn read<Fd: std::os::fd::AsFd>(fd: Fd, buf: &mut [u8]) -> Result<usize> { | ^^^^^^^^^^^^^^^^^ required by this bound in `read`error[E0277]: the trait bound `i32: AsFd` is not satisfied --> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nsh-0.4.2/src/utils.rs:51:33 | 51 | let len = unistd::write(self.fd, buf).expect("failed to write"); | ------------- ^^^^^^^ the trait `AsFd` is not implemented for `i32` | | | required by a bound introduced by this call | = help: the following other types implement trait `AsFd`: &T &mut T Arc<T> BorrowedFd<'_>
Box<T>
ChildStderr
ChildStdin
ChildStdout
and 23 others
note: required by a bound in`nix::unistd::write`
--> /home/w495/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.31.2/src/unistd.rs:1379:18
|
1379 | pub fn write<Fd: std::os::fd::AsFd>(fd: Fd, buf: &[u8]) -> Result<usize> {
| ^^^^^^^^^^^^^^^^^ required by this bound in`write`
Some errors have detailed explanations: E0277, E0308, E0425, E0432, E0433.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `nsh` (bin "nsh") due to 21 previous errors
error: failed to compile `nsh v0.4.2`, intermediate artifacts can be found at `/tmp/cargo-installyc6cC8`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
# /home/w495
1819 |12.419|02:49:44 βββ[x]~βββ
Activity
w495 commentedon Mar 3, 2026
I have the same problem.