Drop /var/cache/pbuilder/build from default bindmounts

If multiple builds are running at the same time then the
/var/cache/pbuilder/build directory shows up as shared bindmounts
in all environments. Besides being ugly this also causes the
first build environment to fail to cleanly unmount it and
therefore failing the build.

As a workaround the pbuilderrc could include the following
snippet, as suggested by Philipp Hahn:

| mount () {
|   case "$1" in
|     -obind) /bin/mount --make-private "$@" ;;
|          *) /bin/mount "$@" ;;
|   esac
| }

Leave this decision up to the user though (to avoid any possible
side effects depending on the user's environment which we can't
control).

The only reason why /var/cache/pbuilder/build should be needed as
bindmount at all is pbuilder-hookdir/C10shell. This pbuilder hook
copies the according build directory away on failing builds (and
if requested to do so).  If this feature is requested and it
fails to access /var/cache/pbuilder/build then inform the user
that /var/cache/pbuilder/build should be added to the
USER_BINDMOUNTS configuration setting.

See http://lists.alioth.debian.org/pipermail/pbuilder-maint/2015-August/005368.html

Thanks: Philipp Hahn <hahn@univention.de> for the bug report and analysis
remotes/origin/mika/pr125
Michael Prokop 11 years ago
parent a12c01db63
commit a410fbb9b0

@ -27,6 +27,7 @@ if ! [ -d /var/cache/pbuilder/build/ ] ; then
cat >&2 <<EOF
┌──────────────────────────────────────────────────────────────────────────────┐
│ Error: could not access /var/cache/pbuilder/build/ - missing in bindmount? │
│ Please make sure /var/cache/pbuilder/build is included in USER_BINDMOUNTS │
└──────────────────────────────────────────────────────────────────────────────┘
EOF
exit 1

@ -536,7 +536,7 @@ cowbuilder_run() {
echo "*** cowbuilder build phase for arch $architecture ***"
mkdir -p "$WORKSPACE"/binaries/ /tmp/apt-$$
local BINDMOUNTS="/tmp/apt-$$ /var/cache/pbuilder/build ${USER_BINDMOUNTS:-}"
local BINDMOUNTS="/tmp/apt-$$ ${USER_BINDMOUNTS:-}"
# make sure we build arch specific packages only when necessary
identify_build_type

Loading…
Cancel
Save