Skip to content

Commit

Permalink
Some wheels have non-arm shared libraries in them?
Browse files Browse the repository at this point in the history
  • Loading branch information
virtuald committed Jan 12, 2024
1 parent f1ed22f commit 62f9fee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ NPY_DISABLE_SVML = "1"
[packages.pydevd]
version = "2.10.0"
mod_version = "2.10.0+r2"
strip_fail_ok = true

[packages.pyinstrument]
version = "4.6.0"
Expand Down
15 changes: 13 additions & 2 deletions whl_mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def add_requirements_to_wheel(
project: str,
version: str,
out_version: str,
strip_fail_ok: bool,
reqs: typing.List[str],
):
whldir = os.path.dirname(wheel)
Expand Down Expand Up @@ -82,7 +83,13 @@ def add_requirements_to_wheel(
if fname.endswith("so") or ".so." in fname:
args = [strip_exe, full_fname]
print("+", *args)
subprocess.check_call(args)
try:
subprocess.check_call(args)
except subprocess.CalledProcessError as e:
if strip_fail_ok:
print(e)
else:
raise

# If we are changing the version, then delete RECORD and rename dist-info
if version != out_version:
Expand Down Expand Up @@ -122,6 +129,10 @@ def add_requirements_to_wheel(
if out_version is None:
out_version = version

strip_fail_ok = pkgdata.get("strip_fail_ok", False)

reqs = pkgdata.get("install_requirements")
if reqs or out_version != version:
add_requirements_to_wheel(args.wheel, project, version, out_version, reqs)
add_requirements_to_wheel(
args.wheel, project, version, out_version, strip_fail_ok, reqs
)

0 comments on commit 62f9fee

Please sign in to comment.