* reduce stale lock TTL to 2 min, check for stale lock before acquiring and each time -- to hold up new shell sessions for as little as possible
---------
Co-authored-by: Ivan Pozdeev <vano@mail.mipt.ru>
fixes stalling for 60s and failing if some past fault
has resulting in a stale lockfile being present
---------
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Skip sort, native extension probe, and per-symlink realpath
when called with --bare --skip-aliases (the rehash case).
Use readlink to distinguish internal aliases (relative target)
from external installs (absolute target).
In MacOS, speeds up rehash by 5.2 ms (7%) in empty environment,
55.9 ms (33%) in a regular environment (3 ver, 12 venvs, 320 bins),
93.7 ms (15%) in a large environment (6 ver, 60 venvs, 1466 bins)
register_shim() already deduplicates via associative array (bash 4+) or
by checking if a shim already exists (bash 3.2). The sort -u pipe in the make_shims
call is thus redundant -- the dedup happens downstream regardless. Shim
creation is order-independent and idempotent, so sorting has no semantic
effect either.
Saves one subprocess fork during every rehash invocation.
provides a reliable way for Pyenv code to locate other parts of Pyenv code that are not under `PYENV_ROOT`
* tests: Work with Git entirely in a test repo
Co-authored-by: Ivan Pozdeev <vano@mail.mipt.ru>