rules_python
rules_python copied to clipboard
fix: use runfiles strategy to get runfiles root
When attempting to calculate the current repository, the runfiles helper used a strategy of walking up the current files directory four times, however this fails to correctly resolve the runfiles root when the runfiles helper is consumed via the PyPi package and linked into a virtual environment (the root will be determined to be the venv lib directory).
This change makes it so the runfiles root is fetched from the helper strategy, which is either created with the $RUNFILES_ROOT environment variable (directory based), or calculates the root via the runfiles manifest (manifest based).
With these changes, the runfiles helper correctly identifies the runfiles root when linked into a Python virtual environment.