Closed
Description
The Bug
We use the process.pid
for building the output directory:
This can cause different builds (even from different apps) to end up with the same directory in the build tree. Here's the scenario where we triggered it:
- running on CI, so reusing the same local directory for various apps (because it's just getting checked out to some default checkout directory)
- the system temp directory we created doesn't get deleted for some reason (we don't delete it in e-c-ts at all as far I can see)
- the PID happens to get recycled
When this happens, the actual same folder on disk gets reused, and you can end up with build artifacts from a previous build – including from totally separate applications! – in the build pipeline, causing runtime require
resolution errors or similarly weird behaviors.
- We should generate a UUID or some such for those to make sure that this kind of collision isn't possible.
- We should be good citizens and clear the directory when we're done.