[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 06/57] docker: Add "cc" subcommand
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PULL v2 06/57] docker: Add "cc" subcommand |
Date: |
Thu, 21 Jun 2018 07:25:14 +0100 |
Signed-off-by: Fam Zheng <address@hidden>
[AJB: add if args.paths check]
Signed-off-by: Alex Bennée <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index e4095270eb..42267bb94d 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -412,6 +412,31 @@ class ProbeCommand(SubCommand):
return
+class CcCommand(SubCommand):
+ """Compile sources with cc in images"""
+ name = "cc"
+
+ def args(self, parser):
+ parser.add_argument("--image", "-i", required=True,
+ help="The docker image in which to run cc")
+ parser.add_argument("--source-path", "-s", nargs="*", dest="paths",
+ help="""Extra paths to (ro) mount into container
for
+ reading sources""")
+
+ def run(self, args, argv):
+ if argv and argv[0] == "--":
+ argv = argv[1:]
+ cwd = os.getcwd()
+ cmd = ["--rm", "-w", cwd,
+ "-v", "%s:%s:rw" % (cwd, cwd)]
+ if args.paths:
+ for p in args.paths:
+ cmd += ["-v", "%s:%s:ro,z" % (p, p)]
+ cmd += [args.image, "cc"]
+ cmd += argv
+ return Docker().command("run", cmd, args.quiet)
+
+
def main():
parser = argparse.ArgumentParser(description="A Docker helper",
usage="%s <subcommand> ..." % os.path.basename(sys.argv[0]))
--
2.17.1
- [Qemu-devel] [PULL v2 00/57] add check-tcg and associated machinery, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 04/57] configure: allow user to specify --cross-cc-cflags-foo=, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 03/57] configure: move i386_cc to cross_cc_i386, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 01/57] docker: docker.py wrap StringIO import for python3, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 06/57] docker: Add "cc" subcommand,
Alex Bennée <=
- [Qemu-devel] [PULL v2 05/57] configure: set cross_cc_FOO for host compiler, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 02/57] configure: add support for --cross-cc-FOO, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 07/57] docker: extend "cc" command to accept compiler, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 09/57] docker: Makefile.include introduce DOCKER_SCRIPT, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 08/57] docker: allow "cc" command to run in user context, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 10/57] tests/tcg: move architecture independent tests into subdir, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 48/57] tests/tcg: override runners for broken tests, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 12/57] tests/tcg/multiarch: enable additional linux-test tests, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 53/57] docker: docker.py add check sub-command, Alex Bennée, 2018/06/21
- [Qemu-devel] [PULL v2 13/57] tests/tcg/multiarch: don't hard code paths/ports for linux-test, Alex Bennée, 2018/06/21