Skip to content

Commit

Permalink
fix(get.py): Check if win32 tools also exist when running on win64 (e…
Browse files Browse the repository at this point in the history
…spressif#10565)

* fix(get.py): Check if win32 tools also exist when running on win64

* change(tools): Push generated binaries to PR

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
lucasssvaz and github-actions[bot] authored Nov 4, 2024
1 parent 870468b commit 11f3cff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Binary file modified tools/get.exe
Binary file not shown.
12 changes: 12 additions & 0 deletions tools/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ def load_tools_list(filename, platform):
tools_info = json.load(open(filename))["packages"][0]["tools"]
tools_to_download = []
for t in tools_info:
if platform == "x86_64-mingw32":
if "i686-mingw32" not in [p["host"] for p in t["systems"]]:
raise Exception("Windows x64 requires both i686-mingw32 and x86_64-mingw32 tools")

tool_platform = [p for p in t["systems"] if p["host"] == platform]
if len(tool_platform) == 0:
# Fallback to x86 on Apple ARM
Expand All @@ -382,6 +386,8 @@ def load_tools_list(filename, platform):
if len(tool_platform) == 0:
continue
else:
if verbose:
print(f"Tool {t['name']} is not available for platform {platform}")
continue
tools_to_download.append(tool_platform[0])
return tools_to_download
Expand Down Expand Up @@ -433,6 +439,12 @@ def identify_platform():
force_all = args.force_all
is_test = args.test

# Set current directory to the script location
if getattr(sys, "frozen", False):
os.chdir(os.path.dirname(sys.executable))
else:
os.chdir(os.path.dirname(os.path.abspath(__file__)))

if is_test and (force_download or force_extract or force_all):
print("Cannot combine test (-t) and forced execution (-d | -e | -f)")
parser.print_help(sys.stderr)
Expand Down

0 comments on commit 11f3cff

Please sign in to comment.