fix(cli): stall on some forge cli builds#1840
Conversation
when a lot of data is outputted by forge, it can cause the build process to stall with no explanation. This is because the buffers are getting filled and cannon has to consume them, otherwise the child process halts.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
PR Review: Fix for Forge Build Process StallingThank you for addressing this important issue! This PR fixes a critical bug where the forge build process could stall when producing large amounts of output. Here is my detailed review: Strengths
Critical Bug FoundLocation: packages/cli/src/index.ts:221 and packages/cli/src/index.ts:224 The current code has a critical bug:
Fix Required:
Other Issues
Performance ConsiderationsAfter fixing the array mutation bug, consider limiting by total BYTES instead of CHUNKS, since each chunk could be large. Suggest using a 1MB limit and tracking cumulative size. Security ConsiderationsNo security concerns identified. The code properly sanitizes output and limits buffer size. Recommendations
SummaryThis PR solves a real problem but has a critical bug that prevents the error output from being captured and displayed. Once the array mutation issue is fixed, this will be a solid improvement to the developer experience. Recommendation: Request changes to fix the array.slice() bug before merging. Great work identifying and tackling this tricky issue with child process buffers! |
reduce noise of code reviewer
|
merging because positive feedback from client, good AI review |
When forge outputs large amounts of data (verbose builds, many warnings),
the child process buffers would fill causing the process to block.
This fix actively consumes stdout/stderr streams and displays them
on build failure to improve debuggability.