Repository navigation
Tweak Python semantics for Python 3 and OpenBSD. - #10432
aldersondrive wants to merge 4 commits into
Conversation
|
Maybe you can just unconditionally use |
That would work for OpenBSD, but would also change behavior on all platforms. Notably, FreeBSD has no On the other hand, if Bazel is going to assume the existence of a How would you like to proceed? I'm fine with whichever way you folks think best. I just hesitate to push a PR that changes behavior on all platforms and breaks one of them without confirmation from Bazel team that doing so is really the right way to go. |
As discussed here: #10432 (comment)
Update: I checked a clean FreeBSD system, and it does have a In any case, it looks like Bazel already assumes the existence of |
|
The issue with putting python3 in the shebang is that 1) it's an incompatible change that 2) affects all For supporting this use case, I think we'd need an attribute on the Python toolchain to set the shebang to use in the stub script. See #8685 for additional commentary along these lines. I think we can dedup this against that one. |
|
Would you be okay with the first version of this PR? It's not an incompatible change, because it affects behavior only on OpenBSD, where Bazel support is still under development. #8685 sounds like a much larger and more complex change that likely won't be done anytime soon. |
|
I'm hesitant to add additional ad hoc logic to the native rules. That said, given that
it may be ok. @katre, do you see any platform-related concerns with a migration path from this native check to a future built-into-bazel platform definition for OpenBSD? (And can you confirm our support status for OpenBSD?) |
|
I am fine with this change, especially if we are moving towards having the python binary in the toolchain (so we can remove it). I'd like to see a TODO to remove the special casing in the future (possibly referencing #8685). Yes, we want to support OpenBSD and if there aren't existing constraints for it, I'd support a PR to add them. |
|
Ok, sounds good. @aldersondrive, can you please revert to the first version and add a TODO referencing #8685? (Standard format is |
|
Should be merged tomorrow. |
As discussed at bazelbuild/bazel#10432 (comment), Bazel is already switching to assume that the Python binary is called `python3`, not `python`. This change is also useful for the OpenBSD port in bazelbuild/bazel#10250. (On OpenBSD, the python executable is called `python3`, and no `python` binary exists.) Closes #10432. PiperOrigin-RevId: 293351316
As discussed at #10432 (comment), Bazel is already switching to assume that the Python binary is called
python3, notpython.This change is also useful for the OpenBSD port in #10250. (On OpenBSD, the python executable is called
python3, and nopythonbinary exists.)