Skip to content

Document effect of Python version on output path #4504

@ghost

Description

Description of the problem / feature request:

Bazel 0.9.0 does not put py_binary targets with default_python_version = "PY3" under bazel-bin. Instead, built targets appear under bazel-out/ in a python3-specific bin directory rather than the same bin directory used by other targets (the one that bazel-bin remains symlinked to)

I realize that Python 3 support is experimental, but is this expected behavior? I thought it was expected that any target built with bazel build should have its artifacts appear in bazel-bin.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

some_py_proj/foo.py:

if __name__ == "__main__":
    print("Hello, world!")

some_py_proj/BUILD:

py_binary(
    name = "foo",
    srcs = ["foo.py"],
)

bazel build some_py_proj:foo prints:

Target //some_py_proj:foo up-to-date:
bazel-bin/some_py_proj/foo

Modify some_py_proj/BUILD:

py_binary(
    name = "foo",
    srcs = ["foo.py"],
    default_python_version = "PY3",
)

bazel build some_py_proj:foo now prints:

Target //some_py_proj:foo up-to-date:
bazel-out/k8-py3-fastbuild/bin/some_py_proj/foo

and bazel-bin is symlinked to effectively bazel-out/k8-fastbuild/bin

What operating system are you running Bazel on?

Ubuntu 16.04

What's the output of bazel info release?

release 0.9.0

Have you found anything relevant by searching the web?

Nothing in release notes about the Python3 binary output directory changing since 0.6.1, which we are migrating from (this version did put the built python3 artifact under bazel-bin). Nothing relevant by searching issues for default_python_version or by searching the web for bazel-bin default_python_version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4This is either out of scope or we don't have bandwidth to review a PR. (No assignee)staleIssues or PRs that are stale (no activity for 30 days)team-DocumentationDocumentation improvements that cannot be directly linked to other team labelsteam-Rules-PythonNative rules for Pythontype: documentation (cleanup)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions