Fix ESP32-S31-WROOM-3 symbol failing to load in KiCad
The easyeda2kicad.py-generated file had an unquoted URL as the (generator ...) value: '(generator https://github.com/uPesy/...)'. Bare/unquoted s-expression tokens can't contain ':' or '/', which broke KiCad's parser and made the whole library silently fail to load (the symbol was present on disk and correctly registered in fp/sym-lib-table, but invisible in KiCad). Wrapped the value in quotes. Also added a check_library.py rule to catch this class of error (an unquoted generator value containing ':' or '/') automatically going forward.
This commit is contained in:
@@ -119,6 +119,14 @@ def check_symbols(report: Report) -> list[tuple[str, Path]]:
|
|||||||
if not parens_balanced(text):
|
if not parens_balanced(text):
|
||||||
report.error(f"[SYM] {path.relative_to(ROOT)}: unbalanced parentheses")
|
report.error(f"[SYM] {path.relative_to(ROOT)}: unbalanced parentheses")
|
||||||
|
|
||||||
|
gen_m = re.search(r'\(generator\s+([^\s")]+)', text)
|
||||||
|
if gen_m and re.search(r'[:/]', gen_m.group(1)):
|
||||||
|
report.error(
|
||||||
|
f"[SYM] {path.relative_to(ROOT)}: unquoted '(generator {gen_m.group(1)})' "
|
||||||
|
f"contains ':' or '/' -- this breaks KiCad's parser and silently makes the "
|
||||||
|
f"whole library fail to load; wrap the value in double quotes"
|
||||||
|
)
|
||||||
|
|
||||||
digest = lc.sha256_file(path)
|
digest = lc.sha256_file(path)
|
||||||
if digest in seen_hash:
|
if digest in seen_hash:
|
||||||
report.warn(
|
report.warn(
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
(kicad_symbol_lib
|
(kicad_symbol_lib
|
||||||
(version 20211014)
|
(version 20211014)
|
||||||
(generator https://github.com/uPesy/easyeda2kicad.py)
|
(generator "https://github.com/uPesy/easyeda2kicad.py")
|
||||||
|
|
||||||
(symbol "ESP32-S31-WROOM-3_C9900281993"
|
(symbol "ESP32-S31-WROOM-3_C9900281993"
|
||||||
(in_bom yes)
|
(in_bom yes)
|
||||||
|
|||||||
Reference in New Issue
Block a user