Skip to content

Commit 75748a4

Browse files
committed
ci: Update dist-{i686,x86_64}-linux to Debian 6
This increases the minimum `{i686,x86_64}-unknown-linux-gnu` platform from RHEL/CentOS 5 (glibc 2.5 and kernel 2.6.18) to a slightly newer Debian 6 `squeeze` (glibc 2.11 and kernel 2.6.32). While that release is already EOL, it happens to match the minimum common versions of two enterprise distros that do still need Rust support -- RHEL 6 (glibc 2.12 and kernel 2.6.32) and SLES 11 SP4 (glibc 2.11 and kernel 3.0).
1 parent 7e11379 commit 75748a4

File tree

7 files changed

+101
-98
lines changed

7 files changed

+101
-98
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,44 @@
1-
FROM centos:5
1+
# We use Debian 6 (glibc 2.11, kernel 2.6.32) as a common base for other
2+
# distros that still need Rust support: RHEL 6 (glibc 2.12, kernel 2.6.32) and
3+
# SLES 11 SP4 (glibc 2.11, kernel 3.0).
4+
FROM debian:6
25

36
WORKDIR /build
47

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
8+
# Debian 6 is EOL and no longer available from the usual mirrors,
9+
# so we'll need to switch to http://archive.debian.org/
10+
RUN sed -i '/updates/d' /etc/apt/sources.list && \
11+
sed -i 's/httpredir/archive/' /etc/apt/sources.list
1012

11-
RUN yum upgrade -y && yum install -y \
12-
curl \
13+
RUN apt-get update && \
14+
apt-get install --allow-unauthenticated -y --no-install-recommends \
15+
automake \
1316
bzip2 \
17+
ca-certificates \
18+
curl \
19+
file \
20+
g++ \
21+
g++-multilib \
1422
gcc \
15-
gcc-c++ \
23+
gcc-multilib \
24+
git \
25+
lib32z1-dev \
26+
libedit-dev \
27+
libncurses-dev \
1628
make \
17-
glibc-devel \
29+
patch \
1830
perl \
19-
zlib-devel \
20-
file \
21-
xz \
22-
which \
23-
pkgconfig \
31+
pkg-config \
32+
unzip \
2433
wget \
25-
autoconf \
26-
gettext
34+
xz-utils \
35+
zlib1g-dev
2736

2837
ENV PATH=/rustroot/bin:$PATH
29-
ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib
38+
ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib
3039
ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
3140
WORKDIR /tmp
41+
RUN mkdir /home/user
3242
COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/
3343

3444
# We need a build of openssl which supports SNI to download artifacts from
@@ -38,14 +48,14 @@ COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/
3848
COPY host-x86_64/dist-x86_64-linux/build-openssl.sh /tmp/
3949
RUN ./build-openssl.sh
4050

41-
# The `curl` binary on CentOS doesn't support SNI which is needed for fetching
51+
# The `curl` binary on Debian 6 doesn't support SNI which is needed for fetching
4252
# some https urls we have, so install a new version of libcurl + curl which is
4353
# using the openssl we just built previously.
4454
#
4555
# Note that we also disable a bunch of optional features of curl that we don't
4656
# really need.
4757
COPY host-x86_64/dist-x86_64-linux/build-curl.sh /tmp/
48-
RUN ./build-curl.sh
58+
RUN ./build-curl.sh && apt-get remove -y curl
4959

5060
# binutils < 2.22 has a bug where the 32-bit executables it generates
5161
# immediately segfault in Rust, so we need to install our own binutils.
@@ -54,40 +64,24 @@ RUN ./build-curl.sh
5464
COPY host-x86_64/dist-x86_64-linux/build-binutils.sh /tmp/
5565
RUN ./build-binutils.sh
5666

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 host-x86_64/dist-x86_64-linux/build-cmake.sh /tmp/
60-
RUN ./build-cmake.sh
61-
62-
# Need a newer version of gcc than centos has to compile LLVM nowadays
67+
# Need at least GCC 5.1 to compile LLVM nowadays
6368
COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/
64-
RUN ./build-gcc.sh
69+
RUN ./build-gcc.sh && apt-get remove -y gcc g++
6570

66-
# CentOS 5.5 has Python 2.4 by default, but LLVM needs 2.7+
71+
# Debian 6 has Python 2.6 by default, but LLVM needs 2.7+
6772
COPY host-x86_64/dist-x86_64-linux/build-python.sh /tmp/
6873
RUN ./build-python.sh
6974

70-
# Now build LLVM+Clang 7, afterwards configuring further compilations to use the
75+
# LLVM needs cmake 3.4.3 or higher, and is planning to raise to 3.13.4.
76+
COPY host-x86_64/dist-x86_64-linux/build-cmake.sh /tmp/
77+
RUN ./build-cmake.sh
78+
79+
# Now build LLVM+Clang, afterwards configuring further compilations to use the
7180
# clang/clang++ compilers.
72-
COPY host-x86_64/dist-x86_64-linux/build-clang.sh host-x86_64/dist-x86_64-linux/llvm-project-centos.patch /tmp/
81+
COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/
7382
RUN ./build-clang.sh
7483
ENV CC=clang CXX=clang++
7584

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 host-x86_64/dist-x86_64-linux/build-git.sh /tmp/
79-
RUN ./build-git.sh
80-
81-
# for sanitizers, we need kernel headers files newer than the ones CentOS ships
82-
# with so we install newer ones here
83-
COPY host-x86_64/dist-x86_64-linux/build-headers.sh /tmp/
84-
RUN ./build-headers.sh
85-
86-
# OpenSSL requires a more recent version of perl
87-
# with so we install newer ones here
88-
COPY host-x86_64/dist-x86_64-linux/build-perl.sh /tmp/
89-
RUN ./build-perl.sh
90-
9185
COPY scripts/sccache.sh /scripts/
9286
RUN sh /scripts/sccache.sh
9387

@@ -117,4 +111,11 @@ ENV CFLAGS -mstackrealign
117111
# libcurl, instead it should compile its own.
118112
ENV LIBCURL_NO_PKG_CONFIG 1
119113

114+
# There was a bad interaction between "old" 32-bit binaries on current 64-bit
115+
# kernels with selinux enabled, where ASLR mmap would sometimes choose a low
116+
# address and then block it for being below `vm.mmap_min_addr` -> `EACCES`.
117+
# This is probably a kernel bug, but setting `ulimit -Hs` works around it.
118+
# See also `src/ci/run.sh` where this takes effect.
119+
ENV SET_HARD_RLIMIT_STACK 1
120+
120121
ENV DIST_REQUIRE_ALL_TOOLS 1

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

+39-45
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,44 @@
1-
FROM centos:5
1+
# We use Debian 6 (glibc 2.11, kernel 2.6.32) as a common base for other
2+
# distros that still need Rust support: RHEL 6 (glibc 2.12, kernel 2.6.32) and
3+
# SLES 11 SP4 (glibc 2.11, kernel 3.0).
4+
FROM debian:6
25

36
WORKDIR /build
47

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
8+
# Debian 6 is EOL and no longer available from the usual mirrors,
9+
# so we'll need to switch to http://archive.debian.org/
10+
RUN sed -i '/updates/d' /etc/apt/sources.list && \
11+
sed -i 's/httpredir/archive/' /etc/apt/sources.list
1012

11-
RUN yum upgrade -y && yum install -y \
12-
curl \
13+
RUN apt-get update && \
14+
apt-get install --allow-unauthenticated -y --no-install-recommends \
15+
automake \
1316
bzip2 \
17+
ca-certificates \
18+
curl \
19+
file \
20+
g++ \
21+
g++-multilib \
1422
gcc \
15-
gcc-c++ \
23+
gcc-multilib \
24+
git \
25+
lib32z1-dev \
26+
libedit-dev \
27+
libncurses-dev \
1628
make \
17-
glibc-devel \
29+
patch \
1830
perl \
19-
zlib-devel \
20-
file \
21-
xz \
22-
which \
23-
pkgconfig \
31+
pkg-config \
32+
unzip \
2433
wget \
25-
autoconf \
26-
gettext
34+
xz-utils \
35+
zlib1g-dev
2736

2837
ENV PATH=/rustroot/bin:$PATH
29-
ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib
38+
ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib
3039
ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
3140
WORKDIR /tmp
41+
RUN mkdir /home/user
3242
COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/
3343

3444
# We need a build of openssl which supports SNI to download artifacts from
@@ -38,14 +48,14 @@ COPY host-x86_64/dist-x86_64-linux/shared.sh /tmp/
3848
COPY host-x86_64/dist-x86_64-linux/build-openssl.sh /tmp/
3949
RUN ./build-openssl.sh
4050

41-
# The `curl` binary on CentOS doesn't support SNI which is needed for fetching
51+
# The `curl` binary on Debian 6 doesn't support SNI which is needed for fetching
4252
# some https urls we have, so install a new version of libcurl + curl which is
4353
# using the openssl we just built previously.
4454
#
4555
# Note that we also disable a bunch of optional features of curl that we don't
4656
# really need.
4757
COPY host-x86_64/dist-x86_64-linux/build-curl.sh /tmp/
48-
RUN ./build-curl.sh
58+
RUN ./build-curl.sh && apt-get remove -y curl
4959

5060
# binutils < 2.22 has a bug where the 32-bit executables it generates
5161
# immediately segfault in Rust, so we need to install our own binutils.
@@ -54,40 +64,24 @@ RUN ./build-curl.sh
5464
COPY host-x86_64/dist-x86_64-linux/build-binutils.sh /tmp/
5565
RUN ./build-binutils.sh
5666

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 host-x86_64/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
67+
# Need at least GCC 5.1 to compile LLVM nowadays
6368
COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/
64-
RUN ./build-gcc.sh
69+
RUN ./build-gcc.sh && apt-get remove -y gcc g++
6570

66-
# CentOS 5.5 has Python 2.4 by default, but LLVM needs 2.7+
71+
# Debian 6 has Python 2.6 by default, but LLVM needs 2.7+
6772
COPY host-x86_64/dist-x86_64-linux/build-python.sh /tmp/
6873
RUN ./build-python.sh
6974

70-
# Now build LLVM+Clang 7, afterwards configuring further compilations to use the
75+
# LLVM needs cmake 3.4.3 or higher, and is planning to raise to 3.13.4.
76+
COPY host-x86_64/dist-x86_64-linux/build-cmake.sh /tmp/
77+
RUN ./build-cmake.sh
78+
79+
# Now build LLVM+Clang, afterwards configuring further compilations to use the
7180
# clang/clang++ compilers.
72-
COPY host-x86_64/dist-x86_64-linux/build-clang.sh host-x86_64/dist-x86_64-linux/llvm-project-centos.patch /tmp/
81+
COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/
7382
RUN ./build-clang.sh
7483
ENV CC=clang CXX=clang++
7584

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 host-x86_64/dist-x86_64-linux/build-git.sh /tmp/
79-
RUN ./build-git.sh
80-
81-
# for sanitizers, we need kernel headers files newer than the ones CentOS ships
82-
# with so we install newer ones here
83-
COPY host-x86_64/dist-x86_64-linux/build-headers.sh /tmp/
84-
RUN ./build-headers.sh
85-
86-
# OpenSSL requires a more recent version of perl
87-
# with so we install newer ones here
88-
COPY host-x86_64/dist-x86_64-linux/build-perl.sh /tmp/
89-
RUN ./build-perl.sh
90-
9185
COPY scripts/sccache.sh /scripts/
9286
RUN sh /scripts/sccache.sh
9387

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

-3
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

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

+4-3
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/host-x86_64/dist-x86_64-linux/build-curl.sh

-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,3 @@ hide_output make install
3636
cd ..
3737
rm -rf curl-build
3838
rm -rf curl-$VERSION
39-
yum erase -y curl

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

-1
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,3 @@ 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

src/ci/run.sh

+12
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ if [ -f /proc/sys/kernel/core_pattern ]; then
2020
ulimit -c unlimited
2121
fi
2222

23+
# There was a bad interaction between "old" 32-bit binaries on current 64-bit
24+
# kernels with selinux enabled, where ASLR mmap would sometimes choose a low
25+
# address and then block it for being below `vm.mmap_min_addr` -> `EACCES`.
26+
# This is probably a kernel bug, but setting `ulimit -Hs` works around it.
27+
# See also `dist-i686-linux` where this setting is enabled.
28+
if [ "$SET_HARD_RLIMIT_STACK" = "1" ]; then
29+
rlimit_stack=$(ulimit -Ss)
30+
if [ "$rlimit_stack" != "" ]; then
31+
ulimit -Hs "$rlimit_stack"
32+
fi
33+
fi
34+
2335
ci_dir=`cd $(dirname $0) && pwd`
2436
source "$ci_dir/shared.sh"
2537

0 commit comments

Comments
 (0)