rust-embedded / discovery-mb2

Rust Discovery Book for BBC micro::bit v2
Apache License 2.0
6 stars 3 forks source link

Cargo embed fails with error[E0463]: can't find crate for `core` on Mac OS #8

Open balintf opened 1 month ago

balintf commented 1 month ago

I have followed the guide at https://docs.rust-embedded.org/discovery-mb2, and at section 3.4. Verify the installation the cargo embed --target thumbv7em-none-eabihf command fails with multiple

error[E0463]: can't find crate for `core`

error messages, one for each dependency

I have added the target previously by running rustup target add thumbv7em-none-eabihf as the section 3.4 and the troubleshooting section suggested.

balintf commented 1 month ago

I think I have figured out the root cause of the issue, I have rustup installed from the rustup.rs website via the shell script installer and I seem to have rust also installed from homebrew:

> which cargo
/opt/homebrew/bin/cargo

> which rustup
/Users/bfarago/.cargo/bin/rustup

The solution was to uninstall rust from homebrew and use only the rustup version:

brew uninstall rust

We should add this either to the Mac OS section or the Troubleshooting section of the book.

BartMassey commented 1 month ago

Thanks for the note! If you'd like to PR a fix, we'll take it. Otherwise I'll get around to writing something eventually. It would be better if you do it, as I don't have a modern Mac to try things out on and haven't used MacOS in a while.

balintf commented 1 month ago

I'll get a PR submitted for the next week, can you assign the issue to me?

BartMassey commented 1 month ago

Done. Thanks!