fix: skip scanner symlink cycles and map compile_batch panics - #3
Merged
Merged
Conversation
Library and source scanners no longer follow directory or file symlinks, and skip target/.git/build trees. compile_batch reports worker panics as CompileError instead of unwinding. Amp-Thread-ID: https://ampcode.com/threads/T-01a0a631-cbad-764e-a59c-662f4c6e0902 Co-authored-by: Max Carter <undivisible@vk.com>
|
Capy couldn't review this pull request because Max's workspace is out of credits, add credits or enable auto-reload to resume automatic reviews. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_5f32ba52-8171-41b1-b37c-b98aa8a43a74) |
|
Tick the box to add this pull request to the merge queue (same as
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Independent of #1 (load/compile hardening).
scan_directoryandLibraryScannerskip symlinks so directory cycles cannot hang discoverytarget,.git,build, and other non-source trees (matching detector)compile_batchmaps worker panics toCompileErrorinstead ofjoin().unwrap()Test plan
cargo test --all-featurescargo clippy --all-targets --all-features -- -D warningscargo fmt --all -- --checktarget/headersNote
Low Risk
Localized filesystem-walk and error-handling changes with tests; no auth, data, or API contract breaks beyond surfacing panics as errors.
Overview
Hardens directory discovery and parallel compilation so bad filesystem layouts and worker failures do not crash the process.
Discovery (
scan_directory,LibraryScanner) now classifies entries withfile_type()and ignores symlinks, so symlinked directory trees cannot cause infinite recursion or hangs. The library header scanner also skips the same non-source directories as the detector (target,.git,build,dist,zig-cache,nimcache, etc.) when recursing.compile_batchno longer panics if a scoped worker thread panics:join()failures are turned intoCompileError::Iowith a clear message instead of propagating an unwrap panic.Tests cover symlinked-dir skipping (Unix) and ignoring headers under
target/.Reviewed by Cursor Bugbot for commit f82581a. Configure here.