D9394: packaging: add `HG_DOCKER_OWN_USER` to `dockerdeb` like exists in `dockerrpm`

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Wed Nov 25 05:14:38 UTC 2020


mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I was getting build failures when it was trying to write to the working
  directory on CentOS 7 without this.  It is basically the same as was added to
  the RPM builder in 4c0d4bbdc395 <https://phab.mercurial-scm.org/rHG4c0d4bbdc39537d00c764b99e88f22e41303cf42>.
  
  For some reason, this doesn't work with Xenial, and the only solution I found
  was to invoke it with UID 1000 on the host side.  It doesn't EOL until April
  2024, but it also has python 3.5.2, so this build complication is the least of
  the problems with supporting it after py2 is dropped.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D9394

AFFECTED FILES
  contrib/packaging/dockerdeb

CHANGE DETAILS

diff --git a/contrib/packaging/dockerdeb b/contrib/packaging/dockerdeb
--- a/contrib/packaging/dockerdeb
+++ b/contrib/packaging/dockerdeb
@@ -25,7 +25,11 @@
 # container and hope it's writable. Whee.
 dn=$(basename $ROOTDIR)
 
-DBUILDUSER=build
+if [[ -z "${HG_DOCKER_OWN_USER:-}" ]]; then
+    DBUILDUSER=build
+else
+    DBUILDUSER="$(id -u):$(id -g)"
+fi
 
 if [ $(uname) = "Darwin" ] ; then
     $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \



To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list