From b1541ff198d3684c4dfadca02d87677bea04f8c0 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Mon, 4 Jul 2022 15:57:10 +0100 Subject: [PATCH 1/2] bootstrap.py: Always use `.exe` for Windows This ensure that it will run the Windows executable if other files in the directory (such as Linux executables) have the same file name minus the extension. --- src/bootstrap/bootstrap.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 3c2f1bdb142a7..d2d294d9040b9 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -152,6 +152,10 @@ def run(args, verbose=False, exception=False, is_bootstrap=False, **kwargs): if verbose: print("running: " + ' '.join(args)) sys.stdout.flush() + # Ensure that the .exe is used on Windoows just in case a Linux ELF has been + # compiled in the same directory. + if os.name == 'nt' and not args[0].endswith('.exe'): + args[0] += '.exe' # Use Popen here instead of call() as it apparently allows powershell on # Windows to not lock up waiting for input presumably. ret = subprocess.Popen(args, **kwargs) From 9ac4a4e67a2d217179a465bc865e31915682c93c Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Tue, 5 Jul 2022 09:06:43 +0100 Subject: [PATCH 2/2] Fix typo in src/bootstrap/bootstrap.py Co-authored-by: Marco Colombo --- src/bootstrap/bootstrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index d2d294d9040b9..9301c5a2ff300 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -152,7 +152,7 @@ def run(args, verbose=False, exception=False, is_bootstrap=False, **kwargs): if verbose: print("running: " + ' '.join(args)) sys.stdout.flush() - # Ensure that the .exe is used on Windoows just in case a Linux ELF has been + # Ensure that the .exe is used on Windows just in case a Linux ELF has been # compiled in the same directory. if os.name == 'nt' and not args[0].endswith('.exe'): args[0] += '.exe'