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

Prevent infinite recursion with pip wheel with $TMPDIR in $PWD #7873

Merged
merged 2 commits into from
Apr 10, 2020

Conversation

hroncok
Copy link
Contributor

@hroncok hroncok commented Mar 19, 2020

During a build of extension module within pip wheel the source directory is
recursively copied in a temporary directory.

See #7555

When the temporary directory is inside the source directory
(for example by setting TMPDIR=$PWD/tmp) this caused an infinite recursion
that ended in:

[Errno 36] File name too long

We prevent that buy never copying the target to the target in _copy_source_tree.

Fixes #7872

During a build of extension module within `pip wheel` the source directory is
recursively copied in a temporary directory.

See pypa#7555

When the temporary directory is inside the source directory
(for example by setting `TMPDIR=$PWD/tmp`) this caused an infinite recursion
that ended in:

    [Errno 36] File name too long

We prevent that buy never copying the target to the target in _copy_source_tree.

Fixes pypa#7872
@hroncok
Copy link
Contributor Author

hroncok commented Mar 19, 2020

I've decided to skip the test on Windows, because the empty source doesn't work there. Let me know if I shall write an actual stub extension instead, but I'd rather avoid that.

@hroncok
Copy link
Contributor Author

hroncok commented Mar 25, 2020

Is there anything else I need to change?

@pradyunsg pradyunsg added the type: enhancement Improvements to functionality label Mar 26, 2020
@pradyunsg pradyunsg merged commit 81f1054 into pypa:master Apr 10, 2020
@pradyunsg
Copy link
Member

@hroncok Nope; just needed one of us to click the green button. :)

@hroncok hroncok deleted the no_copy_self branch April 10, 2020 13:33
@hroncok
Copy link
Contributor Author

hroncok commented Apr 10, 2020

Thanks! 🙇

@sbidoul
Copy link
Member

sbidoul commented Apr 10, 2020

@hroncok #7882 may be of interest to you.

@hroncok
Copy link
Contributor Author

hroncok commented Apr 10, 2020

Thanks, I'm watching #7555 closely. Setting TMPDIR to pwd is just a temporary hack.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label May 20, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation type: enhancement Improvements to functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When $TMPDIR is within $PWD, pip wheel dies on infinite recursion
5 participants