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

cargo doc doesn't work for thumbv7m-none-eabi targets #223

Open
mayl opened this issue May 27, 2020 · 0 comments
Open

cargo doc doesn't work for thumbv7m-none-eabi targets #223

mayl opened this issue May 27, 2020 · 0 comments

Comments

@mayl
Copy link

mayl commented May 27, 2020

Hi, I've been trying to set up a nix-shell for doing embedded Rust development for ARM. The shell I have so far can compile working binaries, which is great! Unfortunately, I can't get cargo doc to work.

The shell.nix I'm using is:

let
  moz_overlay = import (bulitins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz);
  nixpkgs = import <nixpkgs>{ overlays = [moz_overlay]; };
in
  with nixpkgs;

  stdenv.mkDerivation {
    name = "rust-env";
    buildINputs = [
        (nixpkgs.rustChannelOfTargets "stable" null [ "thumbv7m-none-eabi" ])
        gcc-arm-embedded #for binutils, etc
    ];
  }

And the error I am getting from cargo doc is:

error[E0463]: can't find crate for `core`
  |
  = note: the `thumbv7m-none-eabi` target may not be installed

I've found that .cargo/config allows the documentation to be built (but obviously compiling binaries doesn't work without the target specified). Also, building the project with a toolchain installed on Ubuntu with rustup successfully builds the documentation. I get the same behavior where rustup toolchains work, but nix-shell doesn't across several thumbv7m-none-eabi projects I've cloned off github.

I've searched quite a bit for other examples of this issue, but am coming up empty. The fact that it works properly with a rustup installed toolchain in a more "standard" environment, and the error asks for a toolchain that is installed (it compiles binaries!) suggests that it may be a packaging issue? Does the overlay have to add a path somewhere for rustdoc to find core for non-native builds?

I'm obviously very new at both Nix and Rust, so any help is much appreciated!

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

No branches or pull requests

1 participant