abuild-rootbld: clear environment for bwrap container

Otherwise, user-set environment variables can leak into the container
and cause spurious build/test failures. A common example is the value of
the SHELL environment variable which is used by a lot of software.
Outside of the bwrap container I use ksh and my SHELL environment
variable points to /bin/ksh, however, inside the container /bin/ksh is
not available and hence software relying on $SHELL doesn't work
properly. This can cause annoying to debug test failures, e.g. !43430.
This commit is contained in:
Sören Tempel 2023-01-21 01:30:39 +01:00 committed by Natanael Copa
parent 489fc06e40
commit 1582617eb8
1 changed files with 4 additions and 0 deletions

View File

@ -2508,6 +2508,10 @@ rootbld() {
--bind "$REPODEST" "$REPODEST" \
--hostname "build-$buildhost-$CARCH" \
--chdir "$startdir" \
--clearenv \
--setenv HOME "$HOME" \
--setenv SOURCE_DATE_EPOCH "$SOURCE_DATE_EPOCH" \
--setenv ABUILD_LAST_COMMIT "$ABUILD_LAST_COMMIT" \
--setenv PATH ${USE_CCACHE:+/usr/lib/ccache/bin:}/bin:/usr/bin:/sbin:/usr/sbin \
--setenv FAKEROOTDONTTRYCHOWN 1 \
--unsetenv CBUILD \