-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
exec: "bash": cannot run executable found relative to current directory #8610
Comments
@me-no-dev can you please take a look? |
how should we reproduce this? |
@me-no-dev Thanks for the reminder! I added a `Reproduce Steps section. Reproduce StepsThe issue reproduces in macOS.
|
I'm also getting this error! on MacOS 13.5 (22G74) (M1) |
@limingjie I tried adding relative search path, but CI did not fail? |
I also can not reproduce this on my M1 Mac with either old and new IDEs |
@me-no-dev The relative path must be added to the |
@limingjie I made sure that the IDE sees that path as well (added a line to print out the PATH). That did not make it fail (same goes for CI). There must be something else at play here... I tried different boards/chips too. |
@me-no-dev That's interesting, is it possible related to the Arduino IDE version or arduino-esp32 version? I recorded the steps and attached the recording here. |
I do the same exact thing (plus I added a line to print out the PATH while building). Mac OS 13.5.2 (M1 MAX) + ArduinoIDE 2.2.1, but can not get it to fail... I tried with both install from BoardManager and from Git... we must be missing something else... BTW default shell for me is |
@me-no-dev Are you reproducing by adding both the relative path and replacing Based on the changes in https://github.com/espressif/arduino-esp32/pull/8622/files#diff-69e60b602c9704198a3cf61eea0e6673e3ced88c6279d830c31c2a15a63c3154R8 |
Of course not :) I tested separately even in the PR. First I added the relative path, then I added the fix to see if anything will break in either case. On my computer I tested over the release 2.0.12, which does not have the fix added at all. |
@me-no-dev I tried several different scenarios today, and finally, found it is related to zsh and seems to have nothing to do with bash at all, I've updated the reproduce steps, can you try again? Thank you for your patience!
|
My zsh version is 5.9, if the default zsh cannot reproduce the problem, please install it by
|
Did all that. ZSH is default on my system, updated with brew to the same version as you... compiles fine |
😂 I have no idea if there is any other difference on my laptop. |
we can try to fix this for 3.0.0. We will release betas and RCs of it first to catch possible issues in other environments. Will release 2.0.13 now and you can add the fix manually again. Next release will have it in :) |
Thank you! |
That is correct. It is documented here: https://pkg.go.dev/os/exec#hdr-Executables_in_the_current_directory
https://cs.opensource.google/go/go/+/master:src/os/exec/exec.go;l=1303 var ErrDot = errors.New("cannot run executable found relative to current directory") This behavior of the Go There is a report here of it happening with the |
Is this still valid? |
Board
ESP32S3 Dev Module, ESP32 Dev Module
Device Description
The issue happens while compiling, a dev board is not required to reproduce the issue.
Version
2.0.12
IDE Name
Arduino IDE Version: 2.2.1
Operating System
macOS Ventura 13.5
Description
I saw this issue in a WeChat group. The compilation step fails if the PATH variable has a relative path. This is probably due to the security restriction of
exec()
that is used by Arduino, using a relative path gives the hacker a chance to replace the binary and potentially gain restricted access.Reproduce Steps
The issue reproduces in macOS.
~/.zshrc
.ESP32S3 Dev Module
orESP32 Dev Module
.Solution
In
platform.txt
, replacebash
with/usr/bin/env bash
to ignore the search path, the issue is gone.Error Log
Sketch
Any sketch will do, to quickly reproduce it, I used the blink one.
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: