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

Fix VCS subprocess output capture #9327

Closed
wants to merge 4 commits into from

Conversation

sbidoul
Copy link
Member

@sbidoul sbidoul commented Dec 20, 2020

Fixes #8876
Supersedes #9234

@Mikuana I took the liberty to continue your PR and attempt to do a complete fix for #8876. Could you test it ?

proc.stdin is always None per documentation
showing_subprocess is always True
@sbidoul sbidoul changed the title Vcs subprocess sbi Fix VCS subprocess output capture Dec 20, 2020
@Mikuana
Copy link

Mikuana commented Dec 20, 2020

@sbidoul that works! I tested your branch on a VCS git install of my problem repo, and it cloned without a hitch. Looks like the use of the subprocess.communicate was the right way to go.

Thank you for solving the deeper issue. I haven't contributed to pip before, and I didn't feel confident about mucking with more than 1 or 2 lines. I'll close out my #9234 in favor of this one.

@sbidoul sbidoul marked this pull request as ready for review December 20, 2020 18:18
@sbidoul
Copy link
Member Author

sbidoul commented Dec 20, 2020

@Mikuana thanks for reporting, investigating, and testing 👍

@sbidoul
Copy link
Member Author

sbidoul commented Dec 20, 2020

To be complete, I must mention that this PR will make #7841 reappear, but I think there is nothing pip can do for that one.

@sbidoul sbidoul added this to the 20.3.4 milestone Dec 20, 2020
@sbidoul sbidoul marked this pull request as draft December 21, 2020 05:37
@sbidoul
Copy link
Member Author

sbidoul commented Dec 21, 2020

Resetting to draft... the more I dig into this, the more I think #7969 has to be reverted. For instance, before there was careful control of output logging with call_subprocess's show_stdout parameter, which was sometimes True (e.g. for git clone) and sometimes False (e.g. for calls to git rev-parse).

@uranusjr
Copy link
Member

uranusjr commented Dec 21, 2020

This reminds me of a reflection when I was working on the VCS code a while ago (I forgot whether by myself or someone else). The vcs package using call_subprocess is a wrong abstraction. call_subprocess was mainly used for calling setup.py or PEP 517 backends, and emit InstallationError when it fails. But VCS operation errors are more akin to network errors occured in PackageFinder instead, and should not use the same function as the installation code in the first place.

@sbidoul
Copy link
Member Author

sbidoul commented Dec 21, 2020

@uranusjr indeed you mentioned that in #7711. As it turns out, extracting the relevant parts of call_subprocess while preserving its carefully crafted logging behaviours is not easy as we now discover, and we'd end up duplicating most of it. So in #9331 I expand call_subprocess to give it the ability to capture stdout without stderr.

@sbidoul
Copy link
Member Author

sbidoul commented Dec 21, 2020

So closing this one. Hopefully #9331 will be the good one. @Mikuana it'd be great if you could test it too.

@sbidoul sbidoul closed this Dec 21, 2020
@sbidoul sbidoul deleted the vcs-subprocess-sbi branch December 21, 2020 17:34
@sbidoul sbidoul removed this from the 20.3.4 milestone Dec 21, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pip install [git repo] hangs on clone step on Windows with large repositories
3 participants