@@ -259,7 +259,6 @@ def get_venv_symlinks(ctx, files, package, version_str, site_packages_root):
259259 if _is_linker_loaded_library (filename ):
260260 entry = VenvSymlinkEntry (
261261 kind = VenvSymlinkKind .LIB ,
262- # todo: omit setting link_to_path
263262 link_to_path = paths .join (runfiles_dir_name , site_packages_root , filename ),
264263 link_to_file = src ,
265264 package = package ,
@@ -297,8 +296,6 @@ def get_venv_symlinks(ctx, files, package, version_str, site_packages_root):
297296 files = depset ([src ]),
298297 )
299298 venv_symlinks .append (entry )
300- else :
301- fail ("hit" , src )
302299
303300 # Sort so that we encounter `foo` before `foo/bar`. This ensures we
304301 # see the top-most explicit package first.
@@ -336,16 +333,18 @@ def get_venv_symlinks(ctx, files, package, version_str, site_packages_root):
336333def _is_linker_loaded_library (filename ):
337334 """Tells if a filename is one that `dlopen()` or the runtime linker handles.
338335
339- This should return true for `libfoo.so` (regular C library), but not
340- `foo.so` (Python C extension library).
336+ This should return true for regular C libraries, but false for Python
337+ C extension modules.
338+
339+ Python extensions: .so (linux, mac), .pyd (windows)
340+
341+ C libraries: lib*.so (linux), lib*.so.* (linux), lib*.dylib (mac), .dll (windows)
341342 """
342- if not filename .startswith ("lib" ):
343- return False
344- if filename .endswith ((".so" , ".dylib" , ".lib" )):
343+ if filename .endswith (".dll" ):
345344 return True
346-
347- # Versioned library, e.g. libfoo. so.1.2.3
348- if ".so." in filename :
345+ if filename . startswith ( "lib" ) and (
346+ filename . endswith (( ".so" , ".dylib" )) or ". so." in filename
347+ ) :
349348 return True
350349 return False
351350
0 commit comments