Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Problem with Rustup install #1719

Open
hanusek opened this issue Feb 5, 2021 · 2 comments
Open

Problem with Rustup install #1719

hanusek opened this issue Feb 5, 2021 · 2 comments

Comments

@hanusek
Copy link

hanusek commented Feb 5, 2021

...
Step 7/10 : RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
 ---> Running in 66b400ac9551
info: downloading installer
info: profile set to 'default'
info: default host triple is x86_64-unknown-linux-gnu
warning: Updating existing toolchain, profile choice will be ignored
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2020-12-31, rust version 1.49.0 (e1884a8e3 2020-12-29)
info: downloading component 'rust-std' for 'arm-unknown-linux-gnueabihf'
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: removing previous version of component 'rust-std' for 'arm-unknown-linux-gnueabihf'
info: rolling back changes
error: could not rename component file from '/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib' to '/root/.rustup/tmp/3nxrhxq47i0kq99__dir/bk'
error: caused by: other os error
The command '/bin/sh -c curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y' returned a non-zero code: 1

Dockerfile:

FROM energotest/rust:arm-unknown-linux-gnueabihf

ENV DEBIAN_FRONTEND=noninteractive
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/arm-linux-gnueabihf/pkgconfig
ENV PKG_CONFIG_ALLOW_CROSS=1

RUN apt-get update && apt-get install -y --no-install-recommends apt-utils

RUN dpkg --add-architecture armhf && \
    apt-get update && \
    apt-get install --assume-yes libpthread-stubs0-dev:armhf && \
    apt-get install --assume-yes libudev-dev:armhf && \
    apt-get install --assume-yes libudev1:armhf


#RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

# Add .cargo/bin to PATH
ENV PATH="/root/.cargo/bin:${PATH}"

# Check cargo is visible
RUN cargo --help

RUN rustup target add arm-unknown-linux-gnueabihf

Please help!

@Xanewok
Copy link
Member

Xanewok commented Feb 10, 2021

This seems like it's related to the rustup tool rather than RLS. @kinnison do you have any idea what may cause this in Docker environment?

@kinnison
Copy link

Sorry for the delay, work has been frantic for the past month or so. This kind of problem is because Docker often doesn't cope well with removing things from one layer in a new layer atop it.

In general we recommend you do not try to change the toolchain if you have a docker with a toolchain embedded in it because Docker simply cannot cope. You should either ensure your baseline container has no toolchain in it and so rustup can cleanly install the toolchain you want; or else it should contain exactly the toolchain you want as docker can't cope with updating it.

Sadly this is not something we can easily fix in rustup because of the way Docker works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants