You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AFAIK, Pyenv auto hashing currently only works with 'standard' Python tools or anything installed by pip. It is not aware of exes that link to Python, unless a shim file is manually created.
A user could provide their own shim, but if there are a lot of Python based commands then there would be a lof of maintainance and any user edits of system files is a PITA to support.
auto-hash-lib-py-app, for want of a better name, would do the following:
On a bash chdir hook, or some other hook (how does pyenv know if this is a pyenv, anyway?), or other command, e.g. activate, this would happen:
on the cd hook (or init or activate or whatever)
pyenv-auto-hash-lib-py-app (*name pending) would scan the entire tree for any executables.
looping through that list:
For each executable it would
If there is no existing shim for that exe
use ldd to determine if that app dynlinks to the Python version present in the current pyenv tree,
If the versions match it auto creates a shim for that app, in pyenv
At app runtime,
As usual, the shim alters the LD_LIBRARY_PATH environemt before running it,
Currently the user must provide 'shims' for each app that diverts it to pyenv as required., diverting all apps would be a bad idea in case one used a different python. There could be a hook script scans the current pyenv tree for executables and uses ldd to finid if that exe uses the same version as the current pyenv and create shims for them automatically if they don't already exist.
Wondering if there is another way. Somehow hook popen() within the environment or spawn another shell on chdir and exit that shell on chdir ?
AFAIK, Pyenv auto hashing currently only works with 'standard' Python tools or anything installed by pip. It is not aware of exes that link to Python, unless a shim file is manually created.
A user could provide their own shim, but if there are a lot of Python based commands then there would be a lof of maintainance and any user edits of system files is a PITA to support.
auto-hash-lib-py-app, for want of a better name, would do the following:
On a bash chdir hook, or some other hook (how does pyenv know if this is a pyenv, anyway?), or other command, e.g. activate, this would happen:
Currently the user must provide 'shims' for each app that diverts it to pyenv as required., diverting all apps would be a bad idea in case one used a different python. There could be a hook script scans the current pyenv tree for executables and uses ldd to finid if that exe uses the same version as the current pyenv and create shims for them automatically if they don't already exist.
Wondering if there is another way. Somehow hook popen() within the environment or spawn another shell on chdir and exit that shell on chdir ?
Other perhaps useful links:
https://github.com/pmem/syscall_intercept (hot patching libc in user space)
https://github.com/rcaloras/bash-preexec bash preexec/postexec hooks
Prerequisite - Yep done that.
The text was updated successfully, but these errors were encountered: