A future change will want to use additional flags which clash with docker/podman command lines. Currently they would get snarfed up by argparser. Make the pass-through commands explicit to avoid this.
Signed-off-by: Alex Bennée <[email protected]> --- scripts/coverity-scan/run-coverity-scan | 2 +- tests/docker/docker.py | 5 ++++- tests/tcg/meson.build | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/coverity-scan/run-coverity-scan b/scripts/coverity-scan/run-coverity-scan index 2f9ccd5e44b..0e1361606e0 100755 --- a/scripts/coverity-scan/run-coverity-scan +++ b/scripts/coverity-scan/run-coverity-scan @@ -381,7 +381,7 @@ if [ "$DOCKER" = yes ]; then # Arrange for this docker run to get access to the sources with -v. # We pass through all the configuration from the outer script to the inner. export COVERITY_EMAIL COVERITY_BUILD_CMD - tests/docker/docker.py run -it --env COVERITY_EMAIL --env COVERITY_BUILD_CMD \ + tests/docker/docker.py run -- -it --env COVERITY_EMAIL --env COVERITY_BUILD_CMD \ -v "$SECRETDIR:/work" coverity-scanner \ ./run-coverity-scan --version "$VERSION" \ --description "$DESCRIPTION" $ARGS --tokenfile /work/token \ diff --git a/tests/docker/docker.py b/tests/docker/docker.py index a2e97061240..d7eb4cf6811 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -336,9 +336,12 @@ def args(self, parser): help="Don't remove image when command completes") parser.add_argument("--run-as-current-user", action="store_true", help="Run container using the current user's uid") + parser.add_argument('cmd', nargs='*', + help="""The command to run. You should precede with + -- to avoid confusion about its flags""") def run(self, args, argv): - return Docker(args.command).run(argv, args.keep, quiet=args.quiet, + return Docker(args.command).run(args.cmd, args.keep, quiet=args.quiet, as_user=args.run_as_current_user) diff --git a/tests/tcg/meson.build b/tests/tcg/meson.build index 22157a47c96..57e3870ac8a 100644 --- a/tests/tcg/meson.build +++ b/tests/tcg/meson.build @@ -275,7 +275,7 @@ foreach target, plan: tcg_tests mount = meson.project_source_root() mount = mount + ':' + mount here = meson.project_build_root() - cc = [docker_wrapper, 'run', '--run-as-current-user', + cc = [docker_wrapper, 'run', '--run-as-current-user', '--', '-w', here, '-v', mount, 'qemu/' + cc_dockerfile, plan['cc']] has_cc = true -- 2.47.3
