Skip to content

Emit file-format silkscreen layer names from the generator - #37

Closed
Cimos wants to merge 1 commit into
claude/dru-generator-overhaulfrom
fix/silkscreen-generator
Closed

Emit file-format silkscreen layer names from the generator#37
Cimos wants to merge 1 commit into
claude/dru-generator-overhaulfrom
fix/silkscreen-generator

Conversation

@Cimos

@Cimos Cimos commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Applies the #33 fix to the generator, so this branch stops carrying the bug into the files it emits.

What was wrong

tools/generate_dru.py hard-coded ?.Silkscreen in the two Legend layer clauses and F./B.Silkscreen in the Pad to Silkscreen condition, so all eight generated .kicad_dru files shipped both faults.

Those are Board Setup display names. A .kicad_dru layer name resolves against the file-format name (F.SilkS, always present) plus the board's current layer name, which equals F.Silkscreen only while the board keeps KiCad's default. Board importers — Altium, Eagle, EasyEDA, CADSTAR, Fabmaster — write the source tool's naming in, and any .kicad_pcb older than file version 20200922 (KiCad 5.1 and earlier) loads with the file-format name showing. On those boards the name does not resolve.

In a (layer ...) clause that makes KiCad reject the entire rule file, so every generated rule silently reverts to KiCad defaults. In the Pad to Silkscreen condition it fails with no message anywhere (#34).

What changed

Three strings in tools/generate_dru.py, plus the eight generated files regenerated to match. No values changed — this is the layer name only.

generate_dru.py --check passes (generated output in sync with the TOML) and lint_dru.py passes. Grepped the branch afterwards: no Silkscreen spelling survives outside the two rule titles, which are prose.

Why this branch and not main

Branched off this branch's head so it lands with the generator work rather than conflicting with it. The same fix for the hand-maintained files on main is in a separate PR.

Not a version regression — the layer names are identical in KiCad 7, 8, 9, 10 and master. Verified by running DRC on KiCad 9.0.6 and 10.0.5.

Refs #33
Refs #34

The generator hard-coded ?.Silkscreen and F./B.Silkscreen, so all eight
generated files carried the bug from #33.

Those are Board Setup display names. A .kicad_dru layer name resolves against
the file-format name (F.SilkS, always present) plus the board's current layer
name, which equals F.Silkscreen only while the board keeps KiCad's default.
Board importers overwrite it, and boards written before KiCad 6 load with the
file-format name showing. On those the name does not resolve, and KiCad
rejects the whole rule file.

Generated files regenerated to match. generate_dru.py --check and
lint_dru.py both pass.

Refs #33
@Cimos

Cimos commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

Superseded by the move. The generator work from #32 is being re-opened against kicad-druid, and this fix goes with it rather than landing on a branch of a retiring repo. Closing.

@Cimos Cimos closed this Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant