-
-
Notifications
You must be signed in to change notification settings - Fork 636
fix(runfiles): correct Python runfiles path assumption #3086
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
0e21de0 to
fa3209a
Compare
|
Hello, going through old PRs and was wondering if you would like to rebase this and see if you can get the CI pass? Recently there were some changes in runfiles to make the compact manifest work, so this may require some work to cleanly rebase. |
The current _FindPythonRunfilesRoot() implementation assumes that the Python module has been unpacked four levels below the runfiles directory. This is not the case in multiple situations, for example when rules_pycross is in use and has installed the module via pypi (in which case it is five levels below runfiles). Both strategies already know where the runfiles directory exists - implement _GetRunfilesDir() on the _DirectoryBased strategy, then call _GetRunfilesDir() in order to populate self._python_runfiles_dir. Stop passing a bogus path to runfiles.Create() in testCurrentRepository(), such that the test actually uses the appropriate runfiles path. Fixes bazel-contrib#3085
45b6f72 to
da225b5
Compare
Thanks for the follow up - have rebased. I had a closer look at the CI failures (Windows) yesterday and will need some guidance on how you want to proceed. The issue is caused by what appears to be a bug in the zip file bootstrap, which is being used by Windows in the two failing tests ( Running the same code/test via a zip from a So given all of this, I'm not sure how we want to proceed... we either need a toolchain that does not have a buggy zip file bootstrap, or we need to skip this particular test (at least the runfiles part of it) on Windows. Preferences/suggestions? |
|
(I've pushed two changes - one that adds an actual |
|
@aignas any chance we can move this forward? |
|
We'll need to fix our CI before we can merge. |
The current _FindPythonRunfilesRoot() implementation assumes that
the Python module has been unpacked four levels below the runfiles
directory. This is not the case in multiple situations, for example when
rules_pycross is in use and has installed the module via pypi (in which
case it is five levels below runfiles).
Both strategies already know where the runfiles directory exists -
implement _GetRunfilesDir() on the _DirectoryBased strategy, then call
_GetRunfilesDir() in order to populate self._python_runfiles_dir.
Stop passing a bogus path to runfiles.Create() in testCurrentRepository(),
such that the test actually uses the appropriate runfiles path.
Fixes #3085