Follow-up to the fix in ec705c3 (from @Pytonballoon810's #188), which stops the search when the file's own directory carries a sym-lib-table or fp-lib-table. That covers the reproducible failure and the hermetic-fixture case. It does not bound the walk in general.
Residual
project_root_for (crates/konnect-core/src/tools/library.rs) still climbs ancestors without limit when the schematic's directory carries neither a library table nor a .kicad_pro:
~/Documents/Other.kicad_pro <- unrelated project
~/Documents/work/foo.kicad_sch <- no table, no project beside it
The walk leaves work/, finds Other.kicad_pro, and every library lookup for foo.kicad_sch then resolves ${KIPRJMOD} against ~/Documents. Silently — the caller gets the wrong library, not an error.
Narrower than the original bug, since a real project normally has its .kicad_pro beside or above its schematics, but the failure mode is the same and it is invisible when it happens.
Why it wasn't fixed in the hotfix
Bounding the walk is a design decision rather than a one-liner, and it landed as a patch on a release cut hours earlier. Options, none obviously right:
- Stop at a VCS root (
.git) — pragmatic, but couples library resolution to source control.
- Depth limit — arbitrary, and wrong for a deeply nested sheet hierarchy.
- Never cross above the user's home directory — helps the common case, does nothing for a shared parent inside it.
- Require an explicit
project argument when resolution is ambiguous, and report the ambiguity — the most honest, the most disruptive.
Acceptance
Follow-up to the fix in
ec705c3(from @Pytonballoon810's #188), which stops the search when the file's own directory carries asym-lib-tableorfp-lib-table. That covers the reproducible failure and the hermetic-fixture case. It does not bound the walk in general.Residual
project_root_for(crates/konnect-core/src/tools/library.rs) still climbs ancestors without limit when the schematic's directory carries neither a library table nor a.kicad_pro:The walk leaves
work/, findsOther.kicad_pro, and every library lookup forfoo.kicad_schthen resolves${KIPRJMOD}against~/Documents. Silently — the caller gets the wrong library, not an error.Narrower than the original bug, since a real project normally has its
.kicad_probeside or above its schematics, but the failure mode is the same and it is invisible when it happens.Why it wasn't fixed in the hotfix
Bounding the walk is a design decision rather than a one-liner, and it landed as a patch on a release cut hours earlier. Options, none obviously right:
.git) — pragmatic, but couples library resolution to source control.projectargument when resolution is ambiguous, and report the ambiguity — the most honest, the most disruptive.Acceptance
.kicad_pro, does not silently resolve against that project.<proj>/sheets/sub/x.kicad_sch) still resolves at the project root — that isa_sheet_in_a_subdirectory_resolves_against_the_project_table.