Skip to content

Commit

Permalink
BUG: Resolve links before sorting library paths.
Browse files Browse the repository at this point in the history
Maybe this will work better?  I should look into whether ELF `so`s store their basename.
  • Loading branch information
DWesl authored Jul 9, 2024
1 parent bd5b614 commit c9c550f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions distutils/tests/test_build_ext.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import contextlib
import glob
import importlib
import os
import os.path
import platform
import re
import shutil
Expand Down Expand Up @@ -112,8 +112,8 @@ def test_build_ext(self, copy_so):
runtime_library_dirs=['/usr/lib'],
)
elif sys.platform == 'linux':
libz_so = glob.glob('/usr/lib*/libz.so*')
libz_so.sort(key=lambda lib_path: len(lib_path))
libz_so = {os.path.realpath(name) for name in glob.iglob('/usr/lib*/libz.so*')}
libz_so = sorted(libz_so, key=lambda lib_path: len(lib_path))
shutil.copyfile(libz_so[-1], '/tmp/libxx_z.so')

xx_ext = Extension(
Expand Down

0 comments on commit c9c550f

Please sign in to comment.