Skip to content

Commit

Permalink
Skip installing 'clang' if 'clang' binary already exists (#32242)
Browse files Browse the repository at this point in the history
Simply installing 'clang' installs the default version of Clang for
Linux. For instance, the command: 'apt install clang' installs
'clang-14' in Ubuntu 22.04.

It might be possible that a more recent version of clang is
already installed in the system. For instance, package 'clang-17'.

In the case a 'clang' binary is already installed in the system, skip
the installation of 'clang'.
  • Loading branch information
dpino committed May 8, 2024
1 parent 6a2e4a6 commit 5298ccb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/servo/platform/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ def install_non_gstreamer_dependencies(self, force: bool) -> bool:
command = ['apt-get', 'install', "-m"]
pkgs = APT_PKGS

# Skip 'clang' if 'clang' binary already exists.
result = subprocess.run(['which', 'clang'], capture_output=True)
if result and result.returncode == 0:
pkgs.remove('clang')

# Try to filter out unknown packages from the list. This is important for Debian
# as it does not ship all of the packages we want.
installable = subprocess.check_output(['apt-cache', '--generate', 'pkgnames'])
Expand Down

0 comments on commit 5298ccb

Please sign in to comment.