Skip to content

Commit

Permalink
Script improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 committed Aug 15, 2024
1 parent 04ff111 commit e80cda1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions suite/check_wheel_bin_arch.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
)

archs = {
"universal2": "[x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [arm64:Mach-O 64-bit dynamically linked shared library arm64]",
"x86_64": "x86_64",
"arm64": "arm64",
"aarch64": "ARM aarch64",
"i686": "Intel 80386",
"win32": "???",
"amd64": "x86-64",
"universal2": ["x86_64", "arm64"],
"x86_64": ["x86_64"],
"arm64": ["arm64"],
"aarch64": ["ARM aarch64"],
"i686": ["Intel 80386"],
"win32": ["???"],
"amd64": ["x86-64"],
}

filename = {
Expand Down Expand Up @@ -57,13 +57,14 @@
lib_path = Path(out_dir).joinpath(f"capstone/lib/{filename[platform]}")
result = sp.run(["file", "-b", f"{lib_path}"], capture_output=True, check=True)
stdout = result.stdout.decode("utf8").strip()
if archs[arch] not in stdout:
if any([a not in stdout for a in archs[arch]]):
success = False
log.error(f"The wheel '{file}' is not compiled for '{archs[arch]}'.")
log.error(f"Binary is: {stdout}")
print()
else:
log.info(f"OK: Arch: {arch} - {lib_path}")
log.info(f"Binary is: {stdout}")
log.info(f"Delete {out_dir}")
print()
os.system(f"rm -r {out_dir}")
Expand Down

0 comments on commit e80cda1

Please sign in to comment.