Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Breaks with Python toolchains (Bazel 0.27) #94

Closed
brandjon opened this issue May 31, 2019 · 7 comments
Closed

Breaks with Python toolchains (Bazel 0.27) #94

brandjon opened this issue May 31, 2019 · 7 comments

Comments

@brandjon
Copy link
Member

Bazel 0.27 enables --incompatible_use_python_toolchains, which breaks tulsi's CI. This flag causes Bazel to actually use the Python version that was decided at analysis time, instead of whatever the system python command happens to be.

You likely want to add python_version = "PY2" to some targets. If Python 2 targets are used in the host configuration, you'll want to set --host_force_python=PY2.

Note that in a recent rerun, tulsi fails in CI for an unrelated breakage that masks this one.

@brandjon
Copy link
Member Author

@sergiocampama I believe you asked me to notify you about this type of breakage when we last spoke in person.

@brandjon
Copy link
Member Author

brandjon commented Jun 4, 2019

Ping @DavidGoldman and @ivanhernandez, can you look at this? It affects the current Bazel RC.

@brandjon
Copy link
Member Author

brandjon commented Jun 6, 2019

The unrelated failures I mentioned were in TulsiGeneratorIntegrationTests:*. And the current dominating failure is for #95. So for both reasons, it's not currently possible to observe this failure at head.

Looking again at the error from before, it is definitely a PY2-code-running-in-a-PY3-interpreter error, and the failing action has bazel-out/host in the path, so you do need to set --host_force_python=PY2 in the project bazelrc file. Looks like there isn't one already so you'll have to create it. Then our downstream projects CI should pick it up.

Downstream users of tulsi should also set --host_force_python=PY2 until such time as they're not depending on any PY2 code in the host configuration. (This issue affects a lot of users but we don't have better alternatives without regressing on PY3-as-default, or Python version checking; or else waiting for the host config to be eliminated entirely.)

@brandjon
Copy link
Member Author

brandjon commented Jun 6, 2019

Spoke with David, the Python failure appears to be upstream, in rules_apple (tracked in bazelbuild/rules_apple#456).

@DavidGoldman
Copy link
Contributor

I believe this should be fixed as of 1cb0527

@brandjon
Copy link
Member Author

rules_apple is actually still failing in CI, I think because they didn't update their bazelrc. But I guess that doesn't block downstream projects from updating their own bazelrc. CI looks good, feel free to close.

@DavidGoldman
Copy link
Contributor

Closing as the tests are now passing on CI

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants