From 505197bfac30686c0923178b867ef81e037ad8f3 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 1 Aug 2022 09:14:16 -0700 Subject: [PATCH] devops: install Python 3.8 on Ubuntu 18.04 (#16101) Ubuntu 18.04 ships Python 3.6 by default on Ubuntu18.04; this python, however, fails to run Firefox build system, so we have to install Python 3.8 and default it to `python3`. --- browser_patches/docker_build.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/browser_patches/docker_build.sh b/browser_patches/docker_build.sh index d31b17fe35..529fc99069 100755 --- a/browser_patches/docker_build.sh +++ b/browser_patches/docker_build.sh @@ -131,15 +131,24 @@ function ensure_docker_container { apt-get update && apt-get install -y wget \ git-core \ - python3 \ - python3-pip \ curl \ autoconf2.13 \ tzdata \ sudo \ zip \ - unzip \ - python3-distutils + unzip + + # Ubuntu 18 installs Python 3.6 as Python3 by default; this, however, + # fails to run Firefox build scripts. + # Install Python3.8 instead on Ubuntu 18.04 as Python3. + if [[ "${BUILD_FLAVOR}" == *ubuntu-18.04* ]]; then + apt-get install -y python3.8 python3.8-pip python3.8-distutils + # Point python3 to python3.8 + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2 + else + apt-get install -y python3 python3-pip python3-distutils + fi + # Create the pwuser and make it passwordless sudoer. adduser --disabled-password --gecos "" pwuser