From 5a6250bf22e123b1b42171c62170ec9419ead0a1 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Fri, 9 Oct 2020 14:27:28 +0000 Subject: [PATCH] Bug 1670169 - Fix hack from bug 914563 when python gets more arguments somehow. r=firefox-build-system-reviewers,rstewart DONTBUILD Some recent change apparently made the multiprocessing code reenter python with the arguments `-s -c "..."` instead of `-c "..."`, which broke the assumption of the hack. Differential Revision: https://phabricator.services.mozilla.com/D93060 --- python/mozbuild/mozbuild/util.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/mozbuild/mozbuild/util.py b/python/mozbuild/mozbuild/util.py index c3aa41563a05..e18825caf6e1 100644 --- a/python/mozbuild/mozbuild/util.py +++ b/python/mozbuild/mozbuild/util.py @@ -1453,7 +1453,10 @@ def patch_main(): "main_module_name = '%s'\n" % main_module_name + ''.join(x[12:] for x in fork_code[1:])) cmdline = orig_command_line() - cmdline[2] = fork_string + # We don't catch errors if "-c" is not found because it's not clear + # what we should do if the original command line is not of the form + # "python ... -c 'script'". + cmdline[cmdline.index('-c') + 1] = fork_string return cmdline orig_command_line = forking.get_command_line forking.get_command_line = my_get_command_line