Skip to content

ERC run from kicad-cli yields "label_dangling" while ERC in GUI is okay

Description

kicad-cli would complain about 1 ERC error (label_dangling) in my schematic, even though that error is not produced when running ERC from within the GUI. The ERC error is a false positive as far as I can tell.

image

The problem has something to do with the rule area, as it seems. If the same directive is moved to the wire, no error is produced.

Steps to reproduce

  1. Open this project: dangling.zip
  2. Run ERC from eeschema GUI and confirm that no error is found.
  3. Run flatpak run --command=kicad-cli org.kicad.KiCad sch erc --exit-code-violations --format json --output erc.json dangling.kicad_sch from within the project's dir.
{
    "$schema": "https://schemas.kicad.org/erc.v1.json",
    "coordinate_units": "mm",
    "date": "2025-04-01T13:25:43+0200",
    "kicad_version": "9.0.1",
    "sheets": [
        {
            "path": "/",
            "uuid_path": "/a7809e62-f3a1-4212-ad37-000e1ab65e7a",
            "violations": [
                {
                    "description": "Label not connected to anything",
                    "items": [
                        {
                            "description": "Directive Label [Net Class SDIO]",
                            "pos": {
                                "x": 1.0668,
                                "y": 0.7366
                            },
                            "uuid": "06d2b384-63e8-4d45-a71a-a191e94abfd0"
                        }
                    ],
                    "severity": "error",
                    "type": "label_dangling"
                }
            ]
        }
    ],
    "source": "dangling.kicad_sch"
}

KiCad Version

Application: kicad-cli x86_64 on x86_64

Version: 9.0.1, release build

Libraries:
	wxWidgets 3.2.7
	FreeType 2.13.3
	HarfBuzz 9.0.0
	FontConfig 2.15.0
	libcurl/8.11.1 OpenSSL/3.3.3 zlib/1.3.1 libidn2/2.3.7 libpsl/0.21.5 nghttp2/1.65.0

Platform: Freedesktop SDK 24.08 (Flatpak runtime), 64 bit, Little endian, wxBase, gnome-xorg, x11

Build Info:
	Date: Mar 30 2025 06:27:59
	wxWidgets: 3.2.7 (wchar_t,wx containers) GTK+ 0.0
	Boost: 1.87.0
	OCC: 7.9.0
	Curl: 8.11.1
	ngspice: 44.2
	Compiler: GCC 14.2.0 with C++ ABI 1019
	KICAD_IPC_API=ON

Locale: 
	Lang: en_US
	Enc: UTF-8
	Num: 1.234,5
	Encoded кΩ丈: D0BACEA9E4B888 (sys), D0BACEA9E4B888 (utf8)