Thanks to visit codestin.com
Credit goes to github.com

Skip to content

xargo build error #296

@chaozju

Description

@chaozju

I am trying out nightly xargo for further customizing target riscv64gc-unknown-linux-musl for cross building inspired by this issue
but I failed at the very beginning :)

I want a statically linked executable so targetting x86_64-unknown-linux-musl
with

xargo build --release --target x86_64-unknown-linux-musl

then got

xargo build --release --target x86_64-unknown-linux-musl
   Compiling hello v0.1.0 (/home/chao/rust_playground/hello)
error[E0463]: can't find crate for `std`
  |
  = note: the `x86_64-unknown-linux-musl` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `hello`.

To learn more, run the command again with --verbose.
Makefile:3: recipe for target 'x86-musl' failed
make: *** [x86-musl] Error 101

my rustup show

chao@DESKTOP-B79IRTG:~/rust_playground/hello$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/chao/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)
1.40.0-x86_64-unknown-linux-gnu

installed targets for active toolchain
--------------------------------------

wasm32-unknown-unknown
x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl

active toolchain
----------------

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.44.0-nightly (f509b26a7 2020-03-18)

Things work fine without nightly but with getting WARNING: the sysroot can't be built for the Stable channel. Switch to nightly. in customizing sysroot and target

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions