@@ -134,7 +134,7 @@ class LibSymlink(Enum):
134134 - LIB64_TO_LIB: 'lib64' is a symlink to 'lib'
135135 - NEITHER: neither 'lib' is a symlink to 'lib64', nor 'lib64' is a symlink to 'lib'
136136 - """
137- UNKNOWN , LIB_TO_LIB64 , LIB64_TO_LIB , NEITHER = range (0 , 4 )
137+ LIB_TO_LIB64 , LIB64_TO_LIB , NEITHER = range (3 )
138138
139139
140140class EasyBlock (object ):
@@ -226,7 +226,7 @@ def __init__(self, ec, logfile=None):
226226 self .install_subdir = None
227227
228228 # track status of symlink between library directories
229- self .install_lib_symlink = LibSymlink . UNKNOWN
229+ self ._install_lib_symlink = None
230230
231231 # indicates whether build should be performed in installation dir
232232 self .build_in_installdir = self .cfg ['buildininstalldir' ]
@@ -311,6 +311,13 @@ def __init__(self, ec, logfile=None):
311311
312312 self .log .info ("Init completed for application name %s version %s" % (self .name , self .version ))
313313
314+ @property
315+ def install_lib_symlink (self ):
316+ """Return symlink state of lib/lib64 folders"""
317+ if self ._install_lib_symlink is None :
318+ self .check_install_lib_symlink ()
319+ return self ._install_lib_symlink
320+
314321 def post_init (self ):
315322 """
316323 Run post-initialization tasks.
@@ -1719,10 +1726,6 @@ def expand_module_search_path(self, search_path, path_type=ModEnvVarType.PATH_WI
17191726 abs_glob = os .path .join (self .installdir , search_path )
17201727 exp_search_paths = [abs_glob ] if search_path == "" else glob .glob (abs_glob )
17211728
1722- # Explicitly check symlink state between lib dirs if it is still undefined (e.g. --module-only)
1723- if self .install_lib_symlink == LibSymlink .UNKNOWN :
1724- self .check_install_lib_symlink ()
1725-
17261729 retained_search_paths = []
17271730 for abs_path in exp_search_paths :
17281731 # return relative paths
@@ -1751,16 +1754,16 @@ def expand_module_search_path(self, search_path, path_type=ModEnvVarType.PATH_WI
17511754 return retained_search_paths
17521755
17531756 def check_install_lib_symlink (self ):
1754- """Check symlink state between library directories in installation prefix"""
1757+ """Update the symlink state between library directories in installation prefix"""
17551758 lib_dir = os .path .join (self .installdir , 'lib' )
17561759 lib64_dir = os .path .join (self .installdir , 'lib64' )
17571760
1758- self .install_lib_symlink = LibSymlink .NEITHER
1761+ self ._install_lib_symlink = LibSymlink .NEITHER
17591762 if os .path .exists (lib_dir ) and os .path .exists (lib64_dir ):
17601763 if os .path .islink (lib_dir ) and os .path .samefile (lib_dir , lib64_dir ):
1761- self .install_lib_symlink = LibSymlink .LIB_TO_LIB64
1764+ self ._install_lib_symlink = LibSymlink .LIB_TO_LIB64
17621765 elif os .path .islink (lib64_dir ) and os .path .samefile (lib_dir , lib64_dir ):
1763- self .install_lib_symlink = LibSymlink .LIB64_TO_LIB
1766+ self ._install_lib_symlink = LibSymlink .LIB64_TO_LIB
17641767
17651768 def make_module_req_guess (self ):
17661769 """
0 commit comments