-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rustup installation failure at installing rustc component #2128
Comments
That is around 140MB allocating memory. If you have a 1GB Raspberry Pi model it may be too much. I wonder why rustup allocated so much memory. |
cc @kinnison & @Manishearth -- the issue should probably be transferred to the rustup repo. |
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 Good luck, and pop along to |
i did set the RUSTUP_UNPACK_RAM=90 X 1024 X 1024 |
The value in |
I was able to install 1.44.1 using RUSTUP_UNPACK_RAM=200000000 fore rustup install |
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. |
That is quite surprising @loehden - Are you running a 32bit or a 64bit userland on that Pi 4? |
I'd be interested in whether this patch: #2756 behaves better. |
Sorry, I must have missed my email notifications. And thanks for the fast replies! @kinnison: I am using 32 bit Raspberry Pi OS. @rbtcollins: Since the patch has been merged into master now, I guess I will see results at the next update, right? For the current update I still had to use the workaround (got the same error, even had to use |
I've updated the beta post on the users forum @loehden - If you get a chance, could you try https://internals.rust-lang.org/t/seeking-testers-for-rustup-1-24-2-beta/14634/6 ? |
@loehden @kinnison I am experiencing same issue on Raspberry Pi 3B (1GB RAM) and Pi 4B (4GB RAM). Used to be able to run |
@sunknudsen If you've time you can check out the beta version linked above, otherwise if you can wait a couple of days we'll have the beta released properly as 1.24.2 |
Thanks @kinnison. Unfortunately, I know little about Rust ecosystem… Is there a way to install older version of Rust using |
You can install the toolchain for a specified date:
About the toolchain, you can refer to https://rust-lang.github.io/rustup/concepts/toolchains.html this docs. |
@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: |
Thanks for helping out @kinnison! |
@sunknudsen You're very welcome, thank you for being patient with this :D |
Here is how to make this work on an RPI with less than 500mbs available physical memory. If you are using say, an RPI zero 2, you will have 500mb's of physical mem. Some of that will be taken by the system. Rustc needs 500mbs of mem to compile. So there is a problem. Standard raspbian setup will have 99mb swap, and will used about 50 mbs of that. So increasing your swap file will solve the mem issue. Making the swap file 200mbs should be more than enough. Run the following commands to increase the swap size. Now rustc will compile and install just fine. |
`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
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
`
The text was updated successfully, but these errors were encountered: