Closed tervay-bdai closed 10 months ago
I'm really sorry I missed this, Justin. I really value your being excited to contribute, and I'd like to get you back on the mainline.
Happy to merge as is if you think, but I wanted to see if you thought it'd be better if we just took a dependency on rules_python and pull in hermetic Python ourselves, rather than export the complexity to the user?
There's also something I'm not understanding: Why is it that this tool's use of system Python causes the pybind11 error? I'd have thought offhand that we'd call through to however you were using it. (I want to make sure also that I shouldn't be recommending you use case (3) in the readme to be getting your top level Python configuration rather than :refresh_all.)
^ Ended up switching to hermetic python in https://github.com/hedronvision/bazel-compile-commands-extractor/commit/0e5b1aa26d87a431d2a52676d0b9ce469448ee54, so I think I should close. If you still have issues, please holler!
Hey Justin, we had to revert hermetic rules_python in https://github.com/hedronvision/bazel-compile-commands-extractor/commit/0b821b7e4286aec887757461366f6eaaa0972cb9, because there were lots of issues :( Tracking restoration in https://github.com/hedronvision/bazel-compile-commands-extractor/issues/168.
LMK if you still need this. I'm wondering also if this is a matter of transition configuration? Please see https://github.com/hedronvision/bazel-compile-commands-extractor/issues/164#issuecomment-1913052639, which is the same, I think, even when not using system python.
We are using pybind11_bazel and a hermetic Python interpreter in our system. When running
refresh_compile_commands
, we often get this error:This is because
refresh_compile_commands.bzl
is usingnative.py_binary
, which defaults to the user's system interpreter, which may or may not be the same version as the hermetic interpreter we're using alongside pybind.This PR adds an optional argument to
refresh_compile_commands()
, namedpy_binary_rule
, which defaults tonative.py_binary
. The user can override it and run the main script with whichever Python version they want, which fixes the above pybind errors.