Skip to content
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

don't add directory that doesn't include any files to $PATH or $LD_LIBRARY_PATH #3769

Merged
merged 3 commits into from
Jul 7, 2021

Conversation

Flamefire
Copy link
Contributor

While we already have detection of those containing any files recursively that is not enough: Those paths are NOT searched recursively, hence we need to check those folders only.

This happens a lot e.g. for Python packages where we have lib/python3.7/site-packages/foo.py with an otherwise empty lib.

And as each path added to those 2 env vars slows down execution/library loading it makes sense to clean those more.

test/framework/easyblock.py Outdated Show resolved Hide resolved
Co-authored-by: ocaisa <a.ocais@fz-juelich.de>
Copy link
Member

@ocaisa ocaisa left a comment

Choose a reason for hiding this comment

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

LGTM

@Flamefire
Copy link
Contributor Author

BTW: I'm not sure if we should do the same for LIBRARY_PATH as is done in e.g. PythonPackage, which would make that redundant and allow for removal of that. However for LIBRARY_PATH=/tmp/foo gcc -l:bar/lib.so it is possible to find /tmp/foo/bar/lib.so. This is a VERY unusual use and I'm not even sure if intended, but it is possible...

@ocaisa
Copy link
Member

ocaisa commented Jul 7, 2021

The fact that that is possible is perhaps enough for me to not include LIBRARY_PATH in this PR. LIBRARY_PATH is only used at link time so I don't think it's going to have the same level of impact as the other two.

@ocaisa ocaisa merged commit 20808ff into easybuilders:develop Jul 7, 2021
@Flamefire Flamefire deleted the empty_dirs branch July 7, 2021 12:39
@ocaisa
Copy link
Member

ocaisa commented Jul 7, 2021

Thanks for the improvement @Flamefire !

@migueldiascosta migueldiascosta added this to the next release (4.4.2?) milestone Jul 29, 2021
@boegel boegel changed the title Don't add empty PATH or LD_LIBRARY_PATH don't add directory that doesn't include any files to $PATH or $LD_LIBRARY_PATH Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants