[SOLVED] Setting up Rust & Cargo on ARM


#1

I’m following these instructions for getting nightly Rust & Cargo running on an ARM device (Odroid U3) which is at a remote location - so I’m doing all this over ssh. I mention that because I have not come across this issue before, setting up my local machine. The ARM device is running Ubuntu 14.04.

I reached the point where I have Cargo and Rust installed and they seem happy:

$ cargo --version
cargo 0.6.0-nightly (e1ed995 2015-10-22)
$ rustc --version
rustc 1.5.0-dev (72ed590f8 2015-10-26)

I can “git clone” a known good project, but when I try a build I’m getting this error:

$ cargo build --verbose
    Updating registry `https://github.com/rust-lang/crates.io-index`
Unable to update registry https://github.com/rust-lang/crates.io-index

Caused by:
  Permission denied (os error 13)

(Cargo update doesn’t work because there is no cargo.lock yet)

I’ve searched online but can’t find anything relevant. There are some similar looking symptoms that seem (they’re in Chinese!) to be about being behind a proxy, but the remote machine isn’t behind a proxy. It is behind a router, and I have port forwarding in place to allow me to ssh to it, but since the machine is initiating requests to github itself, I don’t think it being behind a router or firewall should matter.

Can anyone suggest what might be going wrong here?

Thanks,


#2

I’d guess cargo can’t create or write to $HOME/.cargo for some reason. Or $CARGO_HOME if that is set.


#3

Thanks for the super quick response.

$HOME/.cargo does not exist and I can create it. That made no difference, so deleted again.

$CARGO_HOME is not set.


#4

These ‘os errors’ are completely useless (probably because of other supported platforms) so to get an idea what’s wrong you should look at output from:

strace cargo build


#5

Thanks @PeteVine, strace output is overwhelming. Lots of “errors” but most are clearly normal file open tests. I’m wondering if my multirust config might be the culprit because…

In the instructions, there are two steps, one of which I tweaked:

Instructions say:

# multirust update unofficial-nightly --link-local
# multirust default unofficial-nightly

But the first complained at a missing parameter after --link-local, so I guessed at this (having followed the example exactly):

# multirust update unofficial-nightly --link-local /opt/rust/nightly
# multirust default unofficial-nightly

I’m not sure if any of the strace output relates to this. Any chance you could take a look?

If so here’s the file: http://markhughes.com/strace.txt


#6

This seems to be the culprit:

mkdir("/home/odroid/.multirust/toolchains/unofficial-nightly/cargo", 0777) = -1 EACCES (Permission denied)

Do you have a symlink in place perhaps?


#7

@PeteVine thanks a million, cargo is building :slight_smile:

The issue was that I messed up groups. My account was not a member of group “users”.