From 8b3b53bd56644affaaf9def11d96ff5840db7cfd Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Thu, 9 Mar 2023 10:26:01 +0100 Subject: [PATCH] [FIX] runbot: append user bin dir to pre commands When pip installs a package that contains a script, it goes in `~/.local/bin` directory of the current user. This leads to a log warning to warn the user that the script won't be accessible by other users. e.g.: `WARNING: The script pygmentize is installed in '/home/odoo/.local/bin' which is not on PATH.` This is particularly annoying for documentation builds because it may confuse the users. Also, it means that when a locally installed pip package overrides a python package installed system wide (e.g.: by apt-get), it's still globally script that runs when called. With this commit, the user PATH is updated to include this local bin directory when building Docker images. --- runbot/models/host.py | 1 + 1 file changed, 1 insertion(+) diff --git a/runbot/models/host.py b/runbot/models/host.py index cd84e6ea3..89a047de9 100644 --- a/runbot/models/host.py +++ b/runbot/models/host.py @@ -126,6 +126,7 @@ def _docker_build_dockerfile(self, dockerfile, workdir): && mkdir /home/{user} \\ && chown -R {user}:{user} /home/{user} USER {user} + ENV PATH /home/{user}/.local/bin:$PATH ENV COVERAGE_FILE /data/build/.coverage """