Skip to content

Commit 462577b

Browse files
authored
Fix Cirrus build: use python3 (#3726)
1 parent c4f4898 commit 462577b

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

.cirrus.yml

+19-12
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
# Installs pip and lit, clones the git submodules, builds LDC and the test
1+
# Installs lit, clones the git submodules, builds LDC and the test
22
# runners and runs the tests.
33
# Requires env variables EXTRA_CMAKE_FLAGS and PARALLELISM.
44
common_steps_template: &COMMON_STEPS_TEMPLATE
5-
install_pip_and_lit_script: |
6-
# Install pip
7-
curl --max-time 300 --retry 3 -OL https://bootstrap.pypa.io/pip/2.7/get-pip.py
8-
python get-pip.py --user
9-
rm get-pip.py
5+
install_lit_script: |
106
# Install lit
117
python -m pip install --user lit
128
python -c "import lit.main; lit.main.main();" --version . | head -n 1
@@ -71,8 +67,11 @@ install_ubuntu_prerequisites_template: &INSTALL_UBUNTU_PREREQUISITES_TEMPLATE
7167
apt-get -yq install \
7268
git-core cmake ninja-build $gcc_pkg \
7369
llvm-dev zlib1g-dev libclang-common-$LIBCLANG_COMMON_VERSION-dev \
74-
$libcurl_pkg curl gdb python tzdata unzip zip \
70+
$libcurl_pkg curl gdb python3 python3-pip tzdata unzip zip \
7571
$EXTRA_APT_PACKAGES
72+
python3 --version
73+
ln -s $(which python3) /usr/bin/python
74+
python --version
7675
# Download & extract host LDC
7776
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
7877
mkdir host-ldc
@@ -105,6 +104,10 @@ install_macos_prerequisites_template: &INSTALL_MACOS_PREREQUISITES_TEMPLATE
105104
mkdir host-ldc
106105
tar -xf ldc2.tar.xz --strip 1 -C host-ldc
107106
rm ldc2.tar.xz
107+
# Install Python3
108+
brew install python
109+
ln -sf $(which python3) /usr/local/bin/python
110+
python --version
108111
109112
environment:
110113
CIRRUS_CLONE_DEPTH: 50
@@ -155,11 +158,13 @@ task:
155158
OS: osx
156159
PATH: ${CIRRUS_WORKING_DIR}/../cmake/bin:${CIRRUS_WORKING_DIR}/../ninja:${CIRRUS_WORKING_DIR}/../llvm/bin:${PATH}
157160
PARALLELISM: 12
158-
matrix:
159-
- TASK_NAME_SUFFIX: x64
160-
EXTRA_CMAKE_FLAGS: "-DBUILD_LTO_LIBS=ON"
161-
- TASK_NAME_SUFFIX: x64 shared-libs-only
162-
EXTRA_CMAKE_FLAGS: "-DBUILD_LTO_LIBS=ON -DBUILD_SHARED_LIBS=ON"
161+
brew_cache:
162+
folder: "$HOME/Library/Caches/Homebrew"
163+
matrix:
164+
- TASK_NAME_SUFFIX: x64
165+
EXTRA_CMAKE_FLAGS: "-DBUILD_LTO_LIBS=ON"
166+
- TASK_NAME_SUFFIX: x64 shared-libs-only
167+
EXTRA_CMAKE_FLAGS: "-DBUILD_LTO_LIBS=ON -DBUILD_SHARED_LIBS=ON"
163168
<< : *INSTALL_MACOS_PREREQUISITES_TEMPLATE
164169
<< : *COMMON_STEPS_TEMPLATE
165170

@@ -181,6 +186,8 @@ task:
181186
cd $CIRRUS_WORKING_DIR/..
182187
sysctl -n hw.ncpu
183188
pkg install -y git cmake ninja gmake llvm bash gtar p7zip
189+
python --version
190+
python -m ensurepip
184191
# Download & extract host LDC
185192
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
186193
mkdir pre-ldc

0 commit comments

Comments
 (0)