Skip to content

fix: clean up system temp directory when running. #319

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

Merged
merged 1 commit into from
Sep 24, 2018

Conversation

chriskrycho
Copy link
Member

While the system temp directory gets cleaned up semi-regularly, on long-running machines (e.g. CI servers), it is possible for the PID to get reused before the system temp directory gets cleared. When this happens, the temp directory we create as an intermediate location for TypeScript build artifacts (to prevent churn in the build) can end up being used for multiple builds, even across separate apps. This can result in very bad output from the build, including total runtime failures from things like require entries including files from different builds or apps.

Prevent this by always running fs.removeSync on the temp output directory prior to setting it and putting new output there.

Fixes #318.

While the system temp directory gets cleaned up semi-regularly,
on long-running machines (e.g. CI servers), it is possible for
the PID to get reused before the system temp directory gets
cleared. When this happens, the temp directory we create as an
intermediate location for TypeScript build artifacts (to prevent
churn in the build) can end up being used for multiple builds,
even across separate apps. This can result in very bad output
from the build, including total runtime failures from things like
`require` entries including files from different builds or apps.

Prevent this by always running `fs.removeSync` on the temp output
directory prior to setting it and putting new output there.

Fixes #318.
@chriskrycho chriskrycho merged commit 9ee7b2a into master Sep 24, 2018
@chriskrycho chriskrycho deleted the clean-up-system-temp branch September 24, 2018 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant