From 21b08557ce2480541d274dce4e1981c7cc089e48 Mon Sep 17 00:00:00 2001 From: John Richards Date: Thu, 21 Oct 2021 22:33:03 -0400 Subject: [PATCH] Refactors how extra args for container executables are specified --- scripts/pymultic | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/pymultic b/scripts/pymultic index 63c94ff..bb18fbe 100755 --- a/scripts/pymultic +++ b/scripts/pymultic @@ -54,7 +54,10 @@ PYVER_CONTAINERS = { '3.10', } CONTAINER_EXES = ['podman', 'docker'] -CONTAINER_EXE_ARGS = { 'docker': ['-u', '{}:{}'.format(os.getuid(), os.getgid())] } # Docker requires extra magic for permissions. +CONTAINER_EXE_EXTRA_ARGS = { + 'podman': [], + 'docker': ['-u', '{}:{}'.format(os.getuid(), os.getgid())], # Docker requires extra magic for permissions. +} def fetch_python(snekdir, version): @@ -220,7 +223,7 @@ def container_compile(ver, infile): os.unlink(outfile) print('*** Compiling for Python {}'.format(fullver)) - proc = subprocess.Popen([container_exe, 'run'] + CONTAINER_EXE_ARGS.get(container_exe, []) + + proc = subprocess.Popen([container_exe, 'run'] + CONTAINER_EXE_EXTRA_ARGS[container_exe] + ['--rm', '--name', '{}'.format(outfile), '-v', '{}:/indir:Z'.format(indir), '-v', '{}:/outdir:Z'.format(os.getcwd()), '-w', '/outdir',