Skip to content

Commit a691a55

Browse files
committed
chore: do not group libraries by real soname
1 parent 3570012 commit a691a55

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

src/auditwheel/repair.py

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
import re
66
import shutil
77
import stat
8-
from collections import OrderedDict, defaultdict
8+
from collections import OrderedDict
99
from os.path import abspath, basename, dirname, exists, isabs
1010
from os.path import join as pjoin
1111
from subprocess import check_call
12-
from typing import Dict, Iterable, List, Optional, Set, Tuple
12+
from typing import Dict, Iterable, List, Optional, Tuple
1313

1414
from auditwheel.patcher import ElfPatcher
1515

@@ -73,8 +73,7 @@ def repair_wheel(
7373
for fn, v in external_refs_by_fn.items():
7474
ext_libs = v[abis[0]]["libs"] # type: Dict[str, str]
7575
replacements = [] # type: List[Tuple[str, str]]
76-
src_path_real_soname_map = {} # type: Dict[str, str]
77-
same_soname_libs = defaultdict(set) # type: Dict[str, Set[str]]
76+
copied_ext_libs = {} # type: Dict[str, str]
7877
for soname, src_path in ext_libs.items():
7978
if src_path is None:
8079
raise ValueError(
@@ -85,21 +84,14 @@ def repair_wheel(
8584
% soname
8685
)
8786

88-
real_soname = patcher.get_soname(src_path)
89-
src_path_real_soname_map[real_soname] = src_path
90-
same_soname_libs[real_soname].add(soname)
91-
92-
if not copy_site_libs:
93-
for soname, src_path in ext_libs.items():
94-
if "site-packages" in str(src_path).split(os.path.sep):
95-
same_soname_libs.pop(src_path_real_soname_map[src_path], None)
96-
97-
for real_soname, sonames in same_soname_libs.items():
98-
if len(sonames) == 0:
87+
if not copy_site_libs and "site-packages" in str(src_path).split(
88+
os.path.sep
89+
):
9990
continue
100-
soname = sonames.pop() # only keep one .so file (remove duplicates)
101-
src_path = ext_libs[soname]
10291

92+
copied_ext_libs[soname] = src_path
93+
94+
for soname, src_path in copied_ext_libs.items():
10395
new_soname, new_path = copylib(src_path, dest_dir, patcher)
10496
soname_map[soname] = (new_soname, new_path)
10597
replacements.append((soname, new_soname))

0 commit comments

Comments
 (0)