commit | c9f78b51d985473224a65be36180d0e215b685af | [log] [tgz] |
---|---|---|
author | brandjon <brandjon@google.com> | Tue Mar 05 12:20:12 2019 -0800 |
committer | Copybara-Service <copybara-worker@google.com> | Tue Mar 05 12:21:43 2019 -0800 |
tree | 7b27d385bd055721c0b1aab2d792e960508e1552 | |
parent | 71a456c377f808447f3b997625bbb72c927e83ba [diff] |
Make Python rules require the new Python toolchain type This makes py_binary / py_test require the new Python toolchain type (@bazel_tools//tools/python:toolchain_type). It does *not* make the rules actually use Python runtimes obtained via the toolchain; that happens in a follow-up CL. A default toolchain is defined and registered automatically in order to prevent analysis of Python rules from failing frivolously. This default is simply a stub that fails at execution time, but a follow-up CL will change it to autodetect the Python interpreter at runtime. Registration of the toolchain occurs via a WORKSPACE suffix file, so it happens automatically for every workspace. Note that workspace suffixes are disabled in BazelAnalysisMock#createRuleClassProvider, so we need to add it to the analysis mock's boilerplate workspace content. Tests that want to register a specific toolchain (and have it take precedence over the boilerplate) should use --extra_toolchains=... in the configuration, rather than manipulate the WORKSPACE file. tools/python/BUILD is refactored into tools/python/BUILD.tools so that the newly added toolchain definitions can be bootstrapped with Bazel 0.23, which does not have the required PyRuntimeInfo provider type. As a drive-by cleanup, the ":py_interpreter" attribute is pushed down from PyBaseRule to PyBinaryBaseRule. Work toward #7375. RELNOTES: None PiperOrigin-RevId: 236897042
{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.
Follow our tutorials:
See CONTRIBUTING.md
Bazel is released in ‘Beta’. See the product roadmap to learn about the path toward a stable 1.0 release.