Giter Club home page Giter Club logo

Comments (8)

JuliDi avatar JuliDi commented on July 20, 2024 3

Just as an info for anyone else encountering the issue, the following steps can be used as a workaround:

  • Clone the embedded-io repo from https://github.com/embassy-rs/embedded-io
  • In embedded-io/src/lib.rs add the following code at the top of the file:
    #![feature(generic_associated_types)]
  • In the training project's Cargo.toml (e.g. in intro/hardware-check/Cargo.toml add the following lines at the end
    [patch.crates-io]
    embedded-io = { path = "/path/to/embedded-io"}

from std-training.

JakobGalaxy avatar JakobGalaxy commented on July 20, 2024

I am experiencing the same problem.

from std-training.

JakobGalaxy avatar JakobGalaxy commented on July 20, 2024

Ok, so I am still new to Rust and a hardly know what I am doing here, but it seems to work, so here it is:

After some searching I found this Reddit post, which says that the feature must be enabled using
#![feature(generic_associated_types)] in order to work.

The error says the problem occurs in this file: ~/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.1/src/asynch.rs, so I opened the src directory containing the asynch.rs and added the before-mentioned line
#![feature(generic_associated_types)] to the top of the lib.rs file.

Now it works for me. I don't really think that this is a solution, but I also don't think that it can break much either, as you can always just delete the ~/.cargo/registry/ directory to revert this change. Hope this might help!

from std-training.

JuliDi avatar JuliDi commented on July 20, 2024

Thanks for the hint! I was thinking about doing what the compiler suggests, as well. However, this can't be a permanent solution.
FYI you do not need to mess with the registry afaik, if you use this https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#testing-a-bugfix

So either embedded-io needs to fix this (which I doubt, because there v0.3.1 is very recent and fixes some issue with nightly), or this repo needs some change – but I have no clue which.

Moreover, it doesn't work on the docker container either. There is an issue with rustc being too old (1.61 and comfy-table needs 1.62 or newer) when installing cargo-espflash.
Some crate in the dependency tree apparently causes a lot of trouble.

from std-training.

JakobGalaxy avatar JakobGalaxy commented on July 20, 2024

Thanks for the explanation!

from std-training.

fakeplant avatar fakeplant commented on July 20, 2024

Easier temp solution than cloning repo. Just override to a prev package version.

[patch.crates-io]
embedded-io = { git = "https://github.com/embassy-rs/embedded-io.git", tag = "v0.3.0"}

and then cargo update

Thanks to @elotom
ivmarkov/rust-esp32-std-demo#123 (comment)

from std-training.

JuliDi avatar JuliDi commented on July 20, 2024

Thanks @fakeplant ! Works like a charm.
Embedded-io is now at release 0.4.0 but the issue seems to persist.

from std-training.

SergioGasquez avatar SergioGasquez commented on July 20, 2024

This should now be fixed with #125

from std-training.

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.