Giter Club home page Giter Club logo

Comments (4)

Dirbaio avatar Dirbaio commented on July 18, 2024

I cannot reproduce this

git[dirbaio@mercury ~]$ git clone https://github.com/rust-embedded/embedded-hal
Cloning into 'embedded-hal'...
remote: Enumerating objects: 4476, done.
remote: Counting objects: 100% (946/946), done.
remote: Compressing objects: 100% (221/221), done.
remote: Total 4476 (delta 781), reused 781 (delta 725), pack-reused 3530
Receiving objects: 100% (4476/4476), 1.49 MiB | 6.91 MiB/s, done.
Resolving deltas: 100% (2898/2898), done.
[dirbaio@mercury ~]$ cd embedded-hal
[dirbaio@mercury embedded-hal]$ cargo build --features defmt-03
(...)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 10.05s
[dirbaio@mercury embedded-hal]$ cd embedded-hal
[dirbaio@mercury embedded-hal]$ cargo build --features defmt-03
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.02s
[dirbaio@mercury embedded-hal]$ 
[dirbaio@mercury embedded-hal]$ cargo --version -v
cargo 1.79.0 (ffa9cf99a 2024-06-03)
release: 1.79.0
commit-hash: ffa9cf99a594e59032757403d4c780b46dc2c43a
commit-date: 2024-06-03
host: x86_64-unknown-linux-gnu
libgit2: 1.7.2 (sys:0.18.3 vendored)
libcurl: 8.6.0-DEV (sys:0.4.72+curl-8.6.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Arch Linux [64-bit]
[dirbaio@mercury embedded-hal]$ rustc --version -v
rustc 1.79.0 (129f3b996 2024-06-10)
binary: rustc
commit-hash: 129f3b9964af4d4a709d1383930ade12dfe7c081
commit-date: 2024-06-10
host: x86_64-unknown-linux-gnu
release: 1.79.0
LLVM version: 18.1.7

Perhaps you have an old Cargo.lock file somewhere, perhaps there's something wrong with your Rust installation so it's actually using an older rustc or something.

from embedded-hal.

joboudreault avatar joboudreault commented on July 18, 2024

Indeed, after whipping and reinstalling the Rustup installation and Cargo.lock and target/, the embedded-hal and embedded-io packages now compiles with the defmt-03 feature.

However, I used the x86_64-unknown-linux-gnu because the problem also happened with it ; what we are actually compiling for is an ESP32-S3 Xtensa platform. I created a MRE in this repository (here) to showcase the same problem while compiling for the device.

In the root Cargo.toml, it successfully compiles only if I do not comment out the patch.crates-io section.

  --> /home/ferris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embedded-hal-1.0.0/src/lib.rs:21:5
   |
21 | use defmt as defmt;
   |     ^^^^^^^^^^^^^^ no external crate `defmt`

For more information about this error, try `rustc --explain E0432`.
error: could not compile `embedded-hal` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Xtensa Rust version:

$ rustup run esp cargo -Vv
cargo 1.77.0-nightly (3fe68eabf 2024-02-29)
release: 1.77.0-nightly
commit-hash: 3fe68eabf93cbf3772bbcad09a9206c783e2de3f
commit-date: 2024-02-29
host: x86_64-unknown-linux-gnu
libgit2: 1.7.2 (sys:0.18.2 vendored)
libcurl: 8.5.0-DEV (sys:0.4.70+curl-8.5.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Arch Linux [64-bit]

$ rustup run esp rustc -Vv
rustc 1.77.0-nightly (424037dcb 2024-03-18) (1.77.0.0)
binary: rustc
commit-hash: 424037dcb6937656992747c4bbff310c40061498
commit-date: 2024-03-18
host: x86_64-unknown-linux-gnu
release: 1.77.0-nightly
LLVM version: 17.0.1

Could you try if the error happens on your side ? The required compiler and installation steps are documented in the README.md.

from embedded-hal.

Dirbaio avatar Dirbaio commented on July 18, 2024

Same, it build fine for me. Both with and without the [patch.crates-io].

from embedded-hal.

joboudreault avatar joboudreault commented on July 18, 2024

Ok, then I will create a clean Docker container and try reproducing it there. Thanks for your time.

from embedded-hal.

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.