-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Found during dogfooding v2.5.35-dev.26434e2
Severity: Medium
Command: codegraph build . --verbose (incremental rebuild after single-file change)
Reproduction
# Modify one source file
echo "// test comment" >> src/logger.js
# Run incremental rebuild
codegraph build . --verboseExpected behavior
Only the changed file and its reverse-deps are re-parsed with no errors.
Actual behavior
The build produces a warning:
[codegraph WARN] Skipping src: EISDIR: illegal operation on a directory, read
and reports Parsed 27 files (1 skipped) — the src directory itself is being collected as a file to parse.
Root cause
During incremental rebuild, when computing reverse-deps for the changed file, the src directory entry appears in the set of files to re-parse. The builder then attempts to read src as a file, which fails with EISDIR. The error is caught and logged as a skip, but the root cause is that a directory path is leaking into the file re-parse set.
Likely in getChangedFiles() or the reverse-dep computation in builder.js — the import graph may have an edge pointing to the src/ directory node which gets included in the re-parse set.
Suggested fix
Filter out directory nodes when computing the set of files to re-parse during incremental builds. Check if entries are files (not directories) before adding them to the parse set.