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

pex_main: always clean up exploded zip when exiting #142

Conversation

chrisnovakovic
Copy link
Contributor

If a pex file contains zip-unsafe files or is otherwise told to explode itself when it runs (e.g. via the PEX_EXPLODE environment variable), pex_main extracts its own contents to a temporary directory. However, it only deletes those files after the entry point script finishes executing provided that the script does not throw an exception. For large pex archives, this can quickly fill up the file system containing the temporary directory.

Unconditionally delete the extracted contents of the pex when the entry point script finishes executing.

Fixes #131.

If a pex file contains zip-unsafe files or is otherwise told to explode
itself when it runs (e.g. via the `PEX_EXPLODE` environment variable),
`pex_main` extracts its own contents to a temporary directory. However,
it only deletes those files after the entry point script finishes
executing provided that the script does not throw an exception. For
large pex archives, this can quickly fill up the file system containing
the temporary directory.

Unconditionally delete the extracted contents of the pex when the entry
point script finishes executing.

Fixes please-build#131.
@chrisnovakovic chrisnovakovic added the bug Something isn't working label Jun 18, 2024
@chrisnovakovic chrisnovakovic merged commit 022a8df into please-build:master Jun 19, 2024
5 checks passed
@chrisnovakovic chrisnovakovic deleted the pex-always-clean-up-temp-files branch June 19, 2024 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pex_main.py doesn't clean up exploded zip
2 participants