commit | b310a8aaf35d73d1310b2a914a459a9f32a04d0d | [log] [tgz] |
---|---|---|
author | Richard Levasseur <rlevasseur@google.com> | Tue Jan 17 12:22:01 2023 -0800 |
committer | Copybara-Service <copybara-worker@google.com> | Tue Jan 17 12:23:45 2023 -0800 |
tree | d3e972f341fcb2e9eb2779797defec89bbf99278 | |
parent | 33a3b01d7ecfcf27102e8cde1253dac987f4a958 [diff] |
python: Make Starlark implementation of Python rules build/pass most tests This makes the Starlark implementation load without errors and pass almost all of the Java unit tests for the Python rules. * Expose `--python_path` flag via fragments to Starlark * Remove load of Google-only toplevel_aliases to get CcInfo symbol * Implement `imports` attribute completely/correctly; the semantics `get_imports()` function is only for processing the `imports` attribute itself, not all imports for a target. That is done by (the new) common function `collect_imports()`. * Only return OutputGroupInfo once (the `output_groups` arg of `_create_providers()` would cause it to be returned twice. * Make `PyCcLinkParamsProvider` usable: bind this global name to the actual Python rule implementation instead of the C++ no-op implementation. * Move the Python-specific `PyWrapCcInfo` and `py_wrap_cc_helper_do_not_use` symbols out of the C++ rules and into the Python rules. This is necessary do avoid a circular dependency between the two rule sets after moving the `PyCcLinkParamsProvider` into the Python rules. These two symbols are still bound to no-ops in Bazel because they are unused in the Bazel parts of the Python rules. * Fix an undefined variable usage in the Bazel `get_imports` function. * Various Bazel-specific functions were slightly renamed to better distinguish them from their common counterparts. * Pass missing `inherited_environment` arg in `py_binary` * Make `py_binary`, `py_test`, and `py_library` macros load and call their respective rule implementations. * Fix `_create_providers` returns doc. * Implement `legacy_create_init` attribute * Implement and fixes for `--build_python_zip`, boostrap-template-executables, and Windows launcher executables. * Fix computing the base executable name: `.basename` attribute, not `.name` * Create zip and supporting files next to the executable (use the `sibling` arg when declaring the artifacts) * Add the zip file to files to build outputs. * Fix undefined variable usage (`bootstrap_output`, not `bootstrap_template`) * Add stub intended for the zip to the zip action's inputs * Add missing methods to Bazel binary semantics object. Note that a few features are still unimplemented (i.e. coverage). * Fix `PLATFORMS_LOCATION` prefix (missing leading slash) * Fix fragment name for getting `--python_path` flag. Closes #17188. Work towards #15897. PiperOrigin-RevId: 502656401 Change-Id: I2cbf103ca1159f8e78dacbe91fd24dd1c60e5dab
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel rebuilds only 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:
To report a security issue, please email security@bazel.build with a description of the issue, the steps you took to create the issue, affected versions, and, if known, mitigations for the issue. Our vulnerability management team will respond within 3 working days of your email. If the issue is confirmed as a vulnerability, we will open a Security Advisory. This project follows a 90 day disclosure timeline.
See CONTRIBUTING.md