Skip to content

Commit bd5b614

Browse files
authored
FIX: Sort library names by length to avoid links
I think /usr/lib/libz.so links to /usr/lib/libz.so.10, which in turn links to /usr/lib/libz.so.10.5.1 (numbers may differ), with the last being the actual library. Ensure that is the one I copy for linking.
1 parent 9e873c2 commit bd5b614

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

distutils/tests/test_build_ext.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def test_build_ext(self, copy_so):
113113
)
114114
elif sys.platform == 'linux':
115115
libz_so = glob.glob('/usr/lib*/libz.so*')
116+
libz_so.sort(key=lambda lib_path: len(lib_path))
116117
shutil.copyfile(libz_so[-1], '/tmp/libxx_z.so')
117118

118119
xx_ext = Extension(

0 commit comments

Comments
 (0)