Skip to content

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

Merged
merged 4 commits into from
Sep 30, 2019

Conversation

pared
Copy link
Contributor

@pared pared commented Sep 27, 2019

  • 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

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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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 😃

Copy link
Contributor

@efiop efiop Sep 30, 2019

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"] = ""

Copy link

@ghost ghost left a 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]>
Copy link
Contributor

@efiop efiop left a comment

Choose a reason for hiding this comment

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

Thanks!

@efiop efiop merged commit 119548e into iterative:master Sep 30, 2019
@pared pared deleted the 2475 branch December 17, 2019 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error on dvc get: GLIBC_2.18 not found. installed with fedora/centos
2 participants