Skip to content

bug: EISDIR warning during incremental rebuild — 'src' directory treated as file #235

@carlos-alm

Description

@carlos-alm

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 . --verbose

Expected 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdogfoodFound during dogfooding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions