Open pva opened 2 months ago
I'm not convinced this is generally a good idea, and it is definitely a change in behavior.
Currently, if direct executable doesn't support preferred impl, other programs will still run through python-exec and run with preferred impl. With this change, the non-preferred impl will be forced for everything.
I'm not convinced as well. It's possible to patch ansible-lint but I failed to think of a good way to detect that program was running with the help of python-exec.
It has never been entirely clear to me why python-exec supports its own use as a shebang to smartly detect the preferred EPYTHON but then uses that facility to execute a launcher script which reads and exec()'s the real script in combination with argv mangling.
One possible solution to this reported case would be to stop doing that, and simply inject itself into the existing script's shebang directly in /usr/bin. What would be the downside of such an approach? (I assume that this must have been considered at some point and rejected, but I haven't seen any documentation on why.)
Please ask in plain English.
Whenever I run ansible-lint on Gentoo system, I get a warning:
This is because ansible-lint adds a binary path into system $PATH and the path binary has (/usr/lib/python-exec/python3.10/) is not in system PATH: https://github.com/ansible/ansible-lint/blob/main/src/ansiblelint/__main__.py#L468
I think python-exec should add a binary path to PATH. Something like this (before
exec()
) fixed issue for me: