rustup: Rustup installation failure at installing rustc component
`pi@raspberrypi:~ $ curl --proto ‘=https’ --tlsv1.2 -sSf https://sh.rustup.rs | sh info: downloading installer
Welcome to Rust!
This will download and install the official compiler for the Rust programming language, and its package manager, Cargo.
It will add the cargo, rustc, rustup and other commands to Cargo’s bin directory, located at:
/home/pi/.cargo/bin
This can be modified with the CARGO_HOME environment variable.
Rustup metadata and toolchains will be installed into the Rustup home directory, located at:
/home/pi/.rustup
This can be modified with the RUSTUP_HOME environment variable.
This path will then be added to your PATH environment variable by modifying the profile file located at:
/home/pi/.profile
You can uninstall at any time with rustup self uninstall and these changes will be reverted.
Current installation options:
default host triple: arm-unknown-linux-gnueabihf default toolchain: stable profile: default modify PATH variable: yes
- Proceed with installation (default)
- Customize installation
- Cancel installation
1
info: profile set to ‘default’ info: syncing channel updates for ‘stable-arm-unknown-linux-gnueabihf’ info: latest update on 2019-11-07, rust version 1.39.0 (4560ea788 2019-11-04) warning: Force-skipping unavailable component ‘clippy-arm-unknown-linux-gnueabihf’ warning: Force-skipping unavailable component ‘rustfmt-arm-unknown-linux-gnueabihf’ info: downloading component ‘cargo’ 4.3 MiB / 4.3 MiB (100 %) 2.1 MiB/s in 3s ETA: 0s info: downloading component ‘rust-std’ 182.6 MiB / 182.6 MiB (100 %) 1.9 MiB/s in 2m 15s ETA: 0s info: downloading component ‘rustc’ 49.3 MiB / 49.3 MiB (100 %) 2.1 MiB/s in 30s ETA: 0s info: installing component ‘cargo’ 4.3 MiB / 4.3 MiB (100 %) 1.6 MiB/s in 3s ETA: 0s info: installing component ‘rust-std’ 182.6 MiB / 182.6 MiB (100 %) 1.5 MiB/s in 3m 23s ETA: 0s 5 iops / 5 iops (100 %) 0 iops/s in 14s ETA: 49710d 6h 28m 15s info: installing component ‘rustc’ 31.1 MiB / 49.3 MiB ( 63 %) 1.2 MiB/s in 38s ETA: 14smemory allocation of 146176856 bytes failedAborted `
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 22 (9 by maintainers)
I now get the same error on my Raspberry Pi 4 with 4 GB RAM (> 3 GB free) and had to reduce the the unpack size even more.
RUSTUP_UNPACK_RAM=20000000worked, but this is < 20 MiB and thus smaller thanrustc, weird.I was able to install 1.44.1 using RUSTUP_UNPACK_RAM=200000000 fore rustup install
Rustup assumes that the average Rust program needs around 400M of RAM to build/link and as such that it’s fair for it to use around that for processing IO as quickly as it can. If you are having difficulty with that, we do have some environment variables you can tweak to see if that helps:
https://github.com/rust-lang/rustup/#environment-variables
In particular
RUSTUP_UNPACK_RAMwhich defaults to419430400(400 * 1024 * 1024) could be lowered. Though it’s worth noting that cannot be below the size of the largest component whichrustuphas to unpack which is likely to be 70 to 90 megabytes for LLVM or librustc.Good luck, and pop along to
#wg-rustupon our discord if you want to discuss ways we might detect this kind of situation and self-limit. I’m not sure of a platform-independent way to detect available RAM.@sunknudsen It’s less about installling on older Rust and more about installing either 1.23.1 of rustup (hard) or the beta copy (medium difficulty) or waiting for the new release (takes time). If you want to do the middle one, then you need to do:
export RUSTUP_UPDATE_ROOT=https://dev-static.rust-lang.org/rustupbefore the usual installation sequence you already know. But you need to remember that export command each time you use rustup until the next release.cc @kinnison & @Manishearth – the issue should probably be transferred to the rustup repo.