Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Cirrus build: use python3 #3726

Merged
merged 14 commits into from
May 16, 2021
31 changes: 19 additions & 12 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# Installs pip and lit, clones the git submodules, builds LDC and the test
# Installs lit, clones the git submodules, builds LDC and the test
# runners and runs the tests.
# Requires env variables EXTRA_CMAKE_FLAGS and PARALLELISM.
common_steps_template: &COMMON_STEPS_TEMPLATE
install_pip_and_lit_script: |
# Install pip
curl --max-time 300 --retry 3 -OL https://bootstrap.pypa.io/pip/2.7/get-pip.py
python get-pip.py --user
rm get-pip.py
install_lit_script: |
# Install lit
python -m pip install --user lit
python -c "import lit.main; lit.main.main();" --version . | head -n 1
Expand Down Expand Up @@ -71,8 +67,11 @@ install_ubuntu_prerequisites_template: &INSTALL_UBUNTU_PREREQUISITES_TEMPLATE
apt-get -yq install \
git-core cmake ninja-build $gcc_pkg \
llvm-dev zlib1g-dev libclang-common-$LIBCLANG_COMMON_VERSION-dev \
$libcurl_pkg curl gdb python tzdata unzip zip \
$libcurl_pkg curl gdb python3 python3-pip tzdata unzip zip \
$EXTRA_APT_PACKAGES
python3 --version
ln -s $(which python3) /usr/bin/python
python --version
# Download & extract host LDC
curl --max-time 300 --retry 3 -L -o ldc2.tar.xz https://github.com/ldc-developers/ldc/releases/download/v$HOST_LDC_VERSION/ldc2-$HOST_LDC_VERSION-linux-x86_64.tar.xz
mkdir host-ldc
Expand Down Expand Up @@ -105,6 +104,10 @@ install_macos_prerequisites_template: &INSTALL_MACOS_PREREQUISITES_TEMPLATE
mkdir host-ldc
tar -xf ldc2.tar.xz --strip 1 -C host-ldc
rm ldc2.tar.xz
# Install Python3
brew install python
ln -sf $(which python3) /usr/local/bin/python
python --version

environment:
CIRRUS_CLONE_DEPTH: 50
Expand Down Expand Up @@ -155,11 +158,13 @@ task:
OS: osx
PATH: ${CIRRUS_WORKING_DIR}/../cmake/bin:${CIRRUS_WORKING_DIR}/../ninja:${CIRRUS_WORKING_DIR}/../llvm/bin:${PATH}
PARALLELISM: 12
matrix:
- TASK_NAME_SUFFIX: x64
EXTRA_CMAKE_FLAGS: "-DBUILD_LTO_LIBS=ON"
- TASK_NAME_SUFFIX: x64 shared-libs-only
EXTRA_CMAKE_FLAGS: "-DBUILD_LTO_LIBS=ON -DBUILD_SHARED_LIBS=ON"
brew_cache:
folder: "$HOME/Library/Caches/Homebrew"
matrix:
- TASK_NAME_SUFFIX: x64
EXTRA_CMAKE_FLAGS: "-DBUILD_LTO_LIBS=ON"
- TASK_NAME_SUFFIX: x64 shared-libs-only
EXTRA_CMAKE_FLAGS: "-DBUILD_LTO_LIBS=ON -DBUILD_SHARED_LIBS=ON"
<< : *INSTALL_MACOS_PREREQUISITES_TEMPLATE
<< : *COMMON_STEPS_TEMPLATE

Expand All @@ -181,6 +186,8 @@ task:
cd $CIRRUS_WORKING_DIR/..
sysctl -n hw.ncpu
pkg install -y git cmake ninja gmake llvm bash gtar p7zip
python --version
python -m ensurepip
# Download & extract host LDC
curl --max-time 300 --retry 3 -L -o ldc2.tar.xz https://github.com/ldc-developers/ldc/releases/download/v$HOST_LDC_VERSION/ldc2-$HOST_LDC_VERSION-freebsd-x86_64.tar.xz
mkdir pre-ldc
Expand Down