Skip to content

Commit

Permalink
fix: don't create empty .libs directory (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 authored Jun 2, 2024
1 parent e969b7b commit d6e5b69
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/auditwheel/repair.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ def repair_wheel(

dest_dir = match.group("name") + lib_sdir

if not exists(dest_dir):
os.mkdir(dest_dir)

# here, fn is a path to an ELF file (lib or executable) in
# the wheel, and v['libs'] contains its required libs
for fn, v in external_refs_by_fn.items():
Expand All @@ -84,6 +81,8 @@ def repair_wheel(
% soname
)

if not exists(dest_dir):
os.mkdir(dest_dir)
new_soname, new_path = copylib(src_path, dest_dir, patcher)
soname_map[soname] = (new_soname, new_path)
replacements.append((soname, new_soname))
Expand Down
8 changes: 7 additions & 1 deletion tests/integration/test_manylinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

logger = logging.getLogger(__name__)


ENCODING = "utf-8"
PLATFORM = get_arch_name()
MANYLINUX1_IMAGE_ID = f"quay.io/pypa/manylinux1_{PLATFORM}:latest"
Expand Down Expand Up @@ -1000,8 +999,15 @@ def test_build_wheel_compat(
repaired_tag = f"{expect_tag}.{target_tag}"
repaired_wheel = f"testsimple-0.0.1-{PYTHON_ABI}-{repaired_tag}.whl"
assert repaired_wheel in filenames

assert_show_output(manylinux_ctr, repaired_wheel, expect, True)

with zipfile.ZipFile(os.path.join(io_folder, repaired_wheel)) as z:
for file in z.namelist():
assert not file.startswith(
"testsimple.libs"
), "should not have empty .libs folder"

docker_exec(docker_python, f"pip install /io/{repaired_wheel}")
docker_exec(
docker_python,
Expand Down

0 comments on commit d6e5b69

Please sign in to comment.