diff mbox series

[v2,09/43] docker: extend "cc" command to accept compiler

Message ID 20180419135901.30035-10-alex.bennee@linaro.org
State Superseded
Headers show
Series fix building of tests/tcg | expand

Commit Message

Alex Bennée April 19, 2018, 1:58 p.m. UTC
When calling our cross-compilation images we want to call something
other than the default cc.

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


---
v2
  - use arg.cc default to simplify logic
---
 tests/docker/docker.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
2.17.0

Comments

Fam Zheng April 20, 2018, 2:06 a.m. UTC | #1
On Thu, 04/19 14:58, Alex Bennée wrote:
> When calling our cross-compilation images we want to call something

> other than the default cc.

> 

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

> 


Reviewed-by: Fam Zheng <famz@redhat.com>
Philippe Mathieu-Daudé April 20, 2018, 2:43 a.m. UTC | #2
On 04/19/2018 10:58 AM, Alex Bennée wrote:
> When calling our cross-compilation images we want to call something

> other than the default cc.

> 

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


Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


> 

> ---

> v2

>   - use arg.cc default to simplify logic

> ---

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

>  1 file changed, 3 insertions(+), 1 deletion(-)

> 

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

> index bcc3ee2dee..59bce9f19a 100755

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

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

> @@ -415,6 +415,8 @@ class CcCommand(SubCommand):

>      def args(self, parser):

>          parser.add_argument("--image", "-i", required=True,

>                              help="The docker image in which to run cc")

> +        parser.add_argument("--cc", default="cc",

> +                            help="The compiler executable to call")

>          parser.add_argument("--source-path", "-s", nargs="*", dest="paths",

>                              help="""Extra paths to (ro) mount into container for

>                              reading sources""")

> @@ -428,7 +430,7 @@ class CcCommand(SubCommand):

>          if args.paths:

>              for p in args.paths:

>                  cmd += ["-v", "%s:%s:ro,z" % (p, p)]

> -        cmd += [args.image, "cc"]

> +        cmd += [args.image, args.cc]

>          cmd += argv

>          return Docker().command("run", cmd, args.quiet)

>  

>
diff mbox series

Patch

diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index bcc3ee2dee..59bce9f19a 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -415,6 +415,8 @@  class CcCommand(SubCommand):
     def args(self, parser):
         parser.add_argument("--image", "-i", required=True,
                             help="The docker image in which to run cc")
+        parser.add_argument("--cc", default="cc",
+                            help="The compiler executable to call")
         parser.add_argument("--source-path", "-s", nargs="*", dest="paths",
                             help="""Extra paths to (ro) mount into container for
                             reading sources""")
@@ -428,7 +430,7 @@  class CcCommand(SubCommand):
         if args.paths:
             for p in args.paths:
                 cmd += ["-v", "%s:%s:ro,z" % (p, p)]
-        cmd += [args.image, "cc"]
+        cmd += [args.image, args.cc]
         cmd += argv
         return Docker().command("run", cmd, args.quiet)