Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
41 changes: 41 additions & 0 deletions tests/integration/test_bundled_wheels.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,3 +277,44 @@ def test_weak_symbols_not_blacklisted() -> None:
assert result.policies.libc == Libc.GLIBC
assert result.policies.architecture == Architecture.x86_64
assert result.overall_policy.name == "manylinux_2_17_x86_64"


def test_symbol_blacklist(
monkeypatch: pytest.MonkeyPatch,
capsys: pytest.CaptureFixture[str],
) -> None:
# wheel built using main@dda40c214e3db607b6ab31cd4cf9e3e5e1347937
# AUDITWHEEL_ARCH=x86_64 nox -s tests-3.10 -- \
# 'tests/integration/test_manylinux.py::TestManylinux::test_zlib_blacklist[manylinux_2_12]'
wheel = HERE / "testzlib-0.0.1-cp310-cp310-linux_x86_64.whl"
result = analyze_wheel_abi(
None,
None,
wheel,
frozenset(),
disable_isa_ext_check=False,
allow_graft=False,
)
Comment thread
mayeut marked this conversation as resolved.
assert result.policies.libc == Libc.GLIBC
assert result.policies.architecture == Architecture.x86_64
assert result.overall_policy.name == "linux_x86_64"
assert result.blacklist_policy.name == "linux_x86_64"
assert result.sym_policy.name == "manylinux_2_12_x86_64"
assert result.graft_policy.name == "manylinux_2_5_x86_64"
assert result.machine_policy.name == "manylinux_2_5_x86_64"
assert result.pyfpe_policy.name == "manylinux_2_5_x86_64"
assert result.ref_policy.name == "manylinux_2_5_x86_64"
assert result.ucs_policy.name == "manylinux_2_5_x86_64"

monkeypatch.setattr(sys, "platform", "linux")
monkeypatch.setattr(Architecture, "detect", lambda: Architecture.x86_64)
monkeypatch.setattr(sys, "argv", ["auditwheel", "repair", str(wheel)])
with pytest.raises(SystemExit):
main()
captured = capsys.readouterr()
assert " because it depends on black-listed symbols" in captured.err.replace("\n", " ")

monkeypatch.setattr(sys, "argv", ["auditwheel", "-v", "show", str(wheel)])
main()
captured = capsys.readouterr()
assert "black-listed symbol dependencies" in captured.out.replace("\n", " ")
Comment thread
mayeut marked this conversation as resolved.
26 changes: 0 additions & 26 deletions tests/integration/test_manylinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -1206,32 +1206,6 @@ def test_mvec(self, anylinux: AnyLinuxContainer, python: PythonContainer) -> Non
# Test the resulting wheel outside the manylinux container
python.install_wheel(repaired_wheel)

def test_zlib_blacklist(self, anylinux: AnyLinuxContainer) -> None:
policy = anylinux.policy
if policy.startswith(
(
"manylinux_2_17_",
"manylinux_2_28_",
"manylinux_2_31_",
"manylinux_2_34_",
"manylinux_2_35_",
"manylinux_2_39_",
),
):
pytest.skip(f"{policy} image has no blacklist symbols in libz.so.1")

test_path = "/auditwheel_src/tests/integration/testzlib"
orig_wheel = anylinux.build_wheel(test_path)
assert orig_wheel.startswith("testzlib-0.0.1")

# Repair the wheel using the appropriate manylinux container
with pytest.raises(CalledProcessError):
anylinux.repair(orig_wheel)

# Check auditwheel show warns about the black listed symbols
output = anylinux.show(orig_wheel, verbose=True)
assert "black-listed symbol dependencies" in output.replace("\n", " ")

@pytest.mark.skipif(PLATFORM != "aarch64", reason="glibc blacklist only for aarch64")
def test_glibc_blacklist(self, anylinux: AnyLinuxContainer, python: PythonContainer) -> None:
# https://github.com/pypa/auditwheel/issues/647
Expand Down
Binary file not shown.
3 changes: 0 additions & 3 deletions tests/integration/testzlib/pyproject.toml

This file was deleted.

19 changes: 0 additions & 19 deletions tests/integration/testzlib/setup.py

This file was deleted.

46 changes: 0 additions & 46 deletions tests/integration/testzlib/testzlib.c

This file was deleted.

Loading