xref: /aosp_15_r20/external/bazelbuild-rules_python/docs/glossary.md (revision 60517a1edbc8ecf509223e9af94a7adec7d736b8)
1# Glossary
2
3{.glossary}
4
5common attributes
6: Every rule has a set of common attributes. See Bazel's
7  [Common attributes](https://bazel.build/reference/be/common-definitions#common-attributes)
8  for a complete listing
9
10in-build runtime
11: An in-build runtime is one where the Python runtime, and all its files, are
12known to the build system and a Python binary includes all the necessary parts
13of the runtime in its runfiles. Such runtimes may be remotely downloaded, part
14of your source control, or mapped in from local files by repositories.
15
16The main advantage of in-build runtimes is they ensure you know what Python
17runtime will be used, since it's part of the build itself and included in
18the resulting binary. The main disadvantage is the additional work it adds to
19building. The whole Python runtime is included in a Python binary's runfiles,
20which can be a significant number of files.
21
22platform runtime
23: A platform runtime is a Python runtime that is assumed to be installed on the
24system where a Python binary runs, whereever that may be. For example, using `/usr/bin/python3`
25as the interpreter is a platform runtime -- it assumes that, wherever the binary
26runs (your local machine, a remote worker, within a container, etc), that path
27is available. Such runtimes are _not_ part of a binary's runfiles.
28
29The main advantage of platform runtimes is they are lightweight insofar as
30building the binary is concerned. All Bazel has to do is pass along a string
31path to the interpreter. The disadvantage is, if you don't control the systems
32being run on, you may get different Python installations than expected.
33
34rule callable
35: A function that behaves like a rule. This includes, but is not is not
36  limited to:
37  * Accepts a `name` arg and other {term}`common attributes`.
38  * Has no return value (i.e. returns `None`).
39  * Creates at least a target named `name`
40
41  There is usually an implicit interface about what attributes and values are
42  accepted; refer to the respective API accepting this type.
43
44simple label
45: A `str` or `Label` object but not a _direct_ `select` object. These usually
46  mean a string manipulation is occuring, which can't be done on `select`
47  objects. Such attributes are usually still configurable if an alias is used,
48  and a reference to the alias is passed instead.
49
50nonconfigurable
51: A nonconfigurable value cannot use `select`. See Bazel's
52  [configurable attributes](https://bazel.build/reference/be/common-definitions#configurable-attributes) documentation.
53
54