Problem
rustup 1.24.1 fails to install Rust 1.38.0 on Windows in Travis CI due to failure to allocate memory. Interestingly installing Rust 1.51.1 with this version of rustup does succeed. Here's an example log:
$ curl -LSso /tmp/rustup.sh https://sh.rustup.rs && sh /tmp/rustup.sh -y --default-toolchain "$RUST_TOOLCHAIN" --profile minimal
Warning: Not enforcing strong cipher suites for TLS, this is potentially less secure
info: downloading installer
info: profile set to 'minimal'
info: default host triple is x86_64-pc-windows-msvc
info: syncing channel updates for '1.38.0-x86_64-pc-windows-gnu'
info: latest update on 2019-09-26, rust version 1.38.0 (625451e37 2019-09-23)
info: downloading component 'cargo'
info: downloading component 'rust-mingw'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: installing component 'cargo'
info: using up to 500.0 MiB of RAM to unpack components
info: installing component 'rust-mingw'
info: installing component 'rust-std'
memory allocation of 16777216 bytes failed
The command "curl -LSso /tmp/rustup.sh https://sh.rustup.rs && sh /tmp/rustup.sh -y --default-toolchain "$RUST_TOOLCHAIN" --profile minimal" exited with 1.
Installing Rust 1.38.0 in this environment works with rustup 1.23.1.
Steps
Possible Solution(s)
Pinning rustup to 1.23.1 successfully installs Rust 1.38.0.
Notes
Output of rustup --version:
Output of rustup show:
Same issue on GitHub Actions
C:\Rust\.cargo\bin\rustup.exe default nightly
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
info: latest update on 2021-05-04, rust version 1.54.0-nightly (716394d65 2021-05-03)
info: downloading component 'cargo'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: installing component 'cargo'
info: using up to 500.0 MiB of RAM to unpack components
info: installing component 'rust-std'
info: installing component 'rustc'
memory allocation of 16777216 bytes failed
Error: The process 'C:\Rust\.cargo\bin\rustup.exe' failed with exit code 3221226505
Yes!, this seems to be the same issue I observed yesterday.
From https://github.com/rust-lang/rustup/issues/2717#issuecomment-831377775:
I think this is the same issue, but I'm not 100% sure, my apologies if it isn't.
@rbtcollins It may potentially still be an issue
On the github CI which has 500MB allocated RAM, rustup seems to sometimes time out with Rustup 1.24.1 too:
DetailsIn cargo-msrv, I use rustup to install different toolchain versions as required, and I have been tracking down an issue where downloads through rustup fail to complete. This happened primarily on CI machines (so far, I assume because of limited memory). It doesn't always fail (e.g. foresterre/cargo-msrv#72 (checks)) , and so far, I've only observed failures on Windows machines.
I saw it once happen on a local Windows machine (with 32GB RAM), but can't reproduce it consistently (or even once anymore).
I'm happy to further help tracking this down, but I'm not sure where to start.
Edit: it seems like another issue, #2748 was opened which more completely describes my issue
I think we'll have to look to a 1.24.2 after the Rust release (so perhaps next week)