Skip to content

Commit 4646ae1

Browse files
committed
Skip check for linked libs on symlinks
`file` will return "symbolic link to libxxx" which will then skip the remaining checks. So do not bother running `file` on it which is much slower than an `islink` check.
1 parent 43195ba commit 4646ae1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

easybuild/tools/systemtools.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,9 @@ def get_linked_libs_raw(path):
11181118
or None for other types of files.
11191119
"""
11201120

1121+
if os.path.islink(path):
1122+
_log.debug(f"{path} is a symbolic link, so skipping check for linked libs")
1123+
return None
11211124
res = run_shell_cmd("file %s" % path, fail_on_error=False, hidden=True, output_file=False, stream_output=False)
11221125
if res.exit_code != EasyBuildExit.SUCCESS:
11231126
fail_msg = "Failed to run 'file %s': %s" % (path, res.output)

0 commit comments

Comments
 (0)