Skip to content

lddtree: support alternative LD_LIBRARY_PATH called AUDITWHEEL_LD_LIBRARY_PATH #575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions tests/integration/test_bundled_wheels.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,25 @@ def test_analyze_wheel_abi(file, external_libs, exclude):
# If exclude libs contain path, LD_LIBRARY_PATH need to be modified to find the libs
# `lddtree.load_ld_paths` needs to be reloaded for it's `lru_cache`-ed.
modify_ld_library_path = any(isabs(e) for e in exclude)
lddtree.parse_ld_so_conf.cache_clear()

for env_var in ["LD_LIBRARY_PATH", "AUDITWHEEL_LD_LIBRARY_PATH"]:
with pytest.MonkeyPatch.context() as cp:
if modify_ld_library_path:
cp.setenv(env_var, f"{HERE}")
importlib.reload(lddtree)

winfo = analyze_wheel_abi(
Libc.GLIBC, Architecture.x86_64, HERE / file, exclude, False, True
)
assert (
set(winfo.external_refs["manylinux_2_5_x86_64"].libs) == external_libs
), f"{HERE}, {exclude}, {os.environ}"
lddtree.parse_ld_so_conf.cache_clear()

with pytest.MonkeyPatch.context() as cp:
if modify_ld_library_path:
cp.setenv("LD_LIBRARY_PATH", f"{HERE}")
importlib.reload(lddtree)

winfo = analyze_wheel_abi(
Libc.GLIBC, Architecture.x86_64, HERE / file, exclude, False, True
)
assert set(winfo.external_refs["manylinux_2_5_x86_64"].libs) == external_libs, (
f"{HERE}, {exclude}, {os.environ}"
)

if modify_ld_library_path:
importlib.reload(lddtree)


def test_analyze_wheel_abi_pyfpe():
winfo = analyze_wheel_abi(
Expand Down