-
Notifications
You must be signed in to change notification settings - Fork 157
Remove libpython linkage instead of ignoring it. #590
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
7ee5d9c
Remove libpython linkage instead of ignoring it.
vyasr b4fec25
Fix test
vyasr ae2555c
Fix one more test
vyasr 43706ff
revert pre-commit change
mayeut 6fb620a
remove the DT_NEEDED entry rather than replacing with an empty one
mayeut 97b917a
add unit test for `Patchelf.remove_needed`
mayeut baea7e0
add tests
mayeut 27232ac
fix linter
mayeut de559c7
use conftest.py to cleanup environment variables for tests
mayeut c2f19bc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 46e0cc3
fix linter
mayeut b3abe00
update tests
mayeut 88161c0
fix: `LIBPYTHON_RE` regex
mayeut 05c1e54
Update link to issue
mayeut File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import os | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture(autouse=True, scope="session") | ||
def clean_env(): | ||
variables = ("AUDITWHEEL_PLAT", "AUDITWHEEL_ZIP_COMPRESSION_LEVEL") | ||
for var in variables: | ||
os.environ.pop(var, None) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Binary file added
BIN
+3.85 MB
tests/integration/python_mscl-67.0.1.0-cp313-cp313-manylinux2014_aarch64.whl
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
from auditwheel.architecture import Architecture | ||
from auditwheel.lddtree import LIBPYTHON_RE, ldd | ||
from auditwheel.libc import Libc | ||
from auditwheel.tools import zip2dir | ||
|
||
HERE = Path(__file__).parent.resolve(strict=True) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"soname", | ||
[ | ||
"libpython3.7m.so.1.0", | ||
"libpython3.9.so.1.0", | ||
"libpython3.10.so.1.0", | ||
"libpython999.999.so.1.0", | ||
], | ||
) | ||
def test_libpython_re_match(soname: str) -> None: | ||
assert LIBPYTHON_RE.match(soname) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"soname", | ||
[ | ||
"libpython3.7m.soa1.0", | ||
"libpython3.9.so.1a0", | ||
], | ||
) | ||
def test_libpython_re_nomatch(soname: str) -> None: | ||
assert LIBPYTHON_RE.match(soname) is None | ||
|
||
|
||
def test_libpython(tmp_path: Path, caplog: pytest.CaptureFixture) -> None: | ||
wheel = ( | ||
HERE | ||
/ ".." | ||
/ "integration" | ||
/ "python_mscl-67.0.1.0-cp313-cp313-manylinux2014_aarch64.whl" | ||
) | ||
so = tmp_path / "python_mscl" / "_mscl.so" | ||
zip2dir(wheel, tmp_path) | ||
result = ldd(so) | ||
assert "Skip libpython3.13.so.1.0 resolution" in caplog.text | ||
assert result.interpreter is None | ||
assert result.libc == Libc.GLIBC | ||
assert result.platform.baseline_architecture == Architecture.aarch64 | ||
assert result.platform.extended_architecture is None | ||
assert result.path is not None | ||
assert result.realpath.samefile(so) | ||
assert result.needed == ( | ||
"libpython3.13.so.1.0", | ||
"libstdc++.so.6", | ||
"libm.so.6", | ||
"libgcc_s.so.1", | ||
"libc.so.6", | ||
"ld-linux-aarch64.so.1", | ||
) | ||
# libpython must be present in dependencies without path | ||
libpython = result.libraries["libpython3.13.so.1.0"] | ||
assert libpython.soname == "libpython3.13.so.1.0" | ||
assert libpython.path is None | ||
assert libpython.platform is None | ||
assert libpython.realpath is None | ||
assert libpython.needed == () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, this is the right approach.