Skip to content

Commit

Permalink
Refactors how extra args for container executables are specified
Browse files Browse the repository at this point in the history
  • Loading branch information
dotjrich committed Oct 22, 2021
1 parent 034c658 commit 21b0855
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/pymultic
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 21b0855

Please sign in to comment.