Conversation
- Generated .zen files are now minimal wrappers (symbol, pins, pin_defs, optional skip_bom/skip_pos); no longer emit part, datasheet, or footprint. - Component() inherits footprint, datasheet, and part from the symbol and package manifest at evaluation time. - pcb import patches canonical MPN, manufacturer, and datasheet path into the KiCad symbol properties when generating components. - Deduplicate KiCad placeholder checks into shared helpers in pcb-eda. - Add regression test for local symbol datasheet inheritance.
Component() now falls back to !symbol.in_bom when skip_bom is not explicitly set. KiCad symbol parser defaults in_bom to true (matching KiCad convention) when the property is omitted.
Imported KiCad symbols retain their original Footprint property (e.g. 'lib:fp' form). Since imported components are local files rather than packages, the KiCad footprint fallback inference path cannot resolve them, causing 'Footprint property is not inferable' errors at build time. Rewrite the symbol's Footprint property to the local footprint stem after rendering, so Component() can infer the footprint file path.
Generated .zen files no longer emit pin_defs; duplicate pin signal names (e.g. multiple NC/GND pads) naturally merge into a single io() declaration. The Component(pin_defs=...) API remains available for manual use.
Use symbol's native signal names directly in pins dict. The io() names (P1, P2) remain unchanged.
Update parameter table: footprint, skip_bom, and datasheet now document their symbol-derived defaults inline.
There was a problem hiding this comment.
Devin Review found 1 new potential issue.
🐛 1 issue in files not directly in the diff
🐛 merge_symbols always overrides parent in_bom=no due to new default in_bom: true (crates/pcb-eda/src/kicad/symbol_library.rs:631-633)
The PR changes parse_symbol to initialize in_bom: true at crates/pcb-eda/src/kicad/symbol.rs:170, but the merge_symbols function at crates/pcb-eda/src/kicad/symbol_library.rs:631 only conditionally overrides the parent's value:
if child.in_bom {
merged.in_bom = child.in_bom;
}Before this PR, the default was false (from Default::default()), so a child symbol without an explicit (in_bom ...) declaration would have in_bom = false, the condition wouldn't fire, and the parent's value was preserved. Now, every child symbol without explicit (in_bom no) gets in_bom = true from the new default, the condition always fires, and the parent's in_bom = false is silently overridden to true. Since this PR adds the feature where Component() inherits skip_bom from !final_symbol.in_bom (crates/pcb-zen-core/src/lang/component.rs:1571), components using extends-resolved symbols whose parent has (in_bom no) will incorrectly get skip_bom = false instead of skip_bom = true.
View 9 additional findings in Devin Review.
Build Performance
Measured with hyperfine. Times show median ±stddev. |
|
@akhilles I wonder what the right way to handle symbol datasheet path should be. It would be great to encode a real PDF file, and footprints do support this now. |
Don't bother generating the duplicate metadata in the component
.zenfile.Note
Medium Risk
Changes how
Component()derives footprint/datasheet/part and defaultskip_bom, which can alter netlist/BOM outputs for existing packages if symbol properties are missing or differ from previous.zenmetadata.Overview
Makes KiCad
.kicad_symmetadata the single source of truth for components. The component.zengenerator now emits a minimal wrapper (symbol + pins + optional skip flags) and stops generating/consuming duplicated fields likempn/manufacturer/part,datasheet,footprint, andpin_defs.Updates build/runtime to inherit more from symbols.
Component()now (a) resolves datasheets from the symbolDatasheetproperty, supporting local paths resolved relative to the symbol file and normalized topackage://..., and (b) defaultsskip_bomfrom the KiCad symbolin_bomflag (inverted) when not explicitly set; KiCad placeholder values (~/empty) are filtered consistently.Adjusts import/search pipelines and stdlib/tests to match.
pcb importpatches the symbolFootprintproperty to the generated local footprint stem;pcb search/datasheet resolution can read either URL or local datasheet refs from symbols; stdlib generics/tests migrate pin mappings to use pin-number keys and snapshots are updated.Written by Cursor Bugbot for commit 287252e. This will update automatically on new commits. Configure here.