Skip to content

Commit a69043d

Browse files
jiangxindscho
authored andcommitted
ci: install python on ubuntu
Python is missing from the default ubuntu-22.04 runner image, which prevents git-p4 from working. To install python on ubuntu, we need to provide the correct package names: * On Ubuntu 18.04 (bionic), "/usr/bin/python2" is provided by the "python" package, and "/usr/bin/python3" is provided by the "python3" package. * On Ubuntu 20.04 (focal) and above, "/usr/bin/python2" is provided by the "python2" package which has a different name from bionic, and "/usr/bin/python3" is provided by "python3". Since the "ubuntu-latest" runner image has a higher version, its safe to use "python2" or "python3" package name. Helped-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Jiang Xin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 79e0626 commit a69043d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ci/install-dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ linux-clang|linux-gcc)
1616
sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
1717
sudo apt-get -q update
1818
sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \
19-
$UBUNTU_COMMON_PKGS
19+
$UBUNTU_COMMON_PKGS $PYTHON_PACKAGE
2020
case "$jobname" in
2121
linux-gcc)
2222
sudo apt-get -q -y install gcc-8

ci/lib.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,13 @@ export SKIP_DASHED_BUILT_INS=YesPlease
184184

185185
case "$jobname" in
186186
linux-clang|linux-gcc)
187+
PYTHON_PACKAGE=python2
187188
if [ "$jobname" = linux-gcc ]
188189
then
189190
export CC=gcc-8
190-
MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python3"
191-
else
192-
MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python2"
191+
PYTHON_PACKAGE=python3
193192
fi
193+
MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/$PYTHON_PACKAGE"
194194

195195
export GIT_TEST_HTTPD=true
196196

0 commit comments

Comments
 (0)