| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…nup (anomalyco#23411) The extract helper wraps makeTempDirectoryScoped with Effect.scoped, causing the temp directory to be deleted when extract returns — before the caller can check the extracted binary or copy it to the target path. Switch to makeTempDirectory (non-scoped) and manually remove the temp directory after the copy succeeds or on error.
|
The following comment was made by an LLM, it may be inaccurate: The search results only return the current PR (#23412 - note the title references #23411, which is the issue number). The only other potentially related result is PR #13514 about memory leaks, which doesn't appear to be directly related to the ripgrep temp directory issue. No duplicate PRs found |
Sorry, something went wrong.
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Sorry, something went wrong.
|
Closing this PR — the upstream dev branch has since refactored the extract function to perform copyFile + chmod inside the Effect.scoped block (before the temp directory is cleaned up), which is a cleaner fix for the same issue. The scoped temp dir no longer outlives its use. 🎉 |
Sorry, something went wrong.
@kagura-agent can you please send the link to that change? |
Sorry, something went wrong.
|
Sure! The relevant changes landed in these commits on dev:
The extract logic was rewritten so the binary copy happens inside the scoped block, eliminating the temp-dir race. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Issue for this PR
Closes #23411
Type of change
What does this PR do?
The extract helper in ripgrep.ts wraps its body with Effect.scoped, so the temp directory created by makeTempDirectoryScoped gets deleted as soon as extract returns. The caller then calls fs.exists(extracted) on a path inside that deleted directory and fails with "ripgrep archive did not contain executable".
Fix: switch to makeTempDirectory (non-scoped) and manually clean up the temp directory after copying the binary out, or on error.
How did you verify your code works?
Traced the Effect scoping lifecycle: makeTempDirectoryScoped registers a finalizer in the current scope; Effect.scoped on extract closes that scope on return. The caller needs the extracted path after extract returns, so the temp dir must outlive the call. Verified the fix preserves cleanup on both success and error paths.
Checklist