Board attach should support serial symlinks #1072
Labels
topic: CLI
Related to the command line interface
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
Milestone
Bug Report
Current behavior
On Linux,
/dev/serial/...
has useful symlinks to serial ports, that allow more persistent references to specific boards, or boards plugged into specific USB ports. However, specifying such a symlink toboard attach
fails:Expected behavior
The second command should find the Arduino, just like the first one.
Environment
arduino-cli version
): current git master 1855b53Additional context
The relevant code is here:
arduino-cli/commands/board/attach.go
Lines 120 to 126 in 1855b53
This matches the given port URI/name to the list of ports verbatim, failing if the port is not among the autodetected list of ports.
A simple fix could be to canonicalize the path and resolving the symlinks.
I also tried
upload --port ...
which does seem to accept the symlink (probably because it just opens the port and/or forwards it to the upload tool directly and does not need to get the vidpid for the port). I haven't checked if there's other commands that do suffer from the same problem.The text was updated successfully, but these errors were encountered: