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.
This commit is contained in:
Nikita Popov 2021-02-03 18:11:28 +01:00
parent 1e21b2cba8
commit b763d9a40c
3 changed files with 14 additions and 9 deletions

View File

@ -68,11 +68,13 @@ RUN ./build-binutils.sh
COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/
RUN ./build-gcc.sh && apt-get remove -y gcc g++
# Debian 6 has Python 2.6 by default, but LLVM needs 2.7+
COPY host-x86_64/dist-x86_64-linux/build-python.sh /tmp/
RUN ./build-python.sh
# Build Python 2.7 needed for Clang 10.
RUN ./build-python.sh 2.7.12
# Build Python 3 needed for LLVM 12.
RUN ./build-python.sh 3.9.1
# LLVM needs cmake 3.4.3 or higher, and is planning to raise to 3.13.4.
# LLVM needs cmake 3.13.4 or higher.
COPY host-x86_64/dist-x86_64-linux/build-cmake.sh /tmp/
RUN ./build-cmake.sh

View File

@ -68,11 +68,13 @@ RUN ./build-binutils.sh
COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/
RUN ./build-gcc.sh && apt-get remove -y gcc g++
# Debian 6 has Python 2.6 by default, but LLVM needs 2.7+
COPY host-x86_64/dist-x86_64-linux/build-python.sh /tmp/
RUN ./build-python.sh
# Build Python 2.7 needed for Clang 10.
RUN ./build-python.sh 2.7.12
# Build Python 3 needed for LLVM 12.
RUN ./build-python.sh 3.9.1
# LLVM needs cmake 3.4.3 or higher, and is planning to raise to 3.13.4.
# LLVM needs cmake 3.13.4 or higher.
COPY host-x86_64/dist-x86_64-linux/build-cmake.sh /tmp/
RUN ./build-cmake.sh

View File

@ -3,7 +3,8 @@
set -ex
source shared.sh
curl https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz | \
VERSION=$1
curl https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz | \
tar xzf -
mkdir python-build
@ -12,10 +13,10 @@ cd python-build
# Gotta do some hackery to tell python about our custom OpenSSL build, but other
# than that fairly normal.
CFLAGS='-I /rustroot/include' LDFLAGS='-L /rustroot/lib -L /rustroot/lib64' \
hide_output ../Python-2.7.12/configure --prefix=/rustroot
hide_output ../Python-$VERSION/configure --prefix=/rustroot
hide_output make -j10
hide_output make install
cd ..
rm -rf python-build
rm -rf Python-2.7.12
rm -rf Python-$VERSION