You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The Bug
We use the
process.pid
for building the output directory:ember-cli-typescript/ts/lib/incremental-typescript-compiler/index.js
Line 119 in 1228ff0
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:
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.The text was updated successfully, but these errors were encountered: