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

Can't compile probe-rs anymore #2168

Closed
uliano opened this issue Feb 10, 2024 · 1 comment
Closed

Can't compile probe-rs anymore #2168

uliano opened this issue Feb 10, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@uliano
Copy link

uliano commented Feb 10, 2024

Describe the bug
Compilation gives error

To Reproduce

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install probe-rs --features cli

Expected behavior
successful compilation

Stacktrace

   Compiling typed-path v0.7.0
error[E0603]: struct `Formatter` is private
   --> /home/uliano/.cargo/registry/src/index.crates.io-6f17d22bba15001f/probe-rs-0.22.0/src/bin/probe-rs/util/rtt.rs:389:36
    |
389 |     formatter: defmt_decoder::log::Formatter,
    |                                    ^^^^^^^^^ private struct
    |
note: the struct `Formatter` is defined here
   --> /home/uliano/.cargo/registry/src/index.crates.io-6f17d22bba15001f/defmt-decoder-0.3.10/src/log/mod.rs:19:14
    |
19  |     format::{Formatter, HostFormatter},
    |              ^^^^^^^^^
help: consider importing this struct instead
    |
389 |     formatter: defmt_decoder::log::format::Formatter,
    |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: import `Formatter` directly
    |
389 |     formatter: defmt_decoder::log::format::Formatter,
    |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0603]: struct `Formatter` is private
   --> /home/uliano/.cargo/registry/src/index.crates.io-6f17d22bba15001f/probe-rs-0.22.0/src/bin/probe-rs/util/rtt.rs:473:53
    |
473 |                 let formatter = defmt_decoder::log::Formatter::new(format);
    |                                                     ^^^^^^^^^ private struct
    |
note: the struct `Formatter` is defined here
   --> /home/uliano/.cargo/registry/src/index.crates.io-6f17d22bba15001f/defmt-decoder-0.3.10/src/log/mod.rs:19:14
    |
19  |     format::{Formatter, HostFormatter},
    |              ^^^^^^^^^
help: consider importing this struct instead
    |
473 |                 let formatter = defmt_decoder::log::format::Formatter::new(format);
    |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: import `Formatter` directly
    |
473 |                 let formatter = defmt_decoder::log::format::Formatter(format);
    |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0599]: no method named `format_to_string` found for reference `&defmt_decoder::log::format::Formatter` in the current scope
   --> /home/uliano/.cargo/registry/src/index.crates.io-6f17d22bba15001f/probe-rs-0.22.0/src/bin/probe-rs/util/rtt.rs:349:43
    |
349 | ...                   formatter.format_to_string(frame, file.as_deref(), line, module);
    |                                 ^^^^^^^^^^^^^^^^ method not found in `&Formatter`

error[E0277]: `defmt_decoder::log::format::Formatter` doesn't implement `std::fmt::Debug`
   --> /home/uliano/.cargo/registry/src/index.crates.io-6f17d22bba15001f/probe-rs-0.22.0/src/bin/probe-rs/util/rtt.rs:389:5
    |
385 | #[derive(Debug)]
    |          ----- in this derive macro expansion
...
389 |     formatter: defmt_decoder::log::Formatter,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `defmt_decoder::log::format::Formatter` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `defmt_decoder::log::format::Formatter`, which is required by `&defmt_decoder::log::format::Formatter: std::fmt::Debug`
    = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
   --> /home/uliano/.cargo/registry/src/index.crates.io-6f17d22bba15001f/probe-rs-0.22.0/src/bin/probe-rs/util/rtt.rs:473:68
    |
473 |                 let formatter = defmt_decoder::log::Formatter::new(format);
    |                                 ---------------------------------- ^^^^^^ expected `FormatterConfig<'_>`, found `&str`
    |                                 |
    |                                 arguments to this function are incorrect
    |
note: associated function defined here
   --> /home/uliano/.cargo/registry/src/index.crates.io-6f17d22bba15001f/defmt-decoder-0.3.10/src/log/format/mod.rs:193:12
    |
193 |     pub fn new(config: FormatterConfig) -> Self {
    |            ^^^

Some errors have detailed explanations: E0277, E0308, E0599, E0603.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `probe-rs` (bin "probe-rs") due to 5 previous errors
error: failed to compile `probe-rs v0.22.0`, intermediate artifacts can be found at `/tmp/cargo-install56mFlV`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
uliano@MeLE ~
% history                                                                                                                                          (python3.11)
  737  history 0 |grep install |probe-rs
  738  history 0 |grep install |grep probe-rs
  739  cargo install probe-rs --features cli
  740  ls
  741  ls -a
  742  cd
  743  ls -a
  744  cat .cargo
  745  ls .cargo
  746  rm -fr .rustup .cargo
  747  curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  748  sudo apt install -y pkg-config libusb-1.0-0-dev libftdi1-dev libudev-dev libssl-dev
  749  cargo install probe-rs --features cli,ftdi
  750  history 0
  751  rustup default nightly
  752  cargo install probe-rs --features cli
uliano@MeLE ~

Desktop (please complete the following information):

Debian GNU/Linux trixie

Additional context
none

@uliano uliano added the bug Something isn't working label Feb 10, 2024
@Tiwalun
Copy link
Member

Tiwalun commented Feb 10, 2024

This is a duplicate of #2155.

I recommend that you use the precompiled binaries (see README), or if you want to build it from source, you can use

cargo install probe-rs --features cli --locked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants