-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Closed
Labels
Description
Problem description
There seems to be something wrong with the libtermux-exec library that wraps execve to handle shebangs on Android 14. In some contexts, it can run scripts fine, but in others, such as with env or nushell instead of bash, it fails with a no such file error.
Steps to reproduce the behavior.
If you take this example script:
#!/usr/bin/python
print("hello")It can execute with ./foo.py:
~ $ ./foo.py
hello
But if you try to run it with env, it fails saying it can't find it
~ $ env ./foo.py
env: ‘./foo.py’: No such file or directory
I tried to poke around the libtermux-exec code, and I was able to find the environment variable that enables debug printing. When used, you can see that when it fails with the "no such file" error, it seems that it does not run the wrapper function at all
~ $ TERMUX_ANDROID10_DEBUG=yes ./foo.py
execve(./foo.py):
./foo.py
hello
~ $ env TERMUX_ANDROID10_DEBUG=yes ./foo.py
env: ‘./foo.py’: No such file or directory
~ $ TERMUX_ANDROID10_DEBUG=yes env ./foo.py
execve(/data/data/com.termux/files/usr/bin/env):
env
./foo.py
env: ‘./foo.py’: No such file or directory
What is the expected behavior?
No response
System information
- Termux application version: 0.118.0
- Android OS version: 14
- Device model: Pixel 8 Pro
- Primary shell: nu