rust-lang / rust-lang/rustup

Install on Chromebook Pixel (crosvm) places files in wrong place

Open
#1,911 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I own a Chromebook Pixel, and use the crosvm (debian) option to do some coding. I tried installing Rust, and the installer placed files in the incorrect location.

Steps

  1. I looked up the command linked here https://www.rust-lang.org/tools/install
  2. I'm used to this kind of thing failing without privs, so I added a sudo before the sh and ran it, eg curl https://sh.rustup.rs -sSf | sudo sh
  3. The installer displayed something like the following
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/pgburt/.cargo/bin

This path will then be added to your PATH environment variable by modifying the
profile files located at:

  /home/pgburt/.profile
  /home/pgburt/.bash_profile

You can uninstall at any time with rustup self uninstall and these changes will
be reverted.

Current installation options:

   default host triple: x86_64-unknown-linux-gnu
     default toolchain: stable
  modify PATH variable: yes

1) Proceed with installation (default)1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
  1. I pressed 1 to do the default installation.
  2. The install appeared to succeed, but instructed me to run a script in $HOME/.cargo/env to set my PATH. When I tried running that script, I found nothing there.
  3. Trying to run rustup showed it wasn't registered.

I expected the install to put everything in my $HOME directory, which should be /home/pgburt. Instead, it placed the files in /root.

I was able to fix the problem by moving the directory to my actual $HOME, and running the env script. I got a error: no default toolchain configured when running rustc after that, so was able to fix by running rustup install stable which seems to work.

Meta

In lieu of a rustc version, I can run curl https://sh.rustup.rs -sSf | less and see the value: rustup-init 1.18.3 (302899482 2019-05-22)

ChromeOS: Version 74.0.3729.159 (Official Build) (64-bit)

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

Read the installer entry point exposed by sh.rustup.rs and rustup-init 1.18.3, focusing on how sudo affects HOME and installation paths. Reproduce the command on the reported ChromeOS/crosvm setup and verify that files and ~/.cargo/env are placed under /home/pgburt rather than /root, with rustup usable afterward.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.