You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Windows, the board-identity errors print KiCad's open boards as
extended-length ("verbatim") paths while printing the requested board as the
caller typed it, so one message shows the same directory in two spellings:
requested board 'C:\Users\me\proj\board.kicad_pcb' is not open in KiCad
(open boards: \\?\C:\Users\me\proj\other.kicad_pcb)
Board identity is unaffected — the comparison is correct and this is a
display problem only. But these errors exist so a caller can see which board
KiCad actually holds and retry against it, and a \\?\ path is a poor thing to
hand back for that purpose.
Reported by
@mixelpixx, reviewing #656 on KiCad 10.0.5 / Windows 11, against a release
build driving a standalone pcbnew over stdio. Quoting the review:
On Windows the wrong_document message prints the open board with a \\?\
prefix. Cosmetic, probably older than this PR; worth a follow-up issue, not a
change here.
Filing it as asked. Not reproduced by me — I am on Fedora Linux, where canonicalize returns a plain absolute path and the defect cannot appear. What
follows is a code trace, not a second measurement, and a Windows user
confirming the exact rendering would be welcome.
Mechanism
In select_requested_board (crates/konnect-ipc/src/client.rs) the two halves
of the message come from different forms of the path:
requested is the raw argument — requested.display().to_string() (:4202).
open_documents is built from the identities (:4273), which are comparable_identity() output (:4335) — i.e. path.canonicalize().
std::fs::canonicalize on Windows returns a verbatim path (\\?\C:\…); on
Unix it returns a plain absolute path. Hence the asymmetry, and hence
Windows-only.
Scope
board_document_label (:4186) is the shared source, so this is wider than wrong_document. Every error kind built from an open-document identity shows
verbatim paths on Windows:
Error kind
Field
wrong_document
open_documents
ambiguous_target
candidates
stale_target
previously_bound, and the open-document list in reason
ambiguous_open_board
the "reports '…' open more than once" reason (:4265)
requested is raw in all of them, so every one of these can show two spellings
of one directory side by side.
Age
comparable_identity landed in f8139e8 (2026-08-31, "tell a KiCad without this
board open apart from a refusal"). There is no verbatim-prefix handling
anywhere in the workspace today. So this predates #656, which touches client.rs only in the enabled-layer methods and none of the identity or label
code.
Expected
Render these paths in the form a user typed and can paste back, while leaving
the comparison on the canonical form.
\\?\UNC\ is not a prefix you can strip.\\?\UNC\server\share\x has
to render as \\server\share\x, not UNC\server\share\x. A naive strip_prefix(r"\\?\") silently corrupts every network path.
Worth a test matrix covering a drive path, a UNC path, a path that does not
exist (which takes comparable_identity's lexical branch and so has no prefix
to begin with), and a Unix path that must pass through untouched.
Related
#537 also concerns how Konnect reports paths, but is a different defect — which path gets resolved and whether the error names it. This one is about
how an already-resolved absolute path is rendered.
Summary
On Windows, the board-identity errors print KiCad's open boards as
extended-length ("verbatim") paths while printing the requested board as the
caller typed it, so one message shows the same directory in two spellings:
Board identity is unaffected — the comparison is correct and this is a
display problem only. But these errors exist so a caller can see which board
KiCad actually holds and retry against it, and a
\\?\path is a poor thing tohand back for that purpose.
Reported by
@mixelpixx, reviewing #656 on KiCad 10.0.5 / Windows 11, against a release
build driving a standalone pcbnew over stdio. Quoting the review:
Filing it as asked. Not reproduced by me — I am on Fedora Linux, where
canonicalizereturns a plain absolute path and the defect cannot appear. Whatfollows is a code trace, not a second measurement, and a Windows user
confirming the exact rendering would be welcome.
Mechanism
In
select_requested_board(crates/konnect-ipc/src/client.rs) the two halvesof the message come from different forms of the path:
requestedis the raw argument —requested.display().to_string()(:4202).open_documentsis built from the identities (:4273), which arecomparable_identity()output (:4335) — i.e.path.canonicalize().std::fs::canonicalizeon Windows returns a verbatim path (\\?\C:\…); onUnix it returns a plain absolute path. Hence the asymmetry, and hence
Windows-only.
Scope
board_document_label(:4186) is the shared source, so this is wider thanwrong_document. Every error kind built from an open-document identity showsverbatim paths on Windows:
wrong_documentopen_documentsambiguous_targetcandidatesstale_targetpreviously_bound, and the open-document list inreasonambiguous_open_boardrequestedis raw in all of them, so every one of these can show two spellingsof one directory side by side.
Age
comparable_identitylanded in f8139e8 (2026-08-31, "tell a KiCad without thisboard open apart from a refusal"). There is no verbatim-prefix handling
anywhere in the workspace today. So this predates #656, which touches
client.rsonly in the enabled-layer methods and none of the identity or labelcode.
Expected
Render these paths in the form a user typed and can paste back, while leaving
the comparison on the canonical form.
Two constraints for whoever picks this up:
select_requested_board's matching. Normalising before the comparison wouldreintroduce exactly the identity defect fix(pcb): tell a KiCad without this board open apart from a refusal #407 fixed.
\\?\UNC\is not a prefix you can strip.\\?\UNC\server\share\xhasto render as
\\server\share\x, notUNC\server\share\x. A naivestrip_prefix(r"\\?\")silently corrupts every network path.Worth a test matrix covering a drive path, a UNC path, a path that does not
exist (which takes
comparable_identity's lexical branch and so has no prefixto begin with), and a Unix path that must pass through untouched.
Related
#537 also concerns how Konnect reports paths, but is a different defect —
which path gets resolved and whether the error names it. This one is about
how an already-resolved absolute path is rendered.