Skip to content

Commit 0d3507f

Browse files
jiangxingitster
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 31a1952 commit 0d3507f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ci/install-dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ case "$runs_on_pool" in
1515
ubuntu-*)
1616
sudo apt-get -q update
1717
sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \
18-
$UBUNTU_COMMON_PKGS $CC_PACKAGE
18+
$UBUNTU_COMMON_PKGS $CC_PACKAGE $PYTHON_PACKAGE
1919
mkdir --parents "$P4_PATH"
2020
pushd "$P4_PATH"
2121
wget --quiet "$P4WHENCE/bin.linux26x86_64/p4d"

ci/lib.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,12 @@ ubuntu-*)
232232
break
233233
fi
234234

235-
if [ "$jobname" = linux-gcc ]
235+
PYTHON_PACKAGE=python2
236+
if test "$jobname" = linux-gcc
236237
then
237-
MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python3"
238-
else
239-
MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python2"
238+
PYTHON_PACKAGE=python3
240239
fi
240+
MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/$PYTHON_PACKAGE"
241241

242242
export GIT_TEST_HTTPD=true
243243

0 commit comments

Comments
 (0)