-
-
Notifications
You must be signed in to change notification settings - Fork 610
fix: normalize stub_path in repl.bzl #3104
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
Conversation
When a REPL target is run from an external Bazel module, the `stub_path` can have path components in it (e.g. "/..") which get rejected by the `Rlocation()` in `runfiles.py`. This commit normalizes the path before it's passed to `Rlocation()`.
I saw windows errors had mixed path separators and I wonder if using the bazel skylib helper is causing this. Maybe trying out os.path.norm would be also an option - the path does not have to exist for it to work, so I think it may be still OK. |
Did you get an error when trying this change? Was the error specific to Windows? Did it work for you on another platform? Would you mind sharing the error message?
I don't think I understand. Can you elaborate on what you mean by, "the path does not have to exist for it to work"? Are you referring to the path to the stub? If it doesn't exist, wouldn't that cause a fatal error? |
See the errors in the CI: https://buildkite.com/organizations/bazel/pipelines/rules-python-python/builds/12251/jobs/01981aa5-6b45-4c43-b5bd-8d6dfc408065/artifacts/01981aab-bc3b-4fae-a258-79dd924dfb80 In my tests
I meant that |
Windows paths had mixed separators when using the path normalizer from skylib which appeared to cause some tests to fail.
Understood. Thanks for the reply! I've added another commit which switches to using Python's I've also tried to clean up the mess I made when I committed the tab completion fix to this same branch. Hopefully everything is better now. |
When a REPL target is run from an external Bazel module, the
stub_path
can have path components in it (e.g. "/..") which get rejected by theRlocation()
function inrunfiles.py
for not being normalized. This commit normalizes the path before it's passed toRlocation()
.Fixes #3101