Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions easybuild/easyblocks/r/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,15 @@ def configure_step(self):
llvm_root = get_software_root('LLVM')
if llvm_root:
llvm_inc = os.path.join(llvm_root, 'include')
cpath = os.getenv('CPATH')
if cpath:
new_cpath = [p for p in cpath.split(os.pathsep) if p != llvm_inc]
self.log.info("Filtered %s from $CPATH to avoid using LLVM loaded as indirect dependency", llvm_inc)
setvar('CPATH', os.pathsep.join(new_cpath))
header_vars = self.toolchain.search_path_vars_headers
for header_var in header_vars:
header_paths = os.getenv(header_var, "")
new_header_paths = [p for p in header_paths.split(os.pathsep) if p != llvm_inc]
if new_header_paths:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this would ever evaluate to False?
If header_paths is an empty string, then new_header_paths will be [''], which is truthy

self.log.info(
f"Filtered '{llvm_inc}' from ${header_var} to avoid using LLVM loaded as indirect dependency"
)
setvar(header_var, os.pathsep.join(new_header_paths))

cfitsio_root = get_software_root('CFITSIO')
if cfitsio_root:
Expand Down