xargo: Xargo can not find component `rust-src`
Following along with the intermezzOs, I installed xargo. After installing Xargo, I ran the following command:
$ xargo build --release --target ./x86_64-unknown-metalomai-gnu.json
error: `rust-src` component not found. Run `rustup component add rust-src`.
$
Following the instructions in the error message, I installed the rust-src component.
$ rustup component add rust-src
info: downloading component 'rust-src'
26.4 MiB / 26.4 MiB (100 %) 377.6 KiB/s ETA: 0 s
info: installing component 'rust-src'
warning: could not delete temp directory: /home/geemili/.multirust/tmp/zgpxf8_tm0kk8a72_dir
$
Then I tried running xargo again.
$ xargo build --release --target ./x86_64-unknown-metalomai-gnu.json
error: `rust-src` component not found. Run `rustup component add rust-src`.
$ # :(
Xargo finds the current sysroot using [this code][find-sysroot]. In bash, that looks like:
$ rustc --print sysroot
/home/geemili/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu
$
Then it walks the directories to [find a file named “version”, in a directory named rust.][find-version]. Translating to bash again:
$ find /home/geemili/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/ -name "version"
/home/geemili/.multirust/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/test/run-make/version
$
The “version” file is not in the “rust” folder, so the program fails.
I don’t know why where version is was changed, but depending on this seems like a hack. Perhaps a better way could be found to find the location of rust-src? Maybe someone from who works on rustup could comment.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 23 (20 by maintainers)
Commits related to this issue
- Fix search for rustup rust-src component Fixes japaric/xargo#85 — committed to jdub/xargo by jdub 8 years ago
- Fix search for rustup rust-src component Fixes japaric/xargo#85 — committed to jdub/xargo by jdub 8 years ago
- Fix search for rustup rust-src component Fixes japaric/xargo#85 — committed to jdub/xargo by jdub 8 years ago
@japaric - will there be a release soon? My travis build uses Xargo on crates.io, not my funky patched version.