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

Installing cargo-espflash with cargo fails #671

Open
FabienTregan opened this issue Aug 17, 2024 · 9 comments
Open

Installing cargo-espflash with cargo fails #671

FabienTregan opened this issue Aug 17, 2024 · 9 comments

Comments

@FabienTregan
Copy link

Hi. I try installing cargo-espflash but it fails :

~/code/no_std-training$ cargo install cargo-espflash espflash
…
   Compiling gix-bitmap v0.2.11
error[E0283]: type annotations needed
  --> /home/fabien/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-credentials-0.23.1/src/program/mod.rs:83:63
   |
83 |                 gix_command::prepare(gix_path::from_bstr(args.as_ref()).into_owned())
…
    Replaced package `espflash v3.1.0` with `espflash v3.1.1` (executable `espflash`)
error: failed to compile `cargo-espflash v3.1.1`, intermediate artifacts can be found at `/tmp/cargo-installmpKzeQ`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
     Summary Successfully installed espflash! Failed to install cargo-espflash (see error(s) above).
error: some crates failed to install

I think I've tried nightly and stable toolchains. I tried changing the defualt tool chains to those two:

nightly-x86_64-unknown-linux-gnu (default)
stable-x86_64-unknown-linux-gnu
~$ uname -v
#45~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Jul 15 16:40:02 UTC 2
~$ rustup -V
rustup 1.27.1 (54dd3d00f 2024-04-24)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.79.0 (129f3b996 2024-06-10)`

After updating the tool chain, (stable to rustc 1.80.1 (3f5fd8dd4 2024-08-06, nightly to rustc 1.82.0-nightly (506052d49 2024-08-16)`) the error is still there.

@FabienTregan
Copy link
Author

I quickly checked something: on Jun 20 16:41, I installed v3.1.0 on this same computer with no issue, I'm pretty sure the rust install was the same that failed this morning trying to install v3.1.1

@jnnks
Copy link

jnnks commented Aug 20, 2024

All previous espflash versions (2.x.x) did not work for me either. Always the same error in gix-credentials, across multiple different gix-credentials versions. I assume it has to do with the rust version gix is using, gix-credentials has declared 1.65 in their Cargo.toml.

I ended up installing v3.1.1 using cargo binstall espflash.

@licsber
Copy link

licsber commented Aug 21, 2024

same above

error[E0283]: type annotations needed
  --> C:\Users\licsber\.cargo\registry\src\mirrors.ustc.edu.cn-4affec411d11e50f\gix-credentials-0.23.1\src\program\mod.rs:83:63
   |
83 |                 gix_command::prepare(gix_path::from_bstr(args.as_ref()).into_owned())
   |                                                               ^^^^^^
   |
   = note: multiple `impl`s satisfying `BString: AsRef<_>` found in the `bstr` crate:
           - impl AsRef<BStr> for BString;
           - impl AsRef<[u8]> for BString;
help: try using a fully qualified path to specify the expected types
   |
83 |                 gix_command::prepare(gix_path::from_bstr(<BString as AsRef<T>>::as_ref(&args)).into_owned())
   |                                                          +++++++++++++++++++++++++++++++    ~

error[E0283]: type annotations needed
   --> C:\Users\licsber\.cargo\registry\src\mirrors.ustc.edu.cn-4affec411d11e50f\gix-credentials-0.23.1\src\program\mod.rs:83:38
    |
83  |                 gix_command::prepare(gix_path::from_bstr(args.as_ref()).into_owned())
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for reference `&_`
    |
    = note: multiple `impl`s satisfying `Cow<'_, BStr>: From<&_>` found in the `bstr` crate:
            - impl<'a> From<&'a BStr> for Cow<'a, BStr>;
            - impl<'a> From<&'a BString> for Cow<'a, BStr>;
    = note: required for `&_` to implement `Into<Cow<'_, BStr>>`
note: required by a bound in `from_bstr`
   --> C:\Users\licsber\.cargo\registry\src\mirrors.ustc.edu.cn-4affec411d11e50f\gix-path-0.10.9\src\convert.rs:135:34
    |
135 | pub fn from_bstr<'a>(input: impl Into<Cow<'a, BStr>>) -> Cow<'a, Path> {
    |                                  ^^^^^^^^^^^^^^^^^^^ required by this bound in `from_bstr`

   Compiling gix-packetline v0.17.5
For more information about this error, try `rustc --explain E0283`.
error: could not compile `gix-credentials` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-espflash v3.1.1`, intermediate artifacts can be found at `C:\Users\licsber\AppData\Local\Temp\cargo-installU1hXOn`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
     Summary Successfully installed espflash, ldproxy! Failed to install cargo-espflash (see error(s) above).
error: some crates failed to install

@ThomasBoom89
Copy link

Run into the same issue and updating cargo as dependency will fix it.
You can look at this commit f00ba45 in the open pull request #666 and install from local within the cargo-espflash directory like so -> cargo install --path ./

@jjcfrancisco
Copy link

Run into the same issue and updating cargo as dependency will fix it.
You can look at this commit f00ba45 in the open pull request #666 and install from local within the cargo-espflash directory like so -> cargo install --path ./

I tried this but got the same error.

@SergioGasquez
Copy link
Member

SergioGasquez commented Aug 30, 2024

Use cargo install cargo-espflash --locked to avoid the error

@felix-kolbe
Copy link

Use cargo install cargo-espflash --locked to avoid the error

This also solved it for me, trying to install it in WSL (running Ubuntu 24.04.1 LTS). 🎉

@VorpalBlade
Copy link

Seems gix broke semver then? Has this been reported to that project so they can yank the bad versions?

@eklipse2k8
Copy link

Seeing this when running

cargo install cargo-espflash --locked
warning: package `bytemuck v1.16.0` in Cargo.lock is yanked in registry `crates-io`, consider running without --locked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

9 participants