Skip to content

Commit b8148b8

Browse files
committed
fix(get.py): Check if win32 tools also exist when running on win64
1 parent 05102fe commit b8148b8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Diff for: tools/get.py

+12
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,10 @@ def load_tools_list(filename, platform):
369369
tools_info = json.load(open(filename))["packages"][0]["tools"]
370370
tools_to_download = []
371371
for t in tools_info:
372+
if platform == "x86_64-mingw32":
373+
if "i686-mingw32" not in [p["host"] for p in t["systems"]]:
374+
raise Exception("Windows x64 requires both i686-mingw32 and x86_64-mingw32 tools")
375+
372376
tool_platform = [p for p in t["systems"] if p["host"] == platform]
373377
if len(tool_platform) == 0:
374378
# Fallback to x86 on Apple ARM
@@ -382,6 +386,8 @@ def load_tools_list(filename, platform):
382386
if len(tool_platform) == 0:
383387
continue
384388
else:
389+
if verbose:
390+
print(f"Tool {t['name']} is not available for platform {platform}")
385391
continue
386392
tools_to_download.append(tool_platform[0])
387393
return tools_to_download
@@ -433,6 +439,12 @@ def identify_platform():
433439
force_all = args.force_all
434440
is_test = args.test
435441

442+
# Set current directory to the script location
443+
if getattr(sys, "frozen", False):
444+
os.chdir(os.path.dirname(sys.executable))
445+
else:
446+
os.chdir(os.path.dirname(os.path.abspath(__file__)))
447+
436448
if is_test and (force_download or force_extract or force_all):
437449
print("Cannot combine test (-t) and forced execution (-d | -e | -f)")
438450
parser.print_help(sys.stderr)

0 commit comments

Comments
 (0)