Skip to content

Commit

Permalink
[FIX] runbot: append user bin dir to pre commands
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
d-fence committed Mar 9, 2023
1 parent 6fdd35e commit 8b3b53b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions runbot/models/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""

Expand Down

0 comments on commit 8b3b53b

Please sign in to comment.