summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGavin Mak <gavinmak@google.com>2023-08-04 21:13:38 +0000
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-08-08 05:50:07 +0000
commitf1ddaaa553521c5c659271dd52c8d33866a51936 (patch)
treef42f7a6f52e542d8b37eb91e9bfa48a7118c78b9
parentf9aacd4087b02948da9a7878da48ea186ab99d5a (diff)
downloadgit-repo-f1ddaaa553521c5c659271dd52c8d33866a51936.tar.gz
main: Pass path to python binary as arg0 when restarting repo
Not including it causes flaky behavior in some Chromium builders because Chromium's custom Python build used by vpython relies on argv[0] to find its own internal files. Bug: https://crbug.com/1468522 Change-Id: I5c32ebe71c9b684d6ee50dbd8c3d6fcd51ca309b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/381974 Reviewed-by: Chenlin Fan <fancl@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com> Tested-by: Gavin Mak <gavinmak@google.com>
-rwxr-xr-xmain.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/main.py b/main.py
index 57a59acb..b213f0a4 100755
--- a/main.py
+++ b/main.py
@@ -887,11 +887,10 @@ def _Main(argv):
887 result = KEYBOARD_INTERRUPT_EXIT 887 result = KEYBOARD_INTERRUPT_EXIT
888 except RepoChangedException as rce: 888 except RepoChangedException as rce:
889 # If repo changed, re-exec ourselves. 889 # If repo changed, re-exec ourselves.
890 #
891 argv = list(sys.argv) 890 argv = list(sys.argv)
892 argv.extend(rce.extra_args) 891 argv.extend(rce.extra_args)
893 try: 892 try:
894 os.execv(sys.executable, [__file__] + argv) 893 os.execv(sys.executable, [sys.executable, __file__] + argv)
895 except OSError as e: 894 except OSError as e:
896 print("fatal: cannot restart repo after upgrade", file=sys.stderr) 895 print("fatal: cannot restart repo after upgrade", file=sys.stderr)
897 print("fatal: %s" % e, file=sys.stderr) 896 print("fatal: %s" % e, file=sys.stderr)