Enable Python toolchains by default

(This is a roll-forward of https://github.com/bazelbuild/bazel/commit/bf66dc7210b46a13f86e144447f8d18505b79c2c.)

This flips --incompatible_use_python_toolchains, which deprecates --python_top (and for the most part, --python_path). See #7899 for more on the change and migration procedure.

Known downstream breakages are summarized [here](https://github.com/bazelbuild/bazel/issues/7899#issuecomment-497797353).

Fixes #7899, fixes #7375, significant progress on #4815.

RELNOTES[INC]: Python rules now determine the Python runtime using toolchains rather than `--python_top` and `--python_path`, which are deprecated. See [#7899](https://github.com/bazelbuild/bazel/issues/7899) for information on declaring Python toolchains and migrating your code. As a side-benefit, this addresses [#4815](https://github.com/bazelbuild/bazel/issues/4815) (incorrect interpreter version used) on non-Windows platforms. Note however that some builds break due to getting the version they asked for -- consider setting `python_version = "PY2"` on Python 2 targets and `--host_force_python=PY2` if any Python 2 targets are used in the host configuration. You can temporarily opt out of this change with `--incompatible_use_python_toolchains=false`.

PiperOrigin-RevId: 250918912
1 file changed
tree: e99eefb7e2117165255ca7c768a21de59f8e336a
  1. .bazelci/
  2. examples/
  3. scripts/
  4. site/
  5. src/
  6. third_party/
  7. tools/
  8. .bazelrc
  9. .gitattributes
  10. .gitignore
  11. AUTHORS
  12. BUILD
  13. CHANGELOG.md
  14. CODEOWNERS
  15. combine_distfiles.py
  16. combine_distfiles_to_tar.sh
  17. compile.sh
  18. CONTRIBUTING.md
  19. CONTRIBUTORS
  20. distdir.bzl
  21. ISSUE_TEMPLATE.md
  22. LICENSE
  23. README.md
  24. WORKSPACE
README.md

Bazel

{Fast, Correct} - Choose two

Build and test software of any size, quickly and reliably.

  • Speed up your builds and tests: Bazel only rebuilds what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.

  • One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.

  • Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.

  • Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.

Getting Started

Documentation

Contributing to Bazel

See CONTRIBUTING.md

Build status

Bazel is released in ‘Beta’. See the product roadmap to learn about the path toward a stable 1.0 release.