Issue #2760: A path dependency without src/ ends in a raw “cannot read …/src” and a Rust backtrace instead of an NK refusal

Open and answer this issue on GitHub.

bug, ready · opened 2026-11-22 · updated 2026-11-22 · 0 comments

Found while building #2516 (the builder’s report, docs/briefs/safety/issue-2516.md.report.md).

Probe

app/nikaia.toml:   [dependencies] demo = { path = "../demo" }
demo/nikaia.toml   (any valid manifest)
demo/nikaia.contracts
demo/               no src/ directory

Running nikaia run in app/ prints a raw Error: cannot read …/demo/src followed by a Rust stack backtrace.

Expected

The same refusal an empty src/ already gets (“src has no .nika files, so there’s nothing to build”), as an NK diagnostic that names the dependency. No backtrace.

Cause (suspected, not traced)

The package source reader in crates/nikaia/src/modules.rs (modules_package_at) propagates the I/O error of the missing directory instead of treating it as “no sources”.

To build

  1. A missing src/ of a path dependency gets the refusal of an empty src/. Where the code is Rust that cannot be moved, the fix stays in Rust; otherwise it moves into Nikaia (CLAUDE.md).
  2. A test in tests/compiler/tests/ with the probe above and its expected .stderr.

Done when

The probe prints the NK refusal and no backtrace, and the test passes.

Back to Open Issues