-
Notifications
You must be signed in to change notification settings - Fork 1.2k
utils: fix_env: dont delete LD_LIBRARY_PATH from env #2541
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
Conversation
dvc/utils/__init__.py
Outdated
env.pop(lp_key, None) | ||
# We used to delete "LD_LIBRARY_PATH" key. We cannot do that | ||
# because GitPython uses env to "update" his own internal state. | ||
# When there is no key in env, this value is not updated and |
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.
I guess this part of the explanation is about why setting None
doesn't work, no?
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.
I wouldn't say that.
This explains why we prefer to set the empty string for "LD_LIBRARY_PATH" over deleting it from the env
dictionary.
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.
Also please add a link to that gitpython issue.
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.
And it is worth noting that this is only relevant for clone_from
really, where env
behaves weirdly, but other things work fine. Hm, it also makes me think whether we should do needed modifications for clone_from specifically and not here. I don't see how this approach would backstub us in the future yet, but it sure makes me a bit nervous 😃
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.
Discussed with @pared that it would make sense to indeed move this logic to 'dvc/scm/git/init.py:Git.clone' to be safe. It could look something like
env = fix_env()
if is_binary():
env["LD_LIBRARY_PATH"] = ""
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.
LGTM 👍
Co-Authored-By: Ruslan Kuprieiev <[email protected]>
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.
Thanks!
Have you followed the guidelines in our
Contributing document?
Does your PR affect documented changes or does it add new functionality
that should be documented? If yes, have you created a PR for
dvc.org documenting it or at
least opened an issue for it? If so, please add a link to it.
Fixes #2471