-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
only add useful entries for $CPATH, $(LD_)LIBRARY_PATH and $PATH #3145
only add useful entries for $CPATH, $(LD_)LIBRARY_PATH and $PATH #3145
Conversation
This avoids adding useless entries in the environment, an example being GCCcore which adds lib and include which are both empty apart from subdirectories.
…tiple paths considered in make_module_req
easybuild/framework/easyblock.py
Outdated
@@ -1301,6 +1301,12 @@ def make_module_req(self): | |||
# only use glob if the string is non-empty | |||
if path and not self.dry_run: | |||
paths = sorted(glob.glob(path)) | |||
if key in ('PATH', 'CPATH', 'LIBRARY_PATH', 'LD_LIBRARY_PATH') and len(paths) == 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bartoldeman I don't think there's a need to only do this when there's a single directory being considered?
see ComputeCanada#18
also only retain subdirs with at least one file in case there are multiple paths considered in make_module_req
This heavily breaks modules! You usually have a structure like include/libfoo/libfoo.h but include won't be added to CPATH due to it not containing a file, but "only" a folder Working on a fix... |
@Flamefire correct, sorry I missed that. May be simplest to exclude CPATH? The same reasoning does not apply to LIBRARY_PATH/LD_LIBRARY_PATH/PATH. |
Does it? I think you are right, but I'm not 100% sure. E.g. pkgconfig for a header-only library would be a counter-example. |
Playing it safe: #3152 removes only folders that have no files recursively |
Can you elaborate on pkgconfig @Flamefire ? PKG_CONFIG_PATH is not in the list so I don't understand this. |
Now the safe fix defeats the purpose which is to avoid the empty GCCcore directories and similar cases, now they are added again. |
Ah yes, you are right. Still: Are you 100% sure there is no Can you elaborate on the GCCcore issue? If the folders are really empty, they won't be added. "Empty"=="Do not contain any file and no subdirectory which contains a file" so |
I don't understand @bartoldeman's point either, the fix in #3152 (ignoring directories that don't contain any files) makes sense imho... |
@Flamefire @boegel With GCCcore we have:
|
Actually I should now change the gcc easyblock to remove lib from LD_LIBRARY_PATH for non-32-bit capable gcc (ie. the common case). I'll submit a new PR for that. |
Ok so there is a file What is the deal with lib? Is there any file in there in 64 bit? If not, my PR is enough, isn't it? |
This avoids adding useless entries in the environment, an
example being GCCcore which adds lib and include which are both
empty apart from subdirectories.