Skip to content

Commit 8d7adae

Browse files
committed
ci: Update dist-{i686,x86_64}-linux to CentOS 6
1 parent 7750c3d commit 8d7adae

File tree

5 files changed

+67
-110
lines changed

5 files changed

+67
-110
lines changed

src/ci/docker/dist-i686-linux/Dockerfile

Lines changed: 30 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,72 @@
1-
FROM centos:5
1+
FROM centos:6
22

33
WORKDIR /build
44

5-
# Centos 5 is EOL and is no longer available from the usual mirrors, so switch
6-
# to http://vault.centos.org/
7-
RUN sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
8-
RUN sed -i 's/mirrorlist/#mirrorlist/' /etc/yum.repos.d/*.repo
9-
RUN sed -i 's|#\(baseurl.*\)mirror.centos.org/centos/$releasever|\1vault.centos.org/5.11|' /etc/yum.repos.d/*.repo
5+
# Centos 6 is near EOL and will no longer be available from the usual mirrors,
6+
# so we'll need to switch to http://vault.centos.org/
7+
# RUN sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
8+
# RUN sed -i 's/mirrorlist/#mirrorlist/' /etc/yum.repos.d/*.repo
9+
# RUN sed -i 's|#\(baseurl.*\)mirror.centos.org/centos/$releasever|\1vault.centos.org/6.10|' /etc/yum.repos.d/*.repo
1010

11+
RUN yum install -y epel-release
1112
RUN yum upgrade -y && yum install -y \
12-
curl \
13+
autoconf \
1314
bzip2 \
15+
curl \
16+
file \
1417
gcc \
1518
gcc-c++ \
19+
gettext \
20+
git \
21+
glibc-devel.i686 \
22+
glibc-devel.x86_64 \
23+
libstdc++-devel.i686 \
24+
libstdc++-devel.x86_64 \
1625
make \
17-
glibc-devel \
26+
openssl-devel.i686 \
27+
openssl-devel.x86_64 \
1828
perl \
19-
zlib-devel \
20-
file \
21-
xz \
22-
which \
2329
pkgconfig \
30+
python34 \
2431
wget \
25-
autoconf \
26-
gettext
32+
which \
33+
xz \
34+
zlib-devel.i686 \
35+
zlib-devel.x86_64
2736

2837
ENV PATH=/rustroot/bin:$PATH
2938
ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib
3039
ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
3140
WORKDIR /tmp
3241
COPY dist-x86_64-linux/shared.sh /tmp/
3342

34-
# We need a build of openssl which supports SNI to download artifacts from
35-
# static.rust-lang.org. This'll be used to link into libcurl below (and used
36-
# later as well), so build a copy of OpenSSL with dynamic libraries into our
37-
# generic root.
38-
COPY dist-x86_64-linux/build-openssl.sh /tmp/
39-
RUN ./build-openssl.sh
40-
41-
# The `curl` binary on CentOS doesn't support SNI which is needed for fetching
42-
# some https urls we have, so install a new version of libcurl + curl which is
43-
# using the openssl we just built previously.
44-
#
45-
# Note that we also disable a bunch of optional features of curl that we don't
46-
# really need.
47-
COPY dist-x86_64-linux/build-curl.sh /tmp/
48-
RUN ./build-curl.sh
49-
5043
# binutils < 2.22 has a bug where the 32-bit executables it generates
5144
# immediately segfault in Rust, so we need to install our own binutils.
5245
#
5346
# See https://github.com/rust-lang/rust/issues/20440 for more info
5447
COPY dist-x86_64-linux/build-binutils.sh /tmp/
5548
RUN ./build-binutils.sh
5649

57-
# libssh2 (a dependency of Cargo) requires cmake 2.8.11 or higher but CentOS
58-
# only has 2.6.4, so build our own
59-
COPY dist-x86_64-linux/build-cmake.sh /tmp/
60-
RUN ./build-cmake.sh
61-
6250
# Need a newer version of gcc than centos has to compile LLVM nowadays
6351
COPY dist-x86_64-linux/build-gcc.sh /tmp/
6452
RUN ./build-gcc.sh
6553

66-
# CentOS 5.5 has Python 2.4 by default, but LLVM needs 2.7+
67-
COPY dist-x86_64-linux/build-python.sh /tmp/
68-
RUN ./build-python.sh
54+
# LLVM needs cmake 3.4.3 or higher, and is planning to raise to 3.13.4.
55+
# CentOS 6 only has cmake-2.8.12, or cmake3-3.6.1 in EPEL, so build our own.
56+
COPY dist-x86_64-linux/build-cmake.sh /tmp/
57+
RUN ./build-cmake.sh
6958

70-
# Now build LLVM+Clang 7, afterwards configuring further compilations to use the
59+
# Now build LLVM+Clang, afterwards configuring further compilations to use the
7160
# clang/clang++ compilers.
72-
COPY dist-x86_64-linux/build-clang.sh dist-x86_64-linux/llvm-project-centos.patch /tmp/
61+
COPY dist-x86_64-linux/build-clang.sh /tmp/
7362
RUN ./build-clang.sh
7463
ENV CC=clang CXX=clang++
7564

76-
# Apparently CentOS 5.5 desn't have `git` in yum, but we're gonna need it for
77-
# cloning, so download and build it here.
78-
COPY dist-x86_64-linux/build-git.sh /tmp/
79-
RUN ./build-git.sh
80-
8165
# for sanitizers, we need kernel headers files newer than the ones CentOS ships
8266
# with so we install newer ones here
8367
COPY dist-x86_64-linux/build-headers.sh /tmp/
8468
RUN ./build-headers.sh
8569

86-
# OpenSSL requires a more recent version of perl
87-
# with so we install newer ones here
88-
COPY dist-x86_64-linux/build-perl.sh /tmp/
89-
RUN ./build-perl.sh
90-
9170
COPY scripts/sccache.sh /scripts/
9271
RUN sh /scripts/sccache.sh
9372

@@ -100,7 +79,7 @@ ENV RUST_CONFIGURE_ARGS \
10079
--set target.i686-unknown-linux-gnu.linker=clang \
10180
--build=i686-unknown-linux-gnu \
10281
--set rust.jemalloc
103-
ENV SCRIPT python2.7 ../x.py dist --build $HOSTS --host $HOSTS --target $HOSTS
82+
ENV SCRIPT python3 ../x.py dist --build $HOSTS --host $HOSTS --target $HOSTS
10483
ENV CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_LINKER=clang
10584

10685
# This was added when we switched from gcc to clang. It's not clear why this is

src/ci/docker/dist-x86_64-linux/Dockerfile

Lines changed: 31 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,72 @@
1-
FROM centos:5
1+
FROM centos:6
22

33
WORKDIR /build
44

5-
# Centos 5 is EOL and is no longer available from the usual mirrors, so switch
6-
# to http://vault.centos.org/
7-
RUN sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
8-
RUN sed -i 's/mirrorlist/#mirrorlist/' /etc/yum.repos.d/*.repo
9-
RUN sed -i 's|#\(baseurl.*\)mirror.centos.org/centos/$releasever|\1vault.centos.org/5.11|' /etc/yum.repos.d/*.repo
5+
# Centos 6 is near EOL and will no longer be available from the usual mirrors,
6+
# so we'll need to switch to http://vault.centos.org/
7+
# RUN sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
8+
# RUN sed -i 's/mirrorlist/#mirrorlist/' /etc/yum.repos.d/*.repo
9+
# RUN sed -i 's|#\(baseurl.*\)mirror.centos.org/centos/$releasever|\1vault.centos.org/6.10|' /etc/yum.repos.d/*.repo
1010

11+
RUN yum install -y epel-release
1112
RUN yum upgrade -y && yum install -y \
12-
curl \
13+
autoconf \
1314
bzip2 \
15+
curl \
16+
file \
1417
gcc \
1518
gcc-c++ \
19+
gettext \
20+
git \
21+
glibc-devel.i686 \
22+
glibc-devel.x86_64 \
23+
libstdc++-devel.i686 \
24+
libstdc++-devel.x86_64 \
1625
make \
17-
glibc-devel \
26+
openssl-devel.i686 \
27+
openssl-devel.x86_64 \
1828
perl \
19-
zlib-devel \
20-
file \
21-
xz \
22-
which \
2329
pkgconfig \
30+
python34 \
2431
wget \
25-
autoconf \
26-
gettext
32+
which \
33+
xz \
34+
zlib-devel.i686 \
35+
zlib-devel.x86_64
2736

2837
ENV PATH=/rustroot/bin:$PATH
2938
ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib
3039
ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
3140
WORKDIR /tmp
3241
COPY dist-x86_64-linux/shared.sh /tmp/
3342

34-
# We need a build of openssl which supports SNI to download artifacts from
35-
# static.rust-lang.org. This'll be used to link into libcurl below (and used
36-
# later as well), so build a copy of OpenSSL with dynamic libraries into our
37-
# generic root.
38-
COPY dist-x86_64-linux/build-openssl.sh /tmp/
39-
RUN ./build-openssl.sh
40-
41-
# The `curl` binary on CentOS doesn't support SNI which is needed for fetching
42-
# some https urls we have, so install a new version of libcurl + curl which is
43-
# using the openssl we just built previously.
44-
#
45-
# Note that we also disable a bunch of optional features of curl that we don't
46-
# really need.
47-
COPY dist-x86_64-linux/build-curl.sh /tmp/
48-
RUN ./build-curl.sh
49-
5043
# binutils < 2.22 has a bug where the 32-bit executables it generates
5144
# immediately segfault in Rust, so we need to install our own binutils.
5245
#
5346
# See https://github.com/rust-lang/rust/issues/20440 for more info
5447
COPY dist-x86_64-linux/build-binutils.sh /tmp/
5548
RUN ./build-binutils.sh
5649

57-
# libssh2 (a dependency of Cargo) requires cmake 2.8.11 or higher but CentOS
58-
# only has 2.6.4, so build our own
59-
COPY dist-x86_64-linux/build-cmake.sh /tmp/
60-
RUN ./build-cmake.sh
61-
62-
# Build a version of gcc capable of building LLVM 6
50+
# Need a newer version of gcc than centos has to compile LLVM nowadays
6351
COPY dist-x86_64-linux/build-gcc.sh /tmp/
6452
RUN ./build-gcc.sh
6553

66-
# CentOS 5.5 has Python 2.4 by default, but LLVM needs 2.7+
67-
COPY dist-x86_64-linux/build-python.sh /tmp/
68-
RUN ./build-python.sh
54+
# LLVM needs cmake 3.4.3 or higher, and is planning to raise to 3.13.4.
55+
# CentOS 6 only has cmake-2.8.12, or cmake3-3.6.1 in EPEL, so build our own.
56+
COPY dist-x86_64-linux/build-cmake.sh /tmp/
57+
RUN ./build-cmake.sh
6958

70-
# Now build LLVM+Clang 7, afterwards configuring further compilations to use the
59+
# Now build LLVM+Clang, afterwards configuring further compilations to use the
7160
# clang/clang++ compilers.
72-
COPY dist-x86_64-linux/build-clang.sh dist-x86_64-linux/llvm-project-centos.patch /tmp/
61+
COPY dist-x86_64-linux/build-clang.sh /tmp/
7362
RUN ./build-clang.sh
7463
ENV CC=clang CXX=clang++
7564

76-
# Apparently CentOS 5.5 desn't have `git` in yum, but we're gonna need it for
77-
# cloning, so download and build it here.
78-
COPY dist-x86_64-linux/build-git.sh /tmp/
79-
RUN ./build-git.sh
80-
8165
# for sanitizers, we need kernel headers files newer than the ones CentOS ships
8266
# with so we install newer ones here
8367
COPY dist-x86_64-linux/build-headers.sh /tmp/
8468
RUN ./build-headers.sh
8569

86-
# OpenSSL requires a more recent version of perl
87-
# with so we install newer ones here
88-
COPY dist-x86_64-linux/build-perl.sh /tmp/
89-
RUN ./build-perl.sh
90-
9170
COPY scripts/sccache.sh /scripts/
9271
RUN sh /scripts/sccache.sh
9372

@@ -103,7 +82,7 @@ ENV RUST_CONFIGURE_ARGS \
10382
--set target.x86_64-unknown-linux-gnu.ranlib=/rustroot/bin/llvm-ranlib \
10483
--set llvm.thin-lto=true \
10584
--set rust.jemalloc
106-
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
85+
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
10786
ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=clang
10887

10988
# This is the only builder which will create source tarballs

src/ci/docker/dist-x86_64-linux/build-clang.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ cd llvm-project
1212
curl -L https://github.com/llvm/llvm-project/archive/$LLVM.tar.gz | \
1313
tar xzf - --strip-components=1
1414

15-
yum install -y patch
16-
patch -Np1 < ../llvm-project-centos.patch
17-
1815
mkdir clang-build
1916
cd clang-build
2017

@@ -35,6 +32,7 @@ INC="$INC:/usr/include"
3532

3633
hide_output \
3734
cmake ../llvm \
35+
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
3836
-DCMAKE_C_COMPILER=/rustroot/bin/gcc \
3937
-DCMAKE_CXX_COMPILER=/rustroot/bin/g++ \
4038
-DCMAKE_BUILD_TYPE=Release \

src/ci/docker/dist-x86_64-linux/build-cmake.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
set -ex
44
source shared.sh
55

6-
curl https://cmake.org/files/v3.6/cmake-3.6.3.tar.gz | tar xzf -
6+
CMAKE=3.13.4
7+
curl -L https://github.com/Kitware/CMake/releases/download/v$CMAKE/cmake-$CMAKE.tar.gz | tar xzf -
78

89
mkdir cmake-build
910
cd cmake-build
10-
hide_output ../cmake-3.6.3/configure --prefix=/rustroot
11+
hide_output ../cmake-$CMAKE/configure --prefix=/rustroot
1112
hide_output make -j10
1213
hide_output make install
1314

1415
cd ..
1516
rm -rf cmake-build
16-
rm -rf cmake-3.6.3
17+
rm -rf cmake-$CMAKE

src/ci/docker/dist-x86_64-linux/build-gcc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ ln -s gcc /rustroot/bin/cc
3737
cd ..
3838
rm -rf gcc-build
3939
rm -rf gcc-$GCC
40-
yum erase -y gcc gcc-c++ binutils
40+
yum erase -y gcc gcc-c++

0 commit comments

Comments
 (0)