-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Bazel's 2to3 fails with no messages #1393
Comments
2to3 is currently a dummy wrapper script. We should connect to python 2 to 3 transpiler. /cc @lberki |
The work-around is to use six to make it cross-compatible, and mark target with srcs_version = "PY2AND3" |
The Bazel Python rules attempt to invoke 2to3 when they encounter a target marked with The bug here is that the rules want 2to3 to exist, but 2to3 was never open sourced and is just a stub. The two options are to implement support for 2to3 or remove the attempted conversion altogether. We'll go with removing 2to3 "support" for three reasons:
|
Im a little confused as to how I should be setting the srcs_version, the bazel error led me to this issue but Im happy to open a new one if this is not the right spot for this conversation. Im using bazel 0.28.1 and have a BUILD file like so:
Setting
This seems to not be the case, is there any way to get EDIT: Heres a repo to reproduce: https://github.com/chrismcbride/py2-bazel-bug If I clone that and run |
The badness of the
|
But I have a repo with mixed PY2 and PY3 targets, and we currently run tests by doing |
|
|
So it appears. I guess the filtering I'm thinking of applies only to running the tests, not to building the targets. |
@brandjon I also came across this issue, the biggest problem that I see is that from the documentation it looks like PY2 and PY2ONLY are the same but that is not really the case I tried with bazel 2.2.0, if in latest bazel there is no difference then forget what I said |
If I don't force any python version on the command line, and use If I instead use The Commenting here because this issue seems to have discussion on the differences between PY2 and PY2ONLY |
I'm trying to debug failure here.
It seems bazel fails at 2to3 on this file and also on this one. The 2to3 command returns Status 1, but doesn't print anything.
bazel-out/host/bin/external/bazel_tools/tools/python/2to3 --no-diffs --nobackups --write --output-dir bazel-out/local_linux-py3-opt/genfiles/python3/tensorflow/contrib/immediate/python/immediate/extra_tests --write-unchanged-files tensorflow/contrib/immediate/python/immediate/extra_tests/math_ops_test.py
Here are the full steps to reproduce, any suggestion how to debug?
The text was updated successfully, but these errors were encountered: