Commit 6efe3d358b7d3605d397d0c6fca8e6230a7995a9

Patrick Steinhardt 2020-02-19T11:34:55

azure: docker: set up HOME variable to fix Coverity builds In commit 01a834066 (azure: docker: fix ARM builds by replacing gosu(1), 2020-02-18), we've switched our entrypoint from gosu(1) to use sudo(1) instead to fix our ARM builds. The switch introduced an incompatibility that now causes our Coverity builds to fail, as the "--preserve-env" switch will also keep HOME at its current value. As a result, Coverity now tries to set up its configuration directory in root's home directory, which it naturally can't write to. Fix the issue by adding the "--set-home" flag to sudo(1).

1
2
3
4
5
6
7
8
9
10
diff --git a/azure-pipelines/docker/entrypoint.sh b/azure-pipelines/docker/entrypoint.sh
index 830df49..8d96e3a 100644
--- a/azure-pipelines/docker/entrypoint.sh
+++ b/azure-pipelines/docker/entrypoint.sh
@@ -1,4 +1,4 @@
 #!/bin/bash -e
 useradd --shell /bin/bash libgit2
 chown --recursive libgit2:libgit2 /home/libgit2
-exec sudo --preserve-env --user=libgit2 "$@"
+exec sudo --preserve-env --set-home --user=libgit2 "$@"