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

Use exec.d to set PYTHONPYCACHEPREFIX #352

Merged
merged 1 commit into from
Jun 17, 2022
Merged

Use exec.d to set PYTHONPYCACHEPREFIX #352

merged 1 commit into from
Jun 17, 2022

Conversation

ryanmoran
Copy link
Member

Summary

We will need to use an exec.d binary to set the PYTHONPYCACHEPREFIX with the dynamic value for $HOME. This is because the values placed into the normal environment variable file API are not interpolated/expanded before the process is executed.

The original implementation of this feature (#340) assumed this interpolation/expansion incorrectly and the bug was being resolved with a surprising and unexpected behavior. Specifically, the __pycache__ contents we being written to /workspace/'$HOME'/.pycache.

This resolved the immediate bug in that these files were no longer being written into what should have been a read-only layer, but then caused another bug in that it would easily crash a watchexec process that was restarting a process when there were modifications to the /workspace directory.

Use Cases

Enables paketo-buildpacks/python#478 to be merged.

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

@ryanmoran ryanmoran requested a review from a team as a code owner June 16, 2022 18:31
cmd/env/internal/run_test.go Outdated Show resolved Hide resolved
cmd/env/main.go Show resolved Hide resolved
@robdimsdale robdimsdale added the semver:patch A change requiring a patch version bump label Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch A change requiring a patch version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants