• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2023 The Bazel Authors. All rights reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15"""Implementation of PyCcToolchainInfo."""
16
17PyCcToolchainInfo = provider(
18    doc = "C/C++ information about the Python runtime.",
19    fields = {
20        "headers": """\
21(struct) Information about the header files, with fields:
22  * providers_map: a dict of string to provider instances. The key should be
23    a fully qualified name (e.g. `@rules_foo//bar:baz.bzl#MyInfo`) of the
24    provider to uniquely identify its type.
25
26    The following keys are always present:
27      * CcInfo: the CcInfo provider instance for the headers.
28      * DefaultInfo: the DefaultInfo provider instance for the headers.
29
30    A map is used to allow additional providers from the originating headers
31    target (typically a `cc_library`) to be propagated to consumers (directly
32    exposing a Target object can cause memory issues and is an anti-pattern).
33
34    When consuming this map, it's suggested to use `providers_map.values()` to
35    return all providers; or copy the map and filter out or replace keys as
36    appropriate. Note that any keys begining with `_` (underscore) are
37    considered private and should be forward along as-is (this better allows
38    e.g. `:current_py_cc_headers` to act as the underlying headers target it
39    represents).
40""",
41        "python_version": "(str) The Python Major.Minor version.",
42    },
43)
44