-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
A race condition in the CI environment is causing build failures with ENOTEMPTY errors when multiple processes attempt to clean and write to the same src/dist directory concurrently.
Error Details
roo-cline:test: roo-cline:bundle: [extension] Cleaning dist directory: /home/runner/work/Roo-Code/Roo-Code/src/dist
roo-cline:test: roo-cline:bundle: Error: ENOTEMPTY: directory not empty, rmdir '/home/runner/work/Roo-Code/Roo-Code/src/dist'
roo-cline:test: roo-cline:bundle: at Object.rmdirSync (node:fs:1215:11)
roo-cline:test: roo-cline:bundle: at _rmdirSync (node:internal/fs/rimraf:262:21)
roo-cline:test: roo-cline:bundle: at rimrafSync (node:internal/fs/rimraf:195:7)
roo-cline:test: roo-cline:bundle: at Module.rmSync (node:fs:1264:10)
roo-cline:test: roo-cline:bundle: at main (file:///home/runner/work/Roo-Code/Roo-Code/src/esbuild.mjs:39:6)Root Cause
The pnpm test command executed by the platform-unit-test job uses turbo to run tasks for multiple packages in parallel. The build script src/esbuild.mjs is being executed concurrently by different packages (e.g., roo-cline and @roo-code/types).
This script is not safe for concurrent execution because it cleans and writes to the same shared directory, src/dist. The error occurs when one process attempts to delete the src/dist directory while another process has already started writing new build artifacts back into it.
Reproduction
This issue was triggered in the following CI run:
CI Run #15669447487 (PR #4733)
Possible Solutions
- Modify
src/esbuild.mjsto allow each package to build to a unique output directory - Configure
turbo.jsonto force the conflictingbundletasks to run serially - Implement a locking mechanism to prevent concurrent access to the shared directory
Metadata
Metadata
Assignees
Labels
Type
Projects
Status