From 1582617eb8ba3df4752f8050f0412c0353c33fdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Sat, 21 Jan 2023 01:30:39 +0100 Subject: [PATCH] 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. --- abuild.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/abuild.in b/abuild.in index 0d7fe84..bf03782 100755 --- a/abuild.in +++ b/abuild.in @@ -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 \