diff --git a/Dockerfile b/Dockerfile index b660c9e..f765f6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,14 +31,4 @@ WORKDIR /app RUN git clone https://github.com/Artisan-Lab/RAP.git . -WORKDIR /app/rap - -RUN git submodule update --init --recursive; \ - cp ./config.toml ./rust/ - -WORKDIR /app/rap/rust - -RUN ./x.py build --stage 2 compiler/rustc; \ - rustup toolchain link stage2 build/${HOST_TRIPLE}/stage2; \ - -ENTRYPOINT ["top", "-b"] +RUN ./install.sh diff --git a/install.sh b/install.sh index 93ccf56..0fc6360 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + # Define color variables BLUE='\033[0;34m' GREEN='\033[0;32m' @@ -31,6 +33,11 @@ if [ ! -f "$toolchain_file" ]; then exit 1 fi +if ! rustup toolchain install "$toolchain_date" --profile minimal --component rustc-dev,rust-src,llvm-tools-preview; then + printf "%bError: Failed to install toolchain %s.%b\n" "${RED}" "$toolchain_date" "${NC}" + exit 1 +fi + os_type=$(uname -s) arch_type=$(uname -m)