Using pyenv to build old Android source using Python 2.7 on Ubuntu 24.04, pyenv results in: /home/user/.pyenv/libexec/pyenv: line 138: /home/user/.pyenv/libexec/pyenv-exec: Argument list too long (errno E2BIG)
Tracking the error down to a call into bash::execute_cmd.c::shell_execve(char *command, char **args, char **env), pyenv has created and passed both PYENV_HOOK_PATH (10455 bytes) and PATH (131147 bytes) equal to a huge env arguments that exceeds the system maximum size. I am unsure if the failure is a single item or the collection of args/env.
$ pyenv --version pyenv 2.5.3
I modified the bash shell on my system to dump the size and contents of all execve args and env parameters in order to see what pyenv was doing at the time of failure.