[PATCH v2 01/12] Run docker probe only if docker or podman are available

Alex Bennée posted 12 patches 3 years, 3 months ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Thomas Huth <thuth@redhat.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Cleber Rosa <crosa@redhat.com>, Alexandre Iooss <erdnaxe@crans.org>, Mahmoud Mandour <ma.mandourr@gmail.com>
[PATCH v2 01/12] Run docker probe only if docker or podman are available
Posted by Alex Bennée 3 years, 3 months ago
From: Stefan Weil <sw@weilnetz.de>

The docker probe uses "sudo -n" which can cause an e-mail with a security warning
each time when configure is run. Therefore run docker probe only if either docker
or podman are available.

That avoids the problematic "sudo -n" on build environments which have neither
docker nor podman installed.

Fixes: c4575b59155e2e00 ("configure: store container engine in config-host.mak")
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Message-Id: <20221030083510.310584-1-sw@weilnetz.de>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 66928692b0..26c7bc5154 100755
--- a/configure
+++ b/configure
@@ -1780,7 +1780,7 @@ fi
 # functions to probe cross compilers
 
 container="no"
-if test $use_containers = "yes"; then
+if test $use_containers = "yes" && (has "docker" || has "podman"); then
     case $($python "$source_path"/tests/docker/docker.py probe) in
         *docker) container=docker ;;
         podman) container=podman ;;
-- 
2.34.1


Re: [PATCH v2 01/12] Run docker probe only if docker or podman are available
Posted by Thomas Huth 3 years, 3 months ago
On 11/11/2022 15.55, Alex Bennée wrote:
> From: Stefan Weil <sw@weilnetz.de>
> 
> The docker probe uses "sudo -n" which can cause an e-mail with a security warning
> each time when configure is run. Therefore run docker probe only if either docker
> or podman are available.
> 
> That avoids the problematic "sudo -n" on build environments which have neither
> docker nor podman installed.
> 
> Fixes: c4575b59155e2e00 ("configure: store container engine in config-host.mak")
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> Message-Id: <20221030083510.310584-1-sw@weilnetz.de>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   configure | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index 66928692b0..26c7bc5154 100755
> --- a/configure
> +++ b/configure
> @@ -1780,7 +1780,7 @@ fi
>   # functions to probe cross compilers
>   
>   container="no"
> -if test $use_containers = "yes"; then
> +if test $use_containers = "yes" && (has "docker" || has "podman"); then
>       case $($python "$source_path"/tests/docker/docker.py probe) in
>           *docker) container=docker ;;
>           podman) container=podman ;;

Maybe the probe should better be done in the docker.py script instead? ... 
but doing it here likely does not hurt either, so:

Reviewed-by: Thomas Huth <thuth@redhat.com>