Cannot compile on FreeBSD 13.0
kettek opened this issue · 5 comments
- Architecture: 64-bit x86
- OS: FreeBSD 13.0
- rustc: 1.53.0
When compiling via cargo install --path .
, I get the following:
Compiling nsh v0.4.0 (/usr/home/kts/Develop/nsh)
warning: use of deprecated associated function `nix::errno::<impl nix::errno::Errno>::Sys`: Use Errno::... instead
--> src/process.rs:319:13
|
319 | Err(nix::Error::Sys(nix::errno::Errno::ECHILD)) | Ok(WaitStatus::StillAlive) => {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
error[E0164]: expected tuple struct or tuple variant, found associated function `nix::Error::Sys`
--> src/process.rs:319:13
|
319 | Err(nix::Error::Sys(nix::errno::Errno::ECHILD)) | Ok(WaitStatus::StillAlive) => {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `fn` calls are not allowed in patterns
|
= help: for more information, visit https://doc.rust-lang.org/book/ch18-00-patterns.html
warning: use of deprecated associated function `nix::errno::<impl nix::errno::Errno>::Sys`: Use Errno::... instead
--> src/process.rs:475:21
|
475 | Err(nix::Error::Sys(nix::errno::Errno::EACCES)) => {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0164]: expected tuple struct or tuple variant, found associated function `nix::Error::Sys`
--> src/process.rs:475:21
|
475 | Err(nix::Error::Sys(nix::errno::Errno::EACCES)) => {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `fn` calls are not allowed in patterns
|
= help: for more information, visit https://doc.rust-lang.org/book/ch18-00-patterns.html
error: aborting due to 2 previous errors; 2 warnings emitted
I would fix this myself but I do not know Rust nor its ecosystem (and as such, don't know if it is an expected Rust version mismatch or otherwise).
Hi, thanks for the report.
I have just published v0.4.1 which includes the fix for the compile error. Could you try installing again?
It seems to work, however I do get a very hard to read set of error messages pertaining to Bash:
nsh: panicked at 'failed to start an external Bash: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /home/kts/.cargo/registry/src/github.com-1ecc6299db9ec823/nsh-0.4.1/src/bash_server.rs:110:10
nsh: 0: 0x114441b - backtrace::backtrace::libunwind::trace::hf4f8e3d543d2ec11
at /home/kts/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.60/src/backtrace/libunwind.rs:90:5
backtrace::backtrace::trace_unsynchronized::h9620a754a7ab8a67
at /home/kts/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.60/src/backtrace/mod.rs:66:5
backtrace::backtrace::trace::h92ddf9b9a40db90f
at /home/kts/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.60/src/backtrace/mod.rs:53:14
backtrace::capture::Backtrace::create::h9e3313e20fa0ef02
at /home/kts/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.60/src/capture.rs:176:9
backtrace::capture::Backtrace::new::hd9ffcb24f8326157
at /home/kts/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.60/src/capture.rs:140:22
1: 0x110fdff - nsh::main::{{closure}}::h19eb0161f1fc7d8c
at /home/kts/.cargo/registry/src/github.com-1ecc6299db9ec823/nsh-0.4.1/src/main.rs:193:29
2: 0x11e2a0b - std::panicking::rust_panic_with_hook::h464a89e144497d4f
3: 0x11c8cec - std::panicking::begin_panic_handler::{{closure}}::hbd60ef88fa4db63c
4: 0x11c8c50 - std::sys_common::backtrace::__rust_end_short_backtrace::hc76c2013cc85f77f
5: 0x11e2550 - rust_begin_unwind
6: 0x11840bf - core::panicking::panic_fmt::he877c08fee645e1d
7: 0x11878f5 - core::result::unwrap_failed::h684a301ec7ed4436
8: 0x10b8f0d - core::result::Result<T,E>::expect::h63dcf53847bebd7b
at /wrkdirs/usr/ports/lang/rust/work/rustc-1.53.0-src/library/core/src/result.rs:997:23
nsh::bash_server::preload_bash::hd5546976a5efb92c
at /home/kts/.cargo/registry/src/github.com-1ecc6299db9ec823/nsh-0.4.1/src/bash_server.rs:105:20
nsh::bash_server::bash_server::{{closure}}::h85d5d477f5fbad2c
at /home/kts/.cargo/registry/src/github.com-1ecc6299db9ec823/nsh-0.4.1/src/bash_server.rs:23:29
9: 0x10730e0 - std::sys_common::backtrace::__rust_begin_short_backtrace::hc19e90a048ed4cb7
at /wrkdirs/usr/ports/lang/rust/work/rustc-1.53.0-src/library/std/src/sys_common/backtrace.rs:125:18
10: 0x1076a80 - std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}::h22eafc62a4d3246e
at /wrkdirs/usr/ports/lang/rust/work/rustc-1.53.0-src/library/std/src/thread/mod.rs:481:17
11: 0x1071190 - <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h6c0698b732c18b77
at /wrkdirs/usr/ports/lang/rust/work/rustc-1.53.0-src/library/std/src/panic.rs:344:9
12: 0x1084125 - std::panicking::try::do_call::hcd1dfbee59535c7c
at /wrkdirs/usr/ports/lang/rust/work/rustc-1.53.0-src/library/std/src/panicking.rs:379:40
std::panicking::try::hb3b1d9447d631162
at /wrkdirs/usr/ports/lang/rust/work/rustc-1.53.0-src/library/std/src/panicking.rs:343:19
std::panic::catch_unwind::hfd4d739c7afe3886
at /wrkdirs/usr/ports/lang/rust/work/rustc-1.53.0-src/library/std/src/panic.rs:431:14
std::thread::Builder::spawn_unchecked::{{closure}}::hbadaff0db813cf49
at /wrkdirs/usr/ports/lang/rust/work/rustc-1.53.0-src/library/std/src/thread/mod.rs:480:30
core::ops::function::FnOnce::call_once{{vtable.shim}}::ha1b60c139d1ab58e
at /wrkdirs/usr/ports/lang/rust/work/rustc-1.53.0-src/library/core/src/ops/function.rs:227:5
13: 0x11c7a5d - std::sys::unix::thread::Thread::new::thread_start::h36f97e85540097b5
14: 0x80124c82b - <unknown>
nsh: Something went wrong. Check out ~/.nsh.log and please file this bug on GitHub: https://github.com/nuta/nsh/issue
Here is the log as well: .nsh.log
bash
is installed in /usr/local/bin/
on FreeBSD, and I see in bash_server.rs
on line 105 that it looks for it in /bin/
. Perhaps there is a way to use the environment's PATH variable to resolve its location?
Besides that, the nsh shell is actually running now.
Potentially this should be moved to a different issue since compilation works fine now.
bash is installed in /usr/local/bin/ on FreeBSD, and I see in bash_server.rs on line 105 that it looks for it in /bin/. Perhaps there is a way to use the environment's PATH variable to resolve its location?
Thanks for the investigation. You're right. I've added a fix so that nsh use $PATH for the lookup.
Working just fine now. Thanks for the changes!