From e126ceb46d5f24015f0644df5d360fa9209d48be Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 14 Mar 2024 15:26:49 +0100 Subject: [PATCH 1/2] Greatly reduce GCC build logs --- .../host-x86_64/dist-x86_64-linux/build-gccjit.sh | 12 ++++++++---- .../docker/host-x86_64/x86_64-gnu-llvm-16/Dockerfile | 3 ++- .../docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile | 3 ++- .../docker/host-x86_64/x86_64-gnu-tools/Dockerfile | 3 ++- 4 files changed, 14 insertions(+), 7 deletions(-) mode change 100644 => 100755 src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh b/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh old mode 100644 new mode 100755 index 324dd5fac161e..2c65522cc1e94 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh @@ -1,9 +1,11 @@ -#!/bin/sh +#!/usr/bin/env bash set -ex cd $1 +source shared.sh + # Setting up folders for GCC git clone https://github.com/antoyo/gcc gcc-src cd gcc-src @@ -20,9 +22,11 @@ cd ../gcc-build --enable-checking=release \ --disable-bootstrap \ --disable-multilib \ - --prefix=$(pwd)/../gcc-install -make -make install + --prefix=$(pwd)/../gcc-install \ + --quiet + +hide_output make +hide_output make install rm -rf ../gcc-src ln -s /scripts/gcc-install/lib/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-16/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-16/Dockerfile index 6540a500d3a58..4fc2b2e507e0d 100644 --- a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-16/Dockerfile +++ b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-16/Dockerfile @@ -59,8 +59,9 @@ ENV RUST_CONFIGURE_ARGS \ COPY host-x86_64/x86_64-gnu-llvm-16/script.sh /tmp/ +COPY host-x86_64/dist-x86_64-linux/shared.sh /scripts/ COPY host-x86_64/dist-x86_64-linux/build-gccjit.sh /scripts/ -RUN sh /scripts/build-gccjit.sh /scripts +RUN /scripts/build-gccjit.sh /scripts ENV SCRIPT /tmp/script.sh diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile index ed4e1978c5d40..7c2ecd198e234 100644 --- a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile +++ b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile @@ -58,8 +58,9 @@ ENV RUST_CONFIGURE_ARGS \ COPY host-x86_64/x86_64-gnu-llvm-16/script.sh /tmp/ +COPY host-x86_64/dist-x86_64-linux/shared.sh /scripts/ COPY host-x86_64/dist-x86_64-linux/build-gccjit.sh /scripts/ -RUN sh /scripts/build-gccjit.sh /scripts +RUN /scripts/build-gccjit.sh /scripts ENV SCRIPT /tmp/script.sh diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile index a03577b45112b..6f72056989818 100644 --- a/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile +++ b/src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile @@ -95,9 +95,10 @@ ENV RUST_CONFIGURE_ARGS \ ENV HOST_TARGET x86_64-unknown-linux-gnu +COPY host-x86_64/dist-x86_64-linux/shared.sh /scripts/ COPY host-x86_64/dist-x86_64-linux/build-gccjit.sh /scripts/ -RUN sh /scripts/build-gccjit.sh /scripts +RUN /scripts/build-gccjit.sh /scripts ENV SCRIPT /tmp/checktools.sh ../x.py && \ NODE_PATH=`npm root -g` python3 ../x.py test tests/rustdoc-gui --stage 2 \ From c4ece1f4c8862724fe195bf5bf0d4dcaa76b7686 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 15 Mar 2024 11:33:14 +0100 Subject: [PATCH 2/2] Build GCC with as many threads as available --- src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh b/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh index 2c65522cc1e94..b22d60f2b1d10 100755 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gccjit.sh @@ -16,16 +16,16 @@ mkdir ../gcc-build ../gcc-install cd ../gcc-build # Building GCC. -../gcc-src/configure \ +hide_output \ + ../gcc-src/configure \ --enable-host-shared \ --enable-languages=jit \ --enable-checking=release \ --disable-bootstrap \ --disable-multilib \ --prefix=$(pwd)/../gcc-install \ - --quiet -hide_output make +hide_output make -j$(nproc) hide_output make install rm -rf ../gcc-src