Giter VIP home page Giter VIP logo

Comments (7)

yonas avatar yonas commented on September 25, 2024 1

It works now, thanks!

from macchina.

grtcdr avatar grtcdr commented on September 25, 2024

It looks like sysctl hw.model may have returned an ill-formatted byte which led to the panic. I'm working on fixing this.

from macchina.

grtcdr avatar grtcdr commented on September 25, 2024

I went and wrapped the value_string invocation using our own ReadoutError which will propagate to macchina in a safe way. The panic should no longer occur and --doctor will show us an error message that may or may not help.

from macchina.

yonas avatar yonas commented on September 25, 2024
❯ RUST_BACKTRACE=full target/release/macchina --doctor
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Utf8Error(Utf8Error { valid_up_to: 48, error_len: Some(1) })', /home/yonas/.cargo/registry/src/github.com-1ecc6299db9ec823/libmacchina-6.4.0/src/freebsd/mod.rs:245:14
stack backtrace:
   0:     0x32a3d53dd75c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he71fd4eda74f87b0
   1:     0x32a3d535696e - core::fmt::write::h5fd3e26984166a6e
   2:     0x32a3d53c30b4 - std::io::Write::write_fmt::h69fa03c5d51d5c91
   3:     0x32a3d53dd537 - std::sys_common::backtrace::print::h05788f88478cef7c
   4:     0x32a3d53c3885 - std::panicking::default_hook::{{closure}}::h0a304c2f161776d3
   5:     0x32a3d53c4194 - std::panicking::rust_panic_with_hook::h2b720056ea930d75
   6:     0x32a3d53ddbb4 - std::panicking::begin_panic_handler::{{closure}}::h9b43afdf57796039
   7:     0x32a3d53ddb1c - std::sys_common::backtrace::__rust_end_short_backtrace::he531317bc19f7b93
   8:     0x32a3d53c3b01 - rust_begin_unwind
   9:     0x32a3d53586d2 - core::panicking::panic_fmt::hf50430e1e32891db
  10:     0x32a3d5358ae2 - core::result::unwrap_failed::ha57a5a37c8028fff
  11:     0x32a3d5377a4c - macchina::data::get_all_readouts::hef727af34dbb0250
  12:     0x32a3d53692e3 - macchina::main::h9baa4fd3d260d27c
  13:     0x32a3d5365059 - std::sys_common::backtrace::__rust_begin_short_backtrace::hd5483f5276f70cc0
  14:     0x32a3d53656c9 - main


❯ RUST_BACKTRACE=full target/release/macchina
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Utf8Error(Utf8Error { valid_up_to: 48, error_len: Some(1) })', /home/yonas/.cargo/registry/src/github.com-1ecc6299db9ec823/libmacchina-6.4.0/src/freebsd/mod.rs:245:14
stack backtrace:
   0:     0x149b30c6d75c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he71fd4eda74f87b0
   1:     0x149b30be696e - core::fmt::write::h5fd3e26984166a6e
   2:     0x149b30c530b4 - std::io::Write::write_fmt::h69fa03c5d51d5c91
   3:     0x149b30c6d537 - std::sys_common::backtrace::print::h05788f88478cef7c
   4:     0x149b30c53885 - std::panicking::default_hook::{{closure}}::h0a304c2f161776d3
   5:     0x149b30c54194 - std::panicking::rust_panic_with_hook::h2b720056ea930d75
   6:     0x149b30c6dbb4 - std::panicking::begin_panic_handler::{{closure}}::h9b43afdf57796039
   7:     0x149b30c6db1c - std::sys_common::backtrace::__rust_end_short_backtrace::he531317bc19f7b93
   8:     0x149b30c53b01 - rust_begin_unwind
   9:     0x149b30be86d2 - core::panicking::panic_fmt::hf50430e1e32891db
  10:     0x149b30be8ae2 - core::result::unwrap_failed::ha57a5a37c8028fff
  11:     0x149b30c07a4c - macchina::data::get_all_readouts::hef727af34dbb0250
  12:     0x149b30bf92e3 - macchina::main::h9baa4fd3d260d27c
  13:     0x149b30bf5059 - std::sys_common::backtrace::__rust_begin_short_backtrace::hd5483f5276f70cc0
  14:     0x149b30bf56c9 - main

from macchina.

grtcdr avatar grtcdr commented on September 25, 2024

Did you point the libmacchina dependency to its git branch?

Something like:

# Cargo.toml
libmacchina = { git = "https://github.com/Macchina-CLI/libmacchina" }

from macchina.

yonas avatar yonas commented on September 25, 2024

@grtcdr After updating Cargo.toml, I get this compile error:

   Compiling macchina v6.1.8 (/usr/home/yonas/git/make-cd/files/macchina)
error[E0425]: cannot find function `version` in crate `libmacchina`
   --> src/main.rs:118:46
    |
118 |     println!("libmacchina  {}", libmacchina::version());
    |                                              ^^^^^^^ not found in `libmacchina`

For more information about this error, try `rustc --explain E0425`.
error: could not compile `macchina` due to previous error

I didn't get this error for pfetch-rs after updating its Cargo.toml.

from macchina.

grtcdr avatar grtcdr commented on September 25, 2024

Sorry about this.

You should also enable the version feature.

libmacchina = { git = "https://github.com/Macchina-CLI/libmacchina", features = ["version"] }

from macchina.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.