commit | 627830e0756e6f7c09f2a95561963121dff9c166 | [log] [tgz] |
---|---|---|
author | Jesse Schalken <jesses@canva.com> | Tue Feb 27 20:01:05 2024 +1100 |
committer | GitHub <noreply@github.com> | Tue Feb 27 09:01:05 2024 +0000 |
tree | afa50d4fe983c3d6c1d65b93d814461cde21f7c0 | |
parent | 9a1a524cb0f9c048fbd0abc9837d4a757d98b9c5 [diff] |
fix(internal): correctly template error message in repository rules (#1779) Fixes "Error in format: Missing argument 'path'" error and correctly templates the binary name and `PATH`. ``` (17:54:57) ERROR: /Users/jesses/work/canva/WORKSPACE:120:17: fetching whl_library rule //external:pypi_jsmin: Traceback (most recent call last): File "/private/var/tmp/_bazel_jesses/06c990151bb0d0bcaaf7ea85520191a3/external/rules_python/python/pip_install/pip_repository.bzl", line 783, column 59, in _whl_library_impl environment = _create_repository_execution_environment(rctx, python_interpreter) File "/private/var/tmp/_bazel_jesses/06c990151bb0d0bcaaf7ea85520191a3/external/rules_python/python/pip_install/pip_repository.bzl", line 257, column 47, in _create_repository_execution_environment cppflags.extend(_get_xcode_location_cflags(rctx)) File "/private/var/tmp/_bazel_jesses/06c990151bb0d0bcaaf7ea85520191a3/external/rules_python/python/pip_install/pip_repository.bzl", line 121, column 46, in _get_xcode_location_cflags arguments = [repo_utils.which_checked(rctx, "xcode-select"), "--print-path"], File "/private/var/tmp/_bazel_jesses/06c990151bb0d0bcaaf7ea85520191a3/external/rules_python/python/private/repo_utils.bzl", line 164, column 39, in _which_checked " PATH = {path}".format(rctx.os.environ.get("PATH")))) Error in format: Missing argument 'path' ```
This repository is the home of the core Python rules -- py_library
, py_binary
, py_test
, py_proto_library
, and related symbols that provide the basis for Python support in Bazel. It also contains package installation rules for integrating with PyPI and other indices.
Documentation for rules_python is at https://rules-python.readthedocs.io and in the Bazel Build Encyclopedia.
Examples live in the examples directory.
Currently, the core rules build into the Bazel binary, and the symbols in this repository are simple aliases. However, we are migrating the rules to Starlark and removing them from the Bazel binary. Therefore, the future-proof way to depend on Python rules is via this repository. SeeMigrating from the Bundled Rules
below.
The core rules are stable. Their implementation in Bazel is subject to Bazel's backward compatibility policy. Once migrated to rules_python, they may evolve at a different rate, but this repository will still follow semantic versioning.
The Bazel community maintains this repository. Neither Google nor the Bazel team provides support for the code. However, this repository is part of the test suite used to vet new Bazel releases. See How to contribute page for information on our development workflow.
For detailed documentation, see https://rules-python.readthedocs.io
See Bzlmod support for more details.