-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dist/tools/usb-serial: call ttys.py with its path #19823
dist/tools/usb-serial: call ttys.py with its path #19823
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
@@ -7,7 +7,7 @@ | |||
exit_code=1 | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I'll change.
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
done It seems to fix #19805 for me and should hopefully also work when called manually, e.g. when |
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
f5a4625
to
1e800f3
Compare
I've applied @maribu patch to both |
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
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 <dylan.laduranty@mesotic.com>
Contribution description
This PR provides a fix for #19805
When calling
SERIAL=xxx make flash
the command failed because the scriptdist/tools/usb-serial/find-ttys.sh
tries to callttys.py
but it doesn't find it. So pass the full path tottys.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 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 flash
It fails on master.
It should works with this PR.
Issues/PRs references
Fixes #19805