diff mbox series

[v1,02/42] configure: clean-up container cross compile detect

Message ID 20190904203013.9028-3-alex.bennee@linaro.org
State Superseded
Headers show
Series current testing/next queue (podman, docker, ci) | expand

Commit Message

Alex Bennée Sept. 4, 2019, 8:29 p.m. UTC
The introduction of podman support inadvertently broke configure's
detect of the container support as the configure probe didn't specify
an engine type. To fix this in docker.py:

  - only (re)set USE_ENGINE if --engine is specified
  - enhance the output so docker is no longer just yes

In the configure script we can at least start cleaning up the
detecting and naming of variables. To avoid too much churn the
conversion of the various make DOCKER_foo variables has been left for
future clean-ups.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
 configure              | 10 +++++-----
 tests/docker/docker.py |  7 ++++---
 2 files changed, 9 insertions(+), 8 deletions(-)

-- 
2.20.1

Comments

David Hildenbrand Sept. 5, 2019, 5:53 p.m. UTC | #1
On 04.09.19 22:29, Alex Bennée wrote:
> The introduction of podman support inadvertently broke configure's

> detect of the container support as the configure probe didn't specify

> an engine type. To fix this in docker.py:

> 

>   - only (re)set USE_ENGINE if --engine is specified

>   - enhance the output so docker is no longer just yes

> 

> In the configure script we can at least start cleaning up the

> detecting and naming of variables. To avoid too much churn the

> conversion of the various make DOCKER_foo variables has been left for

> future clean-ups.


This is not only a "clean-up" but an actual fix :) (maybe add a Fixes: tag).

This makes it work again for me.

t460s: ~/git/qemu mvc $ tests/docker/docker.py probe
docker

Thanks!

> 

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

> ---

>  configure              | 10 +++++-----

>  tests/docker/docker.py |  7 ++++---

>  2 files changed, 9 insertions(+), 8 deletions(-)

> 

> diff --git a/configure b/configure

> index 95134c0180b..94845fc5101 100755

> --- a/configure

> +++ b/configure

> @@ -495,7 +495,7 @@ qed="yes"

>  parallels="yes"

>  sheepdog="yes"

>  libxml2=""

> -docker="no"

> +container="no"

>  debug_mutex="no"

>  libpmem=""

>  default_devices="yes"

> @@ -5894,14 +5894,14 @@ EOF

>  fi

>  

>  ##########################################

> -# Docker and cross-compiler support

> +# Container based cross-compiler support

>  #

>  # This is specifically for building test

>  # cases for foreign architectures, not

>  # cross-compiling QEMU itself.

>  

> -if has "docker"; then

> -    docker=$($python $source_path/tests/docker/docker.py probe)

> +if has "docker" || has "podman"; then

> +    container=$($python $source_path/tests/docker/docker.py probe)

>  fi

>  

>  ##########################################

> @@ -6474,7 +6474,7 @@ echo "qed support       $qed"

>  echo "parallels support $parallels"

>  echo "sheepdog support  $sheepdog"

>  echo "capstone          $capstone"

> -echo "docker            $docker"

> +echo "container support $container"

>  echo "libpmem support   $libpmem"

>  echo "libudev           $libudev"

>  echo "default devices   $default_devices"

> diff --git a/tests/docker/docker.py b/tests/docker/docker.py

> index 4bba29e104e..e23209f71ee 100755

> --- a/tests/docker/docker.py

> +++ b/tests/docker/docker.py

> @@ -536,9 +536,9 @@ class ProbeCommand(SubCommand):

>          try:

>              docker = Docker()

>              if docker._command[0] == "docker":

> -                print("yes")

> +                print("docker")

>              elif docker._command[0] == "sudo":

> -                print("sudo")

> +                print("sudo docker")

>              elif docker._command[0] == "podman":

>                  print("podman")

>          except Exception:

> @@ -651,7 +651,8 @@ def main():

>          cmd.args(subp)

>          subp.set_defaults(cmdobj=cmd)

>      args, argv = parser.parse_known_args()

> -    USE_ENGINE = args.engine

> +    if args.engine:

> +        USE_ENGINE = args.engine

>      return args.cmdobj.run(args, argv)

>  

>  

> 



-- 

Thanks,

David / dhildenb
Alex Bennée Sept. 5, 2019, 6:35 p.m. UTC | #2
David Hildenbrand <david@redhat.com> writes:

> On 04.09.19 22:29, Alex Bennée wrote:

>> The introduction of podman support inadvertently broke configure's

>> detect of the container support as the configure probe didn't specify

>> an engine type. To fix this in docker.py:

>>

>>   - only (re)set USE_ENGINE if --engine is specified

>>   - enhance the output so docker is no longer just yes

>>

>> In the configure script we can at least start cleaning up the

>> detecting and naming of variables. To avoid too much churn the

>> conversion of the various make DOCKER_foo variables has been left for

>> future clean-ups.

>

> This is not only a "clean-up" but an actual fix :) (maybe add a Fixes:

> tag).


Done... do I get a Tested-by: ?

>

> This makes it work again for me.

>

> t460s: ~/git/qemu mvc $ tests/docker/docker.py probe

> docker

>

> Thanks!

>

>>

>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

>> ---

>>  configure              | 10 +++++-----

>>  tests/docker/docker.py |  7 ++++---

>>  2 files changed, 9 insertions(+), 8 deletions(-)

>>

>> diff --git a/configure b/configure

>> index 95134c0180b..94845fc5101 100755

>> --- a/configure

>> +++ b/configure

>> @@ -495,7 +495,7 @@ qed="yes"

>>  parallels="yes"

>>  sheepdog="yes"

>>  libxml2=""

>> -docker="no"

>> +container="no"

>>  debug_mutex="no"

>>  libpmem=""

>>  default_devices="yes"

>> @@ -5894,14 +5894,14 @@ EOF

>>  fi

>>

>>  ##########################################

>> -# Docker and cross-compiler support

>> +# Container based cross-compiler support

>>  #

>>  # This is specifically for building test

>>  # cases for foreign architectures, not

>>  # cross-compiling QEMU itself.

>>

>> -if has "docker"; then

>> -    docker=$($python $source_path/tests/docker/docker.py probe)

>> +if has "docker" || has "podman"; then

>> +    container=$($python $source_path/tests/docker/docker.py probe)

>>  fi

>>

>>  ##########################################

>> @@ -6474,7 +6474,7 @@ echo "qed support       $qed"

>>  echo "parallels support $parallels"

>>  echo "sheepdog support  $sheepdog"

>>  echo "capstone          $capstone"

>> -echo "docker            $docker"

>> +echo "container support $container"

>>  echo "libpmem support   $libpmem"

>>  echo "libudev           $libudev"

>>  echo "default devices   $default_devices"

>> diff --git a/tests/docker/docker.py b/tests/docker/docker.py

>> index 4bba29e104e..e23209f71ee 100755

>> --- a/tests/docker/docker.py

>> +++ b/tests/docker/docker.py

>> @@ -536,9 +536,9 @@ class ProbeCommand(SubCommand):

>>          try:

>>              docker = Docker()

>>              if docker._command[0] == "docker":

>> -                print("yes")

>> +                print("docker")

>>              elif docker._command[0] == "sudo":

>> -                print("sudo")

>> +                print("sudo docker")

>>              elif docker._command[0] == "podman":

>>                  print("podman")

>>          except Exception:

>> @@ -651,7 +651,8 @@ def main():

>>          cmd.args(subp)

>>          subp.set_defaults(cmdobj=cmd)

>>      args, argv = parser.parse_known_args()

>> -    USE_ENGINE = args.engine

>> +    if args.engine:

>> +        USE_ENGINE = args.engine

>>      return args.cmdobj.run(args, argv)

>>

>>

>>



--
Alex Bennée
David Hildenbrand Sept. 5, 2019, 6:37 p.m. UTC | #3
On 05.09.19 20:35, Alex Bennée wrote:
> 

> David Hildenbrand <david@redhat.com> writes:

> 

>> On 04.09.19 22:29, Alex Bennée wrote:

>>> The introduction of podman support inadvertently broke configure's

>>> detect of the container support as the configure probe didn't specify

>>> an engine type. To fix this in docker.py:

>>>

>>>   - only (re)set USE_ENGINE if --engine is specified

>>>   - enhance the output so docker is no longer just yes

>>>

>>> In the configure script we can at least start cleaning up the

>>> detecting and naming of variables. To avoid too much churn the

>>> conversion of the various make DOCKER_foo variables has been left for

>>> future clean-ups.

>>

>> This is not only a "clean-up" but an actual fix :) (maybe add a Fixes:

>> tag).

> 

> Done... do I get a Tested-by: ?


Most certainly, you saved me quite some time today:

Tested-by: David Hildenbrand <david@redhat.com>


Thanks!

-- 

Thanks,

David / dhildenb
diff mbox series

Patch

diff --git a/configure b/configure
index 95134c0180b..94845fc5101 100755
--- a/configure
+++ b/configure
@@ -495,7 +495,7 @@  qed="yes"
 parallels="yes"
 sheepdog="yes"
 libxml2=""
-docker="no"
+container="no"
 debug_mutex="no"
 libpmem=""
 default_devices="yes"
@@ -5894,14 +5894,14 @@  EOF
 fi
 
 ##########################################
-# Docker and cross-compiler support
+# Container based cross-compiler support
 #
 # This is specifically for building test
 # cases for foreign architectures, not
 # cross-compiling QEMU itself.
 
-if has "docker"; then
-    docker=$($python $source_path/tests/docker/docker.py probe)
+if has "docker" || has "podman"; then
+    container=$($python $source_path/tests/docker/docker.py probe)
 fi
 
 ##########################################
@@ -6474,7 +6474,7 @@  echo "qed support       $qed"
 echo "parallels support $parallels"
 echo "sheepdog support  $sheepdog"
 echo "capstone          $capstone"
-echo "docker            $docker"
+echo "container support $container"
 echo "libpmem support   $libpmem"
 echo "libudev           $libudev"
 echo "default devices   $default_devices"
diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index 4bba29e104e..e23209f71ee 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -536,9 +536,9 @@  class ProbeCommand(SubCommand):
         try:
             docker = Docker()
             if docker._command[0] == "docker":
-                print("yes")
+                print("docker")
             elif docker._command[0] == "sudo":
-                print("sudo")
+                print("sudo docker")
             elif docker._command[0] == "podman":
                 print("podman")
         except Exception:
@@ -651,7 +651,8 @@  def main():
         cmd.args(subp)
         subp.set_defaults(cmdobj=cmd)
     args, argv = parser.parse_known_args()
-    USE_ENGINE = args.engine
+    if args.engine:
+        USE_ENGINE = args.engine
     return args.cmdobj.run(args, argv)