Skip to content

Commit d914acd

Browse files
committed
cli: Prevent . from being added to CLOE_PLUGIN_PATH
An empty entry in LD_LIBRARY_PATH is interpreted as the current working directory. Conan sets LD_LIBRARY_PATH in such a way that it inserts an empty entry, inadvertently.
1 parent 093bd23 commit d914acd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cli/cloe_launch/exec.py

+6
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,12 @@ def _extract_plugin_paths(self, env: Environment) -> List[Path]:
429429
"""Return all Cloe plugin paths we find in LD_LIBRARY_PATH."""
430430
plugin_paths = []
431431
for libdir in env.get_list("LD_LIBRARY_PATH", default=[]):
432+
# Conan defines LD_LIBRARY_PATH like this:
433+
# LD_LIBRARY_PATH=...:$LD_LIBRARY_PATH
434+
# If the initial value is empty, this leads to an empty item in the list;
435+
# we don't want this to be interpreted as CWD.
436+
if len(libdir) == 0:
437+
continue
432438
pp = Path(libdir) / "cloe"
433439
if pp.exists():
434440
plugin_paths.append(pp)

0 commit comments

Comments
 (0)