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

make sure ~/.cache/pip isn't used while installing Tkinter #1691

Merged
merged 1 commit into from Apr 23, 2019

Conversation

boegel
Copy link
Member

@boegel boegel commented Apr 23, 2019

I deliberately broke the use of $HOME/.cache/pip in my test account to catch occurrences where pip tries to use it (after we told it not to in #1687.

Tkinter installed failed because of that, with a Permission denied on $HOME/.cache/pip/wheels:

Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/home/example/.cache/pip/wheels/f7/0b/c4/81c147d50fe89c71703e455053466f33e558af45fbab1812f4'

which can be circumvented by pointing $XDG_CACHE_HOME to a temporary location

shutil.move(os.path.join(tmpdir, os.path.basename(tkparts[1])), pylibdir)
except (IOError, OSError) as err:
raise EasyBuildError("Failed to move Tkinter back to the install directory: %s", err)
move_file(os.path.join(tmpdir, tkparts[0]), os.path.join(pylibdir, tkparts[0]))
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't move_file take a dir as the second arg? Because if it can you should only need pylibdir there and not the path.join with tkparts[0].

And the same for the one below.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right now, it can't.

The problem is that you can't distinguish between a file or directory if the target doesn't exist yet in case you're moving a file: should the target directory be created, and the file moved into it, or should the parent of the target be created as a directory, and then the file moved to the specified target?

Copy link
Contributor

Choose a reason for hiding this comment

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

Aha, forgot the non-exist dir situation...

Copy link
Contributor

@akesandgren akesandgren left a comment

Choose a reason for hiding this comment

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

LGTM

@akesandgren
Copy link
Contributor

Going in, thanks @boegel!

@akesandgren akesandgren merged commit 193cbb8 into easybuilders:develop Apr 23, 2019
@boegel boegel deleted the Tkinter_pip_cache branch April 23, 2019 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants