From 2d8da82b2309120d83a2341095e0dcd550d171da Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 25 Jun 2020 19:54:55 +0800 Subject: [PATCH] install-deps.sh: always use python3-sphinx to build the docs python-sphinx creates a symlink pointing ../share/sphinx/scripts/python2/sphinx-build to /usr/bin/sphinx-build even if python3-sphinx is already installed. in that case, if python-sphinx is installed after python3-sphinx, sphinx-build is in python2. and it breaks the build of master, as we are using python3 syntax in conf.py since e9e17b9ceff0c862c8f29d629ad54a1dc401ed73. and we are still using python2 as well as "python-sphinx" when building nautilus, so if a build slave happen to compile nautilus before it is scheduled to build master or a wip- branch, the doc build fails. in this change, python-sphinx is uninstalled, if /usr/bin/sphinx-build is found to be written in python2. Signed-off-by: Kefu Chai --- install-deps.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/install-deps.sh b/install-deps.sh index 6dc37314eda..f48c5472a9d 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -124,6 +124,16 @@ ENDOFKEY $SUDO ln -nsf /usr/bin/g++ /usr/bin/${ARCH}-linux-gnu-g++ } +function ensure_python3_sphinx_on_ubuntu { + local sphinx_command=/usr/bin/sphinx-build + # python-sphinx points $sphinx_command to + # ../share/sphinx/scripts/python2/sphinx-build when it's installed + # let's "correct" this + if test -e $sphinx_command && head -n1 $sphinx_command | grep -q python$; then + $SUDO env DEBIAN_FRONTEND=noninteractive apt-get -y remove python-sphinx + fi +} + function install_pkg_on_ubuntu { local project=$1 shift @@ -263,6 +273,7 @@ else echo "Using apt-get to install dependencies" $SUDO apt-get install -y devscripts equivs $SUDO apt-get install -y dpkg-dev + ensure_python3_sphinx_on_ubuntu case "$VERSION" in *Bionic*) ensure_decent_gcc_on_ubuntu 9 bionic -- 2.47.3