Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit b763d9a

Browse files
committed
Build both Python 2 and Python 3 on x86 dist builders
Python 2 is needed for Clang 10, Python 3 for LLVM 12. The Python 2 dependency could be removed by upgrading to Clang 11, but that causes linker errors of unclear origin.
1 parent 1e21b2c commit b763d9a

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,13 @@ RUN ./build-binutils.sh
6868
COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/
6969
RUN ./build-gcc.sh && apt-get remove -y gcc g++
7070

71-
# Debian 6 has Python 2.6 by default, but LLVM needs 2.7+
7271
COPY host-x86_64/dist-x86_64-linux/build-python.sh /tmp/
73-
RUN ./build-python.sh
72+
# Build Python 2.7 needed for Clang 10.
73+
RUN ./build-python.sh 2.7.12
74+
# Build Python 3 needed for LLVM 12.
75+
RUN ./build-python.sh 3.9.1
7476

75-
# LLVM needs cmake 3.4.3 or higher, and is planning to raise to 3.13.4.
77+
# LLVM needs cmake 3.13.4 or higher.
7678
COPY host-x86_64/dist-x86_64-linux/build-cmake.sh /tmp/
7779
RUN ./build-cmake.sh
7880

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,13 @@ RUN ./build-binutils.sh
6868
COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/
6969
RUN ./build-gcc.sh && apt-get remove -y gcc g++
7070

71-
# Debian 6 has Python 2.6 by default, but LLVM needs 2.7+
7271
COPY host-x86_64/dist-x86_64-linux/build-python.sh /tmp/
73-
RUN ./build-python.sh
72+
# Build Python 2.7 needed for Clang 10.
73+
RUN ./build-python.sh 2.7.12
74+
# Build Python 3 needed for LLVM 12.
75+
RUN ./build-python.sh 3.9.1
7476

75-
# LLVM needs cmake 3.4.3 or higher, and is planning to raise to 3.13.4.
77+
# LLVM needs cmake 3.13.4 or higher.
7678
COPY host-x86_64/dist-x86_64-linux/build-cmake.sh /tmp/
7779
RUN ./build-cmake.sh
7880

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

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

6-
curl https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz | \
6+
VERSION=$1
7+
curl https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz | \
78
tar xzf -
89

910
mkdir python-build
@@ -12,10 +13,10 @@ cd python-build
1213
# Gotta do some hackery to tell python about our custom OpenSSL build, but other
1314
# than that fairly normal.
1415
CFLAGS='-I /rustroot/include' LDFLAGS='-L /rustroot/lib -L /rustroot/lib64' \
15-
hide_output ../Python-2.7.12/configure --prefix=/rustroot
16+
hide_output ../Python-$VERSION/configure --prefix=/rustroot
1617
hide_output make -j10
1718
hide_output make install
1819

1920
cd ..
2021
rm -rf python-build
21-
rm -rf Python-2.7.12
22+
rm -rf Python-$VERSION

0 commit comments

Comments
 (0)