dist/tools/usb-serial: call ttys.py with its path#19823
dist/tools/usb-serial: call ttys.py with its path#19823bors[bot] merged 2 commits intoRIOT-OS:masterfrom
Conversation
|
bors merge |
|
🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set. |
dist/tools/usb-serial/find-tty.sh
Outdated
|
|
||
| for serial in "$@"; do | ||
| if ./ttys.py --format path --serial "$serial"; then | ||
| if ${RIOTTOOLS}/usb-serial/ttys.py --format path --serial "$serial"; then |
There was a problem hiding this comment.
| if ${RIOTTOOLS}/usb-serial/ttys.py --format path --serial "$serial"; then | |
| if "${RIOTTOOLS}/usb-serial/ttys.py" --format path --serial "$serial"; then |
Maybe we should also fall back RIOTTOOLS to . when not provided, so that ./find-tty.sh still works?
|
bors cancel |
|
How about this instead: diff --git a/dist/tools/usb-serial/find-tty.sh b/dist/tools/usb-serial/find-tty.sh
index 136513d3ef..4b020c3227 100755
--- a/dist/tools/usb-serial/find-tty.sh
+++ b/dist/tools/usb-serial/find-tty.sh
@@ -6,8 +6,10 @@
exit_code=1
+SCRIPTDIR="$(cd "$(dirname "$0")" || exit 1; pwd)"
+
for serial in "$@"; do
- if ./ttys.py --format path --serial "$serial"; then
+ if "$SCRIPTDIR"/ttys.py --format path --serial "$serial"; then
exit_code=0
fi
doneIt seems to fix #19805 for me and should hopefully also work when called manually, e.g. when |
Signed-off-by: Dylan Laduranty <[email protected]>
f5a4625 to
1e800f3
Compare
|
I've applied @maribu patch to both |
Signed-off-by: Dylan Laduranty <[email protected]>
1e800f3 to
1007f02
Compare
|
bors merge |
|
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page.
|
|
Thanks @maribu |
|
Backport provided in #19831 |
19831: dist/tools/usb-serial: call ttys.py with its path [backport 2023.07] r=benpicco a=maribu # Backport of #19823 ### Contribution description This PR provides a fix for #19805 When calling `SERIAL=xxx make flash` the command failed because the script `dist/tools/usb-serial/find-ttys.sh` tries to call `ttys.py` but it doesn't find it. So pass the full path to `ttys.py` to get rid of the problem. ### Testing procedure Connect at least two boards to your computer run `make list-ttys ` to get the ID of your boards Try to flash one of them with (replace SERIAL with the one you get with the previous command): `BOARD=xxx SERIAL=xxx make -C tests/leds flash` It fails on master. It should works with this PR. ### Issues/PRs references Fixes #19805 Co-authored-by: Dylan Laduranty <[email protected]>
Contribution description
This PR provides a fix for #19805
When calling
SERIAL=xxx make flashthe command failed because the scriptdist/tools/usb-serial/find-ttys.shtries to callttys.pybut it doesn't find it. So pass the full path tottys.pyto get rid of the problem.Testing procedure
Connect at least two boards to your computer
run
make list-ttysto get the ID of your boardsTry to flash one of them with (replace SERIAL with the one you get with the previous command):
BOARD=xxx SERIAL=xxx make -C tests/leds flashIt fails on master.
It should works with this PR.
Issues/PRs references
Fixes #19805