From a1610e3c100a613bbac38112b31e0469ff06f83b Mon Sep 17 00:00:00 2001 From: klensy Date: Wed, 23 Aug 2023 17:15:58 +0300 Subject: [PATCH 1/4] copy build-gcc.sh for dist-i686-linux from dist-x86_64-linux --- .../host-x86_64/dist-i686-linux/Dockerfile | 2 +- .../host-x86_64/dist-i686-linux/build-gcc.sh | 45 +++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/ci/docker/host-x86_64/dist-i686-linux/build-gcc.sh diff --git a/src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile index f5274104d60ac..6e47e10fac7a5 100644 --- a/src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile @@ -44,7 +44,7 @@ RUN mkdir /home/user COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/ # Need at least GCC 5.1 to compile LLVM nowadays -COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/ +COPY host-x86_64/dist-i686-linux/build-gcc.sh /tmp/ RUN ./build-gcc.sh && yum remove -y gcc gcc-c++ COPY scripts/cmake.sh /tmp/ diff --git a/src/ci/docker/host-x86_64/dist-i686-linux/build-gcc.sh b/src/ci/docker/host-x86_64/dist-i686-linux/build-gcc.sh new file mode 100644 index 0000000000000..6da3f89220e23 --- /dev/null +++ b/src/ci/docker/host-x86_64/dist-i686-linux/build-gcc.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +set -ex + +source shared.sh + +GCC=8.5.0 + +curl https://ftp.gnu.org/gnu/gcc/gcc-$GCC/gcc-$GCC.tar.xz | xzcat | tar xf - +cd gcc-$GCC + +# FIXME(#49246): Remove the `sed` below. +# +# On 2018 March 21st, two Travis builders' cache for Docker are suddenly invalidated. Normally this +# is fine, because we just need to rebuild the Docker image. However, it reveals a network issue: +# downloading from `ftp://gcc.gnu.org/` from Travis (using passive mode) often leads to "Connection +# timed out" error, and even when the download completed, the file is usually corrupted. This causes +# nothing to be landed that day. +# +# We observed that the `gcc-4.8.5.tar.bz2` above can be downloaded successfully, so as a stability +# improvement we try to download from the HTTPS mirror instead. Turns out this uncovered the third +# bug: the host `gcc.gnu.org` and `cygwin.com` share the same IP, and the TLS certificate of the +# latter host is presented to `wget`! Therefore, we choose to download from the insecure HTTP server +# instead here. +# +sed -i'' 's|ftp://gcc\.gnu\.org/|https://gcc.gnu.org/|g' ./contrib/download_prerequisites + +./contrib/download_prerequisites +mkdir ../gcc-build +cd ../gcc-build +hide_output ../gcc-$GCC/configure \ + --prefix=/rustroot \ + --enable-languages=c,c++ \ + --disable-gnu-unique-object +hide_output make -j$(nproc) +hide_output make install +ln -s gcc /rustroot/bin/cc + +cd .. +rm -rf gcc-build +rm -rf gcc-$GCC + +# FIXME: clang doesn't find 32-bit libraries in /rustroot/lib, +# but it does look all the way under /rustroot/lib/[...]/32, +# so we can link stuff there to help it out. +ln /rustroot/lib/*.{a,so} -rst /rustroot/lib/gcc/x86_64-pc-linux-gnu/$GCC/32/ From 5ae8838ee36a65b744a2ecde180f47623cd80544 Mon Sep 17 00:00:00 2001 From: klensy Date: Wed, 23 Aug 2023 17:21:15 +0300 Subject: [PATCH 2/4] dist-x86_64-linux: for gcc add --disable-multilib, as there no need to build 32-bit. Remove linked 32-bit libraries, dist-i686-linux have it's own build-gcc.sh --- src/ci/docker/host-x86_64/dist-x86_64-linux/build-gcc.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gcc.sh b/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gcc.sh index 6da3f89220e23..08615bc91e7ae 100755 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gcc.sh +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/build-gcc.sh @@ -30,7 +30,8 @@ cd ../gcc-build hide_output ../gcc-$GCC/configure \ --prefix=/rustroot \ --enable-languages=c,c++ \ - --disable-gnu-unique-object + --disable-gnu-unique-object \ + --disable-multilib hide_output make -j$(nproc) hide_output make install ln -s gcc /rustroot/bin/cc @@ -38,8 +39,3 @@ ln -s gcc /rustroot/bin/cc cd .. rm -rf gcc-build rm -rf gcc-$GCC - -# FIXME: clang doesn't find 32-bit libraries in /rustroot/lib, -# but it does look all the way under /rustroot/lib/[...]/32, -# so we can link stuff there to help it out. -ln /rustroot/lib/*.{a,so} -rst /rustroot/lib/gcc/x86_64-pc-linux-gnu/$GCC/32/ From 9154a8f0c820d1e95f524613daed8f0771fc4dc9 Mon Sep 17 00:00:00 2001 From: klensy Date: Wed, 23 Aug 2023 17:29:08 +0300 Subject: [PATCH 3/4] [dont merge] handmade try --- .github/workflows/ci.yml | 11 +---------- src/ci/github-actions/ci.yml | 12 ++---------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3680136d89ff7..2bc965c0d5033 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,16 +49,7 @@ jobs: strategy: matrix: include: - - name: mingw-check - os: ubuntu-20.04-4core-16gb - env: {} - - name: mingw-check-tidy - os: ubuntu-20.04-4core-16gb - env: {} - - name: x86_64-gnu-llvm-15 - os: ubuntu-20.04-16core-64gb - env: {} - - name: x86_64-gnu-tools + - name: dist-x86_64-linux os: ubuntu-20.04-16core-64gb env: {} timeout-minutes: 600 diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index 89b82d59d3176..ecc09675c5b0d 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -315,16 +315,8 @@ jobs: strategy: matrix: include: - - name: mingw-check - <<: *job-linux-4c - - - name: mingw-check-tidy - <<: *job-linux-4c - - - name: x86_64-gnu-llvm-15 - <<: *job-linux-16c - - - name: x86_64-gnu-tools + - &dist-x86_64-linux + name: dist-x86_64-linux <<: *job-linux-16c auto: From a5d18e53340c0604f5756ae81c29f639ea0c2360 Mon Sep 17 00:00:00 2001 From: klensy Date: Wed, 23 Aug 2023 19:19:34 +0300 Subject: [PATCH 4/4] dist-x86_64-linux: don't install i686 libs in docker --- src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile index 319989df33460..82b54133b56f8 100644 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile @@ -15,10 +15,8 @@ RUN yum upgrade -y && \ gcc \ gcc-c++ \ git \ - glibc-devel.i686 \ glibc-devel.x86_64 \ libedit-devel \ - libstdc++-devel.i686 \ libstdc++-devel.x86_64 \ make \ ncurses-devel \ @@ -30,7 +28,6 @@ RUN yum upgrade -y && \ unzip \ wget \ xz \ - zlib-devel.i686 \ zlib-devel.x86_64 \ && yum clean all