I have a problem to compile rust-hello-world example

Hello RIOT developers, users,

Thank you watching this HELP topic. Now I have a problem to compile a new example.

I download the latest version RIOT 2022.01 then have tried to compile examples. Some examples are new, ‘rust-hello-world’ is one of them. I can not compile the ‘rust-hello-world’ on iotlab-m3 board, so I take steps as the followings[1].

$ curl https://sh.rustup.rs -sSf | sh $ source $HOME/.cargo/env $ make

I have tried to compile again, but compiling is failed. Error message is as following[2].

. . . Compiling riot-sys v0.7.6 error: failed to run custom build command for riot-sys v0.7.6

Caused by: process didn’t exit successfully: /home/user/RIOT/examples/rust-hello-world/bin/iotlab-m3/target/release/build/riot-sys-ec74ba235dd0869d/build-script-build (exit status: 101)

I have two questions about this problem.

(1) Is steps of [1] correct for compiling ‘rust-hello-world’ ?. If no, please let me know the correct steps, for examples what are necessary libraries and how to download, install them.

(2) Have anyone experienced the same error message [2] ?. How to resolve error message [2] ?.

Thank you and best regards Dicek

Hello Dicek,

the actually helpful part of the error message is a bit further up in your backlog – probably C2Rust is missing.

The toolchain installation docs have the lines you’ll need to install c2rust. (In particular, the apt install line and the block below).

As you build for the iotlab-m3 board, you’ll also need the rustup target add line, but which version of thumb…something you will need you will best see once you’ve installed C2Rust and get an error message about the core library being missing for a particular target.

Hello chrysn and riot users, developpers,

Thank you for providing helpful information. I consult the toolchain installation docs to install c2rust on my PC. It will solve the problem to compile rust-hello-world example.

But it causes the different problem. On the way to execute the toolchain installation docs, the disk space become short to continue installing. The error message is as following,

user@riot-vm:~$ rustup install nightly-2019-12-05 info: syncing channel updates for ‘nightly-2019-12-05-x86_64-unknown-linux-gnu’ info: latest update on 2019-12-05, rust version 1.41.0-nightly (6d77e45f0 2019-12-04) info: downloading component ‘cargo’ 4.7 MiB / 4.7 MiB (100 %) 288.0 KiB/s in 15s ETA: 0s info: downloading component ‘clippy’ 1.8 MiB / 1.8 MiB (100 %) 387.3 KiB/s in 5s ETA: 0s info: downloading component ‘rust-docs’ 11.9 MiB / 11.9 MiB (100 %) 419.2 KiB/s in 29s ETA: 0s info: downloading component ‘rust-std’ 17.7 MiB / 17.7 MiB (100 %) 390.4 KiB/s in 43s ETA: 0s info: downloading component ‘rustc’ 58.3 MiB / 58.3 MiB (100 %) 1.2 MiB/s in 2m 34s ETA: 0s info: downloading component ‘rustc-dev’ 166.0 MiB / 166.0 MiB (100 %) 1.7 MiB/s in 1m 26s ETA: 0s info: downloading component ‘rustfmt’ 3.0 MiB / 3.0 MiB (100 %) 1.5 MiB/s in 2s ETA: 0s info: installing component ‘cargo’ info: installing component ‘clippy’ info: installing component ‘rust-docs’ info: rolling back changes error: failed to extract package (perhaps you ran out of disk space?): No space left on device (os error 28)

I use the Vagrantfile attached on the top directory of RIOT-master. Virtual Machine is Oracle VirtualBox 6.0.12. Now even if I can extend the storage size (RIOT-VM-disk001.vmdk) of VIrtualBox from 10GB to 20GB, I can not extend the storage size on the Ubuntu18.04. The result of “df -h” command is

Filesystem Size Used Avail Use% Mounted on udev 472M 0 472M 0% /dev tmpfs 99M 536K 98M 1% /run /dev/mapper/riot–vm–vg-root 8.9G 8.3G 88M 99% / tmpfs 493M 0 493M 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 493M 0 493M 0% /sys/fs/cgroup home_user_RIOT 238G 90G 149G 38% /home/user/RIOT tmpfs 99M 0 99M 0% /run/user/1000

I guess if /dev/mapper/riot–vm–vg-root size is extended, this problem will be solved. All Ubuntu18.04 environment on the attached Vagrantfile must have the same problem. I have tried to do it, but I have not succeeded yet. Are there any solution ?.

Thank you and best regards, Dicek.

I have no experience with vagrant or its setup of virtual machines; I just build on a regular Linux system (and only resort to building in Docker if something breaks host-side). What I can tell you of Virtualbox and Linux setups is that if you resize the outer disk, you’ll later have to resize the partitions and file systems too, which the gparted tool should manage to do easily once the disk image is enlarged. (But I can’t tell you whether that’s a workflow that makes sense with vagrant).

Pinging @cgundogan as the most regular contributor to the Vagrantfile: Is this even still current? (I see something about Ubuntu 18.04 in there while our docker images all use 20.04 now).

If the vagrant issue can not be resolved quickly, and you prefer to run in some form of virtualization, you may consider just using RIOT in your host system – it should require nothing but regular tools (GNU Make, Python 3, git) if you defer the actual building to the Docker image by passing BUILD_IN_DOCKER=1 to the make line.

(By the way, please use the preview to check formatting; when you copy-paste terminal output, the easiest way to get it readable is to wrap it in ``` lines.)

Hello chrysn,

I tried to extend disk storage size on the Ubuntu18.04, but it was too difficult for me to do it. So I gave up to adopt Ubuntu18.04.

Now the development environment is switched to Ubuntu20.04. Installing Rust components, library and toolchains is succeeded. Of course disk size is no problem. And compiling rust-hello-world, rust-gcoap with BUILD_IN_DOCKER=1 to the make line is also succeeded.

Thank you very much for helpful information.

Thank you and best regards. DiceK.

1 Like