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. .
This commit is contained in:
Sören Tempel 2023-01-21 01:30:39 +01:00 committed by Natanael Copa
parent 489fc06e40
commit 1582617eb8

View File

@ -2508,6 +2508,10 @@ rootbld() {
--bind "$REPODEST" "$REPODEST" \ --bind "$REPODEST" "$REPODEST" \
--hostname "build-$buildhost-$CARCH" \ --hostname "build-$buildhost-$CARCH" \
--chdir "$startdir" \ --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 PATH ${USE_CCACHE:+/usr/lib/ccache/bin:}/bin:/usr/bin:/sbin:/usr/sbin \
--setenv FAKEROOTDONTTRYCHOWN 1 \ --setenv FAKEROOTDONTTRYCHOWN 1 \
--unsetenv CBUILD \ --unsetenv CBUILD \