Skip to content

Improve error message when host tools built for PY3 fail #8549

Closed

Description

@brandjon

The default host config Python version is PY3, but many host tools are written for Python 2. With --incompatible_use_python_toolchains being flipped, a common mode of failure is that these tools now fail for downstream users who do not know to set --host_force_python=PY2. This previously worked because we were ignoring the Python version and just calling python, which on most systems is Python 2 (#4815).

We already have a diagnostic message for host tools that exit with a non-zero code, in the case where the target's python_version disagrees with the host config's Python version. But this message does not fire when there is no python_version attribute set and no --host_force_python passed, since both of these default to PY3. I propose we extend this message to also fire when python_version is not explicitly set. That will cover the common case and help alert downstream users to the changed needed in their bazelrc.

Looking to cherrypick into 0.27.

Activity

  1. added
    P1
    team-Rules-Python
    on Jun 3, 2019
  2. self-assigned this
    on Jun 3, 2019
  3. added 2 commits that reference this issue on Jun 6, 2019
    9359cdb
    bcae1ce
  4. added a commit that references this issue on Jun 18, 2019
    0085487
  5. added a commit that references this issue on Jul 15, 2019
    e0db63a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1team-Rules-Pythontype: feature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions