rust-lang / rust-lang/rustup

rustup-init fails to copy itself to CARGO_HOME with OS error 11 (EAGAIN)

Open
#3,328 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
22h 40m
Merged PRs (30d)
46

Description

Problem

I'm running into an install issue where the downloaded rustup-init binary fails to copy itself into CARGO_HOME :

> env RUSTUP_HOME=/tmp/rustup CARGO_HOME=/tmp/rustup/Cargo /tmp/rustup-install.sh  --profile minimal --no-modify-path -y
info: downloading installer
warning: it looks like you have an existing installation of Rust at:
warning: /usr/bin
warning: rustup should not be installed alongside Rust. Please uninstall your existing Rust first.
warning: Otherwise you may have confusion unless you are careful with your PATH
warning: If you are sure that you want both rustup and your already installed Rust
warning: then please reply `y' or `yes' or set RUSTUP_INIT_SKIP_PATH_CHECK to yes
warning: or pass `-y' to ignore all ignorable checks.
error: cannot install while Rust is installed
warning: continuing (because the -y flag is set and the error is ignorable)
error: could not copy file from '/tmp/tmp.xxJfK1RrCn/rustup-init' to '/tmp/rustup/Cargo/bin/rustup': Resource temporarily unavailable (os error 11)
Steps
  1. (optional) download the install script from rustup.rs and save it
  2. execute it as shown above
Possible Solution(s)

I think the failing copy operation must be using sendfile(2) behind the scenes because this function is apparent problematic on Linux when the destination is on a ZFS pool (I'm running ZFS 2.1.2). Indeed, the issue doesn't arise when I point RUSTUP_HOME and CARGO_HOME to a tmpfs volume.

My current workaround has been to download the correct rustup-init binary myself, move it to /desired/location/rustup and then figure out how to invoke it to obtain the install I was after (stable/minimal). Fortunately this is possible without further EAGAIN errors.

Notes

No response

Rustup version
rustup 1.25.2 (17db695f1 2023-02-01)
Installed toolchains
N/A because the error occurs before anything else gets installed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source files or tests are named. Reproduce the installer command with CARGO_HOME and RUSTUP_HOME on ZFS and tmpfs, then trace the copy of rustup-init into CARGO_HOME/bin/rustup. Done means the installation completes without the EAGAIN copy error on the affected filesystem.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.