rust-lang / rust-lang/rustup

using rustup in debian:latest docker image on macos x86_64 gives wrong version of rust (that won't run)

Open
#3,544 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Problem

installing rust via rustup on a debian:latest dockerimage on macos x86_64 seems to install 32 bit version of rust that doesn't run under the image.

$ rustc
error: command failed: 'rustc': No such file or directory (os error 2)

Steps

Dockerfile

FROM debian:latest

RUN apt-get update
RUN apt-get install -y gcc libc6-dev wget curl file
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

CMD bash

$ docker build . --progress=plain -t rustdev > builder.log 2>&1
$ docker run -it rustdev bash

Possible Solution(s)

No response

Notes

$ file ~/.cargo/bin/rustc

/root/.cargo/bin/rustc: ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, with debug_info, not stripped
Rustup version
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `(error reading rustc version)`
Installed toolchains
Default host: x86_64-unknown-linux-gnu
rustup home:  /root/.rustup

stable-x86_64-unknown-linux-gnu (default)
(error reading rustc version)

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

Start by reproducing the issue with the Dockerfile in the report on macOS x86_64, then inspect the installed rustc with file and compare it with the reported x86_64-unknown-linux-gnu host. Read the rustup installation and host-detection behavior involved in that environment. Done means rustup installs a rustc binary that runs successfully in the debian:latest container.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, rust
Domain
devops, tooling
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.