From 9dc4c4978271aa719a5179735aa39640b4078ce3 Mon Sep 17 00:00:00 2001
From: Grzegorz Lukasik Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+global {
+ name: "abs"
+ callable {
+ param {
+ name: "x"
+ doc: "A number (int or float)"
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
}
- doc: "Information about neverlink libraries for Android targets."
+ doc: "Returns the absolute value of a number (a non-negative number with the same magnitude). Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+global {
+ name: "all"
+ callable {
+ param {
+ name: "elements"
+ doc: "A string or a collection of elements."
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
}
- doc: "A provider that holds debug outputs of an Apple binary target."
+ doc: "Returns true if all elements evaluate to True or if the collection is empty. Elements are converted to boolean using the bool function. Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+global {
+ name: "any"
+ callable {
+ param {
+ name: "elements"
+ doc: "A string or a collection of elements."
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
}
- doc: "A provider containing information about an Apple dynamic framework."
+ doc: "Returns true if at least one element evaluates to True. Elements are converted to boolean using the bool function. Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+global {
+ name: "bool"
+ callable {
+ param {
+ name: "x"
+ doc: "The variable to convert."
+ default_value: "False"
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
}
- doc: "A provider containing the executable binary output that was built using an apple_binary target with the \'executable\' type."
+ doc: "Constructor for the bool type. It returns Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+ param {
+ name: "**kwargs"
+ doc: "Dictionary of additional entries."
+ is_star_star_arg: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
}
- doc: "Baseline profile file used for Android binaries."
+ doc: "Creates a dictionary from an optional positional argument and an optional set of keyword arguments. In the case where the same key is given multiple times, the last value will be used. Entries supplied via keyword arguments are considered to come after entries supplied via the positional argument."
}
-type {
- name: "CcInfo"
- field {
- name: "compilation_context"
- type: "CompilationContext"
- doc: "Returns the Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+global {
+ name: "dir"
+ callable {
+ param {
+ name: "x"
+ doc: "The object to check."
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
}
- doc: "A provider for compilation and linking of C++. This is also a marking provider telling C++ rules that they can depend on the rule with this provider. If it is not intended for the rule to be depended on by C++, the rule should wrap the CcInfo in some other provider."
+ doc: "Returns a list of strings: the names of the attributes and methods of the parameter object."
}
-type {
- name: "CcToolchainConfigInfo"
- field {
- name: "proto"
- type: "string"
- doc: "Returns CToolchain text proto from the CcToolchainConfigInfo data."
- }
- field {
- name: "to_json"
- callable {
- return_type: "string"
+global {
+ name: "enumerate"
+ callable {
+ param {
+ name: "list"
+ doc: "input sequence."
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+ param {
+ name: "start"
+ doc: "start index."
+ default_value: "0"
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
}
- doc: "Additional layer of configurability for C++ rules. Encapsulates platform-dependent specifics of C++ actions through features and action configs. It is used to configure the C++ toolchain, and later on for command line construction. Replaces the functionality of CROSSTOOL file."
+ doc: "Returns a list of pairs (two-element tuples), with the index (int) and the item from the input sequence.\n Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
}
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+ doc: "Causes execution to fail with an error."
+}
+global {
+ name: "float"
+ callable {
+ param {
+ name: "x"
+ doc: "The value to convert."
+ default_value: "unbound"
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
}
- doc: "Information about the C++ compiler being used."
-}
-type {
- name: "ConstraintCollection"
- doc: "Provides access to data about a collection of ConstraintValueInfo providers. Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+ param {
+ name: "name"
+ doc: "The name of the struct attribute."
+ is_mandatory: true
+ }
+ param {
+ name: "default"
+ doc: "The default value to return in case the struct doesn\'t have an attribute of the given name."
+ default_value: "unbound"
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
}
- doc: "A specific constraint setting that may be used to define a platform. See Defining Constraints and Platforms for more information. Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+ param {
+ name: "name"
+ doc: "The name of the attribute."
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
}
- doc: "A value for a constraint setting that can be used to define a platform. See Defining Constraints and Platforms for more information. Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+global {
+ name: "hash"
+ callable {
+ param {
+ name: "value"
+ doc: "String value to hash."
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
}
- field {
- name: "unstripped_file"
- type: "File"
- doc: "Returns the unstripped file (the default executable target)"
- }
- doc: "A provider for the binary file and its associated .dwp files, if fission is enabled.If Fission ({@url https://gcc.gnu.org/wiki/DebugFission}) is not enabled, the dwp file will be null."
+ doc: "Return a hash value for a string. This is computed deterministically using the same algorithm as Java\'s Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+ param {
+ name: "base"
+ doc: "The base used to interpret a string value; defaults to 10. Must be between 2 and 36 (inclusive), or 0 to detect the base as if Deprecated: use proto.encode_text(x) instead."
}
- doc: "A provider that gives general information about a target\'s direct and transitive files. Every rule type has this provider, even if it is not returned explicitly by the rule\'s implementation function. Each Examples: Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+global {
+ name: "len"
+ callable {
+ param {
+ name: "x"
+ doc: "The value whose length to report."
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
}
- doc: "Use this provider to specify special environment requirements needed to run tests."
+ doc: "Returns the length of a string, sequence (such as a list or tuple), dict, set, or other iterable."
}
-type {
- name: "FeatureFlagInfo"
- field {
- name: "error"
- type: "string"
- doc: "If non-None, this error was generated when trying to compute current value of flag."
- }
- field {
- name: "is_valid_value"
- callable {
- param {
- name: "value"
- doc: "String, the value to check for validity for this flag."
- is_mandatory: true
- }
- return_type: "bool"
- }
- doc: "The value of the flag in the configuration used by the flag rule."
- }
- field {
- name: "to_json"
- callable {
- return_type: "string"
- }
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+global {
+ name: "list"
+ callable {
+ param {
+ name: "x"
+ doc: "The object to convert."
+ default_value: "[]"
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
- }
- field {
- name: "value"
- type: "string"
- doc: "The current value of the flag in the flag\'s current configuration. None if there is an error."
- }
- doc: "A provider used to access information about config_feature_flag rules."
-}
-type {
- name: "file_provider"
- doc: "An interface for rules that provide files."
-}
-type {
- name: "FilesToRunProvider"
- field {
- name: "executable"
- type: "File"
- doc: "The main executable or None if it does not exist."
- }
- field {
- name: "repo_mapping_manifest"
- type: "File"
- doc: "The repo mapping manifest or None if it does not exist."
- }
- field {
- name: "runfiles_manifest"
- type: "File"
- doc: "The runfiles manifest or None if it does not exist."
}
+ doc: "Returns a new list with the same elements as the given iterable value. Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+ param {
+ name: "*args"
+ doc: "The elements to be checked."
+ is_star_arg: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
}
- doc: "Information about generated proto extensions."
+ doc: "Returns the largest one of all given arguments. If only one positional argument is provided, it must be a non-empty iterable.It is an error if elements are not comparable (for example int with string), or if no arguments are given. Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+ param {
+ name: "*args"
+ doc: "The elements to be checked."
+ is_star_arg: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
}
- doc: "Contains information about source files and instrumentation metadata files for rule targets matched by Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+ param {
+ name: "*args"
+ doc: "The objects to print."
+ is_star_arg: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
- }
- field {
- name: "version"
- type: "int"
- doc: "The Java feature version of the runtime. This is 0 if the version is unknown."
}
- doc: "Information about the Java runtime being used."
+ doc: "Prints Using Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
- }
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
- }
- field {
- name: "tools"
- type: "depset"
- doc: "The compilation tools."
- }
- doc: "Provides access to information about the Java toolchain rule. Accessible as a \'java_toolchain\' field on a Target struct."
-}
-type {
- name: "ObjcProvider"
- field {
- name: "direct_module_maps"
- type: "sequence"
- doc: "Module map files from this target directly (no transitive module maps). Used to enforce proper use of private header files and for Swift compilation."
- }
- field {
- name: "direct_sources"
- type: "sequence"
- doc: "All direct source files from this target (no transitive files), including any headers in the \'srcs\' attribute."
- }
- field {
- name: "dynamic_framework_file"
- type: "depset"
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+ param {
+ name: "step"
+ doc: "The increment (default is 1). It may be negative."
+ default_value: "1"
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
}
- doc: "A provider that indicates what output groups a rule has. Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
}
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+ doc: "Returns a new, unfrozen list that contains the elements of the original iterable sequence in reversed order. Deprecated: use proto.encode_text(x) instead."
}
- doc: "Information about transitive package specifications used in package groups."
+ doc: "Creates a new set containing the unique elements of a given\niterable, preserving iteration order.\n\n If called with no argument, For example,\n Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+ param {
+ name: "key"
+ doc: "An optional function applied to each element before comparison."
+ default_value: "None"
+ }
+ param {
+ name: "reverse"
+ doc: "Return results in descending order."
+ default_value: "False"
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
}
- doc: "Provides access to data about a specific platform. See Defining Constraints and Platforms for more information. Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
}
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+ doc: "Converts any object to string. This is useful for debugging. Deprecated: use proto.encode_text(x) instead."
}
- doc: "Proguard specifications used for Android binaries."
+ doc: "Returns a tuple with the same elements as the given iterable value. Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
}
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+ doc: "Returns the type name of its argument. This is useful for debugging and type-checking. Examples: Deprecated: use proto.encode_text(x) instead."
}
- doc: "Information about flavors for all built protos."
+ doc: "Returns a The order of the depset is not guaranteed and may be changed in the future. It is recommended to use This field is currently unused in Bazel and may go away in the future."
- }
- doc: "Encapsulates information provided by the Python rules."
+global {
+ name: "Actions"
+ doc: "Deprecated and subject to imminent removal. Please do not use."
+ api_context: BZL
}
-type {
- name: "PyRuntimeInfo"
- field {
- name: "bootstrap_template"
- type: "File"
- doc: "The stub script template file to use. Should have %python_binary%, %workspace_name%, %main%, and %imports%. See @bazel_tools//tools/python:python_bootstrap_template.txt for more variables."
- }
- field {
- name: "coverage_files"
- type: "depset"
- doc: "The files required at runtime for using A Python runtime describes either a platform runtime or an in-build runtime. A platform runtime accesses a system-installed interpreter at a known path, whereas an in-build runtime points to a Encapsulates information about an analysis-phase error which would have occurred during a build. In most builds, an analysis-phase error would result in a build failure and the error description would be output to the console. However, if Under Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+ param {
+ name: "message"
+ doc: "A descriptive message containing information about the test and its success/failure."
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
}
- doc: "A provider that can be returned from executable rules to control the environment in which their executable is executed."
+ doc: "Encapsulates the result of analyis-phase testing. Build targets which return an instance of this provider signal to the build system that it should generate a \'stub\' test executable which generates the equivalent test result. Analysis test rules (rules created with Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+ param {
+ name: "linking_context"
+ doc: "The Deprecated: use proto.encode_text(x) instead."
- }
- field {
- name: "variables"
- type: "dict"
- doc: "Returns the make variables defined by this target as a dictionary with string keys and string values"
}
- doc: "Encapsulates template variables, that is, variables that can be referenced by strings like Example: Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+ param {
+ name: "owners"
+ doc: "[Label] - cc_shared_library will know which linker_inputs to link based on the owners field of each linker_input. Most rules will simply use the ctx.label but certain APIs like cc_common.create_linker_input(owner=) accept any label. cc_common.create_linking_context_from_compilation_outputs() accepts a `name` which will then be used to create the owner of the linker_input together with ctx.package.For these cases, since the cc_shared_library cannot guess, the rule author should provide a hint with the owners of the linker inputs. If the value of owners is not set, then ctx.label will be used. If the rule author passes a list and they want ctx.label plus some other label then they will have to add ctx.label explicitly. If you want to use custom owners from C++ rules keep as close to the original ctx.label as possible, to avoid conflicts with linker_inputs created by other targets keep the original repository name, the original package name and re-use the original name as part of your new name, limiting your custom addition to a prefix or suffix."
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
}
- doc: "Provider returned by toolchain rules to share data with rules which depend on toolchains. Read about toolchains for more information."
+ doc: "This provider should be used by rules that provide C++ linker inputs and\nwant to guide what the cc_shared_library uses. The reason for this may be\nfor example because the rule is not providing a standard provider like\nCcInfo or ProtoInfo or because the rule does not want certain attributes\nto be used for linking into shared libraries. It may also be needed if the\nrule is using non-standard linker_input.owner names.\n\nPropagation of the cc_shared_library aspect will always happen via all\nattributes that provide either CcInfo, ProtoInfo or\nCcSharedLibraryHintInfo, the hints control whether the result of that\npropagation actually gets used."
+ api_context: BZL
}
-type {
- name: "ToolchainTypeInfo"
- field {
- name: "to_json"
- callable {
- return_type: "string"
+global {
+ name: "CcSharedLibraryInfo"
+ callable {
+ param {
+ name: "dynamic_deps"
+ doc: "All shared libraries depended on transitively"
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
- }
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
- }
- field {
- name: "type_label"
- type: "Label"
- doc: "The label uniquely identifying this toolchain type."
- }
- doc: "Provides access to data about a specific toolchain type. Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+ param {
+ name: "link_once_static_libs"
+ doc: "All libraries linked statically into this library that should only be linked once, e.g. because they have static initializers. If we try to link them more than once, we will throw an error"
+ is_mandatory: true
+ }
+ param {
+ name: "linker_input"
+ doc: "the resulting linker input artifact for the shared library"
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
- }
- field {
- name: "xcode_version"
- type: "string"
- doc: "The xcode version, or Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
- }
- field {
- name: "to_proto"
- callable {
- return_type: "string"
+ param {
+ name: "runfiles"
+ doc: "runfiles descriptor describing the files that this target needs when run (via the Deprecated: use proto.encode_text(x) instead."
- }
- field {
- name: "xcode_version"
- callable {
- return_type: "DottedVersion"
- }
- doc: "Returns the Xcode version that is being used to build. This will return Note that some types of actions do not yet support exposure of this field. For such action types, this is This object is visible for the purpose of testing, and may be obtained from an Some fields of this object are only applicable for certain kinds of actions. Fields that are inapplicable are set to It is recommended that you avoid using this parameter (see \"runfiles features to avoid\") It is recommended that you avoid using this parameter (see \"runfiles features to avoid\") Only use this method if interface Jars don\'t work with\nyour rule set(s) (e.g. some Scala targets) If you\'re working with\nJava-only targets it\'s preferable to use interface Jars via\nJavaInfo.compile_jars"
+ is_mandatory: true
+ }
+ param {
+ name: "java_outputs"
+ doc: "(_JavaOutputInfo) Information about outputs of this Java/Java-like target."
+ is_mandatory: true
+ }
+ param {
+ name: "module_flags_info"
+ doc: "(_ModuleFlagsInfo) The Java module flag configuration."
+ is_mandatory: true
+ }
+ param {
+ name: "outputs"
+ doc: "Deprecated: use java_outputs."
+ is_mandatory: true
+ }
+ param {
+ name: "plugins"
+ doc: "(_JavaPluginDataInfo) Data about all plugins that a consuming target should\napply.\nThis is typically either a `java_plugin` itself or a `java_library` exporting\none or more plugins.\nA `java_library` runs annotation processing with all plugins from this field\nappearing in Remember that in addition to declaring a file, you must separately create an action that emits the file. Creating that action will require passing the returned Note that predeclared output files do not need to be (and cannot be) declared using this function. You can obtain their For macros, a related function, The content of this file (generally one of the outputs of the action) corresponds to the list of input files that were not used during the whole action execution. Any change in those files must not affect in any way the outputs of the action."
- default_value: "None"
- }
- param {
- name: "executable"
- type: "File; or string; or FilesToRunProvider"
- doc: "The executable file to be called by the action."
- is_mandatory: true
- }
- param {
- name: "tools"
- type: "sequence; or depset"
- doc: "List or depset of any tools needed by the action. Tools are inputs with additional runfiles that are automatically made available to the action. When a list is provided, it can be a heterogenous collection of Files, FilesToRunProvider instances, or depsets of Files. Files which are directly in the list and come from ctx.executable will have their runfiles automatically added. When a depset is provided, it must contain only Files. In both cases, files within depsets are not cross-referenced with ctx.executable for runfiles."
- default_value: "unbound"
- }
- param {
- name: "arguments"
- type: "sequence"
- doc: "Command line arguments of the action. Must be a list of strings or If both If both The function accepts two positional arguments: a string representing an OS name (e.g. \"osx\"), and an integer representing the number of inputs to the action. The returned dictionary may contain the following entries, each of which may be a float or an int: If this parameter is set to The callback must be top-level (lambda and nested functions aren\'t allowed)."
- default_value: "None"
- }
- param {
- name: "toolchain"
- type: "Label; or string; or Toolchain type of the executable or tools used in this action. The parameter must be set, so that, the action executes on the correct execution platform. It\'s a no-op right now, but we recommend to set it when a toolchain is used, because it will be required in the future Bazel releases. Note that the rule which creates this action needs to define this toolchain inside its \'rule()\' function. When `toolchain` and `exec_group` parameters are both set, `exec_group` will be used. An error is raised in case the `exec_group` doesn\'t specify the same."
- default_value: "unbound"
- }
- return_type: "NoneType"
+ doc: "Information about proguard specs for Android binaries."
+ api_context: BZL
+}
+global {
+ name: "ProtoInfo"
+ callable {
+ param {
+ name: "allow_exports"
+ doc: "(Target) The packages where this proto_library can be exported."
+ is_mandatory: true
+ }
+ param {
+ name: "check_deps_sources"
+ doc: "(depset[File]) The `.proto` sources from the \'srcs\' attribute.\nIf the library is a proxy library that has no sources, it contains the\n`check_deps_sources` from this library\'s direct deps."
+ is_mandatory: true
+ }
+ param {
+ name: "direct_descriptor_set"
+ doc: "(File) The descriptor set of the direct sources. If no srcs,\ncontains an empty file."
+ is_mandatory: true
+ }
+ param {
+ name: "direct_sources"
+ doc: "(list[File]) The `.proto` source files from the `srcs` attribute."
+ is_mandatory: true
+ }
+ param {
+ name: "proto_source_root"
+ doc: "(str) The directory relative to which the `.proto` files defined in\nthe `proto_library` are defined. For example, if this is `a/b` and the rule has the\nfile `a/b/c/d.proto` as a source, that source file would be imported as\n`import c/d.proto`\n\nIn principle, the `proto_source_root` directory itself should always\nbe relative to the output directory (`ctx.bin_dir`).\n\nThis is at the moment not true for `proto_libraries` using (additional and/or strip)\nimport prefixes. `proto_source_root` is in this case prefixed with the output\ndirectory. For example, the value is similar to\n`bazel-out/k8-fastbuild/bin/a/_virtual_includes/b` for an input file in\n`a/_virtual_includes/b/c.proto` that should be imported as `c.proto`.\n\nWhen using the value please account for both cases in a general way.\nThat is assume the value is either prefixed with the output directory or not.\nThis will make it possible to fix `proto_library` in the future."
+ is_mandatory: true
+ }
+ param {
+ name: "transitive_descriptor_sets"
+ doc: "(depset[File]) A set of descriptor set files of all\ndependent `proto_library` rules, and this one\'s. This is not the same as passing\n--include_imports to proto-compiler. Will be empty if no dependencies."
+ is_mandatory: true
+ }
+ param {
+ name: "transitive_imports"
+ doc: "(depset[File]) Deprecated: use `transitive_sources` instead."
+ is_mandatory: true
+ }
+ param {
+ name: "transitive_proto_path"
+ doc: "(depset(str) A set of `proto_source_root`s collected from the\ntransitive closure of this rule."
+ is_mandatory: true
+ }
+ param {
+ name: "transitive_sources"
+ doc: "(depset[File]) The `.proto` source files from this rule and all\nits dependent protocol buffer rules."
+ is_mandatory: true
+ }
+ }
+ doc: "Encapsulates information provided by a `proto_library.`"
+ api_context: BZL
+}
+global {
+ name: "PyCcLinkParamsProvider"
+ callable {
+ param {
+ name: "cc_info"
+ doc: ":type: CcInfo\n\nLinking information; it has only {obj}`CcInfo.linking_context` set."
+ is_mandatory: true
+ }
+ }
+ doc: "Python-wrapper to forward {obj}`CcInfo.linking_context`. This is to allow Python targets to propagate C++ linking information, but without the Python target appearing to be a valid C++ rule dependency"
+ api_context: BZL
+}
+global {
+ name: "PyInfo"
+ callable {
+ param {
+ name: "direct_pyc_files"
+ doc: ":type: depset[File]\n\nPrecompiled Python files that are considered directly provided\nby the target and **must be included**.\n\nThese files usually come from, e.g., a library setting {attr}`precompile=enabled`\nto forcibly enable precompiling for itself. Downstream binaries are expected\nto always include these files, as the originating target expects them to exist."
+ is_mandatory: true
+ }
+ param {
+ name: "has_py2_only_sources"
+ doc: ":type: bool\n\nWhether any of this target\'s transitive sources requires a Python 2 runtime."
+ is_mandatory: true
+ }
+ param {
+ name: "has_py3_only_sources"
+ doc: ":type: bool\n\nWhether any of this target\'s transitive sources requires a Python 3 runtime."
+ is_mandatory: true
+ }
+ param {
+ name: "imports"
+ doc: ":type: depset[str]\n\nA depset of import path strings to be added to the `PYTHONPATH` of executable\nPython targets. These are accumulated from the transitive `deps`.\nThe order of the depset is not guaranteed and may be changed in the future. It\nis recommended to use `default` order (the default)."
+ is_mandatory: true
+ }
+ param {
+ name: "transitive_implicit_pyc_files"
+ doc: ":type: depset[File]\n\nAutomatically generated pyc files that downstream binaries (or equivalent)\ncan choose to include in their output. If not included, then\n{obj}`transitive_implicit_pyc_source_files` should be included instead.\n\n::::{versionadded} 0.37.0\n::::"
+ is_mandatory: true
+ }
+ param {
+ name: "transitive_implicit_pyc_source_files"
+ doc: ":type: depset[File]\n\nSource `.py` files for {obj}`transitive_implicit_pyc_files` that downstream\nbinaries (or equivalent) can choose to include in their output. If not included,\nthen {obj}`transitive_implicit_pyc_files` should be included instead.\n\n::::{versionadded} 0.37.0\n::::"
+ is_mandatory: true
+ }
+ param {
+ name: "transitive_pyc_files"
+ doc: ":type: depset[File]\n\nThe transitive set of precompiled files that must be included.\n\nThese files usually come from, e.g., a library setting {attr}`precompile=enabled`\nto forcibly enable precompiling for itself. Downstream binaries are expected\nto always include these files, as the originating target expects them to exist."
+ is_mandatory: true
+ }
+ param {
+ name: "transitive_sources"
+ doc: ":type: depset[File]\n\nA (`postorder`-compatible) depset of `.py` files that are considered required\nand downstream binaries (or equivalent) **must** include in their outputs\nto have a functioning program.\n\nNormally, these are the `.py` files in the appearing in the target\'s `srcs` and\nthe `srcs` of the target\'s transitive `deps`, **however**, precompile settings\nmay cause `.py` files to be omitted. In particular, pyc-only builds may result\nin this depset being **empty**.\n\n::::{versionchanged} 0.37.0\nThe files are considered necessary for downstream binaries to function;\npreviously they were considerd informational and largely unused.\n::::"
+ is_mandatory: true
+ }
+ param {
+ name: "uses_shared_libraries"
+ doc: ":type: bool\n\nWhether any of this target\'s transitive `deps` has a shared library file (such\nas a `.so` file).\n\nThis field is currently unused in Bazel and may go away in the future."
+ is_mandatory: true
+ }
+ }
+ doc: "Encapsulates information provided by the Python rules."
+ api_context: BZL
+}
+global {
+ name: "PyRuntimeInfo"
+ callable {
+ param {
+ name: "abi_flags"
+ doc: ":type: str\n\nThe runtime\'s ABI flags, i.e. `sys.abiflags`."
+ is_mandatory: true
+ }
+ param {
+ name: "bootstrap_template"
+ doc: ":type: File\n\nA template of code responsible for the initial startup of a program.\n\nThis code is responsible for:\n\n* Locating the target interpreter. Typically it is in runfiles, but not always.\n* Setting necessary environment variables, command line flags, or other\n configuration that can\'t be modified after the interpreter starts.\n* Invoking the appropriate entry point. This is usually a second-stage bootstrap\n that performs additional setup prior to running a program\'s actual entry point.\n\nThe {obj}`--bootstrap_impl` flag affects how this stage 1 bootstrap\nis expected to behave and the substutitions performed.\n\n* `--bootstrap_impl=system_python` substitutions: `%is_zipfile%`, `%python_binary%`,\n `%target%`, `%workspace_name`, `%coverage_tool%`, `%import_all%`, `%imports%`,\n `%main%`, `%shebang%`\n* `--bootstrap_impl=script` substititions: `%is_zipfile%`, `%python_binary%`,\n `%target%`, `%workspace_name`, `%shebang%, `%stage2_bootstrap%`\n\nSubstitution definitions:\n\n* `%shebang%`: The shebang to use with the bootstrap; the bootstrap template\n may choose to ignore this.\n* `%stage2_bootstrap%`: A runfiles-relative path to the stage 2 bootstrap.\n* `%python_binary%`: The path to the target Python interpreter. There are three\n types of paths:\n * An absolute path to a system interpreter (e.g. begins with `/`).\n * A runfiles-relative path to an interpreter (e.g. `somerepo/bin/python3`)\n * A program to search for on PATH, i.e. a word without spaces, e.g. `python3`.\n* `%workspace_name%`: The name of the workspace the target belongs to.\n* `%is_zipfile%`: The string `1` if this template is prepended to a zipfile to\n create a self-executable zip file. The string `0` otherwise.\n\nFor the other substitution definitions, see the {obj}`stage2_bootstrap_template`\ndocs.\n\n:::{versionchanged} 0.33.0\nThe set of substitutions depends on {obj}`--bootstrap_impl`\n:::"
+ is_mandatory: true
+ }
+ param {
+ name: "coverage_files"
+ doc: ":type: depset[File] | None\n\nThe files required at runtime for using `coverage_tool`. Will be `None` if no\n`coverage_tool` was provided."
+ is_mandatory: true
+ }
+ param {
+ name: "coverage_tool"
+ doc: ":type: File | None\n\nIf set, this field is a `File` representing tool used for collecting code\ncoverage information from python tests. Otherwise, this is `None`."
+ is_mandatory: true
+ }
+ param {
+ name: "files"
+ doc: ":type: depset[File] | None\n\nIf this is an in-build runtime, this field is a `depset` of `File`s that need to\nbe added to the runfiles of an executable target that uses this runtime (in\nparticular, files needed by `interpreter`). The value of `interpreter` need not\nbe included in this field. If this is a platform runtime then this field is\n`None`."
+ is_mandatory: true
+ }
+ param {
+ name: "implementation_name"
+ doc: ":type: str | None\n\nThe Python implementation name (`sys.implementation.name`)"
+ is_mandatory: true
+ }
+ param {
+ name: "interpreter"
+ doc: ":type: File | None\n\nIf this is an in-build runtime, this field is a `File` representing the\ninterpreter. Otherwise, this is `None`. Note that an in-build runtime can use\neither a prebuilt, checked-in interpreter or an interpreter built from source."
+ is_mandatory: true
+ }
+ param {
+ name: "interpreter_path"
+ doc: ":type: str | None\n\nIf this is a platform runtime, this field is the absolute filesystem path to the\ninterpreter on the target platform. Otherwise, this is `None`."
+ is_mandatory: true
+ }
+ param {
+ name: "interpreter_version_info"
+ doc: ":type: struct\n\nVersion information about the interpreter this runtime provides.\nIt should match the format given by `sys.version_info`, however\nfor simplicity, the micro, releaselevel, and serial values are\noptional.\nA struct with the following fields:\n* `major`: {type}`int`, the major version number\n* `minor`: {type}`int`, the minor version number\n* `micro`: {type}`int | None`, the micro version number\n* `releaselevel`: {type}`str | None`, the release level\n* `serial`: {type}`int | None`, the serial number of the release"
+ is_mandatory: true
+ }
+ param {
+ name: "pyc_tag"
+ doc: ":type: str | None\n\nThe tag portion of a pyc filename, e.g. the `cpython-39` infix\nof `foo.cpython-39.pyc`. See PEP 3147. If not specified, it will be computed\nfrom {obj}`implementation_name` and {obj}`interpreter_version_info`. If no\npyc_tag is available, then only source-less pyc generation will function\ncorrectly."
+ is_mandatory: true
+ }
+ param {
+ name: "python_version"
+ doc: ":type: str\n\nIndicates whether this runtime uses Python major version 2 or 3. Valid values\nare (only) `\"PY2\"` and `\"PY3\"`."
+ is_mandatory: true
+ }
+ param {
+ name: "stage2_bootstrap_template"
+ doc: ":type: File\n\nA template of Python code that runs under the desired interpreter and is\nresponsible for orchestrating calling the program\'s actual main code. This\nbootstrap is responsible for affecting the current runtime\'s state, such as\nimport paths or enabling coverage, so that, when it runs the program\'s actual\nmain code, it works properly under Bazel.\n\nThe following substitutions are made during template expansion:\n* `%main%`: A runfiles-relative path to the program\'s actual main file. This\n can be a `.py` or `.pyc` file, depending on precompile settings.\n* `%coverage_tool%`: Runfiles-relative path to the coverage library\'s entry point.\n If coverage is not enabled or available, an empty string.\n* `%import_all%`: The string `True` if all repositories in the runfiles should\n be added to sys.path. The string `False` otherwise.\n* `%imports%`: A colon-delimited string of runfiles-relative paths to add to\n sys.path.\n* `%target%`: The name of the target this is for.\n* `%workspace_name%`: The name of the workspace the target belongs to.\n\n:::{versionadded} 0.33.0\n:::"
+ is_mandatory: true
+ }
+ param {
+ name: "stub_shebang"
+ doc: ":type: str\n\n\"Shebang\" expression prepended to the bootstrapping Python stub\nscript used when executing {obj}`py_binary` targets. Does not\napply to Windows."
+ is_mandatory: true
+ }
+ param {
+ name: "zip_main_template"
+ doc: ":type: File\n\nA template of Python code that becomes a zip file\'s top-level `__main__.py`\nfile. The top-level `__main__.py` file is used when the zip file is explicitly\npassed to a Python interpreter. See PEP 441 for more information about zipapp\nsupport. Note that py_binary-generated zip files are self-executing and\nskip calling `__main__.py`.\n\nThe following substitutions are made during template expansion:\n* `%stage2_bootstrap%`: A runfiles-relative string to the stage 2 bootstrap file.\n* `%python_binary%`: The path to the target Python interpreter. There are three\n types of paths:\n * An absolute path to a system interpreter (e.g. begins with `/`).\n * A runfiles-relative path to an interpreter (e.g. `somerepo/bin/python3`)\n * A program to search for on PATH, i.e. a word without spaces, e.g. `python3`.\n* `%workspace_name%`: The name of the workspace for the built target.\n\n:::{versionadded} 0.33.0\n:::"
+ is_mandatory: true
+ }
+ }
+ doc: "Contains information about a Python runtime, as returned by the `py_runtime`\nrule.\n\nA Python runtime describes either a *platform runtime* or an *in-build runtime*.\nA platform runtime accesses a system-installed interpreter at a known path,\nwhereas an in-build runtime points to a `File` that acts as the interpreter. In\nboth cases, an \"interpreter\" is really any executable binary or wrapper script\nthat is capable of running a Python script passed on the command line, following\nthe same conventions as the standard CPython interpreter."
+ api_context: BZL
+}
+global {
+ name: "RunEnvironmentInfo"
+ callable {
+ param {
+ name: "environment"
+ doc: "A map of string keys and values that represent environment variables and their values. These will be made available when the target that returns this provider is executed, either as a test or via the run command."
+ default_value: "{}"
+ }
+ param {
+ name: "inherited_environment"
+ doc: "A sequence of names of environment variables. These variables are made available with their current value taken from the shell environment when the target that returns this provider is executed, either as a test or via the run command. If a variable is contained in both Creates a configuration transition to be applied on an analysis-test rule\'s dependencies. This transition may only be applied on attributes of rules with This function is primarily designed to facilitate the Analysis Test Framework core library. See its documentation (or its implementation) for best practices."
+ api_context: BZL
+}
+global {
+ name: "android_common"
+ doc: "Do not use this module. It is intended for migration purposes only. If you depend on it, you will be broken when it is removed.Common utilities and functionality related to Android rules."
+ api_context: BZL
+ global_variable {
+ name: "createDexMergerActions"
callable {
param {
- name: "outputs"
- type: "sequence of Files"
- doc: "List of the output files of the action."
+ name: "ctx"
+ doc: "The rule context."
is_mandatory: true
}
param {
- name: "inputs"
- type: "sequence of Files; or depset"
- doc: "List or depset of the input files of the action."
- default_value: "[]"
+ name: "output"
+ doc: "The output directory."
+ is_mandatory: true
}
param {
- name: "tools"
- type: "sequence of Files; or depset"
- doc: "List or depset of any tools needed by the action. Tools are inputs with additional runfiles that are automatically made available to the action. The list can contain Files or FilesToRunProvider instances."
- default_value: "unbound"
+ name: "input"
+ doc: "The input directory."
+ is_mandatory: true
}
param {
- name: "arguments"
- type: "sequence"
- doc: "Command line arguments of the action. Must be a list of strings or Bazel passes the elements in this attribute as arguments to the command.The command can access these arguments using shell variable substitutions such as In the case where If (Deprecated) If Bazel uses the same shell to execute the command as it does for genrules."
+ name: "dexmerger"
+ doc: "A FilesToRunProvider to be used for dex merging."
is_mandatory: true
}
param {
- name: "progress_message"
- type: "string; or If both If both Toolchain type of the executable or tools used in this action. The parameter must be set, so that, the action executes on the correct execution platform. It\'s a no-op right now, but we recommend to set it when a toolchain is used, because it will be required in the future Bazel releases. Note that the rule which creates this action needs to define this toolchain inside its \'rule()\' function. When `toolchain` and `exec_group` parameters are both set, `exec_group` will be used. An error is raised in case the `exec_group` doesn\'t specify the same. toolchain. This feature does not make sense for This function must be called with exactly one of When you use Otherwise, when you use Specific instances of this type can be retrieved from the fields of the apple_common.platform struct: More commonly, however, the apple configuration fragment has fields/methods that allow rules to determine the platform for which a target is being built. Example: Specific instances of this type can be retrieved by accessing the fields of the apple_common.platform_type: Likewise, the platform type of an existing platform value can be retrieved using its Platform types can be converted to a lowercase string (e.g., Implicit attributes starting with Explicit attributes must have type Declared attributes will convert An unnested list of providers will automatically be converted to a list containing one list of providers. That is, To make some rule (e.g. An unnested list of providers will automatically be converted to a list containing one list of providers. That is, To make another aspect (e.g. It is an error if the implementation function omits any of the types of providers listed here from its return value. However, the implementation function may return additional providers not listed here. Each element of the list is an For example, suppose an aspect propagates transitively through attribute `deps` and it is applied to target `alpha`. Suppose `alpha` has `deps = [\':beta_output\']`, where `beta_output` is a declared output of a target `beta`. Suppose `beta` has a target `charlie` as one of its `deps`. If `apply_to_generating_rules=True` for the aspect, then the aspect will propagate through `alpha`, `beta`, and `charlie`. If False, then the aspect will propagate only to `alpha`. False by default. See the Rules page for more on defining\nand using attributes. If For an attribute of a rule or aspect, If For an attribute of a rule or aspect, The function is passed either one or two positional arguments: the item to convert, followed by an optional The return value\'s type depends on how many arguments are to be produced for the item: Ordinarily, items that are directories are automatically expanded to their contents when To avoid unintended retention of large analysis-phase data structures into the execution phase, the Warning: If For an attribute of a rule or aspect, Most of the processing occurs over a list of arguments to be appended, as per the following steps: If For an attribute of a rule or aspect, Processing is similar to If after filtering there are no strings to join into an argument, and if The format defaults to \"shell\" if not called."
- is_mandatory: true
+ name: "providers"
+ doc: "The providers that must be given by any dependency appearing in this attribute. The format of this argument is a list of lists of providers -- For example, if the args are spilled to a params file \"params.txt\", then specifying \"--file=%s\" would cause the action command line to contain \"--file=params.txt\"."
- is_mandatory: true
+ name: "for_dependency_resolution"
+ doc: "If this is set, the attribute is available for materializers. Only rules marked with the flag of the same name are allowed to be referenced through such attributes."
+ default_value: "unbound"
}
param {
- name: "use_always"
- doc: "Whether to always spill the args to a params file. If false, bazel will decide whether the arguments need to be spilled based on your system and arg length."
- default_value: "False"
+ name: "allow_rules"
+ doc: "Which rule targets (name of the classes) are allowed. This is deprecated (kept only for compatibility), use providers instead."
+ default_value: "None"
}
- return_type: "Args"
- }
- doc: "Spills the args to a params file, replacing them with a pointer to the param file. Use when your args may be too large for the system\'s command length limits. Bazel may choose to elide writing the params file to the output tree during execution for efficiency. If you are debugging actions and want to inspect the param file, pass It often happens that an action requires a large command line containing values accumulated from transitive dependencies. For example, a linker command line might list every object file needed by all of the libraries being linked. It is best practice to store such transitive data in For this reason, the action-constructing functions accept The When using string formatting ( Each of the If the size of the command line can grow longer than the maximum size allowed by the system, the arguments can be spilled over into parameter files. See Example: Suppose we wanted to generate the command line: Creates a schema for a label attribute. This is a dependency attribute. This attribute contains unique At analysis time (within the rule\'s implementation function), when retrieving the attribute value from In addition to ordinary source files, this kind of attribute is often used to refer to a tool -- for example, a compiler. Such tools are considered to be dependencies, just like source files. To avoid requiring users to specify the tool\'s label every time they use the rule in their BUILD files, you can hard-code the label of a canonical tool as the If For an attribute of a rule or aspect, This field does not exist on aspect contexts, since aspects do not have predeclared outputs. The fields of this object are defined as follows. It is an error if two outputs produce the same field name or have the same label. The format of this argument is a list of lists of providers -- Creates a schema for an attribute holding a dictionary, where the keys are labels and the values are strings. This is a dependency attribute. This attribute contains unique At analysis time (within the rule\'s implementation function), when retrieving the attribute value from If For an attribute of a rule or aspect, Whether to collect the data runfiles from the dependencies in srcs, data and deps attributes."
- default_value: "False"
+ name: "default"
+ doc: "A default value to use if no value for this attribute is given when instantiating the rule.Use strings or the Whether to collect the default runfiles from the dependencies in srcs, data and deps attributes."
- default_value: "False"
+ name: "materializer"
+ doc: "If set, the attribute materializes dormant dependencies from the transitive closure. The value of this parameter must be a functon that gets access to the values of the attributes of the rule that either are not dependencies or are marked as available for dependency resolution. It must return either a dormant dependency or a list of them depending on the type of the attribute"
+ default_value: "None"
}
param {
- name: "symlinks"
- type: "dict; or depset of SymlinkEntrys"
- doc: "Either a SymlinkEntry depset or the map of symlinks to be added to the runfiles. Symlinks are always added under the main workspace\'s runfiles directory (e.g. In particular, it lets the implementation function access the current target\'s label, attributes, configuration, and the providers of its dependencies. It has methods for declaring output files and the actions that produce them. Context objects essentially live for the duration of the call to the implementation function. It is not useful to access these objects outside of their associated function. See the Rules page for more information."
-}
-type {
- name: "depset"
- field {
- name: "to_list"
- callable {
- return_type: "list"
- }
- doc: "Returns a list of the elements, without duplicates, in the depset\'s traversal order. Note that order is unspecified (but deterministic) for elements that were added more than once to the depset. Order is also unspecified for A specialized data structure that supports efficient merge operations and has a defined traversal order. Commonly used for accumulating data from transitive dependencies in rules and aspects. For more information see here. The elements of a depset must be hashable and all of the same type (as defined by the built-in type(x) function), but depsets are not simply hash sets and do not support fast membership tests. If you need a general set datatype, you can simulate one using a dictionary where all keys map to Depsets are immutable. They should be created using their constructor function and merged or augmented with other depsets via the The Two depsets may only be merged if either both depsets have the same order, or one of them has Depsets may contain duplicate values but these will be suppressed when iterating (using The format of this argument is a list of lists of providers -- When a Only configuration fragments which are declared in the rule definition may be accessed in this collection. See the configuration fragment reference for a list of available fragments and the rules documentation for how to use them."
-}
-type {
- name: "java_annotation_processing"
- field {
- name: "class_jar"
- type: "File"
- doc: "Deprecated: Please use If the repository mapping passed in is For every See configuration_field for example usage."
-}
-type {
- name: "LibraryToLink"
- field {
- name: "alwayslink"
- type: "bool"
- doc: "Whether to link the static library/objects in the --whole_archive block."
- }
- field {
- name: "dynamic_library"
- type: "File"
- doc: " Creates a schema for a list-of-labels attribute. This is a dependency attribute. The corresponding This attribute contains unique At analysis time (within the rule\'s implementation function), when retrieving the attribute value from Creates a schema for an output (label) attribute. This attribute contains unique At analysis time, the corresponding This attribute contains unique At analysis time, the corresponding If For an attribute of a rule or aspect, If For an attribute of a rule or aspect, If For an attribute of a rule or aspect, If one of Exactly one of If one of Exactly one of The format of this argument is a list of lists of providers -- Creates a schema for an attribute whose value is a dictionary where the keys are strings and the values are labels. This is a dependency attribute. This attribute contains unique At analysis time (within the rule\'s implementation function), when retrieving the attribute value from If For an attribute of a rule or aspect, If For an attribute of a rule or aspect, ex: the following rule is marked as a build setting by setting the Example usage: Defining a rule attribute: Accessing in rule implementation: All elements (direct and indirect) of a depset must be of the same type, as obtained by the expression Because a hash-based set is used to eliminate duplicates during iteration, all elements of a depset should be hashable. However, this invariant is not currently checked consistently in all constructors. Use the --incompatible_always_check_depset_elements flag to enable consistent checking; this will be the default behavior in future releases; see Issue 10313.\n In addition, elements must currently be immutable, though this restriction will be relaxed in future.\n The order of the created depset should be compatible with the order of its Note: When you have many runfiles objects to merge, use See runfiles guide for details."
-}
-type {
- name: "struct"
- field {
- name: "to_json"
- callable {
- return_type: "string"
- }
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: instead, use json.encode(x) or json.encode_indent(x), which work for values other than structs and do not pollute the struct field namespace. "
+ global_variable {
+ name: "compile"
}
- field {
- name: "to_proto"
- callable {
- return_type: "string"
- }
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with Deprecated: use proto.encode_text(x) instead."
+ global_variable {
+ name: "default_javac_opts"
}
- doc: "A generic object with fields. Structs fields cannot be reassigned once the struct is created. Two structs are equal if they have the same fields and if corresponding field values are equal."
-}
-type {
- name: "Subrule"
- doc: "Experimental: a building block for writing rules with shared code. For more information, please see the subrule proposal: https://docs.google.com/document/d/1RbNC88QieKvBEwir7iV5zZU08AaMlOzxhVkPnmKDedQ"
-}
-type {
- name: "subrule_ctx"
- field {
- name: "actions"
- type: "actions"
- doc: "Contains methods for declaring output files and the actions that produce them"
- }
- field {
- name: "fragments"
- type: "fragments"
- doc: "Allows access to configuration fragments in target configuration."
- }
- field {
- name: "label"
- type: "Label"
- doc: "The label of the target currently being analyzed"
- }
- field {
- name: "toolchains"
- type: "ToolchainContext"
- doc: "Contains methods for declaring output files and the actions that produce them"
- }
- doc: "A context object passed to the implementation function of a subrule."
-}
-type {
- name: "SymlinkEntry"
- field {
- name: "path"
- type: "string"
- doc: "The path of the symlink in the runfiles tree"
- }
- field {
- name: "target_file"
- type: "File"
- doc: "Target file of the symlink"
- }
- doc: "A single runfiles symlink represented by a link name and target."
-}
-type {
- name: "tag_class"
- doc: "Defines a schema of attributes for a tag."
-}
-type {
- name: "Target"
- doc: "The BUILD target for a dependency. Appears in the fields of Represents a configuration transition across a dependency edge. For example, if If a target propagates the If a target propagates the If a target propagates the If a target propagates the If a target propagates the The encode function accepts one required positional argument, which it converts to JSON by cases:\n This API is highly experimental and subject to change at any time. Do not depend on the stability of this function at this time."
+ doc: "The encode_indent function is equivalent to This API is highly experimental and subject to change at any time. Do not depend on the stability of this function at this time."
- }
- field {
- name: "new_dynamic_framework_provider"
- callable {
- param {
- name: "binary"
- type: "File; or By convention, the implementation function should have a named parameter for any attribute that\nthe macro needs to examine, modify, or pass to non-\"main\" targets, while the \"bulk\" inherited\nattributes which will be passed to the \"main\" target unchanged are passed as The implementation function must not return a value. Instead, the implementation function\ndeclares targets by calling rule or macro symbols.\n\n The name of any target or inner symbolic macro declared by a symbolic macro (including by any\nStarlark function that the macro\'s implementation function transitively calls) must either equal\n By default, targets declared by a symbolic macro (including by any Starlark function that the\nmacro\'s implementation function transitively calls) are visible only in the package containing the\n.bzl file defining the macro. To declare targets visible externally, including to the caller of\nthe symbolic macro, the implementation function must set The following APIs are unavailable within a macro implementation function and any Starlark\nfunction it transitively calls:\n The special Attributes whose names start with To limit memory usage, there is a cap on the number of attributes that may be declared.\n"
+ default_value: "{}"
+ }
+ param {
+ name: "inherit_attrs"
+ doc: "A rule symbol, macro symbol, or the name of a built-in common attribute list (see below) from which\nthe macro should inherit attributes.\n\n If Note that if the return value of The inheritance mechanism works as follows: When a non-mandatory attribute is inherited, the default value of the attribute is overridden\nto be For example, the following macro inherits all attributes from If By convention, a macro should pass inherited, non-overridden attributes unchanged to the \"main\"\nrule or macro symbol which the macro is wrapping. Typically, most inherited attributes will not have\na parameter in the implementation function\'s parameter list, and will simply be passed via\n Unlike ordinary symbolic macros, rule finalizers may call\n The value returned by See Macros for a comprehensive guide on how to use symbolic\nmacros.\n"
+ api_context: BZL
+}
+global {
+ name: "module_extension"
+ callable {
+ param {
+ name: "implementation"
+ doc: "The function that implements this module extension. Must take a single parameter, These values can be passed to methods that expect a platform, like XcodeVersionConfig.sdk_version_for_platform."
}
- field {
- name: "platform_type"
- type: "struct"
- doc: "An enum-like struct that contains the following fields corresponding to Apple platform types: These values can be passed to methods that expect a platform type, like the \'apple\' configuration fragment\'s multi_arch_platform method. Example: The format of this argument is a list of lists of providers -- Creates a schema for a label attribute. This is a dependency attribute. This attribute contains unique At analysis time (within the rule\'s implementation function), when retrieving the attribute value from In addition to ordinary source files, this kind of attribute is often used to refer to a tool -- for example, a compiler. Such tools are considered to be dependencies, just like source files. To avoid requiring users to specify the tool\'s label every time they use the rule in their BUILD files, you can hard-code the label of a canonical tool as the A struct is converted to a message. Fields are emitted in name order.\nEach struct field whose value is None is ignored.\n A sequence (such as a list or tuple) is converted to a repeated field.\nIts elements must not be sequences or dicts.\n A dict is converted to a repeated field of messages with fields named \'key\' and \'value\'.\nEntries are emitted in iteration (insertion) order.\nThe dict\'s keys must be strings or ints, and its values must not be sequences or dicts.\nExamples: The format of this argument is a list of lists of providers -- Creates a schema for an attribute holding a dictionary, where the keys are labels and the values are strings. This is a dependency attribute. This attribute contains unique At analysis time (within the rule\'s implementation function), when retrieving the attribute value from The format of this argument is a list of lists of providers -- Creates a schema for a list-of-labels attribute. This is a dependency attribute. The corresponding This attribute contains unique At analysis time (within the rule\'s implementation function), when retrieving the attribute value from Creates a schema for an output (label) attribute. This attribute contains unique At analysis time, the corresponding A precise description follows; see Rules (Custom initialization of providers) for an intuitive discussion and use cases. Let But in the case where NB: the above steps imply that an error occurs if In this way, the When This attribute contains unique At analysis time, the corresponding See Rules (Providers) for a comprehensive guide on how to use providers. Returns a If See the Rules page for more on defining and using attributes."
-}
-type {
- name: "cc_common"
- field {
- name: "CcToolchainInfo"
- type: "Provider"
- doc: "The key used to retrieve the provider that contains information about the C++ toolchain being used"
+ global_variable {
+ name: "cc_helper"
}
- field {
- name: "action_is_enabled"
- callable {
- param {
- name: "feature_configuration"
- doc: "Feature configuration to be queried."
- is_mandatory: true
- }
- param {
- name: "action_name"
- doc: "Name of the action_config."
- is_mandatory: true
- }
- return_type: "bool"
- }
- doc: "Returns True if given action_config is enabled in the feature configuration."
+ global_variable {
+ name: "cc_info_debug_context"
}
- field {
- name: "configure_features"
- callable {
- param {
- name: "ctx"
- type: "ctx; or Arguments: Arguments: Arguments: Built-in include directories for C++ compilation. These should be the exact paths used by the compiler, and are generally relative to the exec root. The paths used by the compiler can be determined by \'gcc -E -xc++ - -v\'. We currently use the C++ paths also for C compilation, which is safe as long as there are no name clashes between C++ and C header files. Relative paths are resolved relative to the configuration file directory. If the compiler has --sysroot support, then these paths should use %sysroot% rather than the include path, and specify the sysroot attribute in order to give blaze the information necessary to make the correct replacements. The unique identifier of the toolchain within the crosstool release. It must be possible to use this as a directory name in a path. It has to match the following regex: [a-zA-Z_][\\.\\- \\w]* Arguments: Declared attributes will convert Declared attributes will convert A schema for defining predeclared outputs. Unlike The value of this argument is either a dictionary or a callback function that produces a dictionary. The callback works similar to computed dependency attributes: The function\'s parameter names are matched against the rule\'s attributes, so for example if you pass Each entry in the dictionary creates a predeclared output where the key is an identifier and the value is a string template that determines the output\'s label. In the rule\'s implementation function, the identifier becomes the field name used to access the output\'s In practice, the most common substitution placeholder is It is an error if the implementation function omits any of the types of providers listed here from its return value. However, the implementation function may return additional providers not listed here. Each element of the list is an Note: Analysis test rules are primarily defined using infrastructure provided in core Starlark libraries. See Testing for guidance. If a rule is defined as an analysis test rule, it becomes allowed to use configuration transitions defined using analysis_test_transition on its attributes, but opts into some restrictions: The function is called at load time for each instance of the rule. It\'s called with It has to return a dictionary from the attribute names to the desired values. The attributes that are not returned are unaffected. Returning Initializers are evaluated before the default values specified in an attribute definition. Consequently, if a parameter in the initializer\'s signature contains a default values, it overwrites the default from the attribute definition (except if returning Similarly, if a parameter in the initializer\'s signature doesn\'t have a default, the parameter will become mandatory. It\'s a good practice to omit default/mandatory settings on an attribute definition in such cases. It\'s a good practice to use In case of extended rules, all initializers are called proceeding from child to ancestors. Each initializer is passed only the public attributes it knows about."
+ default_value: "None"
+ }
+ param {
+ name: "parent"
+ doc: "Experimental: the Stalark rule that is extended. When set the public attributes are merged as well as advertised providers. The rule matches Rules must be assigned to global variables in a .bzl file; the name of the global variable is the rule\'s name. Test rules are required to have a name ending in Structs fields cannot be reassigned once the struct is created. Two structs are equal if they have the same fields and if corresponding field values are equal."
+ api_context: BZL
+}
+global {
+ name: "subrule"
+ callable {
+ param {
+ name: "implementation"
+ doc: "The Starlark function implementing this subrule"
+ is_mandatory: true
+ }
+ param {
+ name: "attrs"
+ doc: "A dictionary to declare all the (private) attributes of the subrule. Note that unlike The number of transitive dependencies of the test are limited. The limit is controlled by The This function must return a Example:\'none\'."
- }
- field {
- name: "multi_arch_platform"
- callable {
- param {
- name: "platform_type"
- doc: "The apple platform type."
- is_mandatory: true
- }
- return_type: "apple_platform"
- }
- doc: "The platform of the current configuration for the given platform type. This should only be invoked in a context where multiple architectures may be supported; consider single_arch_platform for other cases."
- }
- field {
- name: "single_arch_cpu"
- type: "string"
- doc: "The single \"effective\" architecture for this configuration (e.g., i386 or arm64) in the context of rule logic that is only concerned with a single architecture (such as objc_library, which registers single-architecture compile actions)."
- }
- field {
- name: "single_arch_platform"
- type: "apple_platform"
- doc: "The platform of the current configuration. This should only be invoked in a context where only a single architecture may be supported; consider multi_arch_platform for other cases."
- }
- doc: "A configuration fragment for Apple platforms."
-}
-type {
- name: "bazel_android"
- field {
- name: "merge_android_manifest_permissions"
- type: "bool"
- doc: "The value of --merge_android_manifest_permissions flag."
- }
-}
-type {
- name: "bazel_py"
- field {
- name: "python_import_all_repositories"
- type: "bool"
- doc: "The value of the --experimental_python_import_all_repositories flag."
- }
- field {
- name: "python_path"
- type: "string"
- doc: "The value of the --python_path flag."
- }
-}
-type {
- name: "coverage"
- field {
- name: "output_generator"
- type: "Label"
- doc: "Returns the label pointed to by the --coverage_output_generator option if coverage collection is enabled, otherwise returns None. Can be accessed with configuration_field:attr.label(
"
- }
- doc: "A configuration fragment representing the coverage configuration."
-}
-type {
- name: "cpp"
- field {
- name: "apple_bitcode_mode"
- type: "string"
- doc: "Deprecated: Returns the Bitcode mode to use for compilation steps. Always returns
default = configuration_field(
fragment = \"coverage\",
name = \"output_generator\"
)
)\'none\'."
- }
- field {
- name: "apple_generate_dsym"
- type: "bool"
- doc: "Whether to generate Apple debug symbol(.dSYM) artifacts."
- }
- field {
- name: "conlyopts"
- type: "list"
- doc: "The flags passed to Bazel by --conlyopt option."
- }
- field {
- name: "copts"
- type: "list"
- doc: "The flags passed to Bazel by --copt option."
- }
- field {
- name: "custom_malloc"
- type: "Label"
- doc: "Returns label pointed to by --custom_malloc option. Can be accessed with configuration_field:attr.label(
"
- }
- field {
- name: "cxxopts"
- type: "list"
- doc: "The flags passed to Bazel by
default = configuration_field(
fragment = \"cpp\",
name = \"custom_malloc\"
)
)--cxxopt option."
- }
- field {
- name: "linkopts"
- type: "list"
- doc: "The flags passed to Bazel by --linkopt option."
- }
- field {
- name: "objc_generate_linkmap"
- type: "bool"
- doc: "(Apple-only) Whether to generate linkmap artifacts."
- }
- field {
- name: "objc_should_strip_binary"
- type: "bool"
- doc: "(Apple-only) whether to perform symbol and dead-code strippings on linked binaries."
- }
- field {
- name: "objccopts"
- type: "list"
- doc: "The flags passed to Bazel by --objccopt option."
- }
- doc: "A configuration fragment for C++."
-}
-type {
- name: "j2objc"
- field {
- name: "translation_flags"
- type: "list"
- doc: "The list of flags to be used when the j2objc compiler is invoked. "
- }
- doc: "A configuration fragment for j2Objc."
-}
-type {
- name: "java"
- field {
- name: "bytecode_optimization_pass_actions"
- type: "int"
- doc: "This specifies the number of actions to divide the OPTIMIZATION stage of the bytecode optimizer into. Note that if split_bytecode_optimization_pass is set, this will only change behavior if it is > 2."
- }
- field {
- name: "bytecode_optimizer_mnemonic"
- type: "string"
- doc: "The mnemonic for the bytecode optimizer."
- }
- field {
- name: "default_javac_flags"
- type: "list"
- doc: "The default flags for the Java compiler."
- }
- field {
- name: "default_javac_flags_depset"
- type: "depset"
- doc: "The default flags for the Java compiler."
- }
- field {
- name: "default_jvm_opts"
- type: "list"
- doc: "Additional options to pass to the Java VM for each java_binary target"
- }
- field {
- name: "disallow_java_import_empty_jars"
- callable {
- return_type: "bool"
- }
- doc: "Returns true if empty java_import jars are not allowed."
- }
- field {
- name: "disallow_java_import_exports"
- callable {
- return_type: "bool"
- }
- doc: "Returns true if java_import exports are not allowed."
- }
- field {
- name: "multi_release_deploy_jars"
- type: "bool"
- doc: "The value of the --incompatible_multi_release_deploy_jars flag."
- }
- field {
- name: "one_version_enforcement_level"
- type: "string"
- doc: "The value of the --experimental_one_version_enforcement flag."
- }
- field {
- name: "plugins"
- type: "list"
- doc: "A list containing the labels provided with --plugins, if any."
- }
- field {
- name: "run_android_lint"
- type: "bool"
- doc: "The value of the --experimental_run_android_lint_on_java_rules flag."
- }
- field {
- name: "split_bytecode_optimization_pass"
- type: "bool"
- doc: "Returns whether the OPTIMIZATION stage of the bytecode optimizer will be split across two actions."
- }
- field {
- name: "strict_java_deps"
- type: "string"
- doc: "The value of the strict_java_deps flag."
- }
- field {
- name: "use_ijars"
- callable {
- return_type: "bool"
- }
- doc: "Returns true iff Java compilation should use ijars."
- }
- doc: "A java compiler configuration."
-}
-type {
- name: "objc"
- field {
- name: "alwayslink_by_default"
- type: "bool"
- doc: "Returns whether objc_library and objc_import should default to alwayslink=True."
- }
- field {
- name: "copts"
- type: "list"
- doc: "Returns a list of options to use for compiling Objective-C.These options are applied after any default options but before options specified in the attributes of the rule."
- }
- field {
- name: "copts_for_current_compilation_mode"
- type: "list"
- doc: "Returns a list of default options to use for compiling Objective-C in the current mode."
- }
- field {
- name: "disallow_sdk_frameworks_attributes"
- type: "bool"
- doc: "Returns whether sdk_frameworks and weak_sdk_frameworks are disallowed attributes."
- }
- field {
- name: "generate_linkmap"
- type: "bool"
- doc: "Whether to generate linkmap artifacts."
- }
- field {
- name: "ios_simulator_device"
- type: "string"
- doc: "The type of device (e.g. \'iPhone 6\') to use when running on the simulator."
- }
- field {
- name: "ios_simulator_version"
- type: "DottedVersion"
- doc: "The SDK version of the iOS simulator to use when running on the simulator."
- }
- field {
- name: "run_memleaks"
- type: "bool"
- doc: "Returns a boolean indicating whether memleaks should be run during tests or not."
- }
- field {
- name: "should_strip_binary"
- type: "bool"
- doc: "Returns whether to perform symbol and dead-code strippings on linked binaries."
- }
- field {
- name: "signing_certificate_name"
- type: "string"
- doc: "Returns the flag-supplied certificate name to be used in signing, or None if no such certificate was specified."
- }
- field {
- name: "uses_device_debug_entitlements"
- type: "bool"
- doc: "Returns whether device debug entitlements should be included when signing an application."
- }
- doc: "A configuration fragment for Objective-C."
-}
-type {
- name: "platform"
- field {
- name: "host_platform"
- type: "Label"
- doc: "The current host platform"
- }
- field {
- name: "platform"
- type: "Label"
- doc: "The current target platform"
- }
- doc: "The platform configuration."
+global {
+ name: "False"
+ type: "bool"
}
-type {
- name: "proto"
- doc: "A configuration fragment representing protocol buffers."
-}
-type {
- name: "py"
- field {
- name: "build_python_zip"
- type: "bool"
- doc: "The effective value of --build_python_zip"
- }
- field {
- name: "default_python_version"
- type: "string"
- doc: "The default python version from --incompatible_py3_is_default"
- }
- field {
- name: "default_to_explicit_init_py"
- type: "bool"
- doc: "The value from the --incompatible_default_to_explicit_init_py flag"
- }
- field {
- name: "disable_py2"
- type: "bool"
- doc: "The value of the --incompatible_python_disable_py2 flag."
- }
- field {
- name: "disallow_native_rules"
- type: "bool"
- doc: "The value of the --incompatible_python_disallow_native_rules flag."
- }
- field {
- name: "use_toolchains"
- type: "bool"
- doc: "The value from the --incompatible_use_python_toolchains flag"
- }
- doc: "A configuration fragment for Python."
-}
-type {
- name: "swift"
- field {
- name: "copts"
- callable {
- return_type: "list"
- }
- doc: "A list of compiler options that should be passed to swiftc when compiling Swift code."
- }
- doc: "A configuration fragment for Swift tools."
+global {
+ name: "None"
+ type: "NoneType"
}
-type {
- name: "AnalysisTestResultInfo"
- field {
- name: "message"
- type: "string"
- doc: "A descriptive message containing information about the test and its success/failure."
- }
- field {
- name: "success"
- type: "bool"
- doc: "If true, then the analysis-phase test represented by this target passed. If false, the test failed."
- }
- doc: "Encapsulates the result of analyis-phase testing. Build targets which return an instance of this provider signal to the build system that it should generate a \'stub\' test executable which generates the equivalent test result. Analysis test rules (rules created with analysis_test=True must return an instance of this provider, and non-analysis-phase test rules cannot return this provider."
+global {
+ name: "True"
+ type: "bool"
}
-type {
- name: "AndroidNeverLinkLibrariesProvider"
- field {
- name: "to_json"
- callable {
- return_type: "string"
- }
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\nabs(-2.3) == 2.3
"
}
-type {
- name: "AppleDebugOutputs"
- field {
- name: "outputs_map"
- type: "dict"
- doc: "A dictionary of: { arch: { output_type: file, output_type: file, ... } }, where \'arch\' is any Apple architecture such as \'arm64\' or \'armv7\', \'output_type\' is a string descriptor such as \'bitcode_symbols\' or \'dsym_binary\', and the file is the file matching that descriptor for that architecture."
- }
- field {
- name: "to_json"
- callable {
- return_type: "string"
- }
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\nall([\"hello\", 3, True]) == True\nall([-1, 0, 1]) == False
"
}
-type {
- name: "AppleDynamicFramework"
- field {
- name: "binary"
- type: "File"
- doc: "The multi-architecture dylib binary of the dynamic framework. May be None if the rule providing the framework only specified framework imports."
- }
- field {
- name: "cc_info"
- type: "CcInfo"
- doc: "A provider which contains information about the transitive dependencies linked into the dynamic framework."
- }
- field {
- name: "framework_dirs"
- type: "depset"
- doc: "The framework path names used as link inputs in order to link against the dynamic framework."
- }
- field {
- name: "framework_files"
- type: "depset"
- doc: "The full set of files that should be included as inputs to link against the dynamic framework."
- }
- field {
- name: "objc"
- type: "ObjcProvider"
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_objc_provider_remove_linking_info. Use this flag to verify your code is compatible with its imminent removal.
A provider which contains information about the transitive dependencies linked into the dynamic framework."
- }
- field {
- name: "to_json"
- callable {
- return_type: "string"
- }
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\nany([-1, 0, 1]) == True\nany([False, 0, \"\"]) == False
"
}
-type {
- name: "AppleExecutableBinary"
- field {
- name: "binary"
- type: "File"
- doc: "The executable binary file output by apple_binary."
- }
- field {
- name: "cc_info"
- type: "CcInfo"
- doc: "A provider which contains information about the transitive dependencies linked into the binary."
- }
- field {
- name: "objc"
- type: "ObjcProvider"
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_objc_provider_remove_linking_info. Use this flag to verify your code is compatible with its imminent removal.
A provider which contains information about the transitive dependencies linked into the binary."
- }
- field {
- name: "to_json"
- callable {
- return_type: "string"
- }
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\nFalse if the object is None, False, an empty string (\"\"), the number 0, or an empty collection (e.g. (), []). Otherwise, it returns True."
}
-type {
- name: "BaselineProfileProvider"
- field {
- name: "to_json"
- callable {
- return_type: "string"
+global {
+ name: "dict"
+ callable {
+ param {
+ name: "pairs"
+ doc: "A dict, or an iterable whose elements are each of length 2 (key, value)."
+ default_value: "[]"
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\nCompilationContext"
- }
- field {
- name: "linking_context"
- type: "LinkingContext"
- doc: "Returns the LinkingContext"
- }
- field {
- name: "to_json"
- callable {
- return_type: "string"
- }
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\n---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\nenumerate([24, 21, 84]) == [(0, 24), (1, 21), (2, 84)]
\n"
}
-type {
- name: "CcToolchainInfo"
- field {
- name: "all_files"
- type: "depset"
- doc: "Returns all toolchain files (so they can be passed to actions using this toolchain as inputs)."
- }
- field {
- name: "ar_executable"
- type: "string"
- doc: "The path to the ar binary."
- }
- field {
- name: "built_in_include_directories"
- type: "list"
- doc: "Returns the list of built-in directories of the compiler."
- }
- field {
- name: "compiler"
- type: "string"
- doc: "C++ compiler."
- }
- field {
- name: "compiler_executable"
- type: "string"
- doc: "The path to the compiler binary."
- }
- field {
- name: "cpu"
- type: "string"
- doc: "Target CPU of the C++ toolchain."
- }
- field {
- name: "dynamic_runtime_lib"
- callable {
- param {
- name: "feature_configuration"
- doc: "Feature configuration to be queried."
- is_mandatory: true
- }
- return_type: "depset"
+global {
+ name: "fail"
+ callable {
+ param {
+ name: "msg"
+ doc: "Deprecated: use positional arguments instead. This argument acts like an implicit leading positional argument."
+ default_value: "None"
}
- doc: "Returns the files from `dynamic_runtime_lib` attribute (so they can be passed to actions using this toolchain as inputs). The caller can check whether the feature_configuration enables `static_link_cpp_runtimes` feature (if not, neither `static_runtime_lib` nor `dynamic_runtime_lib` have to be used), and use `static_runtime_lib` if static linking mode is active."
- }
- field {
- name: "gcov_executable"
- type: "string"
- doc: "The path to the gcov binary."
- }
- field {
- name: "ld_executable"
- type: "string"
- doc: "The path to the ld binary."
- }
- field {
- name: "libc"
- type: "string"
- doc: "libc version string."
- }
- field {
- name: "needs_pic_for_dynamic_libraries"
- callable {
- param {
- name: "feature_configuration"
- doc: "Feature configuration to be queried."
- is_mandatory: true
- }
- return_type: "bool"
+ param {
+ name: "attr"
+ doc: "Deprecated. Causes an optional prefix containing this string to be added to the error message."
+ default_value: "None"
}
- doc: "Returns true if this rule\'s compilations should apply -fPIC, false otherwise. Determines if we should apply -fPIC for this rule\'s C++ compilations depending on the C++ toolchain and presence of `--force_pic` Bazel option."
- }
- field {
- name: "nm_executable"
- type: "string"
- doc: "The path to the nm binary."
- }
- field {
- name: "objcopy_executable"
- type: "string"
- doc: "The path to the objcopy binary."
- }
- field {
- name: "objdump_executable"
- type: "string"
- doc: "The path to the objdump binary."
- }
- field {
- name: "preprocessor_executable"
- type: "string"
- doc: "The path to the preprocessor binary."
- }
- field {
- name: "static_runtime_lib"
- callable {
- param {
- name: "feature_configuration"
- doc: "Feature configuration to be queried."
- is_mandatory: true
- }
- return_type: "depset"
+ param {
+ name: "sep"
+ doc: "The separator string between the objects, default is space (\" \")."
+ default_value: "\" \""
}
- doc: "Returns the files from `static_runtime_lib` attribute (so they can be passed to actions using this toolchain as inputs). The caller should check whether the feature_configuration enables `static_link_cpp_runtimes` feature (if not, neither `static_runtime_lib` nor `dynamic_runtime_lib` should be used), and use `dynamic_runtime_lib` if dynamic linking mode is active."
- }
- field {
- name: "strip_executable"
- type: "string"
- doc: "The path to the strip binary."
- }
- field {
- name: "sysroot"
- type: "string"
- doc: "Returns the sysroot to be used. If the toolchain compiler does not support different sysroots, or the sysroot is the same as the default sysroot, then this method returns None."
- }
- field {
- name: "target_gnu_system_name"
- type: "string"
- doc: "The GNU System Name."
- }
- field {
- name: "to_json"
- callable {
- return_type: "string"
+ param {
+ name: "*args"
+ doc: "A list of values, formatted with debugPrint (which is equivalent to str by default) and joined with sep (defaults to \" \"), that appear in the error message."
+ is_star_arg: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\n
Note: This API is experimental and may change at any time. It is disabled by default, but may be enabled with --experimental_platforms_api"
+ doc: "Returns x as a float value.
Any other value causes an error. With no argument, x is already a float, float returns it unchanged. x is a bool, float returns 1.0 for True and 0.0 for False. x is an int, float returns the nearest finite floating-point value to x, or an error if the magnitude is too large. x is a string, it must be a valid floating-point literal, or be equal (ignoring case) to NaN, Inf, or Infinity, optionally preceded by a + or - sign. float() returns 0.0."
}
-type {
- name: "ConstraintSettingInfo"
- field {
- name: "has_default_constraint_value"
- type: "bool"
- doc: "Whether there is a default constraint_value for this setting."
- }
- field {
- name: "to_json"
- callable {
- return_type: "string"
+global {
+ name: "getattr"
+ callable {
+ param {
+ name: "x"
+ doc: "The struct whose attribute is accessed."
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\n
Note: This API is experimental and may change at any time. It is disabled by default, but may be enabled with --experimental_platforms_api"
+ doc: "Returns the struct\'s field of the given name if it exists. If not, it either returns default (if specified) or raises an error. getattr(x, \"foobar\") is equivalent to x.foobar.getattr(ctx.attr, \"myattr\")\ngetattr(ctx.attr, \"myattr\", \"mydefault\")
"
}
-type {
- name: "ConstraintValueInfo"
- field {
- name: "to_json"
- callable {
- return_type: "string"
+global {
+ name: "hasattr"
+ callable {
+ param {
+ name: "x"
+ doc: "The object to check."
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\n
Note: This API is experimental and may change at any time. It is disabled by default, but may be enabled with --experimental_platforms_api"
+ doc: "Returns True if the object x has an attribute or method of the given name, otherwise False. Example:hasattr(ctx.attr, \"myattr\")
"
}
-type {
- name: "DebugPackageInfo"
- field {
- name: "dwp_file"
- type: "File"
- doc: "Returns the .dwp file (for fission builds) or null if --fission=no."
- }
- field {
- name: "stripped_file"
- type: "File"
- doc: "Returns the stripped file (the explicit \".stripped\" target)."
- }
- field {
- name: "target_label"
- type: "Label"
- doc: "Returns the label for the *_binary target"
- }
- field {
- name: "to_json"
- callable {
- return_type: "string"
- }
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\nString.hashCode(), namely: s[0] * (31^(n-1)) + s[1] * (31^(n-2)) + ... + s[n-1]
Hashing of values besides strings is not currently supported."
}
-type {
- name: "DefaultInfo"
- field {
- name: "data_runfiles"
- type: "runfiles"
- doc: "runfiles descriptor describing the files that this target needs when run in the condition that it is a data dependency attribute. Under most circumstances, use the default_runfiles parameter instead. See \"runfiles features to avoid\" for details. "
- }
- field {
- name: "default_runfiles"
- type: "runfiles"
- doc: "runfiles descriptor describing the files that this target needs when run (via the run command or as a tool dependency)."
- }
- field {
- name: "files"
- type: "depset"
- doc: "A depset of File objects representing the default outputs to build when this target is specified on the bazel command line. By default it is all predeclared outputs."
- }
- field {
- name: "files_to_run"
- type: "FilesToRunProvider"
- doc: "A FilesToRunProvider object containing information about the executable and runfiles of the target."
- }
- field {
- name: "to_json"
- callable {
- return_type: "string"
+global {
+ name: "int"
+ callable {
+ param {
+ name: "x"
+ doc: "The string to convert."
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.x were an integer literal. This parameter must not be supplied if the value is not a string."
+ default_value: "unbound"
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\nDefaultInfo instance has the following fields:
See the rules page for extensive guides on how to use this provider."
+ doc: "Returns x as an int value.filesfiles_to_rundata_runfilesdefault_runfiles
This function fails if x is already an int, int returns it unchanged.x is a bool, int returns 1 for True and 0 for False.x is a string, it must have the format <sign><prefix><digits>. <sign> is either \"+\", \"-\", or empty (interpreted as positive). <digits> are a sequence of digits from 0 up to base - 1, where the letters a-z (or equivalently, A-Z) are used as digits for 10-35. In the case where base is 2/8/16, <prefix> is optional and may be 0b/0o/0x (or equivalently, 0B/0O/0X) respectively; if the base is any other value besides these bases or the special value 0, the prefix must be empty. In the case where base is 0, the string is interpreted as an integer literal, in the sense that one of the bases 2/8/10/16 is chosen depending on which prefix if any is used. If base is 0, no prefix is used, and there is more than one digit, the leading digit cannot be 0; this is to avoid confusion between octal and decimal. The magnitude of the number represented by the string must be within the allowed range for the int type.x is a float, int returns the integer value of the float, rounding towards zero. It is an error if x is non-finite (NaN or infinity).x is any other type, or if the value is a string not satisfying the above format. Unlike Python\'s int function, this function does not allow zero arguments, and does not allow extraneous whitespace for string arguments.int(\"123\") == 123\nint(\"-123\") == -123\nint(\"+123\") == 123\nint(\"FF\", 16) == 255\nint(\"0xFF\", 16) == 255\nint(\"10\", 0) == 10\nint(\"-0x10\", 0) == -16\nint(\"-0x10\", 0) == -16\nint(\"123.456\") == 123\n
"
}
-type {
- name: "ExecutionInfo"
- field {
- name: "exec_group"
- type: "string"
- doc: "The name of the exec group that is used to execute the test."
- }
- field {
- name: "requirements"
- type: "dict"
- doc: "A dict indicating special execution requirements, such as hardware platforms."
- }
- field {
- name: "to_json"
- callable {
- return_type: "string"
- }
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\n---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\nlist([1, 2]) == [1, 2]\nlist((2, 3, 2)) == [2, 3, 2]\nlist({5: \"a\", 2: \"b\", 4: \"c\"}) == [5, 2, 4]"
}
-type {
- name: "GeneratedExtensionRegistryProvider"
- field {
- name: "to_json"
- callable {
- return_type: "string"
+global {
+ name: "max"
+ callable {
+ param {
+ name: "key"
+ doc: "An optional function applied to each element before comparison."
+ default_value: "None"
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\n\nmax(2, 5, 4) == 5\nmax([5, 6, 3]) == 6\nmax(\"two\", \"three\", \"four\", key = len) ==\"three\" # the longest\nmax([1, -1, -2, 2], key = abs) == -2 # the first encountered with maximal key value\n
"
}
-type {
- name: "IncompatiblePlatformProvider"
- doc: "A provider for targets that are incompatible with the target platform. See Detecting incompatible targets using bazel cquery for more information."
-}
-type {
- name: "InstrumentedFilesInfo"
- field {
- name: "instrumented_files"
- type: "depset"
- doc: "depset of File objects representing instrumented source files for this target and its dependencies."
- }
- field {
- name: "metadata_files"
- type: "depset"
- doc: "depset of File objects representing coverage metadata files for this target and its dependencies. These files contain additional information required to generate LCOV-format coverage output after the code is executed, e.g. the .gcno files generated when gcc is run with -ftest-coverage."
- }
- field {
- name: "to_json"
- callable {
- return_type: "string"
+global {
+ name: "min"
+ callable {
+ param {
+ name: "key"
+ doc: "An optional function applied to each element before comparison."
+ default_value: "None"
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\n--instrumentation_filter for purposes of code coverage data collection. When coverage data collection is enabled, a manifest containing the combined paths in instrumented_files and metadata_files are passed to the test action as inputs, with the manifest\'s path noted in the environment variable COVERAGE_MANIFEST. The metadata files, but not the source files, are also passed to the test action as inputs. When InstrumentedFilesInfo is returned by an aspect\'s implementation function, any InstrumentedFilesInfo from the base rule target is ignored."
+ doc: "Returns the smallest one of all given arguments. If only one positional argument is provided, it must be a non-empty iterable. It is an error if elements are not comparable (for example int with string), or if no arguments are given.\nmin(2, 5, 4) == 2\nmin([5, 6, 3]) == 3\nmin(\"six\", \"three\", \"four\", key = len) == \"six\" # the shortest\nmin([2, -2, -1, 1], key = abs) == -1 # the first encountered with minimal key value\n
"
}
-type {
- name: "java_compilation_info"
- field {
- name: "boot_classpath"
- type: "list"
- doc: "Boot classpath for this Java target."
- }
- field {
- name: "compilation_classpath"
- type: "depset"
- doc: "Compilation classpath for this Java target."
- }
- field {
- name: "javac_options"
- type: "list"
- doc: "Options to java compiler."
- }
- field {
- name: "javac_options_list"
- type: "list"
- doc: "A list of options to java compiler. This exists temporarily for migration purposes. javac_options will return a depset in the future, and this method will be dropped once all usages have been updated to handle depsets."
- }
- field {
- name: "runtime_classpath"
- type: "depset"
- doc: "Run-time classpath for this Java target."
- }
- doc: "Provides access to compilation information for Java rules."
-}
-type {
- name: "java_output_jars"
- field {
- name: "jars"
- type: "list"
- doc: "Returns information about outputs of this Java/Java-like target. Deprecated: Use java_info.java_outputs."
- }
- field {
- name: "jdeps"
- type: "File"
- doc: "A manifest proto file. The protobuf file containing the manifest generated from JavaBuilder. This function returns a value when exactly one manifest proto file is present in the outputs. Deprecated: Use java_info.java_outputs[i].jdeps."
- }
- field {
- name: "native_headers"
- type: "File"
- doc: "A jar containing CC header files supporting native method implementation. This function returns a value when exactly one native headers jar file is present in the outputs. Deprecated: Use java_info.java_outputs[i].native_headers_jar."
- }
- doc: "Information about outputs of a Java rule. Deprecated: use java_info.java_outputs."
-}
-type {
- name: "JavaRuntimeInfo"
- field {
- name: "default_cds"
- type: "File"
- doc: "Returns the JDK default CDS archive."
- }
- field {
- name: "files"
- type: "depset"
- doc: "Returns the files in the Java runtime."
- }
- field {
- name: "hermetic_files"
- type: "depset"
- doc: "Returns the files in the Java runtime needed for hermetic deployments."
- }
- field {
- name: "hermetic_static_libs"
- type: "sequence"
- doc: "Returns the JDK static libraries."
- }
- field {
- name: "java_executable_exec_path"
- type: "string"
- doc: "Returns the execpath of the Java executable."
- }
- field {
- name: "java_executable_runfiles_path"
- type: "string"
- doc: "Returns the path of the Java executable in runfiles trees. This should only be used when one needs to access the JVM during the execution of a binary or a test built by Bazel. In particular, when one needs to invoke the JVM during an action, java_executable_exec_path should be used instead."
- }
- field {
- name: "java_home"
- type: "string"
- doc: "Returns the execpath of the root of the Java installation."
- }
- field {
- name: "java_home_runfiles_path"
- type: "string"
- doc: "Returns the path of the Java installation in runfiles trees. This should only be used when one needs to access the JDK during the execution of a binary or a test built by Bazel. In particular, when one needs the JDK during an action, java_home should be used instead."
- }
- field {
- name: "lib_ct_sym"
- type: "File"
- doc: "Returns the lib/ct.sym file."
- }
- field {
- name: "lib_modules"
- type: "File"
- doc: "Returns the lib/modules file."
- }
- field {
- name: "to_json"
- callable {
- return_type: "string"
+global {
+ name: "print"
+ callable {
+ param {
+ name: "sep"
+ doc: "The separator string between the objects, default is space (\" \")."
+ default_value: "\" \""
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\nargs as debug output. It will be prefixed with the string \"DEBUG\" and the location (file and line number) of this call. The exact way in which the arguments are converted to strings is unspecified and may change at any time. In particular, it may be different from (and more detailed than) the formatting done by str() and repr().print in production code is discouraged due to the spam it creates for users. For deprecations, prefer a hard error using fail() whenever possible."
}
-type {
- name: "JavaToolchainInfo"
- field {
- name: "bootclasspath"
- type: "depset"
- doc: "The Java target bootclasspath entries. Corresponds to javac\'s -bootclasspath flag."
- }
- field {
- name: "ijar"
- type: "FilesToRunProvider"
- doc: "A FilesToRunProvider representing the ijar executable."
- }
- field {
- name: "jacocorunner"
- type: "FilesToRunProvider"
- doc: "The jacocorunner used by the toolchain."
- }
- field {
- name: "java_runtime"
- type: "JavaRuntimeInfo"
- doc: "The java runtime information."
- }
- field {
- name: "jvm_opt"
- type: "depset"
- doc: "The default options for the JVM running the java compiler and associated tools."
- }
- field {
- name: "label"
- type: "Label"
- doc: "The toolchain label."
- }
- field {
- name: "proguard_allowlister"
- type: "FilesToRunProvider"
- doc: "Return the binary to validate proguard configuration"
- }
- field {
- name: "single_jar"
- type: "FilesToRunProvider"
- doc: "The SingleJar deploy jar."
- }
- field {
- name: "source_version"
- type: "string"
- doc: "The java source version."
- }
- field {
- name: "target_version"
- type: "string"
- doc: "The java target version."
- }
- field {
- name: "to_json"
- callable {
- return_type: "string"
+global {
+ name: "range"
+ callable {
+ param {
+ name: "start_or_stop"
+ doc: "Value of the start element if stop is provided, otherwise value of stop and the actual start is 0"
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\n---incompatible_objc_provider_remove_linking_info. Use this flag to verify your code is compatible with its imminent removal.
The library files in .framework directories belonging to a dynamically linked framework."
- }
- field {
- name: "dynamic_framework_names"
- type: "depset"
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_objc_provider_remove_linking_info. Use this flag to verify your code is compatible with its imminent removal.
Returns all names of dynamic frameworks in this provider."
- }
- field {
- name: "dynamic_framework_paths"
- type: "depset"
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_objc_provider_remove_linking_info. Use this flag to verify your code is compatible with its imminent removal.
Returns all framework paths to dynamic frameworks in this provider."
- }
- field {
- name: "force_load_library"
- type: "depset"
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_objc_provider_remove_linking_info. Use this flag to verify your code is compatible with its imminent removal.
Libraries to load with -force_load."
- }
- field {
- name: "imported_library"
- type: "depset"
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_objc_provider_remove_linking_info. Use this flag to verify your code is compatible with its imminent removal.
Imported precompiled static libraries (.a files) to be linked into the binary."
- }
- field {
- name: "j2objc_library"
- type: "depset"
- doc: "Static libraries that are built from J2ObjC-translated Java code."
- }
- field {
- name: "library"
- type: "depset"
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_objc_provider_remove_linking_info. Use this flag to verify your code is compatible with its imminent removal.
Library (.a) files compiled by dependencies of the current target."
- }
- field {
- name: "link_inputs"
- type: "depset"
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_objc_provider_remove_linking_info. Use this flag to verify your code is compatible with its imminent removal.
Link time artifacts from dependencies that do not fall into any other category such as libraries or archives. This catch-all provides a way to add arbitrary data (e.g. Swift AST files) to the linker. The rule that adds these is also responsible to add the necessary linker flags to \'linkopt\'."
- }
- field {
- name: "linkopt"
- type: "depset"
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_objc_provider_remove_linking_info. Use this flag to verify your code is compatible with its imminent removal.
Linking options."
- }
- field {
- name: "module_map"
- type: "depset"
- doc: "Clang module maps, used to enforce proper use of private header files."
- }
- field {
- name: "sdk_dylib"
- type: "depset"
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_objc_provider_remove_linking_info. Use this flag to verify your code is compatible with its imminent removal.
Names of SDK .dylib libraries to link with. For instance, \'libz\' or \'libarchive\'."
- }
- field {
- name: "sdk_framework"
- type: "depset"
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_objc_provider_remove_linking_info. Use this flag to verify your code is compatible with its imminent removal.
Names of SDK frameworks to link with (e.g. \'AddressBook\', \'QuartzCore\')."
- }
- field {
- name: "source"
- type: "depset"
- doc: "All transitive source files."
- }
- field {
- name: "static_framework_file"
- type: "depset"
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_objc_provider_remove_linking_info. Use this flag to verify your code is compatible with its imminent removal.
The library files in .framework directories that should be statically linked."
- }
- field {
- name: "static_framework_names"
- type: "depset"
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_objc_provider_remove_linking_info. Use this flag to verify your code is compatible with its imminent removal.
Returns all names of static frameworks in this provider."
- }
- field {
- name: "static_framework_paths"
- type: "depset"
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_objc_provider_remove_linking_info. Use this flag to verify your code is compatible with its imminent removal.
Returns all framework paths to static frameworks in this provider."
- }
- field {
- name: "strict_include"
- type: "depset"
- doc: "Non-propagated include search paths specified with \'-I\' on the command line. Also known as header search paths (and distinct from user header search paths)."
- }
- field {
- name: "umbrella_header"
- type: "depset"
- doc: "Clang umbrella header. Public headers are #included in umbrella headers to be compatible with J2ObjC segmented headers."
- }
- field {
- name: "weak_sdk_framework"
- type: "depset"
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_objc_provider_remove_linking_info. Use this flag to verify your code is compatible with its imminent removal.
Names of SDK frameworks to weakly link with. For instance, \'MediaAccessibility\'. In difference to regularly linked SDK frameworks, symbols from weakly linked frameworks do not cause an error if they are not present at runtime."
- }
- doc: "A provider for compilation and linking of objc."
-}
-type {
- name: "OutputGroupInfo"
- field {
- name: "to_json"
- callable {
- return_type: "string"
+ param {
+ name: "stop_or_none"
+ doc: "optional index of the first item not to be included in the resulting list; generation of the list stops before stop is reached."
+ default_value: "None"
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\n
See Requesting output files for more information."
+ doc: "Creates a list where items go from start to stop, using a step increment. If a single argument is provided, items will range from 0 to that element.range(4) == [0, 1, 2, 3]\nrange(3, 9, 2) == [3, 5, 7]\nrange(3, 0, -1) == [3, 2, 1]
"
}
-type {
- name: "PackageSpecificationInfo"
- field {
- name: "contains"
- callable {
- param {
- name: "target"
- type: "Label; or string"
- doc: "A target which is checked if it exists inside the package group."
- is_mandatory: true
- }
- return_type: "bool"
+global {
+ name: "repr"
+ callable {
+ param {
+ name: "x"
+ doc: "The object to convert."
+ is_mandatory: true
}
- doc: "Checks if a target exists in a package group."
}
- field {
- name: "to_json"
- callable {
- return_type: "string"
+ doc: "Converts any object to a string representation. This is useful for debugging.repr(\"ab\") == \'\"ab\"\'
"
+}
+global {
+ name: "reversed"
+ callable {
+ param {
+ name: "sequence"
+ doc: "The iterable sequence (e.g. list) to be reversed."
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.reversed([3, 5, 4]) == [4, 5, 3]
"
+}
+global {
+ name: "set"
+ callable {
+ param {
+ name: "elements"
+ doc: "A set, a sequence of hashable values, or a dict."
+ default_value: "[]"
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\nset() returns a new empty set.\n\n\nset() # an empty set\nset([3, 1, 1, 2]) # set([3, 1, 2]), a set of three elements\nset({\"k1\": \"v1\", \"k2\": \"v2\"}) # set([\"k1\", \"k2\"]), a set of two elements\n\n"
}
-type {
- name: "PlatformInfo"
- field {
- name: "to_json"
- callable {
- return_type: "string"
+global {
+ name: "sorted"
+ callable {
+ param {
+ name: "iterable"
+ doc: "The iterable sequence to sort."
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\n
Note: This API is experimental and may change at any time. It is disabled by default, but may be enabled with --experimental_platforms_api"
+ doc: "Returns a new sorted list containing all the elements of the supplied iterable sequence. An error may occur if any pair of elements x, y may not be compared using x < y. The elements are sorted into ascending order, unless the reverse argument is True, in which case the order is descending.\n Sorting is stable: elements that compare equal retain their original relative order.\n\nsorted([3, 5, 4]) == [3, 4, 5]\nsorted([3, 5, 4], reverse = True) == [5, 4, 3]\nsorted([\"two\", \"three\", \"four\"], key = len) == [\"two\", \"four\", \"three\"] # sort by length\n
"
}
-type {
- name: "ProguardSpecProvider"
- field {
- name: "to_json"
- callable {
- return_type: "string"
+global {
+ name: "str"
+ callable {
+ param {
+ name: "x"
+ doc: "The object to convert."
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.str(\"ab\") == \"ab\"\nstr(8) == \"8\"
"
+}
+global {
+ name: "tuple"
+ callable {
+ param {
+ name: "x"
+ doc: "The object to convert."
+ default_value: "()"
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\ntuple([1, 2]) == (1, 2)\ntuple((2, 3, 2)) == (2, 3, 2)\ntuple({5: \"a\", 2: \"b\", 4: \"c\"}) == (5, 2, 4)"
}
-type {
- name: "ProtoRegistryProvider"
- field {
- name: "to_json"
- callable {
- return_type: "string"
+global {
+ name: "type"
+ callable {
+ param {
+ name: "x"
+ doc: "The object to check type of."
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.type(2) == \"int\"\ntype([1]) == \"list\"\ntype(struct(a = 2)) == \"struct\"
This function might change in the future. To write Python-compatible code and be future-proof, use it only to compare return values: if type(x) == type([]): # if x is a list
"
+}
+global {
+ name: "zip"
+ callable {
+ param {
+ name: "*args"
+ doc: "lists to zip."
+ is_star_arg: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\nlist of tuples, where the i-th tuple contains the i-th element from each of the argument sequences or iterables. The list has the size of the shortest input. With a single iterable argument, it returns a list of 1-tuples. With no arguments, it returns an empty list. Examples:zip() # == []\nzip([1, 2]) # == [(1,), (2,)]\nzip([1, 2], [3, 4]) # == [(1, 3), (2, 4)]\nzip([1, 2], [3, 4, 5]) # == [(1, 3), (2, 4)]
"
}
-type {
- name: "PyInfo"
- field {
- name: "has_py2_only_sources"
- type: "bool"
- doc: "Whether any of this target\'s transitive sources requires a Python 2 runtime."
- }
- field {
- name: "has_py3_only_sources"
- type: "bool"
- doc: "Whether any of this target\'s transitive sources requires a Python 3 runtime."
- }
- field {
- name: "imports"
- type: "depset"
- doc: "A depset of import path strings to be added to the PYTHONPATH of executable Python targets. These are accumulated from the transitive deps.default order (the default)."
- }
- field {
- name: "transitive_sources"
- type: "depset"
- doc: "A (postorder-compatible) depset of .py files appearing in the target\'s srcs and the srcs of the target\'s transitive deps."
- }
- field {
- name: "uses_shared_libraries"
- type: "bool"
- doc: "Whether any of this target\'s transitive deps has a shared library file (such as a .so file).coverage_tool. Will be None if no coverage_tool was provided."
- }
- field {
- name: "coverage_tool"
- type: "File"
- doc: "If set, this field is a File representing tool used for collecting code coverage information from python tests. Otherwise, this is None."
- }
- field {
- name: "files"
- type: "depset"
- doc: "If this is an in-build runtime, this field is a depset of Files that need to be added to the runfiles of an executable target that uses this runtime (in particular, files needed by interpreter). The value of interpreter need not be included in this field. If this is a platform runtime then this field is None."
- }
- field {
- name: "interpreter"
- type: "File"
- doc: "If this is an in-build runtime, this field is a File representing the interpreter. Otherwise, this is None. Note that an in-build runtime can use either a prebuilt, checked-in interpreter or an interpreter built from source."
- }
- field {
- name: "interpreter_path"
- type: "string"
- doc: "If this is a platform runtime, this field is the absolute filesystem path to the interpreter on the target platform. Otherwise, this is None."
- }
- field {
- name: "python_version"
- type: "string"
- doc: "Indicates whether this runtime uses Python major version 2 or 3. Valid values are (only) \"PY2\" and \"PY3\"."
- }
- field {
- name: "stub_shebang"
- type: "string"
- doc: "\"Shebang\" expression prepended to the bootstrapping Python stub script used when executing py_binary targets. Does not apply to Windows."
- }
- doc: "Contains information about a Python runtime, as returned by the py_runtimerule.File that acts as the interpreter. In both cases, an \"interpreter\" is really any executable binary or wrapper script that is capable of running a Python script passed on the command line, following the same conventions as the standard CPython interpreter."
-}
-type {
- name: "RunEnvironmentInfo"
- field {
- name: "environment"
- type: "dict"
- doc: "A map of string keys and values that represent environment variables and their values. These will be made available when the target that returns this provider is executed, either as a test or via the run command."
- }
- field {
- name: "inherited_environment"
- type: "list"
- doc: "A sequence of names of environment variables. These variables are made available with their current value taken from the shell environment when the target that returns this provider is executed, either as a test or via the run command. If a variable is contained in both environment and inherited_environment, the value inherited from the shell environment will take precedence if set."
- }
- field {
- name: "to_json"
- callable {
- return_type: "string"
+global {
+ name: "AnalysisFailureInfo"
+ doc: "Experimental. This API is experimental and subject to change at any time--allow_analysis_failure is set, targets which would otherwise fail in analysis will instead propagate an instance of this object (and no other provider instances). --allow_analysis_failure, AnalysisFailureInfo objects are automatically re-propagated up a dependency tree using the following logic:
If an aspect and the rule target that it is applied to both provide AnalysisFailureInfo, the instances are merged."
+ api_context: BZL
+}
+global {
+ name: "AnalysisTestResultInfo"
+ callable {
+ param {
+ name: "success"
+ doc: "If true, then the analysis-phase test represented by this target should pass. If false, the test should fail."
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with AnalysisFailureInfo, then propagate an instance of this provider containing an AnalysisFailure object describing the failure.AnalysisFailureInfo, then propagate a provider with causes equal to the union of the causes of the dependencies.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\nanalysis_test=True must return an instance of this provider, and non-analysis-phase test rules cannot return this provider."
+ api_context: BZL
}
-type {
- name: "TemplateVariableInfo"
- field {
- name: "to_json"
- callable {
- return_type: "string"
+global {
+ name: "AndroidIdeInfo"
+ type: "CLASS: com.google.devtools.build.lib.packages.AutoloadSymbols$1"
+ api_context: BZL
+}
+global {
+ name: "CcInfo"
+ callable {
+ param {
+ name: "compilation_context"
+ doc: "The CompilationContext."
+ default_value: "None"
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.LinkingContext."
+ default_value: "None"
+ }
+ param {
+ name: "debug_context"
+ doc: "The DebugContext."
+ default_value: "None"
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\n$(VARIABLE) in BUILD files and expanded by ctx.expand_make_variables and implicitly in certain attributes of built-in rules.TemplateVariableInfo can be created by calling its eponymous constructor with a string-to-string dict as an argument that specifies the variables provided.platform_common.TemplateVariableInfo({\'FOO\': \'bar\'})---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\n---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\n
Note: This API is experimental and may change at any time. It is disabled by default, but may be enabled with --experimental_platforms_api"
-}
-type {
- name: "XcodeProperties"
- field {
- name: "default_ios_sdk_version"
- type: "string"
- doc: "The default iOS sdk version for this version of xcode, or None if unknown."
- }
- field {
- name: "default_macos_sdk_version"
- type: "string"
- doc: "The default macOS sdk version for this version of xcode, or None if unknown."
- }
- field {
- name: "default_tvos_sdk_version"
- type: "string"
- doc: "The default tvOS sdk version for this version of xcode, or None if unknown."
- }
- field {
- name: "default_visionos_sdk_version"
- type: "string"
- doc: "The default visionOS sdk version for this version of xcode, or None if unknown."
- }
- field {
- name: "default_watchos_sdk_version"
- type: "string"
- doc: "The default watchOS sdk version for this version of xcode, or None if unknown."
- }
- field {
- name: "to_json"
- callable {
- return_type: "string"
+ param {
+ name: "exports"
+ doc: "cc_libraries that are linked statically and exported"
+ is_mandatory: true
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\nNone if the xcode version is unknown."
}
- doc: "A provider containing information about a version of Xcode and its properties."
+ doc: "Information about a cc shared library."
+ api_context: BZL
}
-type {
- name: "XcodeVersionConfig"
- field {
- name: "availability"
- callable {
- return_type: "string"
+global {
+ name: "CcToolchainConfigInfo"
+ doc: "Additional layer of configurability for C++ rules. Encapsulates platform-dependent specifics of C++ actions through features and action configs. It is used to configure the C++ toolchain, and later on for command line construction. Replaces the functionality of CROSSTOOL file."
+ api_context: BZL
+}
+global {
+ name: "DebugPackageInfo"
+ callable {
+ param {
+ name: "target_label"
+ doc: "The label for the *_binary target"
+ is_mandatory: true
}
- doc: "Returns the availability of this Xcode version, \'remote\' if the version is only available remotely, \'local\' if the version is only available locally, \'both\' if the version is available both locally and remotely, or \'unknown\' if the availability could not be determined."
- }
- field {
- name: "execution_info"
- callable {
- return_type: "dict"
+ param {
+ name: "stripped_file"
+ doc: "The stripped file (the explicit \".stripped\" target)"
+ default_value: "None"
}
- doc: "Returns the execution requirements for actions that use this Xcode config."
- }
- field {
- name: "minimum_os_for_platform_type"
- callable {
- param {
- name: "platform_type"
- doc: "The apple platform type."
- is_mandatory: true
- }
- return_type: "DottedVersion"
+ param {
+ name: "unstripped_file"
+ doc: "The unstripped file (the default executable target)."
+ is_mandatory: true
}
- doc: "The minimum compatible OS version for target simulator and devices for a particular platform type."
- }
- field {
- name: "sdk_version_for_platform"
- callable {
- param {
- name: "platform"
- doc: "The apple platform."
- is_mandatory: true
- }
- return_type: "DottedVersion"
+ param {
+ name: "dwp_file"
+ doc: "The .dwp file (for fission builds) or null if --fission=no."
+ default_value: "None"
}
- doc: "The version of the platform SDK that will be used to build targets for the given platform."
}
- field {
- name: "to_json"
- callable {
- return_type: "string"
+ doc: "A provider for the binary file and its associated .dwp files, if fission is enabled.If Fission ({@url https://gcc.gnu.org/wiki/DebugFission}) is not enabled, the dwp file will be null."
+ api_context: BZL
+}
+global {
+ name: "DefaultInfo"
+ callable {
+ param {
+ name: "files"
+ doc: "A depset of File objects representing the default outputs to build when this target is specified on the bazel command line. By default it is all predeclared outputs."
+ default_value: "None"
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.run command or as a tool dependency)."
+ default_value: "None"
}
- doc: "Deprecated. This API is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\nNone if no Xcode versions are available."
- }
- doc: "The set of Apple versions computed from command line options and the xcode_config rule."
-}
-type {
- name: "Action"
- field {
- name: "args"
- type: "sequence"
- doc: "A list of frozen Args objects containing information about the action arguments. These objects contain accurate argument information, including arguments involving expanded action output directories. However, Args objects are not readable in the analysis phase. For a less accurate account of arguments which is available in the analysis phase, see argv. None."
- }
- field {
- name: "argv"
- type: "sequence"
- doc: "For actions created by ctx.actions.run() or ctx.actions.run_shell() an immutable list of the arguments for the command line to be executed. Note that for shell actions the first two arguments will be the shell path and \"-c\"."
- }
- field {
- name: "content"
- type: "string"
- doc: "For actions created by ctx.actions.write() or ctx.actions.expand_template(), the contents of the file to be written, if those contents can be computed during the analysis phase. The value is None if the contents cannot be determined until the execution phase, such as when a directory in an Args object needs to be expanded."
- }
- field {
- name: "env"
- type: "dict"
- doc: "The \'fixed\' environment variables for this action. This includes only environment settings which are explicitly set by the action definition, and thus omits settings which are only pre-set in the execution environment."
- }
- field {
- name: "inputs"
- type: "depset"
- doc: "A set of the input files of this action."
- }
- field {
- name: "mnemonic"
- type: "string"
- doc: "The mnemonic for this action."
- }
- field {
- name: "outputs"
- type: "depset"
- doc: "A set of the output files of this action."
- }
- field {
- name: "substitutions"
- type: "dict"
- doc: "For actions created by ctx.actions.expand_template(), an immutable dict holding the substitution mapping."
- }
- doc: "An action created during rule analysis.Actions provider. It is normally not necessary to access Action objects or their fields within a rule\'s implementation function. You may instead want to see the Rules page for a general discussion of how to use actions when defining custom rules, or the API reference for creating actions.None."
-}
-type {
- name: "actions"
- field {
- name: "args"
- callable {
- return_type: "Args"
+ param {
+ name: "data_runfiles"
+ doc: "data attribute."
+ default_value: "None"
+ }
+ param {
+ name: "default_runfiles"
+ doc: "data attribute."
+ default_value: "None"
+ }
+ param {
+ name: "executable"
+ doc: "If this rule is marked executable or test, this is a File object representing the file that should be executed to run the target. By default it is the predeclared output ctx.outputs.executable but it is recommended to pass another file (either predeclared or not) explicitly."
+ default_value: "None"
}
- doc: "Returns an Args object that can be used to build memory-efficient command lines."
}
- field {
- name: "declare_directory"
- callable {
- param {
- name: "filename"
- doc: "If no \'sibling\' provided, path of the new directory, relative to the current package. Otherwise a base name for a file (\'sibling\' defines a directory)."
- is_mandatory: true
- }
- param {
- name: "sibling"
- type: "File; or None"
- doc: "A file that lives in the same directory as the newly declared directory. The file must be in the current package."
- default_value: "None"
- }
- return_type: "File"
+ doc: "A provider that gives general information about a target\'s direct and transitive files. Every rule type has this provider, even if it is not returned explicitly by the rule\'s implementation function. Each DefaultInfo instance has the following fields:
See the rules page for extensive guides on how to use this provider."
+ api_context: BZL
+}
+global {
+ name: "InstrumentedFilesInfo"
+ doc: "Contains information about source files and instrumentation metadata files for rule targets matched by filesfiles_to_rundata_runfilesdefault_runfiles--instrumentation_filter for purposes of code coverage data collection. When coverage data collection is enabled, a manifest containing the combined paths in instrumented_files and metadata_files are passed to the test action as inputs, with the manifest\'s path noted in the environment variable COVERAGE_MANIFEST. The metadata files, but not the source files, are also passed to the test action as inputs. When InstrumentedFilesInfo is returned by an aspect\'s implementation function, any InstrumentedFilesInfo from the base rule target is ignored."
+ api_context: BZL
+}
+global {
+ name: "JavaInfo"
+ callable {
+ param {
+ name: "annotation_processing"
+ doc: "Deprecated: Please use plugins instead."
+ is_mandatory: true
+ }
+ param {
+ name: "api_generating_plugins"
+ doc: "\"(_JavaPluginDataInfo) Data about API generating plugins\ndefined or exported by this target.\nThose annotation processors are applied to a Java target before\nproducing its header jars (which contain method signatures). When\nno API plugins are present, header jars are generated from the\nsources, reducing critical path.\nThe `api_generating_plugins` is a subset of `plugins`."
+ is_mandatory: true
+ }
+ param {
+ name: "cc_link_params_info"
+ doc: "Deprecated. Do not use. C++ libraries to be linked into Java targets."
+ is_mandatory: true
+ }
+ param {
+ name: "compilation_info"
+ doc: "(java_compilation_info) Compilation information for this\nJava/Java-like target."
+ is_mandatory: true
+ }
+ param {
+ name: "compile_jars"
+ doc: "(depset[File]) The jars required directly at compile time. They can be interface jars\n(ijar or hjar), regular jars or both, depending on whether rule\nimplementations chose to create interface jars or not."
+ is_mandatory: true
+ }
+ param {
+ name: "full_compile_jars"
+ doc: "(depset[File]) The regular, full compile time Jars required by this target directly.\nThey can be:\n - the corresponding regular Jars of the interface Jars returned by JavaInfo.compile_jars\n - the regular (full) Jars returned by JavaInfo.compile_jars\n\nNote: JavaInfo.compile_jars can return a mix of interface Jars and\nregular Jars.deps and `plugins` attributes."
+ is_mandatory: true
+ }
+ param {
+ name: "runtime_output_jars"
+ doc: "([File]) A list of runtime Jars created by this Java/Java-like target."
+ is_mandatory: true
+ }
+ param {
+ name: "source_jars"
+ doc: "([File]) A list of Jars with all the source files (including those generated by\nannotations) of the target itself, i.e. NOT including the sources of the\ntransitive dependencies."
+ is_mandatory: true
+ }
+ param {
+ name: "transitive_compile_time_jars"
+ doc: "(depset[File]) The transitive set of jars required to\nbuild the target.\nArgs.add_all(). Only regular files and directories can be in the expanded contents of a declare_directory."
}
- field {
- name: "declare_file"
- callable {
- param {
- name: "filename"
- doc: "If no \'sibling\' provided, path of the new file, relative to the current package. Otherwise a base name for a file (\'sibling\' determines a directory)."
- is_mandatory: true
- }
- param {
- name: "sibling"
- type: "File; or None"
- doc: "A file that lives in the same directory as the newly created file. The file must be in the current package."
- default_value: "None"
- }
- return_type: "File"
+ doc: "Info object encapsulating all information by java rules."
+ api_context: BZL
+}
+global {
+ name: "JavaPluginInfo"
+ callable {
+ param {
+ name: "api_generating_plugins"
+ doc: "Returns data about API generating plugins defined or exported by\nthis target.\nThose annotation processors are applied to a Java target before\nproducing its header jars (which contain method signatures). When\nno API plugins are present, header jars are generated from the\nsources, reducing critical path.\nThe api_generating_plugins is a subset of\nplugins."
+ is_mandatory: true
+ }
+ param {
+ name: "java_outputs"
+ doc: "Returns information about outputs of this Java/Java-like target."
+ is_mandatory: true
+ }
+ param {
+ name: "plugins"
+ doc: "Returns data about all plugins that a consuming target should apply.\nThis is typically either a java_plugin itself or a\njava_library exporting one or more plugins.\nA java_library runs annotation processing with all\nplugins from this field appearing in deps and\nplugins attributes."
+ is_mandatory: true
}
- doc: "Declares that the rule or aspect creates a file with the given filename. If sibling is not specified, the file name is relative to the package directory, otherwise the file is in the same directory as sibling. Files cannot be created outside of the current package.File object to the action\'s construction function.File objects from ctx.outputs instead. See example of use."
}
- field {
- name: "declare_symlink"
- callable {
- param {
- name: "filename"
- doc: "If no \'sibling\' provided, path of the new symlink, relative to the current package. Otherwise a base name for a file (\'sibling\' defines a directory)."
- is_mandatory: true
- }
- param {
- name: "sibling"
- type: "File; or None"
- doc: "A file that lives in the same directory as the newly declared symlink."
- default_value: "None"
- }
- return_type: "File"
+ doc: "Provider encapsulating information about Java plugins."
+ api_context: BZL
+}
+global {
+ name: "Label"
+ callable {
+ param {
+ name: "input"
+ doc: "The input label string or Label object. If a Label object is passed, it\'s returned as is."
+ is_mandatory: true
}
- doc: "Declares that the rule or aspect creates a symlink with the given name in the current package. You must create an action that generates this symlink. Bazel will never dereference this symlink and will transfer it verbatim to sandboxes or remote executors. Symlinks inside tree artifacts are not currently supported."
}
- field {
- name: "do_nothing"
- callable {
- param {
- name: "mnemonic"
- doc: "A one-word description of the action, for example, CppCompile or GoLink."
- is_mandatory: true
- }
- param {
- name: "inputs"
- type: "sequence of Files; or depset"
- doc: "List of the input files of the action."
- default_value: "[]"
- }
- return_type: "NoneType"
+ doc: "Converts a label string into a Label object, in the context of the package where the calling .bzl source file lives. If the given value is already a Label, it is returned unchanged.native.package_relative_label(), converts the input into a Label in the context of the package currently being constructed. Use that function to mimic the string-to-label conversion that is automatically done by label-valued rule attributes."
+ api_context: BZL
+}
+global {
+ name: "OutputGroupInfo"
+ callable {
+ param {
+ name: "**kwargs"
+ doc: "Dictionary of arguments."
+ is_star_star_arg: true
}
- doc: "Creates an empty action that neither executes a command nor produces any output, but that is useful for inserting \'extra actions\'."
}
- field {
- name: "expand_template"
- callable {
- param {
- name: "template"
- doc: "The template file, which is a UTF-8 encoded text file."
- is_mandatory: true
- }
- param {
- name: "output"
- doc: "The output file, which is a UTF-8 encoded text file."
- is_mandatory: true
- }
- param {
- name: "substitutions"
- doc: "Substitutions to make when expanding the template."
- default_value: "{}"
- }
- param {
- name: "is_executable"
- doc: "Whether the output file should be executable."
- default_value: "False"
- }
- param {
- name: "computed_substitutions"
- type: "TemplateDict"
- doc: "Substitutions to make when expanding the template."
- default_value: "unbound"
- }
- return_type: "NoneType"
+ doc: "A provider that indicates what output groups a rule has.
See Requesting output files for more information."
+ api_context: BZL
+}
+global {
+ name: "PackageSpecificationInfo"
+ doc: "Information about transitive package specifications used in package groups."
+ api_context: BZL
+}
+global {
+ name: "ProguardSpecProvider"
+ callable {
+ param {
+ name: "specs"
+ doc: "A list of proguard specs files"
+ is_mandatory: true
}
- doc: "Creates a template expansion action. When the action is executed, it will generate a file based on a template. Parts of the template will be replaced using the substitutions dictionary, in the order the substitutions are specified. Whenever a key of the dictionary appears in the template (or a result of a previous substitution), it is replaced with the associated value. There is no special syntax for the keys. You may, for example, use curly braces to avoid conflicts (for example, {KEY}). See example of use."
}
- field {
- name: "run"
- callable {
- param {
- name: "outputs"
- type: "sequence of Files"
- doc: "List of the output files of the action."
- is_mandatory: true
- }
- param {
- name: "inputs"
- type: "sequence of Files; or depset"
- doc: "List or depset of the input files of the action."
- default_value: "[]"
- }
- param {
- name: "unused_inputs_list"
- type: "File; or None"
- doc: "File containing list of inputs unused by the action. actions.args() objects."
- default_value: "[]"
- }
- param {
- name: "mnemonic"
- type: "string; or None"
- doc: "A one-word description of the action, for example, CppCompile or GoLink."
- default_value: "None"
- }
- param {
- name: "progress_message"
- type: "string; or None"
- doc: "Progress message to show to the user during the build, for example, \"Compiling foo.cc to create foo.o\". The message may contain %{label}, %{input}, or %{output} patterns, which are substituted with label string, first input, or output\'s path, respectively. Prefer to use patterns instead of static strings, because the former are more efficient."
- default_value: "None"
- }
- param {
- name: "use_default_shell_env"
- doc: "Whether the action should use the default shell environment, which consists of a few OS-dependent variables as well as variables set via --action_env.use_default_shell_env and env are set to True, values set in env will overwrite the default shell environment if --incompatible_merge_fixed_and_default_shell_env is enabled (default). If the flag is not enabled, env is ignored."
- default_value: "False"
- }
- param {
- name: "env"
- type: "dict; or None"
- doc: "Sets the dictionary of environment variables.use_default_shell_env and env are set to True, values set in env will overwrite the default shell environment if --incompatible_merge_fixed_and_default_shell_env is enabled (default). If the flag is not enabled, env is ignored."
- default_value: "None"
- }
- param {
- name: "execution_requirements"
- type: "dict; or None"
- doc: "Information for scheduling the action. See tags for useful keys."
- default_value: "None"
- }
- param {
- name: "input_manifests"
- type: "sequence; or None"
- doc: "(Experimental) sets the input runfiles metadata; they are typically generated by resolve_command."
- default_value: "None"
- }
- param {
- name: "exec_group"
- type: "string; or None"
- doc: "Runs the action on the given exec group\'s execution platform. If none, uses the target\'s default execution platform."
- default_value: "None"
- }
- param {
- name: "shadowed_action"
- type: "Action"
- doc: "Runs the action using the given shadowed action\'s inputs and environment added to the action\'s inputs list and environment. The action environment can overwrite any of the shadowed action\'s environment variables. If none, uses only the action\'s inputs and given environment."
- default_value: "None"
- }
- param {
- name: "resource_set"
- type: "callable; or None"
- doc: "A callback function that returns a resource set dictionary, used to estimate resource usage at execution time if this action is run locally.None or if --experimental_action_resource_set is false, the default values are used.None"
- doc: "environment and inherited_environment, the value inherited from the shell environment will take precedence if set."
+ default_value: "[]"
+ }
+ }
+ doc: "A provider that can be returned from executable rules to control the environment in which their executable is executed."
+ api_context: BZL
+}
+global {
+ name: "analysis_test_transition"
+ callable {
+ param {
+ name: "settings"
+ doc: "A dictionary containing information about configuration settings which should be set by this configuration transition. Keys are build setting labels and values are their new post-transition values. All other settings are unchanged. Use this to declare specific configuration settings that an analysis test requires to be set in order to pass."
+ is_mandatory: true
}
- doc: "Creates an action that runs an executable. See example of use."
}
- field {
- name: "run_shell"
+ doc: "analysis_test = True. Such rules are restricted in capabilities (for example, the size of their dependency tree is limited), so transitions created using this function are limited in potential scope as compared to transitions created using transition(). actions.args() objects.$1, $2, etc. Note that since Args objects are flattened before indexing, if there is an Args object of unknown size then all subsequent strings will be at unpredictable indices. It may be useful to use $@ (to retrieve all arguments) in conjunction with Args objects of indeterminate size.command is a list of strings, this parameter may not be used."
+ name: "dexopts"
+ doc: "A list of additional command-line flags for the dx tool. Optional"
default_value: "[]"
}
param {
- name: "mnemonic"
- type: "string; or None"
- doc: "A one-word description of the action, for example, CppCompile or GoLink."
- default_value: "None"
- }
- param {
- name: "command"
- type: "string; or sequence of strings"
- doc: "Shell command to execute. This may either be a string (preferred) or a sequence of strings (deprecated).command is a string, then it is executed as if by sh -c <command> \"\" <arguments> -- that is, the elements in arguments are made available to the command as $1, $2 (or %1, %2 if using Windows batch), etc. If arguments contains any actions.args() objects, their contents are appended one by one to the command line, so $i can refer to individual strings within an Args object. Note that if an Args object of unknown size is passed as part of arguments, then the strings will be at unknown indices; in this case the $@ shell substitution (retrieve all arguments) may be useful.command is a sequence of strings, the first item is the executable to run and the remaining items are its arguments. If this form is used, the arguments parameter must not be supplied. Note that this form is deprecated and will soon be removed. It is disabled with `--incompatible_run_shell_command_string`. Use this flag to verify your code is compatible. None"
- doc: "Progress message to show to the user during the build, for example, \"Compiling foo.cc to create foo.o\". The message may contain %{label}, %{input}, or %{output} patterns, which are substituted with label string, first input, or output\'s path, respectively. Prefer to use patterns instead of static strings, because the former are more efficient."
- default_value: "None"
- }
- param {
- name: "use_default_shell_env"
- doc: "Whether the action should use the default shell environment, which consists of a few OS-dependent variables as well as variables set via --action_env.use_default_shell_env and env are set to True, values set in env will overwrite the default shell environment if --incompatible_merge_fixed_and_default_shell_env is enabled (default). If the flag is not enabled, env is ignored."
- default_value: "False"
- }
- param {
- name: "env"
- type: "dict; or None"
- doc: "Sets the dictionary of environment variables.use_default_shell_env and env are set to True, values set in env will overwrite the default shell environment if --incompatible_merge_fixed_and_default_shell_env is enabled (default). If the flag is not enabled, env is ignored."
- default_value: "None"
- }
- param {
- name: "execution_requirements"
- type: "dict; or None"
- doc: "Information for scheduling the action. See tags for useful keys."
- default_value: "None"
- }
- param {
- name: "input_manifests"
- type: "sequence; or None"
- doc: "(Experimental) sets the input runfiles metadata; they are typically generated by resolve_command."
- default_value: "None"
- }
- param {
- name: "exec_group"
- type: "string; or None"
- doc: "Runs the action on the given exec group\'s execution platform. If none, uses the target\'s default execution platform."
- default_value: "None"
- }
- param {
- name: "shadowed_action"
- type: "Action"
- doc: "Runs the action using the given shadowed action\'s discovered inputs added to the action\'s inputs list. If none, uses only the action\'s inputs."
- default_value: "None"
+ name: "min_sdk_version"
+ doc: "The minSdkVersion the dexes were built for."
+ default_value: "0"
}
param {
- name: "resource_set"
- type: "callable; or None"
- doc: "A callback function for estimating resource usage if run locally. Seectx.actions.run()."
+ name: "desugar_globals"
+ doc: "The D8 desugar globals file."
default_value: "None"
}
- param {
- name: "toolchain"
- type: "Label; or string; or None"
- doc: "None"
- doc: "The File that the output symlink will point to."
- default_value: "None"
- }
- param {
- name: "target_path"
- type: "string; or None"
- doc: "The exact path that the output symlink will point to. No normalization or other processing is applied."
- default_value: "None"
- }
- param {
- name: "is_executable"
- doc: "May only be used with target_file, not target_path. If true, when the action is executed, the target_file\'s path is checked to confirm that it is executable, and an error is reported if it is not. Setting is_executable to False does not mean the target is not executable, just that no verification is done.target_path because dangling symlinks might not exist at build time.None"
- doc: "Progress message to show to the user during the build."
- default_value: "None"
- }
- return_type: "NoneType"
}
- doc: "Creates an action that writes a symlink in the file system.target_file or target_path specified.target_file, declare output with declare_file() or declare_directory() and match the type of target_file. This makes the symlink point to target_file. Bazel invalidates the output of this action whenever the target of the symlink or its contents change.target_path, declare output with declare_symlink()). In this case, the symlink points to target_path. Bazel never resolves the symlink and the output of this action is invalidated only when the text contents of the symlink (that is, the value of readlink()) changes. In particular, this can be used to create a dangling symlink.actions.args() object."
+ name: "resource"
+ doc: "The android resource file."
is_mandatory: true
}
- param {
- name: "is_executable"
- doc: "Whether the output file should be executable."
- default_value: "False"
- }
- return_type: "NoneType"
}
- doc: "Creates a file write action. When the action is executed, it will write the given content to a file. This is used to generate files using information available in the analysis phase. If the file is large and with a lot of static content, consider using expand_template."
+ doc: "Returns a source directory for Android resource file. The source directory is a prefix of resource\'s relative path up to a directory that designates resource kind (cf. http://developer.android.com/guide/topics/resources/providing-resources.html)."
+ api_context: BZL
}
- doc: "Module providing functions to create actions. Access this module using ctx.actions."
}
-type {
- name: "apple_platform"
- field {
- name: "is_device"
- type: "bool"
- doc: "Returns True if this platform is a device platform or False if it is a simulator platform."
+global {
+ name: "apple_common"
+ api_context: BZL
+ global_variable {
+ name: "Objc"
+ }
+ global_variable {
+ name: "XcodeProperties"
+ }
+ global_variable {
+ name: "XcodeVersionConfig"
+ }
+ global_variable {
+ name: "apple_host_system_env"
+ }
+ global_variable {
+ name: "apple_platform"
+ }
+ global_variable {
+ name: "apple_toolchain"
+ }
+ global_variable {
+ name: "compilation_support"
+ }
+ global_variable {
+ name: "dotted_version"
}
- field {
- name: "name_in_plist"
- type: "string"
- doc: "The name of the platform as it appears in the CFBundleSupportedPlatforms entry of an Info.plist file and in Xcode\'s platforms directory, without the extension (for example, iPhoneOS or iPhoneSimulator).
This name, when converted to lowercase (e.g., iphoneos, iphonesimulator), can be passed to Xcode\'s command-line tools like ibtool and actool when they expect a platform name."
+ global_variable {
+ name: "get_apple_config"
}
- field {
+ global_variable {
+ name: "get_cpu"
+ }
+ global_variable {
+ name: "get_split_build_configs"
+ }
+ global_variable {
+ name: "get_split_prerequisites"
+ }
+ global_variable {
+ name: "new_objc_provider"
+ }
+ global_variable {
+ name: "platform"
+ }
+ global_variable {
name: "platform_type"
- type: "apple_platform_type"
- doc: "Returns the platform type of this platform."
}
- doc: "Corresponds to Xcode\'s notion of a platform as would be found in Xcode.app/Contents/Developer/Platforms. Each platform represents an Apple platform type (such as iOS or tvOS) combined with one or more related CPU architectures. For example, the iOS simulator platform supports x86_64 and i386 architectures.apple_common.platform.ios_deviceapple_common.platform.ios_simulatorapple_common.platform.macosapple_common.platform.tvos_deviceapple_common.platform.tvos_simulatorapple_common.platform.watchos_deviceapple_common.platform.watchos_simulator\np = apple_common.platform.ios_device\nprint(p.name_in_plist) # \'iPhoneOS\'\n
"
-}
-type {
- name: "apple_platform_type"
- doc: "Describes an Apple \"platform type\", such as iOS, macOS, tvOS, visionOS, or watchOS. This is distinct from a \"platform\", which is the platform type combined with one or more CPU architectures.apple_common.platform_type.iosapple_common.platform_type.macosapple_common.platform_type.tvosapple_common.platform_type.watchosplatform_type field.ios or macos) using the str function."
+ global_variable {
+ name: "target_apple_env"
+ }
}
-type {
- name: "apple_toolchain"
- field {
- name: "developer_dir"
- callable {
- return_type: "string"
+global {
+ name: "aspect"
+ callable {
+ param {
+ name: "implementation"
+ doc: "A Starlark function that implements this aspect, with exactly two parameters: Target (the target to which the aspect is applied) and ctx (the rule context which the target is created from). Attributes of the target are available via the ctx.rule field. This function is evaluated during the analysis phase for each application of an aspect to a target."
+ is_mandatory: true
}
- doc: "Returns the Developer directory inside of Xcode for a given configuration."
- }
- field {
- name: "platform_developer_framework_dir"
- callable {
- param {
- name: "configuration"
- doc: "The apple configuration fragment."
- is_mandatory: true
- }
- return_type: "string"
+ param {
+ name: "attr_aspects"
+ doc: "List of attribute names. The aspect propagates along dependencies specified in the attributes of a target with these names. Common values here include deps and exports. The list can also contain a single string \"*\" to propagate along all dependencies of a target."
+ default_value: "[]"
}
- doc: "Returns the platform frameworks directory inside of Xcode for a given configuration."
- }
- field {
- name: "sdk_dir"
- callable {
- return_type: "string"
+ param {
+ name: "toolchains_aspects"
+ doc: "List of toolchain types. The aspect propagates to target toolchains which match these toolchain types."
+ default_value: "[]"
+ }
+ param {
+ name: "attrs"
+ doc: "A dictionary declaring all the attributes of the aspect. It maps from an attribute name to an attribute object, like attr.label or attr.string (see attr module). Aspect attributes are available to implementation function as fields of ctx parameter. _ must have default values, and have type label or label_list.string, and must use the values restriction. Explicit attributes restrict the aspect to only be used with rules that have attributes of the same name, type, and valid values according to the restriction.None to the default value.[[FooInfo], [BarInfo], [BazInfo, QuxInfo]] is a valid value while [FooInfo, BarInfo, [BazInfo, QuxInfo]] is not valid.[FooInfo, BarInfo] will automatically be converted to [[FooInfo, BarInfo]].some_rule) targets visible to an aspect, some_rule must advertise all providers from at least one of the required providers lists. For example, if the required_providers of an aspect are [[FooInfo], [BarInfo], [BazInfo, QuxInfo]], this aspect can see some_rule targets if and only if some_rule provides FooInfo, or BarInfo, or both BazInfo and QuxInfo."
+ default_value: "[]"
+ }
+ param {
+ name: "required_aspect_providers"
+ doc: "This attribute allows this aspect to inspect other aspects. The value must be a list containing either individual providers or lists of providers but not both. For example, [[FooInfo], [BarInfo], [BazInfo, QuxInfo]] is a valid value while [FooInfo, BarInfo, [BazInfo, QuxInfo]] is not valid.[FooInfo, BarInfo] will automatically be converted to [[FooInfo, BarInfo]]. other_aspect) visible to this aspect, other_aspect must provide all providers from at least one of the lists. In the example of [[FooInfo], [BarInfo], [BazInfo, QuxInfo]], this aspect can see other_aspect if and only if other_aspect provides FooInfo, or BarInfo, or both BazInfo and QuxInfo."
+ default_value: "[]"
+ }
+ param {
+ name: "provides"
+ doc: "A list of providers that the implementation function must return.*Info object returned by provider(), except that a legacy provider is represented by its string name instead.When a target of the rule is used as a dependency for a target that declares a required provider, it is not necessary to specify that provider here. It is enough that the implementation function returns it. However, it is considered best practice to specify it, even though this is not required. The required_providers field of an aspect does, however, require that providers are specified here."
+ default_value: "[]"
+ }
+ param {
+ name: "requires"
+ doc: "List of aspects required to be propagated before this aspect."
+ default_value: "[]"
+ }
+ param {
+ name: "fragments"
+ doc: "List of names of configuration fragments that the aspect requires in target configuration."
+ default_value: "[]"
+ }
+ param {
+ name: "host_fragments"
+ doc: "List of names of configuration fragments that the aspect requires in host configuration."
+ default_value: "[]"
+ }
+ param {
+ name: "toolchains"
+ doc: "If set, the set of toolchains this aspect requires. The list can contain String, Label, or StarlarkToolchainTypeApi objects, in any combination. Toolchains will be found by checking the current platform, and provided to the aspect implementation via ctx.toolchain."
+ default_value: "[]"
+ }
+ param {
+ name: "incompatible_use_toolchain_transition"
+ doc: "Deprecated, this is no longer in use and should be removed."
+ default_value: "False"
+ }
+ param {
+ name: "doc"
+ doc: "A description of the aspect that can be extracted by documentation generating tools."
+ default_value: "None"
+ }
+ param {
+ name: "apply_to_generating_rules"
+ doc: "If true, the aspect will, when applied to an output file, instead apply to the output file\'s generating rule. exec_groups. If set, allows aspects to run actions on multiple execution platforms within a single instance. See execution groups documentation for more info."
+ default_value: "None"
+ }
+ param {
+ name: "subrules"
+ doc: "Experimental: list of subrules used by this aspect."
+ default_value: "[]"
}
- doc: "Returns the platform directory inside of Xcode for a given configuration."
}
- doc: "Utilities for resolving items from the Apple toolchain."
+ doc: "Creates a new aspect. The result of this function must be stored in a global value. Please see the introduction to Aspects for more details."
+ api_context: BZL
}
-type {
- name: "Args"
- field {
- name: "add"
+global {
+ name: "attr"
+ doc: "This is a top-level module for defining the attribute schemas of a rule or aspect. Each function returns an object representing the schema of a single attribute. These objects are used as the values of the attrs dictionary argument of rule(), aspect(), repository_rule() and tag_class(). value (see below)."
- is_mandatory: true
+ name: "configurable"
+ doc: "This argument can only be specified for an attribute of a symbolic macro.configurable is explicitly set to False, the symbolic macro attribute is non-configurable - in other words, it cannot take a select() value. If the configurable is either unbound or explicitly set to True, the attribute is configurable and can take a select() value.configurable must be left unbound. Most Starlark rule attributes are always configurable, with the exception of attr.output(), attr.output_list(), and attr.license() rule attributes, which are always non-configurable."
+ default_value: "unbound"
}
param {
- name: "value"
- doc: "The object to append. It will be converted to a string using the standard conversion mentioned above. Since there is no map_each parameter for this function, value should be either a string or a File. A list, tuple, depset, or directory File must be passed to add_all() or add_joined() instead of this method."
- default_value: "unbound"
+ name: "default"
+ doc: "A default value to use if no value for this attribute is given when instantiating the rule."
+ default_value: "False"
}
param {
- name: "format"
- type: "string; or None"
- doc: "A format string pattern, to be applied to the stringified version of value."
+ name: "doc"
+ doc: "A description of the attribute that can be extracted by documentation generating tools."
default_value: "None"
}
- return_type: "Args"
+ param {
+ name: "mandatory"
+ doc: "If true, the value must be specified explicitly (even if it has a default)."
+ default_value: "False"
+ }
}
- doc: "Appends an argument to this command line."
+ doc: "Creates a schema for a boolean attribute. The corresponding ctx.attr attribute will be of type bool."
+ api_context: BZL
}
- field {
- name: "add_all"
+ global_variable {
+ name: "intAttribute"
callable {
param {
- name: "arg_name_or_values"
- doc: "If two positional parameters are passed this is interpreted as the arg name. The arg name is added before the values as a separate argument without any processing. This arg name will not be added if omit_if_empty is true (the default) and no other items are appended (as happens if values is empty or all of its items are filtered). If only one positional parameter is passed, it is interpreted as values (see below)."
- is_mandatory: true
- }
- param {
- name: "values"
- type: "sequence; or depset"
- doc: "The list, tuple, or depset whose items will be appended."
+ name: "configurable"
+ doc: "This argument can only be specified for an attribute of a symbolic macro.configurable is explicitly set to False, the symbolic macro attribute is non-configurable - in other words, it cannot take a select() value. If the configurable is either unbound or explicitly set to True, the attribute is configurable and can take a select() value.configurable must be left unbound. Most Starlark rule attributes are always configurable, with the exception of attr.output(), attr.output_list(), and attr.license() rule attributes, which are always non-configurable."
default_value: "unbound"
}
param {
- name: "map_each"
- type: "callable; or None"
- doc: "A function that converts each item to zero or more strings, which may be further processed before appending. If this param is not provided, the standard conversion is used.DirectoryExpander. The second argument will be passed only if the supplied function is user-defined (not built-in) and declares more than one parameter.
Returning a single string or None.None has the same effect as returning a list of length 1 or length 0 respectively. However, it is more efficient and readable to avoid creating a list where it is not needed.expand_directories=True is set. However, this will not expand directories contained inside other values -- for instance, when the items are structs that have directories as fields. In this situation, the DirectoryExpander argument can be applied to manually obtain the files of a given directory.map_each function must be declared by a top-level def statement; it may not be a nested function closure by default.print() statements that are executed during the call to map_each will not produce any visible output."
- default_value: "None"
+ name: "default"
+ doc: "A default value to use if no value for this attribute is given when instantiating the rule."
+ default_value: "0"
}
param {
- name: "format_each"
- type: "string; or None"
- doc: "An optional format string pattern, applied to each string returned by the map_each function. The format string must have exactly one \'%s\' placeholder."
+ name: "doc"
+ doc: "A description of the attribute that can be extracted by documentation generating tools."
default_value: "None"
}
param {
- name: "before_each"
- type: "string; or None"
- doc: "An optional argument to append before each argument derived from values is appended."
- default_value: "None"
+ name: "mandatory"
+ doc: "If true, the value must be specified explicitly (even if it has a default)."
+ default_value: "False"
}
param {
- name: "omit_if_empty"
- doc: "If true, if there are no arguments derived from values to be appended, then all further processing is suppressed and the command line will be unchanged. If false, the arg name and terminate_with, if provided, will still be appended regardless of whether or not there are other arguments."
- default_value: "True"
+ name: "values"
+ doc: "The list of allowed values for the attribute. An error is raised if any other value is given."
+ default_value: "[]"
}
+ }
+ doc: "Creates a schema for an integer attribute. The value must be in the signed 32-bit range. The corresponding ctx.attr attribute will be of type int."
+ api_context: BZL
+ }
+ global_variable {
+ name: "intListAttribute"
+ callable {
param {
- name: "uniquify"
- doc: "If true, duplicate arguments that are derived from values will be omitted. Only the first occurrence of each argument will remain. Usually this feature is not needed because depsets already omit duplicates, but it can be useful if map_each emits the same string for multiple items."
+ name: "mandatory"
+ doc: "If true, the value must be specified explicitly (even if it has a default)."
default_value: "False"
}
param {
- name: "expand_directories"
- doc: "If true, any directories in values will be expanded to a flat list of files. This happens before map_each is applied."
+ name: "allow_empty"
+ doc: "True if the attribute can be empty."
default_value: "True"
}
param {
- name: "terminate_with"
- type: "string; or None"
- doc: "An optional argument to append after all other arguments. This argument will not be added if omit_if_empty is true (the default) and no other items are appended (as happens if values is empty or all of its items are filtered)."
- default_value: "None"
+ name: "configurable"
+ doc: "This argument can only be specified for an attribute of a symbolic macro.configurable is explicitly set to False, the symbolic macro attribute is non-configurable - in other words, it cannot take a select() value. If the configurable is either unbound or explicitly set to True, the attribute is configurable and can take a select() value.configurable must be left unbound. Most Starlark rule attributes are always configurable, with the exception of attr.output(), attr.output_list(), and attr.license() rule attributes, which are always non-configurable."
+ default_value: "unbound"
}
param {
- name: "allow_closure"
- doc: "If true, allows the use of closures in function parameters like map_each. Usually this isn\'t necessary and it risks retaining large analysis-phase data structures into the execution phase."
- default_value: "False"
+ name: "default"
+ doc: "A default value to use if no value for this attribute is given when instantiating the rule."
+ default_value: "[]"
+ }
+ param {
+ name: "doc"
+ doc: "A description of the attribute that can be extracted by documentation generating tools."
+ default_value: "None"
}
- return_type: "Args"
}
- doc: "Appends multiple arguments to this command line. The items are processed lazily during the execution phase.
Note that empty strings are valid arguments that are subject to all these processing steps."
+ doc: "Creates a schema for a list-of-integers attribute. Each element must be in the signed 32-bit range."
+ api_context: BZL
}
- field {
- name: "add_joined"
+ global_variable {
+ name: "labelAttribute"
callable {
param {
- name: "arg_name_or_values"
- doc: "If two positional parameters are passed this is interpreted as the arg name. The arg name is added before File item is replaced by all Files recursively contained in that directory.map_each is given, it is applied to each item, and the resulting lists of strings are concatenated to form the initial argument list. Otherwise, the initial argument list is the result of applying the standard conversion to each item.format_each, if present.uniquify is true, duplicate arguments are removed. The first occurrence is the one that remains.before_each string is given, it is inserted as a new argument before each existing argument in the list. This effectively doubles the number of arguments to be appended by this point.omit_if_empty is true (the default), the arg name and terminate_with are inserted as the first and last arguments, respectively, if they are given.values without any processing. This arg will not be added if omit_if_empty is true (the default) and there are no strings derived from values to join together (which can happen if values is empty or all of its items are filtered). If only one positional parameter is passed, it is interpreted as values (see below)."
- is_mandatory: true
- }
- param {
- name: "values"
- type: "sequence; or depset"
- doc: "The list, tuple, or depset whose items will be joined."
+ name: "configurable"
+ doc: "This argument can only be specified for an attribute of a symbolic macro.configurable is explicitly set to False, the symbolic macro attribute is non-configurable - in other words, it cannot take a select() value. If the configurable is either unbound or explicitly set to True, the attribute is configurable and can take a select() value.configurable must be left unbound. Most Starlark rule attributes are always configurable, with the exception of attr.output(), attr.output_list(), and attr.license() rule attributes, which are always non-configurable."
default_value: "unbound"
}
param {
- name: "join_with"
- doc: "A delimiter string used to join together the strings obtained from applying map_each and format_each, in the same manner as string.join()."
- is_mandatory: true
+ name: "default"
+ doc: "A default value to use if no value for this attribute is given when instantiating the rule.Use a string or the Label function to specify a default value, for example, attr.label(default = \"//a:b\")."
+ default_value: "None"
}
param {
- name: "map_each"
- type: "callable; or None"
- doc: "Same as for add_all."
+ name: "materializer"
+ doc: "If set, the attribute materializes dormant dependencies from the transitive closure. The value of this parameter must be a functon that gets access to the values of the attributes of the rule that either are not dependencies or are marked as available for dependency resolution. It must return either a dormant dependency or a list of them depending on the type of the attribute"
default_value: "None"
}
param {
- name: "format_each"
- type: "string; or None"
- doc: "Same as for add_all."
+ name: "doc"
+ doc: "A description of the attribute that can be extracted by documentation generating tools."
default_value: "None"
}
param {
- name: "format_joined"
- type: "string; or None"
- doc: "An optional format string pattern applied to the joined string. The format string must have exactly one \'%s\' placeholder."
- default_value: "None"
+ name: "executable"
+ doc: "True if the dependency has to be executable. This means the label must refer to an executable file, or to a rule that outputs an executable file. Access the label with ctx.executable.<attribute_name>."
+ default_value: "False"
}
param {
- name: "omit_if_empty"
- doc: "If true, if there are no strings to join together (either because values is empty or all its items are filtered), then all further processing is suppressed and the command line will be unchanged. If false, then even if there are no strings to join together, two arguments will be appended: the arg name followed by an empty string (which is the logical join of zero strings)."
- default_value: "True"
+ name: "allow_files"
+ doc: "Whether File targets are allowed. Can be True, False (default), or a list of file extensions that are allowed (for example, [\".cc\", \".cpp\"])."
+ default_value: "None"
}
param {
- name: "uniquify"
- doc: "Same as for add_all."
- default_value: "False"
+ name: "allow_single_file"
+ doc: "This is similar to allow_files, with the restriction that the label must correspond to a single File. Access it through ctx.file.<attribute_name>."
+ default_value: "None"
}
param {
- name: "expand_directories"
- doc: "Same as for add_all."
- default_value: "True"
+ name: "mandatory"
+ doc: "If true, the value must be specified explicitly (even if it has a default)."
+ default_value: "False"
}
param {
- name: "allow_closure"
- doc: "Same as for add_all."
+ name: "skip_validations"
+ doc: "If true, validation actions of transitive dependencies from this attribute will not run. This is a temporary mitigation and WILL be removed in the future."
default_value: "False"
}
- return_type: "Args"
- }
- doc: "Appends an argument to this command line by concatenating together multiple values using a separator. The items are processed lazily during the execution phase.add_all(), but the list of arguments derived from values is combined into a single argument as if by join_with.join(...), and then formatted using the given format_joined string template. Unlike add_all(), there is no before_each or terminate_with parameter since these are not generally useful when the items are combined into a single argument.omit_if_empty is true (the default), no processing is done. Otherwise if there are no strings to join but omit_if_empty is false, the joined string will be an empty string."
- }
- field {
- name: "set_param_file_format"
- callable {
param {
- name: "format"
- doc: "Must be one of:*Info objects returned by provider() (or in the case of a legacy provider, its string name). The dependency must return ALL providers mentioned in at least ONE of the inner lists. As a convenience, this argument may also be a single-level list of providers, in which case it is wrapped in an outer list with one element. It is NOT required that the rule of the dependency advertises those providers in its provides parameter, however, it is considered best practice."
+ default_value: "[]"
}
- return_type: "Args"
- }
- doc: "Sets the format of the param file, if one is used"
- }
- field {
- name: "use_param_file"
- callable {
param {
- name: "param_file_arg"
- doc: "A format string with a single \"%s\". If the args are spilled to a params file then they are replaced with an argument consisting of this string formatted with the path of the params file.--materialize_param_files to your build."
- }
- doc: "An object that encapsulates, in a memory-efficient way, the data needed to build part or all of a command line.depsets, so that they can be shared by multiple targets. However, if the rule author had to convert these depsets into lists of strings in order to construct an action command line, it would defeat this memory-sharing optimization.Args objects in addition to strings. Each Args object represents a concatenation of strings and depsets, with optional transformations for manipulating the data. Args objects do not process the depsets they encapsulate until the execution phase, when it comes time to calculate the command line. This helps defer any expensive copying until after the analysis phase is complete. See the Optimizing Performance page for more information.Args are constructed by calling ctx.actions.args(). They can be passed as the arguments parameter of ctx.actions.run() or ctx.actions.run_shell(). Each mutation of an Args object appends values to the eventual command line.map_each feature allows you to customize how items are transformed into strings. If you do not provide a map_each function, the standard conversion is as follows: File objects are turned into their File.path values.File type to add(), and if you pass them to add_all() or add_joined() then you should provide a map_each function.format, format_each, and format_joined params of the add*() methods), the format template is interpreted in the same way as %-substitution on strings, except that the template must have exactly one substitution placeholder and it must be %s. Literal percents may be escaped as %%. Formatting is applied after the value is converted to a string as per the above.add*() methods have an alternate form that accepts an extra positional parameter, an \"arg name\" string to insert before the rest of the arguments. For add_all and add_joined the extra string will not be added if the sequence turns out to be empty. For instance, the same usage can add either --foo val1 val2 val3 --bar or just --bar to the command line, depending on whether the given sequence contains val1..val3 or is empty.use_param_file() and set_param_file_format().\n--foo foo1.txt foo2.txt ... fooN.txt --bar bar1.txt,bar2.txt,...,barM.txt --baz\n
We could use the following Args object: \n# foo_deps and bar_deps are depsets containing\n# File objects for the foo and bar .txt files.\nargs = ctx.actions.args()\nargs.add_all(\"--foo\", foo_deps)\nargs.add_joined(\"--bar\", bar_deps, join_with=\",\")\nargs.add(\"--baz\")\nctx.actions.run(\n ...\n arguments = [args],\n ...\n)\n
"
-}
-type {
- name: "Aspect"
- doc: "For more information about Aspects, please consult the documentation of the aspect function or the introduction to Aspects."
-}
-type {
- name: "Attribute"
- doc: "Representation of a definition of an attribute. Use the attr module to create an Attribute. They are only for use with a rule or an aspect."
-}
-type {
- name: "bazel_module"
- field {
- name: "is_root"
- type: "bool"
- doc: "Whether this module is the root module."
- }
- field {
- name: "name"
- type: "string"
- doc: "The name of the module."
- }
- field {
- name: "tags"
- type: "bazel_module_tags"
- doc: "The tags in the module related to the module extension currently being processed."
- }
- field {
- name: "version"
- type: "string"
- doc: "The version of the module."
- }
- doc: "Represents a Bazel module in the external dependency graph."
-}
-type {
- name: "bazel_module_tags"
- doc: "Contains the tags in a module for the module extension currently being processed. This object has a field for each tag class of the extension, and the value of the field is a list containing an object for each tag instance. This \"tag instance\" object in turn has a field for each attribute of the tag class.\n\nWhen passed as positional arguments to print() or fail(), tag instance objects turn into a meaningful string representation of the form \"\'install\' tag at /home/user/workspace/MODULE.bazel:3:4\". This can be used to construct error messages that point to the location of the tag in the module file, e.g. fail(\"Conflict between\", tag1, \"and\", tag2)."
-}
-type {
- name: "BuildSetting"
- doc: "The descriptor for a single piece of configuration information. If configuration is a key-value map of settings like {\'cpu\': \'ppc\', \'copt\': \'-DFoo\'}, this describes a single entry in that map."
-}
-type {
- name: "CcCompilationOutputs"
- field {
- name: "objects"
- type: "sequence"
- doc: "Non-PIC object files."
- }
- field {
- name: "pic_objects"
- type: "sequence"
- doc: "PIC object files."
- }
- doc: "Helper class containing CC compilation outputs."
-}
-type {
- name: "CcLinkingOutputs"
- field {
- name: "executable"
- type: "File"
- doc: "Represents the linked executable."
- }
- field {
- name: "library_to_link"
- type: "LibraryToLink"
- doc: "LibraryToLink for including these outputs in further linking."
- }
- doc: "Helper class containing CC compilation outputs."
-}
-type {
- name: "CompilationContext"
- field {
- name: "defines"
- type: "depset"
- doc: "Returns the set of defines needed to compile this target. Each define is a string. These values are propagated to the target\'s transitive dependents, that is, any rules that depend on this target."
- }
- field {
- name: "direct_headers"
- type: "list"
- doc: "Returns the list of modular headers that are declared by this target. This includes both public headers (such as those listed in \"hdrs\") and private headers (such as those listed in \"srcs\")."
- }
- field {
- name: "direct_private_headers"
- type: "list"
- doc: "Returns the list of modular private headers (those listed in \"srcs\") that are declared by this target."
- }
- field {
- name: "direct_public_headers"
- type: "list"
- doc: "Returns the list of modular public headers (those listed in \"hdrs\") that are declared by this target."
- }
- field {
- name: "direct_textual_headers"
- type: "list"
- doc: "Returns the list of textual headers that are declared by this target."
- }
- field {
- name: "external_includes"
- type: "depset"
- doc: "Returns the set of search paths (as strings) for external header files referenced by angle bracket. Usually passed with -isystem."
- }
- field {
- name: "framework_includes"
- type: "depset"
- doc: "Returns the set of search paths (as strings) for framework header files. Usually passed with -F."
- }
- field {
- name: "headers"
- type: "depset"
- doc: "Returns the set of headers needed to compile this target."
- }
- field {
- name: "includes"
- type: "depset"
- doc: "Returns the set of search paths (as strings) for header files referenced both by angle bracket and quotes. Usually passed with -I."
- }
- field {
- name: "local_defines"
- type: "depset"
- doc: "Returns the set of defines needed to compile this target. Each define is a string. These values are not propagated to the target\'s transitive dependents."
- }
- field {
- name: "quote_includes"
- type: "depset"
- doc: "Returns the set of search paths (as strings) for header files referenced by quotes, e.g. #include \"foo/bar/header.h\". They can be either relative to the exec root or absolute. Usually passed with -iquote."
- }
- field {
- name: "system_includes"
- type: "depset"
- doc: "Returns the set of search paths (as strings) for header files referenced by angle brackets, e.g. #include <foo/bar/header.h>. They can be either relative to the exec root or absolute. Usually passed with -isystem."
- }
- field {
- name: "validation_artifacts"
- type: "depset"
- doc: "Returns the set of validation artifacts."
- }
- doc: "Immutable store of information needed for C++ compilation that is aggregated across dependencies."
-}
-type {
- name: "configuration"
- field {
- name: "coverage_enabled"
- type: "bool"
- doc: "A boolean that tells whether code coverage is enabled for this run. Note that this does not compute whether a specific rule should be instrumented for code coverage data collection. For that, see the ctx.coverage_instrumented function."
- }
- field {
- name: "default_shell_env"
- type: "dict"
- doc: "A dictionary representing the static local shell environment. It maps variables to their values (strings)."
- }
- field {
- name: "host_path_separator"
- type: "string"
- doc: "Returns the separator for PATH environment variable, which is \':\' on Unix."
- }
- field {
- name: "test_env"
- type: "dict"
- doc: "A dictionary containing user-specified test environment variables and their values, as set by the --test_env options. DO NOT USE! This is not the complete environment!"
- }
- doc: "This object holds information about the environment in which the build is running. See the Rules page for more on the general concept of configurations."
-}
-type {
- name: "ctx"
- field {
- name: "actions"
- type: "actions"
- doc: "Contains methods for declaring output files and the actions that produce them."
- }
- field {
- name: "aspect_ids"
- type: "list"
- doc: "A list of ids for all aspects applied to the target. Only available in aspect implementation functions."
- }
- field {
- name: "attr"
- type: "struct"
- doc: "A struct to access the values of the attributes. The values are provided by the user (if not, a default value is used). The attributes of the struct and the types of their values correspond to the keys and values of the attrs dict provided to the rule function. See example of use."
- }
- field {
- name: "bin_dir"
- type: "root"
- doc: "The root corresponding to bin directory."
- }
- field {
- name: "build_file_path"
- type: "string"
- doc: "The path to the BUILD file for this rule, relative to the source root."
- }
- field {
- name: "build_setting_value"
- type: "unknown"
- doc: "Value of the build setting represented by the current target. If this isn\'t the context for an instance of a rule that sets the build_setting attribute, reading this is an error."
- }
- field {
- name: "configuration"
- type: "configuration"
- doc: "The default configuration. See the configuration type for more details."
- }
- field {
- name: "coverage_instrumented"
- callable {
param {
- name: "target"
- type: "Target; or None"
- doc: "A Target specifying a rule. If not provided, defaults to the current rule."
+ name: "cfg"
+ doc: "Configuration of the attribute. It can be either \"exec\", which indicates that the dependency is built for the execution platform, or \"target\", which indicates that the dependency is build for the target platform. A typical example of the difference is when building mobile apps, where the target platform is Android or iOS while the execution platform is Linux, macOS, or Windows. This parameter is required if executable is True to guard against accidentally building host tools in the target configuration. \"target\" has no semantic effect, so don\'t set it when executable is False unless it really helps clarify your intentions."
default_value: "None"
}
- return_type: "bool"
- }
- doc: "Returns whether code coverage instrumentation should be generated when performing compilation actions for this rule or, if target is provided, the rule specified by that Target. (If a non-rule or a Starlark rule Target is provided, this returns False.) Checks if the sources of the current rule (if no Target is provided) or the sources of Target should be instrumented based on the --instrumentation_filter and --instrument_test_targets config settings. This differs from coverage_enabled in the configuration, which notes whether coverage data collection is enabled for the entire run, but not whether a specific target should be instrumented."
- }
- field {
- name: "created_actions"
- callable {
- return_type: "StarlarkValue"
- }
- doc: "For rules with _skylark_testable set to True, this returns an Actions provider representing all actions created so far for the current rule. For all other rules, returns None. Note that the provider is not updated when subsequent actions are created, so you will have to call this function again if you wish to inspect them.
This is intended to help write tests for rule-implementation helper functions, which may take in a ctx object and create actions on it."
- }
- field {
- name: "disabled_features"
- type: "list"
- doc: "The set of features that are explicitly disabled by the user for this rule."
- }
- field {
- name: "exec_groups"
- type: "ExecGroupCollection"
- doc: "A collection of the execution groups available for this rule, indexed by their name. Access with ctx.exec_groups[name_of_group]."
- }
- field {
- name: "executable"
- type: "struct"
- doc: "A struct containing executable files defined in label type attributes marked as executable=True. The struct fields correspond to the attribute names. Each value in the struct is either a File or None. If an optional attribute is not specified in the rule then the corresponding struct value is None. If a label type is not marked as executable=True, no corresponding struct field is generated. See example of use."
- }
- field {
- name: "expand_location"
- callable {
param {
- name: "input"
- doc: "String to be expanded."
- is_mandatory: true
+ name: "aspects"
+ doc: "Aspects that should be applied to the dependency or dependencies specified by this attribute."
+ default_value: "[]"
}
param {
- name: "targets"
- type: "sequence of Targets"
- doc: "List of targets for additional lookup information."
+ name: "flags"
+ doc: "Deprecated, will be removed."
default_value: "[]"
}
- return_type: "string"
}
- doc: "Expands all $(location ...) templates in the given string by replacing $(location //x) with the path of the output file of target //x. Expansion only works for labels that point to direct dependencies of this rule or that are explicitly listed in the optional argument targets. $(location ...) will cause an error if the referenced target has multiple outputs. In this case, please use $(locations ...) since it produces a space-separated list of output paths. It can be safely used for a single output file, too.
This function is useful to let the user specify a command in a BUILD file (like for genrule). In other cases, it is often better to manipulate labels directly."
+ doc: "Label values. If a string is supplied in place of a Label, it will be converted using the label constructor. The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target\'s package.ctx.attr, labels are replaced by the corresponding Targets. This allows you to access the providers of the current target\'s dependencies.default value of this attribute. If you also want to prevent users from overriding this default, you can make the attribute private by giving it a name that starts with an underscore. See the Rules page for more information."
+ api_context: BZL
}
- field {
- name: "expand_make_variables"
+ global_variable {
+ name: "labelKeyedStringDictAttribute"
callable {
param {
- name: "attribute_name"
- doc: "The attribute name. Used for error reporting."
- is_mandatory: true
+ name: "allow_empty"
+ doc: "True if the attribute can be empty."
+ default_value: "True"
}
param {
- name: "command"
- doc: "The expression to expand. It can contain references to \"Make variables\"."
- is_mandatory: true
+ name: "configurable"
+ doc: "This argument can only be specified for an attribute of a symbolic macro.configurable is explicitly set to False, the symbolic macro attribute is non-configurable - in other words, it cannot take a select() value. If the configurable is either unbound or explicitly set to True, the attribute is configurable and can take a select() value.configurable must be left unbound. Most Starlark rule attributes are always configurable, with the exception of attr.output(), attr.output_list(), and attr.license() rule attributes, which are always non-configurable."
+ default_value: "unbound"
}
param {
- name: "additional_substitutions"
- doc: "Additional substitutions to make beyond the default make variables."
- is_mandatory: true
+ name: "default"
+ doc: "A default value to use if no value for this attribute is given when instantiating the rule.Use strings or the Label function to specify default values, for example, attr.label_keyed_string_dict(default = {\"//a:b\": \"value\", \"//a:c\": \"string\"})."
+ default_value: "{}"
}
- return_type: "string"
- }
- doc: "Deprecated. Use ctx.var to access the variables instead.
Returns a string after expanding all references to \"Make variables\". The variables must have the following format: $(VAR_NAME). Also, $$VAR_NAME expands to $VAR_NAME. Examples:\nctx.expand_make_variables(\"cmd\", \"$(MY_VAR)\", {\"MY_VAR\": \"Hi\"}) # == \"Hi\"\nctx.expand_make_variables(\"cmd\", \"$$PWD\", {}) # == \"$PWD\"\nAdditional variables may come from other places, such as configurations. Note that this function is experimental."
- }
- field {
- name: "features"
- type: "list"
- doc: "The set of features that are explicitly enabled by the user for this rule. See example of use."
- }
- field {
- name: "file"
- type: "struct"
- doc: "A struct containing files defined in label type attributes marked as allow_single_file. The struct fields correspond to the attribute names. The struct value is always a File or None. If an optional attribute is not specified in the rule then the corresponding struct value is None. If a label type is not marked as allow_single_file, no corresponding struct field is generated. It is a shortcut for:list(ctx.attr.<ATTR>.files)[0]
In other words, use file to access the (singular) default output of a dependency. See example of use."
- }
- field {
- name: "files"
- type: "struct"
- doc: "A struct containing files defined in label or label list type attributes. The struct fields correspond to the attribute names. The struct values are list of Files. It is a shortcut for:[f for t in ctx.attr.<ATTR> for f in t.files]
In other words, use files to access the default outputs of a dependency. See example of use."
- }
- field {
- name: "fragments"
- type: "fragments"
- doc: "Allows access to configuration fragments in target configuration."
- }
- field {
- name: "genfiles_dir"
- type: "root"
- doc: "The root corresponding to genfiles directory."
- }
- field {
- name: "info_file"
- type: "File"
- doc: "The file that is used to hold the non-volatile workspace status for the current build request. See documentation for --workspace_status_command for more information."
- }
- field {
- name: "label"
- type: "Label"
- doc: "The label of the target currently being analyzed."
- }
- field {
- name: "outputs"
- type: "structure"
- doc: "A pseudo-struct containing all the predeclared output files, represented by File objects. See the Rules page for more information and examples.
"
- }
- field {
- name: "resolve_command"
- callable {
param {
- name: "command"
- doc: "Command to resolve."
- default_value: "\'\'"
+ name: "doc"
+ doc: "A description of the attribute that can be extracted by documentation generating tools."
+ default_value: "None"
}
param {
- name: "attribute"
- type: "string; or outputs dict, then for every entry in the dict, there is a field whose name is the key and whose value is the corresponding File.attr.output that the rule declares, there is a field whose name is the attribute\'s name. If the target specified a label for that attribute, then the field value is the corresponding File; otherwise the field value is None.attr.output_list that the rule declares, there is a field whose name is the attribute\'s name. The field value is a list of File objects corresponding to the labels given for that attribute in the target, or an empty list if the attribute was not specified in the target.executable or test, there is a field named \"executable\", which is the default executable. It is recommended that instead of using this, you pass another file (either predeclared or not) to the executable arg of DefaultInfo.None"
- doc: "Name of the associated attribute for which to issue an error, or None."
+ name: "allow_files"
+ doc: "Whether File targets are allowed. Can be True, False (default), or a list of file extensions that are allowed (for example, [\".cc\", \".cpp\"])."
default_value: "None"
}
param {
- name: "expand_locations"
- doc: "Shall we expand $(location) variables? See ctx.expand_location() for more details."
- default_value: "False"
+ name: "allow_rules"
+ doc: "Which rule targets (name of the classes) are allowed. This is deprecated (kept only for compatibility), use providers instead."
+ default_value: "None"
}
param {
- name: "make_variables"
- type: "dict; or None"
- doc: "Make variables to expand, or None."
- default_value: "None"
+ name: "providers"
+ doc: "The providers that must be given by any dependency appearing in this attribute.*Info objects returned by provider() (or in the case of a legacy provider, its string name). The dependency must return ALL providers mentioned in at least ONE of the inner lists. As a convenience, this argument may also be a single-level list of providers, in which case it is wrapped in an outer list with one element. It is NOT required that the rule of the dependency advertises those providers in its provides parameter, however, it is considered best practice."
+ default_value: "[]"
+ }
+ param {
+ name: "for_dependency_resolution"
+ doc: "If this is set, the attribute is available for materializers. Only rules marked with the flag of the same name are allowed to be referenced through such attributes."
+ default_value: "unbound"
}
param {
- name: "tools"
- type: "sequence of Targets"
- doc: "List of tools (list of targets)."
+ name: "flags"
+ doc: "Deprecated, will be removed."
default_value: "[]"
}
param {
- name: "label_dict"
- doc: "Dictionary of resolved labels and the corresponding list of Files (a dict of Label : list of Files)."
- default_value: "{}"
+ name: "mandatory"
+ doc: "If true, the value must be specified explicitly (even if it has a default)."
+ default_value: "False"
}
param {
- name: "execution_requirements"
- doc: "Information for scheduling the action to resolve this command. See tags for useful keys."
- default_value: "{}"
+ name: "cfg"
+ doc: "Configuration of the attribute. It can be either \"exec\", which indicates that the dependency is built for the execution platform, or \"target\", which indicates that the dependency is build for the target platform. A typical example of the difference is when building mobile apps, where the target platform is Android or iOS while the execution platform is Linux, macOS, or Windows."
+ default_value: "None"
}
- return_type: "tuple"
- }
- doc: "(Experimental) Returns a tuple (inputs, command, input_manifests) of the list of resolved inputs, the argv list for the resolved command, and the runfiles metadata required to run the command, all of them suitable for passing as the same-named arguments of the ctx.action method.
Note for Windows users: this method requires Bash (MSYS2). Consider using resolve_tools() instead (if that fits your needs)."
- }
- field {
- name: "resolve_tools"
- callable {
param {
- name: "tools"
- type: "sequence of Targets"
- doc: "List of tools (list of targets)."
+ name: "aspects"
+ doc: "Aspects that should be applied to the dependency or dependencies specified by this attribute."
default_value: "[]"
}
- return_type: "tuple"
}
- doc: "Returns a tuple (inputs, input_manifests) of the depset of resolved inputs and the runfiles metadata required to run the tools, both of them suitable for passing as the same-named arguments of the ctx.actions.run method.
In contrast to ctx.resolve_command, this method does not require that Bash be installed on the machine, so it\'s suitable for rules built on Windows."
- }
- field {
- name: "rule"
- type: "rule_attributes"
- doc: "Rule attributes descriptor for the rule that the aspect is applied to. Only available in aspect implementation functions."
+ doc: "Label values. If a string is supplied in place of a Label, it will be converted using the label constructor. The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target\'s package.ctx.attr, labels are replaced by the corresponding Targets. This allows you to access the providers of the current target\'s dependencies."
+ api_context: BZL
}
- field {
- name: "runfiles"
+ global_variable {
+ name: "labelListAttribute"
callable {
param {
- name: "files"
- type: "sequence of Files"
- doc: "The list of files to be added to the runfiles."
- default_value: "[]"
+ name: "allow_empty"
+ doc: "True if the attribute can be empty."
+ default_value: "True"
}
param {
- name: "transitive_files"
- type: "depset of Files; or None"
- doc: "The (transitive) set of files to be added to the runfiles. The depset should use the default order (which, as the name implies, is the default)."
- default_value: "None"
+ name: "configurable"
+ doc: "This argument can only be specified for an attribute of a symbolic macro.configurable is explicitly set to False, the symbolic macro attribute is non-configurable - in other words, it cannot take a select() value. If the configurable is either unbound or explicitly set to True, the attribute is configurable and can take a select() value.configurable must be left unbound. Most Starlark rule attributes are always configurable, with the exception of attr.output(), attr.output_list(), and attr.license() rule attributes, which are always non-configurable."
+ default_value: "unbound"
}
param {
- name: "collect_data"
- doc: "Use of this parameter is not recommended. See runfiles guide. Label function to specify default values, for example, attr.label_list(default = [\"//a:b\", \"//a:c\"])."
+ default_value: "[]"
}
param {
- name: "collect_default"
- doc: "Use of this parameter is not recommended. See runfiles guide. <runfiles_root>/_main/<symlink_path>, not the directory corresponding to the current target\'s repository. See Runfiles symlinks in the rules guide."
- default_value: "{}"
+ name: "doc"
+ doc: "A description of the attribute that can be extracted by documentation generating tools."
+ default_value: "None"
}
param {
- name: "root_symlinks"
- type: "dict; or depset of SymlinkEntrys"
- doc: "Either a SymlinkEntry depset or a map of symlinks to be added to the runfiles. See Runfiles symlinks in the rules guide."
- default_value: "{}"
+ name: "allow_files"
+ doc: "Whether File targets are allowed. Can be True, False (default), or a list of file extensions that are allowed (for example, [\".cc\", \".cpp\"])."
+ default_value: "None"
}
- return_type: "runfiles"
- }
- doc: "Creates a runfiles object."
- }
- field {
- name: "split_attr"
- type: "struct"
- doc: "A struct to access the values of attributes with split configurations. If the attribute is a label list, the value of split_attr is a dict of the keys of the split (as strings) to lists of the ConfiguredTargets in that branch of the split. If the attribute is a label, then the value of split_attr is a dict of the keys of the split (as strings) to single ConfiguredTargets. Attributes with split configurations still appear in the attr struct, but their values will be single lists with all the branches of the split merged together."
- }
- field {
- name: "super"
- callable {
- return_type: "unknown"
- }
- doc: "Experimental: Calls parent\'s implementation function and returns its providers"
- }
- field {
- name: "target_platform_has_constraint"
- callable {
param {
- name: "constraintValue"
- doc: "The constraint value to check the target platform against."
- is_mandatory: true
+ name: "allow_rules"
+ doc: "Which rule targets (name of the classes) are allowed. This is deprecated (kept only for compatibility), use providers instead."
+ default_value: "None"
}
- return_type: "bool"
- }
- doc: "Returns true if the given constraint value is part of the current target platform."
- }
- field {
- name: "toolchains"
- type: "ToolchainContext"
- doc: "Toolchains for the default exec group of this rule."
- }
- field {
- name: "var"
- type: "dict"
- doc: "Dictionary (String to String) of configuration variables."
- }
- field {
- name: "version_file"
- type: "File"
- doc: "The file that is used to hold the volatile workspace status for the current build request. See documentation for --workspace_status_command for more information."
- }
- field {
- name: "workspace_name"
- type: "string"
- doc: "The workspace name as defined in the WORKSPACE file."
- }
- doc: "A context object that is passed to the implementation function for a rule or aspect. It provides access to the information and methods needed to analyze the current target.\"default\"-ordered depsets, and for elements of child depsets whose order differs from that of the parent depset. The list is a copy; modifying it has no effect on the depset and vice versa."
- }
- doc: "True.transitive argument. order parameter determines the kind of traversal that is done to convert the depset to an iterable. There are four possible values:\"default\" (formerly \"stable\"): Order is unspecified (but deterministic).\"postorder\" (formerly \"compile\"): A left-to-right post-ordering. Precisely, this recursively traverses all children leftmost-first, then the direct elements leftmost-first.\"preorder\" (formerly \"naive_link\"): A left-to-right pre-ordering. Precisely, this traverses the direct elements leftmost-first, then recursively traverses the children leftmost-first.\"topological\" (formerly \"link\"): A topological ordering from the root down to the leaves. There is no left-to-right guarantee.\"default\" order. In the latter case the resulting depset\'s order will be the same as the other\'s order.to_list()). Duplicates may interfere with the ordering semantics."
-}
-type {
- name: "DirectoryExpander"
- field {
- name: "expand"
- callable {
param {
- name: "file"
- doc: "The directory or file to expand."
- is_mandatory: true
+ name: "providers"
+ doc: "The providers that must be given by any dependency appearing in this attribute.*Info objects returned by provider() (or in the case of a legacy provider, its string name). The dependency must return ALL providers mentioned in at least ONE of the inner lists. As a convenience, this argument may also be a single-level list of providers, in which case it is wrapped in an outer list with one element. It is NOT required that the rule of the dependency advertises those providers in its provides parameter, however, it is considered best practice."
+ default_value: "[]"
}
- return_type: "list"
- }
- doc: "If the given File is a directory, this returns a list of Files recursively underneath the directory. Otherwise, this returns a list containing just the given File itself."
- }
- doc: "Expands directories created by ctx.actions.declare_directory during the execution phase. This is useful to expand directories in map_each."
-}
-type {
- name: "DottedVersion"
- field {
- name: "compare_to"
- callable {
param {
- name: "other"
- doc: "The other dotted version."
- is_mandatory: true
+ name: "for_dependency_resolution"
+ doc: "If this is set, the attribute is available for materializers. Only rules marked with the flag of the same name are allowed to be referenced through such attributes."
+ default_value: "unbound"
}
- return_type: "int"
- }
- doc: "Compares based on most significant (first) not-matching version component. So, for example, 1.2.3 < 1.2.4"
- }
- doc: "A value representing a version with multiple components, separated by periods, such as 1.2.3.4."
-}
-type {
- name: "exec_result"
- field {
- name: "return_code"
- type: "int"
- doc: "The return code returned after the execution of the program. 256 if the process was terminated by a time out; values larger than 128 indicate termination by a signal."
- }
- field {
- name: "stderr"
- type: "string"
- doc: "The content of the standard error output returned by the execution."
- }
- field {
- name: "stdout"
- type: "string"
- doc: "The content of the standard output returned by the execution."
- }
- doc: "A structure storing result of repository_ctx.execute() method. It contains the standard output stream content, the standard error stream content and the execution return code."
-}
-type {
- name: "ExecGroupCollection"
- doc: "Stores exec groups available to a given rule."
-}
-type {
- name: "ExecGroupContext"
- field {
- name: "toolchains"
- type: "ToolchainContext"
- doc: "Toolchains required for this exec group"
- }
- doc: "Stores information about an exec group."
-}
-type {
- name: "ExecTransitionFactory"
- doc: "an execution transition."
-}
-type {
- name: "extension_metadata"
- doc: "Return values of this type from a module extension\'s implementation function to provide metadata about the repositories generated by the extension to Bazel."
-}
-type {
- name: "FeatureConfiguration"
- doc: "Class used to construct command lines from CROSSTOOL features."
-}
-type {
- name: "File"
- field {
- name: "basename"
- type: "string"
- doc: "The base name of this file. This is the name of the file inside the directory."
- }
- field {
- name: "dirname"
- type: "string"
- doc: "The name of the directory containing this file. It\'s taken from path and is always relative to the execution directory."
- }
- field {
- name: "extension"
- type: "string"
- doc: "The file extension of this file, following (not including) the rightmost period. Empty string if the file\'s basename includes no periods."
- }
- field {
- name: "is_directory"
- type: "bool"
- doc: "Returns true if this is a directory."
- }
- field {
- name: "is_source"
- type: "bool"
- doc: "Returns true if this is a source file, i.e. it is not generated."
- }
- field {
- name: "owner"
- type: "Label"
- doc: "A label of a target that produces this File."
- }
- field {
- name: "path"
- type: "string"
- doc: "The execution path of this file, relative to the workspace\'s execution directory. It consists of two parts, an optional first part called the root (see also the root module), and the second part which is the short_path. The root may be empty, which it usually is for non-generated files. For generated files it usually contains a configuration-specific path fragment that encodes things like the target CPU architecture that was used while building said file. Use the short_path for the path under which the file is mapped if it\'s in the runfiles of a binary."
- }
- field {
- name: "root"
- type: "root"
- doc: "The root beneath which this file resides."
- }
- field {
- name: "short_path"
- type: "string"
- doc: "The path of this file relative to its root. This excludes the aforementioned root, i.e. configuration-specific fragments of the path. This is also the path under which the file is mapped if it\'s in the runfiles of a binary."
- }
- field {
- name: "tree_relative_path"
- type: "string"
- doc: "The path of this file relative to the root of the ancestor\'s tree, if the ancestor\'s is_directory field is true. tree_relative_path is only available for expanded files of a directory in an action command, i.e. Args.add_all(). For other types of files, it is an error to access this field."
- }
- doc: "This object is created during the analysis phase to represent a file or directory that will be read or written during the execution phase. It is not an open file handle, and cannot be used to directly read or write file contents. Rather, you use it to construct the action graph in a rule implementation function by passing it to action-creating functions. See the Rules page for more information.File is passed to an Args object without using a map_each function, it is converted to a string by taking the value of its path field."
-}
-type {
- name: "fragments"
- doc: "A collection of configuration fragments available in the current rule implementation context. Access a specific fragment by its field name. For example, ctx.fragments.java JavaInfo.java_outputs.generated_class_jar instead."
- }
- field {
- name: "enabled"
- type: "bool"
- doc: "Deprecated. Returns true if annotation processing was applied on this target."
- }
- field {
- name: "processor_classnames"
- type: "list"
- doc: "Deprecated: Please use JavaInfo.plugins instead. Returns class names of annotation processors applied to this rule."
- }
- field {
- name: "processor_classpath"
- type: "depset"
- doc: "Deprecated: Please use JavaInfo.plugins instead. Returns a classpath of annotation processors applied to this rule."
- }
- field {
- name: "source_jar"
- type: "File"
- doc: "Deprecated: Please use JavaInfo.java_outputs.generated_source_jar instead."
- }
- field {
- name: "transitive_class_jars"
- type: "depset"
- doc: "Deprecated. Returns a transitive set of class file jars resulting from annotation processing of this rule and its dependencies."
- }
- field {
- name: "transitive_source_jars"
- type: "depset"
- doc: "Deprecated. Returns a transitive set of source archives resulting from annotation processing of this rule and its dependencies."
- }
- doc: "Information about jars that are a result of annotation processing for a Java rule."
-}
-type {
- name: "Label"
- field {
- name: "name"
- type: "string"
- doc: "The name of this label within the package. For instance:Label(\"//pkg/foo:abc\").name == \"abc\"
"
- }
- field {
- name: "package"
- type: "string"
- doc: "The package part of this label. For instance:Label(\"//pkg/foo:abc\").package == \"pkg/foo\"
"
- }
- field {
- name: "relative"
- callable {
param {
- name: "relName"
- doc: "The label that will be resolved relative to this one."
- is_mandatory: true
+ name: "flags"
+ doc: "Deprecated, will be removed."
+ default_value: "[]"
}
- return_type: "Label"
- }
- doc: "Resolves a label that is either absolute (starts with //) or relative to the current package. If this label is in a remote repository, the argument will be resolved relative to that repository. If the argument contains a repository name, the current label is ignored and the argument is returned as-is, except that the repository name is rewritten if it is in the current repository mapping. Reserved labels will also be returned as-is.
For example:\nLabel(\"//foo/bar:baz\").relative(\":quux\") == Label(\"//foo/bar:quux\")\nLabel(\"//foo/bar:baz\").relative(\"//wiz:quux\") == Label(\"//wiz:quux\")\nLabel(\"@repo//foo/bar:baz\").relative(\"//wiz:quux\") == Label(\"@repo//wiz:quux\")\nLabel(\"@repo//foo/bar:baz\").relative(\"//visibility:public\") == Label(\"//visibility:public\")\nLabel(\"@repo//foo/bar:baz\").relative(\"@other//wiz:quux\") == Label(\"@other//wiz:quux\")\n
{\'@other\' : \'@remapped\'}, then the following remapping will take place:\nLabel(\"@repo//foo/bar:baz\").relative(\"@other//wiz:quux\") == Label(\"@remapped//wiz:quux\")\n
"
- }
- field {
- name: "workspace_name"
- type: "string"
- doc: "The repository part of this label. For instance, Label(\"@foo//bar:baz\").workspace_name == \"foo\"
"
- }
- field {
- name: "workspace_root"
- type: "string"
- doc: "Returns the execution root for the workspace of this label, relative to the execroot. For instance:Label(\"@repo//pkg/foo:abc\").workspace_root == \"external/repo\"
"
- }
- doc: "A BUILD target identifier.Label instance l, the string representation str(l) has the property that Label(str(l)) == l, regardless of where the Label() call occurs."
-}
-type {
- name: "LateBoundDefault"
- doc: "Represents a late-bound default attribute value of type \'Label\'. The value of a LateBoundDefault is only resolvable in the context of a rule implementation function, and depends on the current build configuration. For example, a LateBoundDefault might represent the Label of the java toolchain in the current build configuration. Artifact of dynamic library to be linked. Always used for runtime and used for linking if interface_library is not passed."
- }
- field {
- name: "interface_library"
- type: "File"
- doc: "Artifact of interface library to be linked."
- }
- field {
- name: "lto_bitcode_files"
- type: "sequence"
- doc: "List of LTO bitcode files in the library."
- }
- field {
- name: "objects"
- type: "sequence"
- doc: "List of object files in the library."
- }
- field {
- name: "pic_lto_bitcode_files"
- type: "sequence"
- doc: "List of pic LTO bitcode files in the library."
- }
- field {
- name: "pic_objects"
- type: "sequence"
- doc: "List of pic object files in the library."
- }
- field {
- name: "pic_static_library"
- type: "File"
- doc: "Artifact of pic static library to be linked."
- }
- field {
- name: "resolved_symlink_dynamic_library"
- type: "File"
- doc: "The resolved Artifact of the dynamic library to be linked if dynamic_library is a symlink, otherwise this is None."
- }
- field {
- name: "resolved_symlink_interface_library"
- type: "File"
- doc: "The resolved Artifact of the interface library to be linked if interface_library is a symlink, otherwise this is None."
- }
- field {
- name: "static_library"
- type: "File"
- doc: "Artifact of static library to be linked."
- }
- doc: "A library the user can link against."
-}
-type {
- name: "License"
- doc: "This API is deprecated and will be removed. Please do not depend on it. This object represents the value of a license attribute."
-}
-type {
- name: "LinkerInput"
- field {
- name: "additional_inputs"
- type: "sequence"
- doc: "Returns the depset of additional inputs, e.g.: linker scripts."
- }
- field {
- name: "libraries"
- type: "sequence"
- doc: "Returns the depset of LibraryToLink. May return a list but this is deprecated. See #8118."
- }
- field {
- name: "owner"
- type: "Label"
- doc: "Returns the owner of this LinkerInput."
- }
- field {
- name: "user_link_flags"
- type: "sequence"
- doc: "Returns the list of user link flags passed as strings."
- }
- doc: "Either libraries, flags or other files that may be passed to the linker as inputs."
-}
-type {
- name: "LinkingContext"
- field {
- name: "linker_inputs"
- type: "depset"
- doc: "Returns the depset of linker inputs."
- }
- doc: "Immutable store of information needed for C++ linking that is aggregated across dependencies."
-}
-type {
- name: "module_ctx"
- field {
- name: "download"
- callable {
param {
- name: "url"
- type: "string; or Iterable of strings"
- doc: "List of mirror URLs referencing the same file."
- is_mandatory: true
+ name: "mandatory"
+ doc: "If true, the value must be specified explicitly (even if it has a default)."
+ default_value: "False"
}
param {
- name: "output"
- type: "string; or Label; or path"
- doc: "path to the output file, relative to the repository directory."
- default_value: "\'\'"
+ name: "skip_validations"
+ doc: "If true, validation actions of transitive dependencies from this attribute will not run. This is a temporary mitigation and WILL be removed in the future."
+ default_value: "False"
}
param {
- name: "sha256"
- doc: "the expected SHA-256 hash of the file downloaded. This must match the SHA-256 hash of the file downloaded. It is a security risk to omit the SHA-256 as remote files can change. At best omitting this field will make your build non-hermetic. It is optional to make development easier but should be set before shipping."
- default_value: "\'\'"
+ name: "cfg"
+ doc: "Configuration of the attribute. It can be either \"exec\", which indicates that the dependency is built for the execution platform, or \"target\", which indicates that the dependency is build for the target platform. A typical example of the difference is when building mobile apps, where the target platform is Android or iOS while the execution platform is Linux, macOS, or Windows."
+ default_value: "None"
}
param {
- name: "executable"
- doc: "set the executable flag on the created file, false by default."
- default_value: "False"
+ name: "aspects"
+ doc: "Aspects that should be applied to the dependency or dependencies specified by this attribute."
+ default_value: "[]"
+ }
+ }
+ doc: "ctx.attr attribute will be of type list of Targets.Label values. If a string is supplied in place of a Label, it will be converted using the label constructor. The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target\'s package.ctx.attr, labels are replaced by the corresponding Targets. This allows you to access the providers of the current target\'s dependencies."
+ api_context: BZL
+ }
+ global_variable {
+ name: "outputAttribute"
+ callable {
+ param {
+ name: "doc"
+ doc: "A description of the attribute that can be extracted by documentation generating tools."
+ default_value: "None"
}
param {
- name: "allow_fail"
- doc: "If set, indicate the error in the return value instead of raising an error for failed downloads"
+ name: "mandatory"
+ doc: "If true, the value must be specified explicitly (even if it has a default)."
default_value: "False"
}
+ }
+ doc: "Label values. If a string is supplied in place of a Label, it will be converted using the label constructor. The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target\'s package.File can be retrieved using ctx.outputs."
+ api_context: BZL
+ }
+ global_variable {
+ name: "outputListAttribute"
+ callable {
param {
- name: "canonical_id"
- doc: "If set, restrict cache hits to those cases where the file was added to the cache with the same canonical id"
- default_value: "\'\'"
+ name: "allow_empty"
+ doc: "True if the attribute can be empty."
+ default_value: "True"
}
param {
- name: "auth"
- doc: "An optional dict specifying authentication information for some of the URLs."
- default_value: "{}"
+ name: "doc"
+ doc: "A description of the attribute that can be extracted by documentation generating tools."
+ default_value: "None"
}
param {
- name: "integrity"
- doc: "Expected checksum of the file downloaded, in Subresource Integrity format. This must match the checksum of the file downloaded. It is a security risk to omit the checksum as remote files can change. At best omitting this field will make your build non-hermetic. It is optional to make development easier but should be set before shipping."
- default_value: "\'\'"
+ name: "mandatory"
+ doc: "If true, the value must be specified explicitly (even if it has a default)."
+ default_value: "False"
}
- return_type: "struct"
}
- doc: "Downloads a file to the output path for the provided url and returns a struct containing success, a flag which is true if the download completed successfully, and if successful, a hash of the file with the fields sha256 and integrity."
+ doc: "Creates a schema for a list-of-outputs attribute.Label values. If a string is supplied in place of a Label, it will be converted using the label constructor. The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target\'s package.File can be retrieved using ctx.outputs."
+ api_context: BZL
}
- field {
- name: "download_and_extract"
+ global_variable {
+ name: "stringAttribute"
callable {
param {
- name: "url"
- type: "string; or Iterable of strings"
- doc: "List of mirror URLs referencing the same file."
- is_mandatory: true
+ name: "configurable"
+ doc: "This argument can only be specified for an attribute of a symbolic macro.configurable is explicitly set to False, the symbolic macro attribute is non-configurable - in other words, it cannot take a select() value. If the configurable is either unbound or explicitly set to True, the attribute is configurable and can take a select() value.configurable must be left unbound. Most Starlark rule attributes are always configurable, with the exception of attr.output(), attr.output_list(), and attr.license() rule attributes, which are always non-configurable."
+ default_value: "unbound"
}
param {
- name: "output"
- type: "string; or Label; or path"
- doc: "path to the directory where the archive will be unpacked, relative to the repository directory."
+ name: "default"
+ doc: "A default value to use if no value for this attribute is given when instantiating the rule."
default_value: "\'\'"
}
param {
- name: "sha256"
- doc: "the expected SHA-256 hash of the file downloaded. This must match the SHA-256 hash of the file downloaded. It is a security risk to omit the SHA-256 as remote files can change. At best omitting this field will make your build non-hermetic. It is optional to make development easier but should be set before shipping. If provided, the repository cache will first be checked for a file with the given hash; a download will only be attempted if the file was not found in the cache. After a successful download, the file will be added to the cache."
- default_value: "\'\'"
+ name: "doc"
+ doc: "A description of the attribute that can be extracted by documentation generating tools."
+ default_value: "None"
}
param {
- name: "type"
- doc: "the archive type of the downloaded file. By default, the archive type is determined from the file extension of the URL. If the file has no extension, you can explicitly specify either \"zip\", \"jar\", \"war\", \"aar\", \"tar\", \"tar.gz\", \"tgz\", \"tar.xz\", \"txz\", \".tar.zst\", \".tzst\", \"tar.bz2\", \".tbz\", \".ar\", or \".deb\" here."
- default_value: "\'\'"
+ name: "mandatory"
+ doc: "If true, the value must be specified explicitly (even if it has a default)."
+ default_value: "False"
}
param {
- name: "stripPrefix"
- doc: "a directory prefix to strip from the extracted files.\nMany archives contain a top-level directory that contains all files in the archive. Instead of needing to specify this prefix over and over in the build_file, this field can be used to strip it from extracted files."
- default_value: "\'\'"
+ name: "values"
+ doc: "The list of allowed values for the attribute. An error is raised if any other value is given."
+ default_value: "[]"
}
+ }
+ doc: "Creates a schema for a string attribute."
+ api_context: BZL
+ }
+ global_variable {
+ name: "stringDictAttribute"
+ callable {
param {
- name: "allow_fail"
- doc: "If set, indicate the error in the return value instead of raising an error for failed downloads"
- default_value: "False"
+ name: "allow_empty"
+ doc: "True if the attribute can be empty."
+ default_value: "True"
}
param {
- name: "canonical_id"
- doc: "If set, restrict cache hits to those cases where the file was added to the cache with the same canonical id"
- default_value: "\'\'"
+ name: "configurable"
+ doc: "This argument can only be specified for an attribute of a symbolic macro.configurable is explicitly set to False, the symbolic macro attribute is non-configurable - in other words, it cannot take a select() value. If the configurable is either unbound or explicitly set to True, the attribute is configurable and can take a select() value.configurable must be left unbound. Most Starlark rule attributes are always configurable, with the exception of attr.output(), attr.output_list(), and attr.license() rule attributes, which are always non-configurable."
+ default_value: "unbound"
}
param {
- name: "auth"
- doc: "An optional dict specifying authentication information for some of the URLs."
+ name: "default"
+ doc: "A default value to use if no value for this attribute is given when instantiating the rule."
default_value: "{}"
}
param {
- name: "integrity"
- doc: "Expected checksum of the file downloaded, in Subresource Integrity format. This must match the checksum of the file downloaded. It is a security risk to omit the checksum as remote files can change. At best omitting this field will make your build non-hermetic. It is optional to make development easier but should be set before shipping."
- default_value: "\'\'"
+ name: "doc"
+ doc: "A description of the attribute that can be extracted by documentation generating tools."
+ default_value: "None"
}
param {
- name: "rename_files"
- doc: "An optional dict specifying files to rename during the extraction. Archive entries with names exactly matching a key will be renamed to the value, prior to any directory prefix adjustment. This can be used to extract archives that contain non-Unicode filenames, or which have files that would extract to the same path on case-insensitive filesystems."
- default_value: "{}"
+ name: "mandatory"
+ doc: "If true, the value must be specified explicitly (even if it has a default)."
+ default_value: "False"
}
- return_type: "struct"
}
- doc: "Downloads a file to the output path for the provided url, extracts it, and returns a struct containing success, a flag which is true if the download completed successfully, and if successful, a hash of the file with the fields sha256 and integrity."
+ doc: "Creates a schema for an attribute holding a dictionary, where the keys and values are strings."
+ api_context: BZL
}
- field {
- name: "execute"
+ global_variable {
+ name: "stringKeyedLabelDictAttribute"
callable {
param {
- name: "arguments"
- doc: "List of arguments, the first element should be the path to the program to execute."
- is_mandatory: true
+ name: "allow_empty"
+ doc: "True if the attribute can be empty."
+ default_value: "True"
}
param {
- name: "timeout"
- doc: "maximum duration of the command in seconds (default is 600 seconds)."
- default_value: "600"
+ name: "configurable"
+ doc: "This argument can only be specified for an attribute of a symbolic macro.configurable is explicitly set to False, the symbolic macro attribute is non-configurable - in other words, it cannot take a select() value. If the configurable is either unbound or explicitly set to True, the attribute is configurable and can take a select() value.configurable must be left unbound. Most Starlark rule attributes are always configurable, with the exception of attr.output(), attr.output_list(), and attr.license() rule attributes, which are always non-configurable."
+ default_value: "unbound"
}
param {
- name: "environment"
- doc: "force some environment variables to be set to be passed to the process."
+ name: "default"
+ doc: "A default value to use if no value for this attribute is given when instantiating the rule.Use strings or the Label function to specify default values, for example, attr.string_keyed_label_dict(default = {\"foo\": \"//a:b\", \"bar\": \"//a:c\"})."
default_value: "{}"
}
param {
- name: "quiet"
- doc: "If stdout and stderr should be printed to the terminal."
- default_value: "True"
- }
- param {
- name: "working_directory"
- doc: "Working directory for command execution.\nCan be relative to the repository root or absolute."
- default_value: "\"\""
+ name: "doc"
+ doc: "A description of the attribute that can be extracted by documentation generating tools."
+ default_value: "None"
}
- return_type: "exec_result"
- }
- doc: "Executes the command given by the list of arguments. The execution time of the command is limited by timeout (in seconds, default 600 seconds). This method returns an exec_result structure containing the output of the command. The environment map can be used to override some environment variables to be passed to the process."
- }
- field {
- name: "extension_metadata"
- callable {
param {
- name: "root_module_direct_deps"
- type: "sequence of strings; or string; or None"
- doc: "The names of the repositories that the extension considers to be direct dependencies of the root module. If the root module imports additional repositories or does not import all of these repositories via use_repo, Bazel will print a warning and a fixup command when the extension is evaluated.root_module_direct_deps and root_module_direct_dev_deps is specified, the other has to be as well. The lists specified by these two parameters must be disjoint.root_module_direct_deps and root_module_direct_dev_deps can be set to the special value \"all\", which is treated as if a list with the names of all repositories generated by the extension was specified as the value."
+ name: "allow_files"
+ doc: "Whether File targets are allowed. Can be True, False (default), or a list of file extensions that are allowed (for example, [\".cc\", \".cpp\"])."
default_value: "None"
}
param {
- name: "root_module_direct_dev_deps"
- type: "sequence of strings; or string; or None"
- doc: "The names of the repositories that the extension considers to be direct dev dependencies of the root module. If the root module imports additional repositories or does not import all of these repositories via use_repo on an extension proxy created with use_extension(..., dev_dependency = True), Bazel will print a warning and a fixup command when the extension is evaluated.root_module_direct_deps and root_module_direct_dev_deps is specified, the other has to be as well. The lists specified by these two parameters must be disjoint.root_module_direct_deps and root_module_direct_dev_deps can be set to the special value \"all\", which is treated as if a list with the names of all repositories generated by the extension was specified as the value."
+ name: "allow_rules"
+ doc: "Which rule targets (name of the classes) are allowed. This is deprecated (kept only for compatibility), use providers instead."
default_value: "None"
}
- return_type: "extension_metadata"
- }
- doc: "Constructs an opaque object that can be returned from the module extension\'s implementation function to provide metadata about the repositories generated by the extension to Bazel."
- }
- field {
- name: "file"
- callable {
param {
- name: "path"
- type: "string; or Label; or path"
- doc: "path of the file to create, relative to the repository directory."
- is_mandatory: true
+ name: "providers"
+ doc: "The providers that must be given by any dependency appearing in this attribute.*Info objects returned by provider() (or in the case of a legacy provider, its string name). The dependency must return ALL providers mentioned in at least ONE of the inner lists. As a convenience, this argument may also be a single-level list of providers, in which case it is wrapped in an outer list with one element. It is NOT required that the rule of the dependency advertises those providers in its provides parameter, however, it is considered best practice."
+ default_value: "[]"
}
param {
- name: "content"
- doc: "the content of the file to create, empty by default."
- default_value: "\'\'"
+ name: "for_dependency_resolution"
+ doc: "If this is set, the attribute is available for materializers. Only rules marked with the flag of the same name are allowed to be referenced through such attributes."
+ default_value: "unbound"
}
param {
- name: "executable"
- doc: "set the executable flag on the created file, true by default."
- default_value: "True"
+ name: "flags"
+ doc: "Deprecated, will be removed."
+ default_value: "[]"
}
param {
- name: "legacy_utf8"
- doc: "encode file content to UTF-8, true by default. Future versions will change the default and remove this parameter."
- default_value: "True"
+ name: "mandatory"
+ doc: "If true, the value must be specified explicitly (even if it has a default)."
+ default_value: "False"
}
- return_type: "NoneType"
- }
- doc: "Generates a file in the repository directory with the provided content."
- }
- field {
- name: "is_dev_dependency"
- callable {
param {
- name: "tag"
- type: "bazel_module_tag"
- doc: "A tag obtained from bazel_module.tags."
- is_mandatory: true
+ name: "cfg"
+ doc: "Configuration of the attribute. It can be either \"exec\", which indicates that the dependency is built for the execution platform, or \"target\", which indicates that the dependency is build for the target platform. A typical example of the difference is when building mobile apps, where the target platform is Android or iOS while the execution platform is Linux, macOS, or Windows."
+ default_value: "None"
}
- return_type: "bool"
- }
- doc: "Returns whether the given tag was specified on the result of a use_extension call with devDependency = True."
- }
- field {
- name: "modules"
- type: "list"
- doc: "A list of all the Bazel modules in the external dependency graph that use this module extension, each of which is a bazel_module object that exposes all the tags it specified for this extension. The iteration order of this dictionary is guaranteed to be the same as breadth-first search starting from the root module."
- }
- field {
- name: "os"
- type: "repository_os"
- doc: "A struct to access information from the system."
- }
- field {
- name: "path"
- callable {
param {
- name: "path"
- type: "string; or Label; or path"
- doc: "string, label or path from which to create a path from"
- is_mandatory: true
+ name: "aspects"
+ doc: "Aspects that should be applied to the dependency or dependencies specified by this attribute."
+ default_value: "[]"
}
- return_type: "path"
}
- doc: "Returns a path from a string, label or path. If the path is relative, it will resolve relative to the repository directory. If the path is a label, it will resolve to the path of the corresponding file. Note that remote repositories are executed during the analysis phase and thus cannot depends on a target result (the label should point to a non-generated file). If path is a path, it will return that path as is."
+ doc: "Label values. If a string is supplied in place of a Label, it will be converted using the label constructor. The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target\'s package.ctx.attr, labels are replaced by the corresponding Targets. This allows you to access the providers of the current target\'s dependencies."
+ api_context: BZL
}
- field {
- name: "read"
+ global_variable {
+ name: "stringListAttribute"
callable {
param {
- name: "path"
- type: "string; or Label; or path"
- doc: "path of the file to read from."
- is_mandatory: true
+ name: "mandatory"
+ doc: "If true, the value must be specified explicitly (even if it has a default)."
+ default_value: "False"
}
- return_type: "string"
- }
- doc: "Reads the content of a file on the filesystem."
- }
- field {
- name: "report_progress"
- callable {
param {
- name: "status"
- type: "string"
- doc: "string describing the current status of the fetch progress"
- default_value: "\'\'"
+ name: "allow_empty"
+ doc: "True if the attribute can be empty."
+ default_value: "True"
}
- return_type: "NoneType"
- }
- doc: "Updates the progress status for the fetching of this repository or module extension"
- }
- field {
- name: "root_module_has_non_dev_dependency"
- type: "bool"
- doc: "Whether the root module uses this extension as a non-dev dependency."
- }
- field {
- name: "which"
- callable {
param {
- name: "program"
- doc: "Program to find in the path."
- is_mandatory: true
+ name: "configurable"
+ doc: "This argument can only be specified for an attribute of a symbolic macro.configurable is explicitly set to False, the symbolic macro attribute is non-configurable - in other words, it cannot take a select() value. If the configurable is either unbound or explicitly set to True, the attribute is configurable and can take a select() value.configurable must be left unbound. Most Starlark rule attributes are always configurable, with the exception of attr.output(), attr.output_list(), and attr.license() rule attributes, which are always non-configurable."
+ default_value: "unbound"
}
- return_type: "path"
- }
- doc: "Returns the path of the corresponding program or None if there is no such program in the path."
- }
- doc: "The context of the module extension containing helper functions and information about pertinent tags across the dependency graph. You get a module_ctx object as an argument to the implementation function when you create a module extension."
-}
-type {
- name: "native_rule_transition"
- doc: "Represents a native transition that can be applied to a Starlark rule as an incoming edge. This is a valid value for cfg in rule() but not attr()."
-}
-type {
- name: "path"
- field {
- name: "basename"
- type: "string"
- doc: "A string giving the basename of the file."
- }
- field {
- name: "dirname"
- type: "path"
- doc: "The parent directory of this file, or None if this file does not have a parent."
- }
- field {
- name: "exists"
- type: "bool"
- doc: "Returns true if the file denoted by this path exists."
- }
- field {
- name: "get_child"
- callable {
param {
- name: "*relative_paths"
- doc: "Zero or more relative path strings to append to this path with path separatorsadded as needed."
- is_mandatory: true
- is_star_arg: true
+ name: "default"
+ doc: "A default value to use if no value for this attribute is given when instantiating the rule."
+ default_value: "[]"
}
- return_type: "path"
- }
- doc: "Returns the path obtained by joining this path with the given relative paths."
- }
- field {
- name: "readdir"
- callable {
- return_type: "list"
- }
- doc: "The list of entries in the directory denoted by this path."
- }
- field {
- name: "realpath"
- type: "path"
- doc: "Returns the canonical path for this path by repeatedly replacing all symbolic links with their referents."
- }
- doc: "A structure representing a file to be used inside a repository."
-}
-type {
- name: "Provider"
- doc: "A constructor for simple value objects, known as provider instances.
This value has a dual purpose:
Create a new DataInfo = provider()\nd = DataInfo(x = 2, y = 3)\nprint(d.x + d.y) # prints 5
Note: Some providers, defined internally, do not allow instance creation DataInfo = provider()\ndef _rule_impl(ctx)\n ... ctx.attr.dep[DataInfo]
Provider using the provider function."
-}
-type {
- name: "repository_ctx"
- field {
- name: "attr"
- type: "struct"
- doc: "A struct to access the values of the attributes. The values are provided by the user (if not, a default value is used)."
- }
- field {
- name: "delete"
- callable {
param {
- name: "path"
- type: "string; or path"
- doc: "Path of the file to delete, relative to the repository directory, or absolute. Can be a path or a string."
- is_mandatory: true
+ name: "doc"
+ doc: "A description of the attribute that can be extracted by documentation generating tools."
+ default_value: "None"
}
- return_type: "bool"
}
- doc: "Deletes a file or a directory. Returns a bool, indicating whether the file or directory was actually deleted by this call."
+ doc: "Creates a schema for a list-of-strings attribute."
+ api_context: BZL
}
- field {
- name: "download"
+ global_variable {
+ name: "stringListDictAttribute"
callable {
param {
- name: "url"
- type: "string; or Iterable of strings"
- doc: "List of mirror URLs referencing the same file."
- is_mandatory: true
+ name: "allow_empty"
+ doc: "True if the attribute can be empty."
+ default_value: "True"
}
param {
- name: "output"
- type: "string; or Label; or path"
- doc: "path to the output file, relative to the repository directory."
- default_value: "\'\'"
+ name: "configurable"
+ doc: "This argument can only be specified for an attribute of a symbolic macro.configurable is explicitly set to False, the symbolic macro attribute is non-configurable - in other words, it cannot take a select() value. If the configurable is either unbound or explicitly set to True, the attribute is configurable and can take a select() value.configurable must be left unbound. Most Starlark rule attributes are always configurable, with the exception of attr.output(), attr.output_list(), and attr.license() rule attributes, which are always non-configurable."
+ default_value: "unbound"
}
param {
- name: "sha256"
- doc: "the expected SHA-256 hash of the file downloaded. This must match the SHA-256 hash of the file downloaded. It is a security risk to omit the SHA-256 as remote files can change. At best omitting this field will make your build non-hermetic. It is optional to make development easier but should be set before shipping."
- default_value: "\'\'"
+ name: "default"
+ doc: "A default value to use if no value for this attribute is given when instantiating the rule."
+ default_value: "{}"
}
param {
- name: "executable"
- doc: "set the executable flag on the created file, false by default."
- default_value: "False"
+ name: "doc"
+ doc: "A description of the attribute that can be extracted by documentation generating tools."
+ default_value: "None"
}
param {
- name: "allow_fail"
- doc: "If set, indicate the error in the return value instead of raising an error for failed downloads"
+ name: "mandatory"
+ doc: "If true, the value must be specified explicitly (even if it has a default)."
default_value: "False"
}
- param {
- name: "canonical_id"
- doc: "If set, restrict cache hits to those cases where the file was added to the cache with the same canonical id"
- default_value: "\'\'"
- }
- param {
- name: "auth"
- doc: "An optional dict specifying authentication information for some of the URLs."
- default_value: "{}"
- }
- param {
- name: "integrity"
- doc: "Expected checksum of the file downloaded, in Subresource Integrity format. This must match the checksum of the file downloaded. It is a security risk to omit the checksum as remote files can change. At best omitting this field will make your build non-hermetic. It is optional to make development easier but should be set before shipping."
- default_value: "\'\'"
- }
- return_type: "struct"
}
- doc: "Downloads a file to the output path for the provided url and returns a struct containing success, a flag which is true if the download completed successfully, and if successful, a hash of the file with the fields sha256 and integrity."
+ doc: "Creates a schema for an attribute holding a dictionary, where the keys are strings and the values are lists of strings."
+ api_context: BZL
+ }
+}
+global {
+ name: "cc_common"
+ api_context: BZL
+ global_variable {
+ name: "CcSharedLibraryHintInfo"
+ }
+ global_variable {
+ name: "CcToolchainInfo"
+ }
+ global_variable {
+ name: "action_is_enabled"
+ }
+ global_variable {
+ name: "check_experimental_cc_shared_library"
+ }
+ global_variable {
+ name: "check_experimental_cc_static_library"
+ }
+ global_variable {
+ name: "compile"
+ }
+ global_variable {
+ name: "configure_features"
+ }
+ global_variable {
+ name: "create_cc_launcher_info"
+ }
+ global_variable {
+ name: "create_cc_toolchain_config_info"
+ }
+ global_variable {
+ name: "create_compilation_context"
+ }
+ global_variable {
+ name: "create_compilation_outputs"
+ }
+ global_variable {
+ name: "create_compile_action"
+ }
+ global_variable {
+ name: "create_compile_variables"
+ }
+ global_variable {
+ name: "create_debug_context"
+ }
+ global_variable {
+ name: "create_extra_link_time_library"
+ }
+ global_variable {
+ name: "create_library_to_link"
+ }
+ global_variable {
+ name: "create_link_variables"
+ }
+ global_variable {
+ name: "create_linker_input"
+ }
+ global_variable {
+ name: "create_linking_context"
+ }
+ global_variable {
+ name: "create_linking_context_from_compilation_outputs"
+ }
+ global_variable {
+ name: "create_lto_backend_artifacts"
+ }
+ global_variable {
+ name: "create_lto_compilation_context"
+ }
+ global_variable {
+ name: "create_module_map"
+ }
+ global_variable {
+ name: "do_not_use_tools_cpp_compiler_present"
+ }
+ global_variable {
+ name: "empty_variables"
+ }
+ global_variable {
+ name: "get_environment_variables"
+ }
+ global_variable {
+ name: "get_execution_requirements"
+ }
+ global_variable {
+ name: "get_memory_inefficient_command_line"
+ }
+ global_variable {
+ name: "get_tool_for_action"
+ }
+ global_variable {
+ name: "get_tool_requirement_for_action"
+ }
+ global_variable {
+ name: "implementation_deps_allowed_by_allowlist"
+ }
+ global_variable {
+ name: "incompatible_disable_objc_library_transition"
+ }
+ global_variable {
+ name: "is_cc_toolchain_resolution_enabled_do_not_use"
+ }
+ global_variable {
+ name: "is_enabled"
+ }
+ global_variable {
+ name: "launcher_provider"
+ }
+ global_variable {
+ name: "ld_tool_path"
+ }
+ global_variable {
+ name: "legacy_cc_flags_make_variable_do_not_use"
+ }
+ global_variable {
+ name: "link"
+ }
+ global_variable {
+ name: "merge_cc_infos"
+ }
+ global_variable {
+ name: "merge_compilation_contexts"
}
- field {
- name: "download_and_extract"
+ global_variable {
+ name: "merge_compilation_outputs"
+ }
+ global_variable {
+ name: "merge_debug_context"
+ }
+ global_variable {
+ name: "merge_linking_contexts"
+ }
+ global_variable {
+ name: "objcopy"
+ }
+ global_variable {
+ name: "objcopy_tool_path"
+ }
+ global_variable {
+ name: "register_linkstamp_compile_action"
+ }
+}
+global {
+ name: "cc_proto_aspect"
+ callable {
+ }
+ api_context: BZL
+}
+global {
+ name: "config"
+ doc: "This is a top-level module for creating configuration transitions and build setting descriptors which describe what kind of build setting (if any) a rule is. build_setting parameter of the rule() function. Specifically it is a build setting of type int and is a flag which means this build setting is callable on the command line. my_rule = rule(\n implementation = _impl,\n build_setting = config.int(flag = True),\n ...\n )
"
+ api_context: BZL
+ global_variable {
+ name: "boolSetting"
callable {
param {
- name: "url"
- type: "string; or Iterable of strings"
- doc: "List of mirror URLs referencing the same file."
- is_mandatory: true
- }
- param {
- name: "output"
- type: "string; or Label; or path"
- doc: "path to the directory where the archive will be unpacked, relative to the repository directory."
- default_value: "\'\'"
- }
- param {
- name: "sha256"
- doc: "the expected SHA-256 hash of the file downloaded. This must match the SHA-256 hash of the file downloaded. It is a security risk to omit the SHA-256 as remote files can change. At best omitting this field will make your build non-hermetic. It is optional to make development easier but should be set before shipping. If provided, the repository cache will first be checked for a file with the given hash; a download will only be attempted if the file was not found in the cache. After a successful download, the file will be added to the cache."
- default_value: "\'\'"
- }
- param {
- name: "type"
- doc: "the archive type of the downloaded file. By default, the archive type is determined from the file extension of the URL. If the file has no extension, you can explicitly specify either \"zip\", \"jar\", \"war\", \"aar\", \"tar\", \"tar.gz\", \"tgz\", \"tar.xz\", \"txz\", \".tar.zst\", \".tzst\", \"tar.bz2\", \".tbz\", \".ar\", or \".deb\" here."
- default_value: "\'\'"
- }
- param {
- name: "stripPrefix"
- doc: "a directory prefix to strip from the extracted files.\nMany archives contain a top-level directory that contains all files in the archive. Instead of needing to specify this prefix over and over in the build_file, this field can be used to strip it from extracted files."
- default_value: "\'\'"
- }
- param {
- name: "allow_fail"
- doc: "If set, indicate the error in the return value instead of raising an error for failed downloads"
+ name: "flag"
+ doc: "Whether or not this build setting is callable on the command line."
default_value: "False"
}
- param {
- name: "canonical_id"
- doc: "If set, restrict cache hits to those cases where the file was added to the cache with the same canonical id"
- default_value: "\'\'"
- }
- param {
- name: "auth"
- doc: "An optional dict specifying authentication information for some of the URLs."
- default_value: "{}"
- }
- param {
- name: "integrity"
- doc: "Expected checksum of the file downloaded, in Subresource Integrity format. This must match the checksum of the file downloaded. It is a security risk to omit the checksum as remote files can change. At best omitting this field will make your build non-hermetic. It is optional to make development easier but should be set before shipping."
- default_value: "\'\'"
- }
- param {
- name: "rename_files"
- doc: "An optional dict specifying files to rename during the extraction. Archive entries with names exactly matching a key will be renamed to the value, prior to any directory prefix adjustment. This can be used to extract archives that contain non-Unicode filenames, or which have files that would extract to the same path on case-insensitive filesystems."
- default_value: "{}"
- }
- return_type: "struct"
}
- doc: "Downloads a file to the output path for the provided url, extracts it, and returns a struct containing success, a flag which is true if the download completed successfully, and if successful, a hash of the file with the fields sha256 and integrity."
+ doc: "A bool-typed build setting"
+ api_context: BZL
}
- field {
- name: "execute"
+ global_variable {
+ name: "exec"
callable {
param {
- name: "arguments"
- doc: "List of arguments, the first element should be the path to the program to execute."
- is_mandatory: true
- }
- param {
- name: "timeout"
- doc: "maximum duration of the command in seconds (default is 600 seconds)."
- default_value: "600"
- }
- param {
- name: "environment"
- doc: "force some environment variables to be set to be passed to the process."
- default_value: "{}"
- }
- param {
- name: "quiet"
- doc: "If stdout and stderr should be printed to the terminal."
- default_value: "True"
- }
- param {
- name: "working_directory"
- doc: "Working directory for command execution.\nCan be relative to the repository root or absolute."
- default_value: "\"\""
+ name: "exec_group"
+ doc: "The name of the exec group whose execution platform this transition will use. If not provided, this exec transition will use the target\'s default execution platform."
+ default_value: "None"
}
- return_type: "exec_result"
}
- doc: "Executes the command given by the list of arguments. The execution time of the command is limited by timeout (in seconds, default 600 seconds). This method returns an exec_result structure containing the output of the command. The environment map can be used to override some environment variables to be passed to the process."
+ doc: "Creates an execution transition."
+ api_context: BZL
}
- field {
- name: "extract"
+ global_variable {
+ name: "intSetting"
callable {
param {
- name: "archive"
- type: "string; or Label; or path"
- doc: "path to the archive that will be unpacked, relative to the repository directory."
- is_mandatory: true
- }
- param {
- name: "output"
- type: "string; or Label; or path"
- doc: "path to the directory where the archive will be unpacked, relative to the repository directory."
- default_value: "\'\'"
- }
- param {
- name: "stripPrefix"
- doc: "a directory prefix to strip from the extracted files.\nMany archives contain a top-level directory that contains all files in the archive. Instead of needing to specify this prefix over and over in the build_file, this field can be used to strip it from extracted files."
- default_value: "\'\'"
- }
- param {
- name: "rename_files"
- doc: "An optional dict specifying files to rename during the extraction. Archive entries with names exactly matching a key will be renamed to the value, prior to any directory prefix adjustment. This can be used to extract archives that contain non-Unicode filenames, or which have files that would extract to the same path on case-insensitive filesystems."
- default_value: "{}"
+ name: "flag"
+ doc: "Whether or not this build setting is callable on the command line."
+ default_value: "False"
}
- return_type: "NoneType"
}
- doc: "Extract an archive to the repository directory."
+ doc: "An integer-typed build setting"
+ api_context: BZL
}
- field {
- name: "file"
+ global_variable {
+ name: "none"
+ callable {
+ }
+ doc: "Creates a transition which removes all configuration, unsetting all flags. Intended for the case where a dependency is data-only and contains no code that needs to be built, but should only be analyzed once."
+ api_context: BZL
+ }
+ global_variable {
+ name: "stringListSetting"
callable {
param {
- name: "path"
- type: "string; or Label; or path"
- doc: "path of the file to create, relative to the repository directory."
- is_mandatory: true
- }
- param {
- name: "content"
- doc: "the content of the file to create, empty by default."
- default_value: "\'\'"
- }
- param {
- name: "executable"
- doc: "set the executable flag on the created file, true by default."
- default_value: "True"
+ name: "flag"
+ doc: "Whether or not this build setting is callable on the command line."
+ default_value: "False"
}
param {
- name: "legacy_utf8"
- doc: "encode file content to UTF-8, true by default. Future versions will change the default and remove this parameter."
- default_value: "True"
+ name: "repeatable"
+ doc: "If set, instead of expecting a comma-separated value, this flag is allowed to be set multiple times on the command line with each individual value treated as a single string to add to the list value. Insertion order and repeated values are both maintained. This list can be post-processed in the build setting implementation function if different behavior is desired."
+ default_value: "False"
}
- return_type: "NoneType"
}
- doc: "Generates a file in the repository directory with the provided content."
- }
- field {
- name: "name"
- type: "string"
- doc: "The name of the external repository created by this rule."
- }
- field {
- name: "os"
- type: "repository_os"
- doc: "A struct to access information from the system."
+ doc: "A string list-typed build setting. On the command line pass a list using comma-separated value like --//my/setting=foo,bar."
+ api_context: BZL
}
- field {
- name: "patch"
+ global_variable {
+ name: "stringSetting"
callable {
param {
- name: "patch_file"
- type: "string; or Label; or path"
- doc: "The patch file to apply, it can be label, relative path or absolute path. If it\'s a relative path, it will resolve to the repository directory."
- is_mandatory: true
+ name: "flag"
+ doc: "Whether or not this build setting is callable on the command line."
+ default_value: "False"
}
param {
- name: "strip"
- doc: "strip the specified number of leading components from file names."
- default_value: "0"
+ name: "allow_multiple"
+ doc: "Deprecated, use a string_list setting with repeatable = True instead. If set, this flag is allowed to be set multiple times on the command line. The Value of the flag as accessed in transitions and build setting implementation function will be a list of strings. Insertion order and repeated values are both maintained. This list can be post-processed in the build setting implementation function if different behavior is desired."
+ default_value: "False"
}
- return_type: "NoneType"
}
- doc: "Apply a patch file to the root directory of external repository. The patch file should be a standard unified diff format file. The Bazel-native patch implementation doesn\'t support fuzz match and binary patch like the patch command line tool."
+ doc: "A string-typed build setting"
+ api_context: BZL
}
- field {
- name: "path"
+ global_variable {
+ name: "target"
callable {
- param {
- name: "path"
- type: "string; or Label; or path"
- doc: "string, label or path from which to create a path from"
- is_mandatory: true
- }
- return_type: "path"
}
- doc: "Returns a path from a string, label or path. If the path is relative, it will resolve relative to the repository directory. If the path is a label, it will resolve to the path of the corresponding file. Note that remote repositories are executed during the analysis phase and thus cannot depends on a target result (the label should point to a non-generated file). If path is a path, it will return that path as is."
+ doc: "Creates a target transition. This is a no-op transition intended for the case where a transition object is needed, but doesn\'t want to actually change anything. Equivalent to cfg = \"target\" in attr.label()."
+ api_context: BZL
}
- field {
- name: "read"
+}
+global {
+ name: "config_common"
+ doc: "Functions for Starlark to interact with Blaze\'s configurability APIs."
+ api_context: BZL
+ global_variable {
+ name: "createConfigFeatureFlagTransitionFactory"
callable {
param {
- name: "path"
- type: "string; or Label; or path"
- doc: "path of the file to read from."
+ name: "attribute"
+ doc: "string corresponding to rule attribute to read"
is_mandatory: true
}
- return_type: "string"
}
- doc: "Reads the content of a file on the filesystem."
+ api_context: BZL
}
- field {
- name: "report_progress"
+ global_variable {
+ name: "getConfigFeatureFlagProviderConstructor"
callable {
- param {
- name: "status"
- type: "string"
- doc: "string describing the current status of the fetch progress"
- default_value: "\'\'"
- }
- return_type: "NoneType"
}
- doc: "Updates the progress status for the fetching of this repository or module extension"
+ doc: "The key used to retrieve the provider containing config_feature_flag\'s value."
+ api_context: BZL
}
- field {
- name: "symlink"
+ global_variable {
+ name: "toolchainType"
callable {
param {
- name: "target"
- type: "string; or Label; or path"
- doc: "The path that the symlink should point to."
+ name: "name"
+ doc: "The toolchain type that is required."
is_mandatory: true
}
param {
- name: "link_name"
- type: "string; or Label; or path"
- doc: "The path of the symlink to create, relative to the repository directory."
- is_mandatory: true
+ name: "mandatory"
+ doc: "Whether the toolchain type is mandatory or optional."
+ default_value: "True"
}
- return_type: "NoneType"
}
- doc: "Creates a symlink on the filesystem."
+ doc: "Declare a rule\'s dependency on a toolchain type."
+ api_context: BZL
+ }
+}
+global {
+ name: "configuration_field"
+ callable {
+ param {
+ name: "fragment"
+ doc: "The name of a configuration fragment which contains the late-bound value."
+ is_mandatory: true
+ }
+ param {
+ name: "name"
+ doc: "The name of the value to obtain from the configuration fragment."
+ is_mandatory: true
+ }
}
- field {
- name: "template"
+ doc: "References a late-bound default value for an attribute of type label. A value is \'late-bound\' if it requires the configuration to be built before determining the value. Any attribute using this as a value must be private. \'_foo\': attr.label(default=configuration_field(fragment=\'java\', name=\'toolchain\'))
def _rule_impl(ctx):\n foo_info = ctx.attr._foo\n ...
"
+ api_context: BZL
+}
+global {
+ name: "coverage_common"
+ doc: "Helper functions to access coverage-related infrastructure."
+ api_context: BZL
+ global_variable {
+ name: "instrumentedFilesInfo"
callable {
param {
- name: "path"
- type: "string; or Label; or path"
- doc: "path of the file to create, relative to the repository directory."
+ name: "ctx"
+ doc: "The rule context."
is_mandatory: true
}
param {
- name: "template"
- type: "string; or Label; or path"
- doc: "path to the template file."
- is_mandatory: true
+ name: "source_attributes"
+ doc: "A list of attribute names which contain source files processed by this rule."
+ default_value: "[]"
}
param {
- name: "substitutions"
- doc: "substitutions to make when expanding the template."
- default_value: "{}"
+ name: "dependency_attributes"
+ doc: "A list of attribute names which might provide runtime dependencies (either code dependencies or runfiles)."
+ default_value: "[]"
}
param {
- name: "executable"
- doc: "set the executable flag on the created file, true by default."
- default_value: "True"
+ name: "extensions"
+ default_value: "None"
}
- return_type: "NoneType"
- }
- doc: "Generates a new file using a template. Every occurrence in template of a key of substitutions will be replaced by the corresponding value. The result is written in path. An optionalexecutable argument (default to true) can be set to turn on or offthe executable bit."
- }
- field {
- name: "which"
- callable {
param {
- name: "program"
- doc: "Program to find in the path."
- is_mandatory: true
+ name: "metadata_files"
+ default_value: "[]"
}
- return_type: "path"
}
- doc: "Returns the path of the corresponding program or None if there is no such program in the path."
- }
- field {
- name: "workspace_root"
- type: "path"
- doc: "The path to the root workspace of the bazel invocation."
+ doc: "Creates a new InstrumentedFilesInfo instance. Use this provider to communicate coverage-related attributes of the current build rule."
+ api_context: BZL
}
- doc: "The context of the repository rule containing helper functions and information about attributes. You get a repository_ctx object as an argument to the implementation function when you create a repository rule."
}
-type {
- name: "repository_os"
- field {
- name: "arch"
- type: "string"
- doc: "A string identifying the architecture Bazel is running on (the value of the \"os.arch\" Java property converted to lower case)."
+global {
+ name: "depset"
+ callable {
+ param {
+ name: "direct"
+ doc: "A list of direct elements of a depset. "
+ default_value: "None"
+ }
+ param {
+ name: "order"
+ doc: "The traversal strategy for the new depset. See here for the possible values."
+ default_value: "\"default\""
+ }
+ param {
+ name: "transitive"
+ doc: "A list of depsets whose elements will become indirect elements of the depset."
+ default_value: "None"
+ }
}
- field {
- name: "environ"
- type: "dict"
- doc: "The list of environment variables."
+ doc: "Creates a depset. The direct parameter is a list of direct elements of the depset, and transitive parameter is a list of depsets whose elements become indirect elements of the created depset. The order in which elements are returned when the depset is converted to a list is specified by the order parameter. See the Depsets overview for more information.\ntype(x).\ntransitive depsets. \"default\" order is compatible with any other order, all other orders are only compatible with themselves."
+ api_context: BZL
+}
+global {
+ name: "exec_group"
+ callable {
+ param {
+ name: "toolchains"
+ doc: "The set of toolchains this execution group requires. The list can contain String, Label, or StarlarkToolchainTypeApi objects, in any combination."
+ default_value: "[]"
+ }
+ param {
+ name: "exec_compatible_with"
+ doc: "A list of constraints on the execution platform."
+ default_value: "[]"
+ }
}
- field {
- name: "name"
- type: "string"
- doc: "A string identifying the operating system Bazel is running on (the value of the \"os.name\" Java property converted to lower case)."
+ doc: "Creates an execution group which can be used to create actions for a specific execution platform during rule implementation."
+ api_context: BZL
+}
+global {
+ name: "exec_transition"
+ callable {
+ param {
+ name: "implementation"
+ is_mandatory: true
+ }
+ param {
+ name: "inputs"
+ is_mandatory: true
+ }
+ param {
+ name: "outputs"
+ is_mandatory: true
+ }
}
- doc: "Various data about the current platform Bazel is running on."
+ doc: "A specialized version of transition() used to define the exec transition. See its documentation (or its implementation) for best practices. Only usable from the Bazel builtins."
+ api_context: BZL
}
-type {
- name: "repository_rule"
- doc: "A callable value that may be invoked during evaluation of the WORKSPACE file or within the implementation function of a module extension to instantiate and return a repository rule."
+global {
+ name: "experimental_java_library_export_do_not_use"
+ doc: "The type of the Starlark None value."
+ api_context: BZL
}
-type {
- name: "root"
- field {
- name: "path"
- type: "string"
- doc: "Returns the relative path from the exec root to the actual root."
+global {
+ name: "java_common"
+ api_context: BZL
+ global_variable {
+ name: "BootClassPathInfo"
}
- doc: "A root for files. The roots are the directories containing files, and they are mapped together into a single directory tree to form the execution environment."
-}
-type {
- name: "rule"
- doc: "A callable value representing the type of a native or Starlark rule. Calling the value during evaluation of a package\'s BUILD file creates an instance of the rule and adds it to the package\'s target set. For more information, visit this page aboutRules."
-}
-type {
- name: "rule_attributes"
- field {
- name: "attr"
- type: "struct"
- doc: "A struct to access the values of the attributes. The values are provided by the user (if not, a default value is used). The attributes of the struct and the types of their values correspond to the keys and values of the attrs dict provided to the rule function. See example of use."
- }
- field {
- name: "executable"
- type: "struct"
- doc: "A struct containing executable files defined in label type attributes marked as executable=True. The struct fields correspond to the attribute names. Each value in the struct is either a File or None. If an optional attribute is not specified in the rule then the corresponding struct value is None. If a label type is not marked as executable=True, no corresponding struct field is generated. See example of use."
- }
- field {
- name: "file"
- type: "struct"
- doc: "A struct containing files defined in label type attributes marked as allow_single_file. The struct fields correspond to the attribute names. The struct value is always a File or None. If an optional attribute is not specified in the rule then the corresponding struct value is None. If a label type is not marked as allow_single_file, no corresponding struct field is generated. It is a shortcut for:list(ctx.attr.<ATTR>.files)[0]
In other words, use file to access the (singular) default output of a dependency. See example of use."
- }
- field {
- name: "files"
- type: "struct"
- doc: "A struct containing files defined in label or label list type attributes. The struct fields correspond to the attribute names. The struct values are list of Files. It is a shortcut for:[f for t in ctx.attr.<ATTR> for f in t.files]
In other words, use files to access the default outputs of a dependency. See example of use."
- }
- field {
- name: "kind"
- type: "string"
- doc: "The kind of a rule, such as \'cc_library\'"
- }
- doc: "Information about attributes of a rule an aspect is applied to."
-}
-type {
- name: "runfiles"
- field {
- name: "empty_filenames"
- type: "depset"
- doc: "Returns names of empty files to create."
- }
- field {
- name: "files"
- type: "depset"
- doc: "Returns the set of runfiles as files."
- }
- field {
- name: "merge"
- callable {
- param {
- name: "other"
- doc: "The runfiles object to merge into this."
- is_mandatory: true
- }
- return_type: "runfiles"
- }
- doc: "Returns a new runfiles object that includes all the contents of this one and the argument.merge_all() rather than calling merge in a loop. This avoids constructing deep depset structures which can cause build failures."
+ global_variable {
+ name: "JavaPluginInfo"
}
- field {
- name: "merge_all"
- callable {
- param {
- name: "other"
- type: "sequence of runfiless"
- doc: "The sequence of runfiles objects to merge into this."
- is_mandatory: true
- }
- return_type: "runfiles"
- }
- doc: "Returns a new runfiles object that includes all the contents of this one and of the runfiles objects in the argument."
+ global_variable {
+ name: "JavaRuntimeClasspathInfo"
}
- field {
- name: "root_symlinks"
- type: "depset"
- doc: "Returns the set of root symlinks."
+ global_variable {
+ name: "JavaRuntimeInfo"
}
- field {
- name: "symlinks"
- type: "depset"
- doc: "Returns the set of symlinks."
+ global_variable {
+ name: "JavaToolchainInfo"
}
- doc: "A container of information regarding a set of files required at runtime execution. This object should be passed via DefaultInfo in order to tell the build system about the runfiles needed by the outputs produced by the rule. ---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a JSON string from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs, a list of these types or a dictionary with string keys and values of these types. Quotes and new lines in strings are escaped. Examples:struct(key=123).to_json()\n# {\"key\":123}\n\nstruct(key=True).to_json()\n# {\"key\":true}\n\nstruct(key=[1, 2, 3]).to_json()\n# {\"key\":[1,2,3]}\n\nstruct(key=\'text\').to_json()\n# {\"key\":\"text\"}\n\nstruct(key=struct(inner_key=\'text\')).to_json()\n# {\"key\":{\"inner_key\":\"text\"}}\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_json()\n# {\"key\":[{\"inner_key\":1},{\"inner_key\":2}]}\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_json()\n# {\"key\":{\"inner_key\":{\"inner_inner_key\":\"text\"}}}\n.---incompatible_struct_has_no_methods. Use this flag to verify your code is compatible with its imminent removal.
Creates a text message from the struct parameter. This method only works if all struct elements (recursively) are strings, ints, booleans, other structs or dicts or lists of these types. Quotes and new lines in strings are escaped. Struct keys are iterated in the sorted order. Examples:struct(key=123).to_proto()\n# key: 123\n\nstruct(key=True).to_proto()\n# key: true\n\nstruct(key=[1, 2, 3]).to_proto()\n# key: 1\n# key: 2\n# key: 3\n\nstruct(key=\'text\').to_proto()\n# key: \"text\"\n\nstruct(key=struct(inner_key=\'text\')).to_proto()\n# key {\n# inner_key: \"text\"\n# }\n\nstruct(key=[struct(inner_key=1), struct(inner_key=2)]).to_proto()\n# key {\n# inner_key: 1\n# }\n# key {\n# inner_key: 2\n# }\n\nstruct(key=struct(inner_key=struct(inner_inner_key=\'text\'))).to_proto()\n# key {\n# inner_key {\n# inner_inner_key: \"text\"\n# }\n# }\n\nstruct(foo={4: 3, 2: 1}).to_proto()\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\nctx.attr corresponding to dependency attributes (label or label_list). Has the following fields:\n\n
"
-}
-type {
- name: "TemplateDict"
- field {
- name: "add"
- callable {
- param {
- name: "key"
- doc: "A String key"
- is_mandatory: true
- }
- param {
- name: "value"
- doc: "A String value"
- is_mandatory: true
- }
- return_type: "TemplateDict"
- }
- doc: "Add a String value"
+ global_variable {
+ name: "default_javac_opts_depset"
}
- field {
- name: "add_joined"
- callable {
- param {
- name: "key"
- doc: "A String key"
- is_mandatory: true
- }
- param {
- name: "values"
- type: "depset"
- doc: "The depset whose items will be joined."
- is_mandatory: true
- }
- param {
- name: "join_with"
- doc: "A delimiter string used to join together the strings obtained from applying label
\nLabel Target.label
\nThe identifier of the target.files
\ndepset Target.files
\nThe set of Files in the default outputs for this target. Equivalent to target[DefaultInfo].files.aspect_ids
\nlist Target.aspect_ids
\nThe list of aspect_ids applied to this target.Providers
\nThe providers of a rule target can be accessed by type using index notation (target[DefaultInfo]). The presence of providers can be checked using the in operator (SomeInfo in target).
\n
\nIf the rule\'s implementation function returns a struct instead of a list of Provider instances, the struct\'s fields can be accessed via the corresponding fields of the Target (target.some_legacy_info). This behavior is deprecated.map_each, in the same manner as string.join()."
- is_mandatory: true
- }
- param {
- name: "map_each"
- type: "callable"
- doc: "A Starlark function accepting a single argument and returning either a string, None, or a list of strings. This function is applied to each item of the depset specified in the values parameter"
- is_mandatory: true
- }
- param {
- name: "uniquify"
- doc: "If true, duplicate strings derived from values will be omitted. Only the first occurrence of each string will remain. Usually this feature is not needed because depsets already omit duplicates, but it can be useful if map_each emits the same string for multiple items."
- default_value: "False"
- }
- param {
- name: "format_joined"
- type: "string; or None"
- doc: "An optional format string pattern applied to the joined string. The format string must have exactly one \'%s\' placeholder."
- default_value: "None"
- }
- param {
- name: "allow_closure"
- doc: "If true, allows the use of closures in function parameters like map_each. Usually this isn\'t necessary and it risks retaining large analysis-phase data structures into the execution phase."
- default_value: "False"
- }
- return_type: "TemplateDict"
- }
- doc: "Add depset of values"
+ global_variable {
+ name: "make_non_strict"
}
- doc: "An Args-like structure for use in ctx.actions.expand_template(), which allows for deferring evaluation of values till the execution phase."
-}
-type {
- name: "toolchain_type"
- field {
- name: "mandatory"
- type: "bool"
- doc: "Whether the toolchain type is mandatory or optional."
+ global_variable {
+ name: "merge"
}
- field {
- name: "toolchain_type"
- type: "Label"
- doc: "The toolchain type that is required."
+ global_variable {
+ name: "pack_sources"
}
- doc: "A data type describing a dependency on a specific toolchain type."
-}
-type {
- name: "ToolchainContext"
- doc: "Holds toolchains available for a particular exec group. Toolchain targets are accessed by indexing with the toolchain type, as in ctx.toolchains[\"//pkg:my_toolchain_type\"]. If the toolchain was optional and no toolchain was resolved, this will return None."
-}
-type {
- name: "transition"
- doc: "//package:foo depends on //package:bar with a configuration transition, then the configuration of these two targets will differ: //package:bar\'s transition will be determined by that of //package:foo, as subject to the function defined by a transition object."
-}
-type {
- name: "apple_common"
- field {
- name: "AppleDebugOutputs"
- type: "Provider"
- doc: "The constructor/key for the AppleDebugOutputs provider.AppleDebugOutputs provider, use this as the key with which to retrieve it. Example:\ndep = ctx.attr.deps[0]\np = dep[apple_common.AppleDebugOutputs]\n
"
- }
- field {
- name: "AppleDynamicFramework"
- type: "Provider"
- doc: "The constructor/key for the AppleDynamicFramework provider.AppleDynamicFramework provider, use this as the key with which to retrieve it. Example:\ndep = ctx.attr.deps[0]\np = dep[apple_common.AppleDynamicFramework]\n
"
- }
- field {
- name: "AppleExecutableBinary"
- type: "Provider"
- doc: "The constructor/key for the AppleExecutableBinary provider.AppleExecutableBinary provider, use this as the key with which to retrieve it. Example:\ndep = ctx.attr.deps[0]\np = dep[apple_common.AppleExecutableBinary]\n
"
- }
- field {
- name: "Objc"
- type: "Provider"
- doc: "The constructor/key for the Objc provider.Objc provider, use this as the key with which to retrieve it. Example:\ndep = ctx.attr.deps[0]\np = dep[apple_common.Objc]\n
"
+ global_variable {
+ name: "provider"
}
- field {
- name: "XcodeProperties"
- type: "Provider"
- doc: "The constructor/key for the XcodeVersionProperties provider.XcodeVersionProperties provider, use this as the key with which to retrieve it. Example:\ndep = ctx.attr.deps[0]\np = dep[apple_common.XcodeVersionProperties]\n
"
+ global_variable {
+ name: "run_ijar"
}
- field {
- name: "XcodeVersionConfig"
- type: "Provider"
- doc: "The constructor/key for the XcodeVersionConfig provider."
+ global_variable {
+ name: "stamp_jar"
}
- field {
- name: "apple_host_system_env"
+}
+global {
+ name: "json"
+ doc: "Module json is a Starlark module of JSON-related functions."
+ api_context: BZL
+ global_variable {
+ name: "decode"
callable {
param {
- name: "xcode_config"
- doc: "A provider containing information about the xcode configuration."
+ name: "x"
+ doc: "JSON string to decode."
is_mandatory: true
}
- return_type: "dict"
- }
- doc: "Returns a dict of environment variables that should be set for actions that need to run build tools on an Apple host system, such as the version of Xcode that should be used. The keys are variable names and the values are their corresponding values."
- }
- field {
- name: "apple_toolchain"
- callable {
- return_type: "apple_toolchain"
+ param {
+ name: "default"
+ doc: "If specified, the value to return when x cannot be decoded."
+ default_value: "unbound"
+ }
}
- doc: "Utilities for resolving items from the apple toolchain."
+ doc: "The decode function has one required positional parameter: a JSON string.\nIt returns the Starlark value that the string denotes.\n
\nIf \"null\", \"true\" and \"false\" are parsed as None, True, and False.\nx is not a valid JSON encoding and the optional default parameter is specified (including specified as None), this function returns the default value.\nIf x is not a valid JSON encoding and the optional default parameter is not specified, this function fails."
+ api_context: BZL
}
- field {
- name: "dotted_version"
+ global_variable {
+ name: "encode"
callable {
param {
- name: "version"
- doc: "The string representation of the DottedVersion."
+ name: "x"
is_mandatory: true
}
- return_type: "DottedVersion"
}
- doc: "Creates a new DottedVersion instance."
+ doc: "\n
\nAn application-defined type may define its own JSON encoding.\nEncoding any other value yields an error.\n"
+ api_context: BZL
}
- field {
- name: "link_multi_arch_binary"
+ global_variable {
+ name: "encodeIndent"
callable {
param {
- name: "ctx"
- doc: "The Starlark rule context."
+ name: "x"
is_mandatory: true
}
param {
- name: "avoid_deps"
- type: "sequence of Targets; or None"
- doc: "A list of Targets that are in the dependency graph of the binary but whose libraries should not be linked into the binary. This is the case for dependencies that will be found at runtime in another image, such as the bundle loader or any dynamic libraries/frameworks that will be loaded by this binary."
- default_value: "None"
- }
- param {
- name: "extra_linkopts"
- type: "sequence of strings"
- doc: "Extra linkopts to be passed to the linker action."
- default_value: "[]"
- }
- param {
- name: "extra_link_inputs"
- type: "sequence of Files"
- doc: "Extra files to pass to the linker action."
- default_value: "[]"
- }
- param {
- name: "extra_requested_features"
- type: "sequence of strings"
- doc: "Extra requested features to be passed to the linker action."
- default_value: "[]"
- }
- param {
- name: "extra_disabled_features"
- type: "sequence of strings"
- doc: "Extra disabled features to be passed to the linker action."
- default_value: "[]"
+ name: "prefix"
+ default_value: "\'\'"
}
param {
- name: "stamp"
- doc: "Whether to include build information in the linked binary. If 1, build information is always included. If 0, build information is always excluded. If -1 (the default), then the behavior is determined by the --[no]stamp flag. This should be set to 0 when generating the executable output for test rules."
- default_value: "-1"
+ name: "indent"
+ default_value: "\'\\t\'"
}
- return_type: "struct"
}
- doc: "Links a (potentially multi-architecture) binary targeting Apple platforms. This method comprises a bulk of the logic of the Starlark apple_binary rule in the rules_apple domain and exists to aid in the migration of its linking logic to Starlark in rules_apple.\njson.indent(json.encode(x), ...). See indent for description of formatting parameters."
+ api_context: BZL
}
- field {
- name: "link_multi_arch_static_library"
+ global_variable {
+ name: "indent"
callable {
param {
- name: "ctx"
- doc: "The Starlark rule context."
+ name: "s"
is_mandatory: true
}
- return_type: "struct"
- }
- doc: "Links a (potentially multi-architecture) static library targeting Apple platforms. This method comprises a part of the Starlark apple_static_library rule logic, in the rules_apple domain and exists to aid in the migration of its linking logic to Starlark in rules_apple.\nNone"
- doc: "The dylib binary artifact of the dynamic framework."
- default_value: "None"
- }
param {
- name: "cc_info"
- doc: "A CcInfo which contains information about the transitive dependencies linked into the binary."
- default_value: "None"
+ name: "prefix"
+ default_value: "\'\'"
}
param {
- name: "objc"
- doc: "An ObjcProvider which contains information about the transitive dependencies linked into the binary."
- default_value: "None"
+ name: "indent"
+ default_value: "\'\\t\'"
}
- param {
- name: "framework_dirs"
- type: "depset of strings; or None"
- doc: "The framework path names used as link inputs in order to link against the dynamic framework."
- default_value: "None"
- }
- param {
- name: "framework_files"
- type: "depset of Files; or None"
- doc: "The full set of artifacts that should be included as inputs to link against the dynamic framework"
- default_value: "None"
- }
- return_type: "AppleDynamicFramework"
}
- doc: "Creates a new AppleDynamicFramework provider instance."
+ doc: "The indent function returns the indented form of a valid JSON-encoded string.\nEach array element or object field appears on a new line, beginning with the prefix string followed by one or more copies of the indent string, according to its nesting depth.\nThe function accepts one required positional parameter, the JSON string,\nand two optional keyword-only string parameters, prefix and indent,\nthat specify a prefix of each new line, and the unit of indentation.\nIf the input is not valid, the function may fail or return invalid output.\n"
+ api_context: BZL
}
- field {
- name: "new_executable_binary_provider"
- callable {
- param {
- name: "binary"
- type: "File; or None"
- doc: "The binary artifact of the executable."
- default_value: "None"
- }
- param {
- name: "cc_info"
- doc: "A CcInfo which contains information about the transitive dependencies linked into the binary."
- default_value: "None"
- }
- param {
- name: "objc"
- doc: "An ObjcProvider which contains information about the transitive dependencies linked into the binary."
- default_value: "None"
- }
- return_type: "AppleExecutableBinary"
+}
+global {
+ name: "macro"
+ callable {
+ param {
+ name: "implementation"
+ doc: "The Starlark function implementing this macro. The values of the macro\'s attributes are passed to\nthe implementation function as keyword arguments. The implementation function must have at least two\nnamed parameters, name and visibility, and if the macro inherits\nattributes (see inherit_attrs below), it must have a **kwargs residual\nkeyword parameter.\n\n**kwargs.\n\nname (this is referred to as the \"main\" target) or start with name,\nfollowed by a separator chracter (\"_\", \"-\", or \".\") and a\nstring suffix. (Targets violating this naming scheme are allowed to be declared, but cannot be\nbuilt, configured, or depended upon.)\n\nvisibility appropriately\n– typically, by passing visibility = visibility to the rule or macro symbol being\ncalled.\n\n\n
\n"
+ is_mandatory: true
+ }
+ param {
+ name: "attrs"
+ doc: "A dictionary of the attributes this macro supports, analogous to\nrule.attrs. Keys are attribute names, and values are either attribute\nobjects like package(), licenses()\n environment_group()\n native.glob() – instead, you may pass\n a glob into the macro via a label list attribute\n native.subpackages()\n finalizer below)\n native.existing_rules(),\n native.existing_rule()\n WORKSPACE threads)\n workspace(),\n register_toolchains(),\n register_execution_platforms(),\n bind(), repository rule instantiation\nattr.label_list(...) (see the attr\nmodule), or None. A None entry means that the macro does not have an\nattribute by that name, even if it would have otherwise inherited one via inherit_attrs\n(see below).\n\nname attribute is predeclared and must not be included in the\ndictionary. The visibility attribute name is reserved and must not be included in the\ndictionary.\n\n_ are private -- they cannot be passed at the call\nsite of the rule. Such attributes can be assigned a default value (as in\nattr.label(default=\"//pkg:foo\")) to create an implicit dependency on a label.\n\ninherit_attrs is set to the string \"common\", the macro will inherit\ncommon rule attribute definitions\nused by all Starlark rules.\n\nrule() or macro() was not assigned to\na global variable in a .bzl file, then such a value has not been registered as a rule or macro\nsymbol, and therefore cannot be used for inherit_attrs.\n\n\n
\n\nname and visibility attributes are never inherited;\n \"_\") are never inherited;\n attrs dictionary are never\n inherited (the entry in attrs takes precedence; note that an entry may be set to\n None to ensure that no attribute by that name gets defined on the macro);\n attrs dict.\nNone, regardless of what it was specified in the original rule or macro. This\nensures that when the macro forwards the attribute\'s value to an instance of the wrapped rule or\nmacro – such as by passing in the unmodified **kwargs – a value that was\nabsent from the outer macro\'s call will also be absent in the inner rule or macro\'s call (since\npassing None to an attribute is treated the same as omitting the attribute).\nThis is important because omitting an attribute has subtly different semantics from passing\nits apparent default value. In particular, omitted attributes are not shown in some bazel\nquery output formats, and computed defaults only execute when the value is omitted. If the\nmacro needs to examine or modify an inherited attribute – for example, to add a value to an\ninherited tags attribute – you must make sure to handle the None\ncase in the macro\'s implementation function.\n\nnative.cc_library,\nexcept for cxxopts (which is removed from the attribute list) and copts\n(which is given a new definition). It also takes care to checks for the default None\nvalue of the inherited tags attribute before appending an additional tag.\n\n\ndef _my_cc_library_impl(name, visibility, tags, **kwargs):\n # Append a tag; tags attr was inherited from native.cc_library, and\n # therefore is None unless explicitly set by the caller of my_cc_library()\n my_tags = (tags or []) + [\"my_custom_tag\"]\n native.cc_library(\n name = name,\n visibility = visibility,\n tags = my_tags,\n **kwargs\n )\n\nmy_cc_library = macro(\n implementation = _my_cc_library_impl,\n inherit_attrs = native.cc_library,\n attrs = {\n \"cxxopts\": None,\n \"copts\": attr.string_list(default = [\"-D_FOO\"]),\n },\n)\n\n\ninherit_attrs is set, the macro\'s implementation function must have a\n**kwargs residual keyword parameter.\n\n**kwargs. It can be convenient for the implementation function to have explicit\nparameters for some inherited attributes (most commonly, tags and\ntestonly) if the macro needs to pass those attributes to both \"main\" and non-\"main\"\ntargets – but if the macro also needs to examine or manipulate those attributes, you must take\ncare to handle the None default value of non-mandatory inherited attributes.\n"
+ default_value: "None"
+ }
+ param {
+ name: "finalizer"
+ doc: "Whether this macro is a rule finalizer, which is a macro that, regardless of its position in a\nBUILD file, is evaluated at the end of package loading, after all non-finalizer targets\nhave been defined.\n\nnative.existing_rule() and\nnative.existing_rules() to query the\nset of non-finalizer rule targets defined in the current package. Note that\nnative.existing_rule() and native.existing_rules() cannot access the\ntargets defined by any rule finalizer, including this one.\n"
+ default_value: "False"
+ }
+ param {
+ name: "doc"
+ doc: "A description of the macro that can be extracted by documentation generating tools."
+ default_value: "None"
}
- doc: "Creates a new AppleExecutableBinaryInfo provider instance."
}
- field {
- name: "new_objc_provider"
- callable {
- param {
- name: "**kwargs"
- doc: "Dictionary of arguments."
- default_value: "{}"
- is_star_star_arg: true
- }
- return_type: "ObjcProvider"
+ doc: "Defines a symbolic macro, which may be called in BUILD files or macros (legacy or\nsymbolic) to define targets – possibly multiple ones.\n\nmacro(...) must be assigned to a global variable in a .bzl\nfile; the name of the global variable will be the macro symbol\'s name.\n\nmodule_ctx. The function is called once at the beginning of a build to determine the set of available repos."
+ is_mandatory: true
+ }
+ param {
+ name: "tag_classes"
+ doc: "A dictionary to declare all the tag classes used by the extension. It maps from the name of the tag class to a tag_class object."
+ default_value: "{}"
+ }
+ param {
+ name: "doc"
+ doc: "A description of the module extension that can be extracted by documentation generating tools."
+ default_value: "None"
+ }
+ param {
+ name: "environ"
+ doc: "Provides a list of environment variable that this module extension depends on. If an environment variable in that list changes, the extension will be re-evaluated."
+ default_value: "[]"
+ }
+ param {
+ name: "os_dependent"
+ doc: "Indicates whether this extension is OS-dependent or not"
+ default_value: "False"
+ }
+ param {
+ name: "arch_dependent"
+ doc: "Indicates whether this extension is architecture-dependent or not"
+ default_value: "False"
}
- doc: "Creates a new ObjcProvider instance."
}
- field {
+ doc: "Creates a new module extension. Store it in a global value, so that it can be exported and used in a MODULE.bazel file with use_extension."
+ api_context: BZL
+}
+global {
+ name: "native"
+ api_context: BZL
+ global_variable {
+ name: "aar_import"
+ }
+ global_variable {
+ name: "action_listener"
+ }
+ global_variable {
+ name: "alias"
+ }
+ global_variable {
+ name: "android_binary"
+ }
+ global_variable {
+ name: "android_library"
+ }
+ global_variable {
+ name: "android_local_test"
+ }
+ global_variable {
+ name: "android_sdk"
+ }
+ global_variable {
+ name: "android_tools_defaults_jar"
+ }
+ global_variable {
+ name: "available_xcodes"
+ }
+ global_variable {
+ name: "cc_binary"
+ }
+ global_variable {
+ name: "cc_import"
+ }
+ global_variable {
+ name: "cc_libc_top_alias"
+ }
+ global_variable {
+ name: "cc_library"
+ }
+ global_variable {
+ name: "cc_proto_library"
+ }
+ global_variable {
+ name: "cc_shared_library"
+ }
+ global_variable {
+ name: "cc_static_library"
+ }
+ global_variable {
+ name: "cc_test"
+ }
+ global_variable {
+ name: "cc_toolchain"
+ }
+ global_variable {
+ name: "cc_toolchain_alias"
+ }
+ global_variable {
+ name: "cc_toolchain_suite"
+ }
+ global_variable {
+ name: "config_feature_flag"
+ }
+ global_variable {
+ name: "config_setting"
+ }
+ global_variable {
+ name: "constraint_setting"
+ }
+ global_variable {
+ name: "constraint_value"
+ }
+ global_variable {
+ name: "environment"
+ }
+ global_variable {
+ name: "existing_rule"
+ }
+ global_variable {
+ name: "existing_rules"
+ }
+ global_variable {
+ name: "exports_files"
+ }
+ global_variable {
+ name: "extra_action"
+ }
+ global_variable {
+ name: "fdo_prefetch_hints"
+ }
+ global_variable {
+ name: "fdo_profile"
+ }
+ global_variable {
+ name: "filegroup"
+ }
+ global_variable {
+ name: "genquery"
+ }
+ global_variable {
+ name: "genrule"
+ }
+ global_variable {
+ name: "glob"
+ }
+ global_variable {
+ name: "java_binary"
+ }
+ global_variable {
+ name: "java_import"
+ }
+ global_variable {
+ name: "java_library"
+ }
+ global_variable {
+ name: "java_lite_proto_library"
+ }
+ global_variable {
+ name: "java_package_configuration"
+ }
+ global_variable {
+ name: "java_plugin"
+ }
+ global_variable {
+ name: "java_plugins_flag_alias"
+ }
+ global_variable {
+ name: "java_proto_library"
+ }
+ global_variable {
+ name: "java_runtime"
+ }
+ global_variable {
+ name: "java_test"
+ }
+ global_variable {
+ name: "java_toolchain"
+ }
+ global_variable {
+ name: "label_flag"
+ }
+ global_variable {
+ name: "label_setting"
+ }
+ global_variable {
+ name: "memprof_profile"
+ }
+ global_variable {
+ name: "module_name"
+ }
+ global_variable {
+ name: "module_version"
+ }
+ global_variable {
+ name: "objc_import"
+ }
+ global_variable {
+ name: "objc_library"
+ }
+ global_variable {
+ name: "package"
+ }
+ global_variable {
+ name: "package_group"
+ }
+ global_variable {
+ name: "package_name"
+ }
+ global_variable {
+ name: "package_relative_label"
+ }
+ global_variable {
name: "platform"
- type: "struct"
- doc: "An enum-like struct that contains the following fields corresponding to Apple platforms:ios_deviceios_simulatormacostvos_devicetvos_simulatorvisionos_devicevisionos_simulatorwatchos_devicewatchos_simulatoriosmacostvosvisionoswatchos\nctx.fragments.apple.multi_arch_platform(apple_common.platform_type.ios)\n
"
+ global_variable {
+ name: "propeller_optimize"
}
- field {
- name: "target_apple_env"
+ global_variable {
+ name: "proto_lang_toolchain"
+ }
+ global_variable {
+ name: "proto_library"
+ }
+ global_variable {
+ name: "py_binary"
+ }
+ global_variable {
+ name: "py_library"
+ }
+ global_variable {
+ name: "py_runtime"
+ }
+ global_variable {
+ name: "py_test"
+ }
+ global_variable {
+ name: "repo_name"
+ }
+ global_variable {
+ name: "repository_name"
+ }
+ global_variable {
+ name: "sh_binary"
+ }
+ global_variable {
+ name: "sh_library"
+ }
+ global_variable {
+ name: "sh_test"
+ }
+ global_variable {
+ name: "starlark_doc_extract"
+ }
+ global_variable {
+ name: "subpackages"
+ }
+ global_variable {
+ name: "test_suite"
+ }
+ global_variable {
+ name: "toolchain"
+ }
+ global_variable {
+ name: "toolchain_type"
+ }
+ global_variable {
+ name: "xcode_config"
+ }
+ global_variable {
+ name: "xcode_config_alias"
+ }
+ global_variable {
+ name: "xcode_version"
+ }
+}
+global {
+ name: "platform_common"
+ doc: "Functions for Starlark to interact with the platform APIs."
+ api_context: BZL
+ global_variable {
+ name: "getConstraintSettingInfoConstructor"
callable {
- param {
- name: "xcode_config"
- doc: "A provider containing information about the xcode configuration."
- is_mandatory: true
- }
- param {
- name: "platform"
- doc: "The apple platform."
- is_mandatory: true
- }
- return_type: "dict"
}
- doc: "Returns a dict of environment variables that should be set for actions that build targets of the given Apple platform type. For example, this dictionary contains variables that denote the platform name and SDK version with which to build. The keys are variable names and the values are their corresponding values."
+ doc: "The constructor/key for the ConstraintSettingInfo provider.
Note: This API is experimental and may change at any time. It is disabled by default, but may be enabled with --experimental_platforms_api"
+ api_context: BZL
}
- doc: "Functions for Starlark to access internals of the apple rule implementations."
-}
-type {
- name: "attr"
- field {
- name: "bool"
+ global_variable {
+ name: "getConstraintValueInfoConstructor"
callable {
- param {
- name: "default"
- doc: "A default value to use if no value for this attribute is given when instantiating the rule."
- default_value: "False"
- }
- param {
- name: "doc"
- type: "string; or None"
- doc: "A description of the attribute that can be extracted by documentation generating tools."
- default_value: "None"
- }
- param {
- name: "mandatory"
- doc: "If true, the value must be specified explicitly (even if it has a default)."
- default_value: "False"
- }
- return_type: "Attribute"
}
- doc: "Creates a schema for a boolean attribute. The corresponding ctx.attr attribute will be of type bool."
+ doc: "The constructor/key for the ConstraintValueInfo provider.
Note: This API is experimental and may change at any time. It is disabled by default, but may be enabled with --experimental_platforms_api"
+ api_context: BZL
}
- field {
- name: "int"
+ global_variable {
+ name: "getMakeVariableProvider"
callable {
- param {
- name: "default"
- doc: "A default value to use if no value for this attribute is given when instantiating the rule."
- default_value: "0"
- }
- param {
- name: "doc"
- type: "string; or None"
- doc: "A description of the attribute that can be extracted by documentation generating tools."
- default_value: "None"
- }
- param {
- name: "mandatory"
- doc: "If true, the value must be specified explicitly (even if it has a default)."
- default_value: "False"
- }
- param {
- name: "values"
- type: "sequence of ints"
- doc: "The list of allowed values for the attribute. An error is raised if any other value is given."
- default_value: "[]"
- }
- return_type: "Attribute"
}
- doc: "Creates a schema for an integer attribute. The value must be in the signed 32-bit range. The corresponding ctx.attr attribute will be of type int."
+ doc: "The constructor/key for the TemplateVariableInfo provider."
+ api_context: BZL
}
- field {
- name: "int_list"
+ global_variable {
+ name: "getPlatformInfoConstructor"
callable {
- param {
- name: "mandatory"
- doc: "If true, the value must be specified explicitly (even if it has a default)."
- default_value: "False"
- }
- param {
- name: "allow_empty"
- doc: "True if the attribute can be empty."
- default_value: "True"
- }
- param {
- name: "default"
- type: "sequence of ints"
- doc: "A default value to use if no value for this attribute is given when instantiating the rule."
- default_value: "[]"
- }
- param {
- name: "doc"
- type: "string; or None"
- doc: "A description of the attribute that can be extracted by documentation generating tools."
- default_value: "None"
- }
- return_type: "Attribute"
}
- doc: "Creates a schema for a list-of-integers attribute. Each element must be in the signed 32-bit range."
+ doc: "The constructor/key for the PlatformInfo provider.
Note: This API is experimental and may change at any time. It is disabled by default, but may be enabled with --experimental_platforms_api"
+ api_context: BZL
+ }
+ global_variable {
+ name: "getToolchainInfoConstructor"
+ callable {
+ }
+ doc: "The constructor/key for the ToolchainInfo provider."
+ api_context: BZL
}
- field {
- name: "label"
+}
+global {
+ name: "proto"
+ doc: "A module for protocol message processing."
+ api_context: BZL
+ global_variable {
+ name: "encodeText"
callable {
param {
- name: "default"
- type: "Label; or string; or LateBoundDefault; or NativeComputedDefault; or function; or None"
- doc: "A default value to use if no value for this attribute is given when instantiating the rule.Use a string or the Label function to specify a default value, for example, attr.label(default = \"//a:b\")."
- default_value: "None"
- }
- param {
- name: "doc"
- type: "string; or None"
- doc: "A description of the attribute that can be extracted by documentation generating tools."
- default_value: "None"
- }
- param {
- name: "executable"
- doc: "True if the dependency has to be executable. This means the label must refer to an executable file, or to a rule that outputs an executable file. Access the label with ctx.executable.<attribute_name>."
- default_value: "False"
- }
- param {
- name: "allow_files"
- type: "bool; or sequence of strings; or None"
- doc: "Whether File targets are allowed. Can be True, False (default), or a list of file extensions that are allowed (for example, [\".cc\", \".cpp\"])."
- default_value: "None"
- }
- param {
- name: "allow_single_file"
- doc: "This is similar to allow_files, with the restriction that the label must correspond to a single File. Access it through ctx.file.<attribute_name>."
- default_value: "None"
- }
- param {
- name: "mandatory"
- doc: "If true, the value must be specified explicitly (even if it has a default)."
- default_value: "False"
- }
- param {
- name: "providers"
- doc: "The providers that must be given by any dependency appearing in this attribute.*Info objects returned by provider() (or in the case of a legacy provider, its string name). The dependency must return ALL providers mentioned in at least ONE of the inner lists. As a convenience, this argument may also be a single-level list of providers, in which case it is wrapped in an outer list with one element. It is NOT required that the rule of the dependency advertises those providers in its provides parameter, however, it is considered best practice."
- default_value: "[]"
- }
- param {
- name: "allow_rules"
- type: "sequence of strings; or None"
- doc: "Which rule targets (name of the classes) are allowed. This is deprecated (kept only for compatibility), use providers instead."
- default_value: "None"
- }
- param {
- name: "cfg"
- doc: "Configuration of the attribute. It can be either \"exec\", which indicates that the dependency is built for the execution platform, or \"target\", which indicates that the dependency is build for the target platform. A typical example of the difference is when building mobile apps, where the target platform is Android or iOS while the execution platform is Linux, macOS, or Windows. This parameter is required if executable is True to guard against accidentally building host tools in the target configuration. \"target\" has no semantic effect, so don\'t set it when executable is False unless it really helps clarify your intentions."
- default_value: "None"
- }
- param {
- name: "aspects"
- type: "sequence of Aspects"
- doc: "Aspects that should be applied to the dependency or dependencies specified by this attribute."
- default_value: "[]"
+ name: "x"
+ is_mandatory: true
}
- return_type: "Attribute"
}
- doc: "Label values. If a string is supplied in place of a Label, it will be converted using the label constructor. The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target\'s package.ctx.attr, labels are replaced by the corresponding Targets. This allows you to access the providers of the current target\'s dependencies.default value of this attribute. If you also want to prevent users from overriding this default, you can make the attribute private by giving it a name that starts with an underscore. See the Rules page for more information."
+ doc: "Returns the struct argument\'s encoding as a text-format protocol message.\nThe data structure must be recursively composed of strings, ints, floats, or bools, or structs, sequences, and dicts of these types.\nproto.encode_text(struct(field=123))\n# field: 123\n\nproto.encode_text(struct(field=True))\n# field: true\n\nproto.encode_text(struct(field=[1, 2, 3]))\n# field: 1\n# field: 2\n# field: 3\n\nproto.encode_text(struct(field=\'text\', ignored_field=None))\n# field: \"text\"\n\nproto.encode_text(struct(field=struct(inner_field=\'text\', ignored_field=None)))\n# field {\n# inner_field: \"text\"\n# }\n\nproto.encode_text(struct(field=[struct(inner_field=1), struct(inner_field=2)]))\n# field {\n# inner_field: 1\n# }\n# field {\n# inner_field: 2\n# }\n\nproto.encode_text(struct(field=struct(inner_field=struct(inner_inner_field=\'text\'))))\n# field {\n# inner_field {\n# inner_inner_field: \"text\"\n# }\n# }\n\nproto.encode_text(struct(foo={4: 3, 2: 1}))\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\n"
+ api_context: BZL
}
- field {
- name: "label_keyed_string_dict"
- callable {
- param {
- name: "allow_empty"
- doc: "True if the attribute can be empty."
- default_value: "True"
- }
- param {
- name: "default"
- type: "dict; or function"
- doc: "A default value to use if no value for this attribute is given when instantiating the rule.Use strings or the Label function to specify default values, for example, attr.label_keyed_string_dict(default = {\"//a:b\": \"value\", \"//a:c\": \"string\"})."
- default_value: "{}"
- }
- param {
- name: "doc"
- type: "string; or None"
- doc: "A description of the attribute that can be extracted by documentation generating tools."
- default_value: "None"
- }
- param {
- name: "allow_files"
- type: "bool; or sequence of strings; or None"
- doc: "Whether File targets are allowed. Can be True, False (default), or a list of file extensions that are allowed (for example, [\".cc\", \".cpp\"])."
- default_value: "None"
- }
- param {
- name: "allow_rules"
- type: "sequence of strings; or None"
- doc: "Which rule targets (name of the classes) are allowed. This is deprecated (kept only for compatibility), use providers instead."
- default_value: "None"
- }
- param {
- name: "providers"
- doc: "The providers that must be given by any dependency appearing in this attribute.*Info objects returned by provider() (or in the case of a legacy provider, its string name). The dependency must return ALL providers mentioned in at least ONE of the inner lists. As a convenience, this argument may also be a single-level list of providers, in which case it is wrapped in an outer list with one element. It is NOT required that the rule of the dependency advertises those providers in its provides parameter, however, it is considered best practice."
- default_value: "[]"
- }
- param {
- name: "flags"
- type: "sequence of strings"
- doc: "Deprecated, will be removed."
- default_value: "[]"
- }
- param {
- name: "mandatory"
- doc: "If true, the value must be specified explicitly (even if it has a default)."
- default_value: "False"
- }
- param {
- name: "cfg"
- doc: "Configuration of the attribute. It can be either \"exec\", which indicates that the dependency is built for the execution platform, or \"target\", which indicates that the dependency is build for the target platform. A typical example of the difference is when building mobile apps, where the target platform is Android or iOS while the execution platform is Linux, macOS, or Windows."
- default_value: "None"
- }
- param {
- name: "aspects"
- type: "sequence of Aspects"
- doc: "Aspects that should be applied to the dependency or dependencies specified by this attribute."
- default_value: "[]"
- }
- return_type: "Attribute"
- }
- doc: "Label values. If a string is supplied in place of a Label, it will be converted using the label constructor. The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target\'s package.ctx.attr, labels are replaced by the corresponding Targets. This allows you to access the providers of the current target\'s dependencies."
+}
+global {
+ name: "proto_common_do_not_use"
+ api_context: BZL
+ global_variable {
+ name: "INCOMPATIBLE_ENABLE_PROTO_TOOLCHAIN_RESOLUTION"
}
- field {
- name: "label_list"
- callable {
- param {
- name: "allow_empty"
- doc: "True if the attribute can be empty."
- default_value: "True"
- }
- param {
- name: "default"
- type: "sequence of Labels; or function"
- doc: "A default value to use if no value for this attribute is given when instantiating the rule.Use strings or the Label function to specify default values, for example, attr.label_list(default = [\"//a:b\", \"//a:c\"])."
- default_value: "[]"
- }
- param {
- name: "doc"
- type: "string; or None"
- doc: "A description of the attribute that can be extracted by documentation generating tools."
- default_value: "None"
- }
- param {
- name: "allow_files"
- type: "bool; or sequence of strings; or None"
- doc: "Whether File targets are allowed. Can be True, False (default), or a list of file extensions that are allowed (for example, [\".cc\", \".cpp\"])."
- default_value: "None"
- }
- param {
- name: "allow_rules"
- type: "sequence of strings; or None"
- doc: "Which rule targets (name of the classes) are allowed. This is deprecated (kept only for compatibility), use providers instead."
- default_value: "None"
- }
- param {
- name: "providers"
- doc: "The providers that must be given by any dependency appearing in this attribute.*Info objects returned by provider() (or in the case of a legacy provider, its string name). The dependency must return ALL providers mentioned in at least ONE of the inner lists. As a convenience, this argument may also be a single-level list of providers, in which case it is wrapped in an outer list with one element. It is NOT required that the rule of the dependency advertises those providers in its provides parameter, however, it is considered best practice."
- default_value: "[]"
- }
- param {
- name: "flags"
- type: "sequence of strings"
- doc: "Deprecated, will be removed."
- default_value: "[]"
- }
- param {
- name: "mandatory"
- doc: "If true, the value must be specified explicitly (even if it has a default)."
- default_value: "False"
- }
- param {
- name: "cfg"
- doc: "Configuration of the attribute. It can be either \"exec\", which indicates that the dependency is built for the execution platform, or \"target\", which indicates that the dependency is build for the target platform. A typical example of the difference is when building mobile apps, where the target platform is Android or iOS while the execution platform is Linux, macOS, or Windows."
- default_value: "None"
- }
- param {
- name: "aspects"
- type: "sequence of Aspects"
- doc: "Aspects that should be applied to the dependency or dependencies specified by this attribute."
- default_value: "[]"
- }
- return_type: "Attribute"
+}
+global {
+ name: "provider"
+ callable {
+ param {
+ name: "doc"
+ doc: "A description of the provider that can be extracted by documentation generating tools."
+ default_value: "None"
}
- doc: "ctx.attr attribute will be of type list of Targets.Label values. If a string is supplied in place of a Label, it will be converted using the label constructor. The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target\'s package.ctx.attr, labels are replaced by the corresponding Targets. This allows you to access the providers of the current target\'s dependencies."
- }
- field {
- name: "output"
- callable {
- param {
- name: "doc"
- type: "string; or None"
- doc: "A description of the attribute that can be extracted by documentation generating tools."
- default_value: "None"
- }
- param {
- name: "mandatory"
- doc: "If true, the value must be specified explicitly (even if it has a default)."
- default_value: "False"
- }
- return_type: "Attribute"
+ param {
+ name: "fields"
+ doc: "If specified, restricts the set of allowed fields.
Possible values are:
All fields are optional."
+ default_value: "None"
}
- doc: "
provider(fields = [\'a\', \'b\'])
provider(\n fields = { \'a\' : \'Documentation for a\', \'b\' : \'Documentation for b\' })Label values. If a string is supplied in place of a Label, it will be converted using the label constructor. The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target\'s package.File can be retrieved using ctx.outputs."
- }
- field {
- name: "output_list"
- callable {
- param {
- name: "allow_empty"
- doc: "True if the attribute can be empty."
- default_value: "True"
- }
- param {
- name: "doc"
- type: "string; or None"
- doc: "A description of the attribute that can be extracted by documentation generating tools."
- default_value: "None"
- }
- param {
- name: "mandatory"
- doc: "If true, the value must be specified explicitly (even if it has a default)."
- default_value: "False"
- }
- return_type: "Attribute"
+ param {
+ name: "init"
+ doc: "An optional callback for preprocessing and validating the provider\'s field values during instantiation. If init is specified, provider() returns a tuple of 2 elements: the normal provider symbol and a raw constructor.P be the provider symbol created by calling provider(). Conceptually, an instance of P is generated by calling a default constructor function c(*args, **kwargs), which does the following:
In the case where an args is non-empty, an error occurs.fields parameter was specified when provider() was called, and if kwargs contains any key that was not listed in fields, an error occurs.c returns a new instance that has, for each k: v entry in kwargs, a field named k with value v.init callback is not given, a call to the symbol P itself acts as a call to the default constructor function c; in other words, P(*args, **kwargs) returns c(*args, **kwargs). For example,MyInfo = provider()\nm = MyInfo(foo = 1)
will straightforwardly make it so that m is a MyInfo instance with m.foo == 1.init is specified, the call P(*args, **kwargs) will perform the following steps instead:init(*args, **kwargs), that is, with the exact same positional and keyword arguments as were passed to P.init is expected to be a dictionary, d, whose keys are field name strings. If it is not, an error occurs.P is generated as if by calling the default constructor with d\'s entries as keyword arguments, as in c(**d).*args or **kwargs does not match init\'s signature, or the evaluation of init\'s body fails (perhaps intentionally via a call to fail()), or if the return value of init is not a dictionary with the expected schema.init callback generalizes normal provider construction by allowing positional arguments and arbitrary logic for preprocessing and validation. It does not enable circumventing the list of allowed fields.init is specified, the return value of provider() becomes a tuple (P, r), where r is the raw constructor. In fact, the behavior of r is exactly that of the default constructor function c discussed above. Typically, r is bound to a variable whose name is prefixed with an underscore, so that only the current .bzl file has direct access to it:MyInfo, _new_myinfo = provider(init = ...)
"
+ default_value: "None"
}
- doc: "Creates a schema for a list-of-outputs attribute.Label values. If a string is supplied in place of a Label, it will be converted using the label constructor. The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target\'s package.File can be retrieved using ctx.outputs."
}
- field {
- name: "string"
- callable {
- param {
- name: "default"
- type: "string; or NativeComputedDefault"
- doc: "A default value to use if no value for this attribute is given when instantiating the rule."
- default_value: "\'\'"
- }
- param {
- name: "doc"
- type: "string; or None"
- doc: "A description of the attribute that can be extracted by documentation generating tools."
- default_value: "None"
- }
- param {
- name: "mandatory"
- doc: "If true, the value must be specified explicitly (even if it has a default)."
- default_value: "False"
- }
- param {
- name: "values"
- type: "sequence of strings"
- doc: "The list of allowed values for the attribute. An error is raised if any other value is given."
- default_value: "[]"
- }
- return_type: "Attribute"
- }
- doc: "Creates a schema for a string attribute."
+ doc: "Defines a provider symbol. The resulting value of this function must be stored in a global value to be usable in a rule or aspect implementation. Providers can be instantiated by calling the resulting value as a function, or used directly as an index key for retrieving an instance of that provider from a target. Example:MyInfo = provider()\n...\ndef _my_library_impl(ctx):\n ...\n my_info = MyInfo(x = 2, y = 3)\n # my_info.x == 2\n # my_info.y == 3\n ...
Provider callable value if init is not specified.init is specified, returns a tuple of 2 elements: a Provider callable value and a raw constructor callable value. See Rules (Custom initialization of custom providers) and the discussion of the init parameter below for details."
+ api_context: BZL
+}
+global {
+ name: "py_internal"
+ api_context: BZL
+ global_variable {
+ name: "CcLauncherInfo"
}
- field {
- name: "string_dict"
- callable {
- param {
- name: "allow_empty"
- doc: "True if the attribute can be empty."
- default_value: "True"
- }
- param {
- name: "default"
- doc: "A default value to use if no value for this attribute is given when instantiating the rule."
- default_value: "{}"
- }
- param {
- name: "doc"
- type: "string; or None"
- doc: "A description of the attribute that can be extracted by documentation generating tools."
- default_value: "None"
- }
- param {
- name: "mandatory"
- doc: "If true, the value must be specified explicitly (even if it has a default)."
- default_value: "False"
- }
- return_type: "Attribute"
- }
- doc: "Creates a schema for an attribute holding a dictionary, where the keys and values are strings."
+ global_variable {
+ name: "PackageSpecificationInfo"
}
- field {
- name: "string_list"
- callable {
- param {
- name: "mandatory"
- doc: "If true, the value must be specified explicitly (even if it has a default)."
- default_value: "False"
- }
- param {
- name: "allow_empty"
- doc: "True if the attribute can be empty."
- default_value: "True"
- }
- param {
- name: "default"
- type: "sequence of strings; or NativeComputedDefault"
- doc: "A default value to use if no value for this attribute is given when instantiating the rule."
- default_value: "[]"
- }
- param {
- name: "doc"
- type: "string; or None"
- doc: "A description of the attribute that can be extracted by documentation generating tools."
- default_value: "None"
- }
- return_type: "Attribute"
- }
- doc: "Creates a schema for a list-of-strings attribute."
+ global_variable {
+ name: "add_py_extra_pseudo_action"
}
- field {
- name: "string_list_dict"
- callable {
- param {
- name: "allow_empty"
- doc: "True if the attribute can be empty."
- default_value: "True"
- }
- param {
- name: "default"
- doc: "A default value to use if no value for this attribute is given when instantiating the rule."
- default_value: "{}"
- }
- param {
- name: "doc"
- type: "string; or None"
- doc: "A description of the attribute that can be extracted by documentation generating tools."
- default_value: "None"
- }
- param {
- name: "mandatory"
- doc: "If true, the value must be specified explicitly (even if it has a default)."
- default_value: "False"
- }
- return_type: "Attribute"
- }
- doc: "Creates a schema for an attribute holding a dictionary, where the keys are strings and the values are lists of strings."
+ global_variable {
+ name: "are_action_listeners_enabled"
}
- doc: "This is a top-level module for defining the attribute schemas of a rule or aspect. Each function returns an object representing the schema of a single attribute. These objects are used as the values of the attrs dictionary argument of rule() and aspect().None"
- doc: "The rule context."
- default_value: "None"
- }
- param {
- name: "cc_toolchain"
- doc: "cc_toolchain for which we configure features."
- is_mandatory: true
- }
- param {
- name: "language"
- type: "string; or None"
- doc: "The language to configure for: either c++ or objc (default c++)"
- default_value: "None"
- }
- param {
- name: "requested_features"
- doc: "List of features to be enabled."
- default_value: "[]"
- }
- param {
- name: "unsupported_features"
- doc: "List of features that are unsupported by the current rule."
- default_value: "[]"
- }
- return_type: "FeatureConfiguration"
- }
- doc: "Creates a feature_configuration instance. Requires the cpp configuration fragment."
+ global_variable {
+ name: "cc_launcher_info_cc_info"
}
- field {
- name: "create_cc_toolchain_config_info"
- callable {
- param {
- name: "ctx"
- doc: "The rule context."
- is_mandatory: true
- }
- param {
- name: "features"
- doc: "Contains all flag specifications for one feature.name: The feature\'s name. It is possible to introduce a feature without a change to Bazel by adding a \'feature\' section to the toolchain and adding the corresponding string as feature in the BUILD file.enabled: If \'True\', this feature is enabled unless a rule type explicitly marks it as unsupported.flag_sets: A FlagSet list. If the given feature is enabled, the flag sets will be applied for the actions are specified for. env_sets: an EnvSet list. If the given feature is enabled, the env sets will be applied for the actions they are specified for. requires: A list of feature sets defining when this feature is supported by the toolchain. The feature is supported if any of the feature sets fully apply, that is, when all features of a feature set are enabled. If requires is omitted, the feature is supported independently of which other features are enabled. Use this for example to filter flags depending on the build mode enabled (opt / fastbuild / dbg). implies: A string list of features or action configs that are automatically enabled when this feature is enabled. If any of the implied features or action configs cannot be enabled, this feature will (silently) not be enabled either. provides: A list of names this feature conflicts with. provides contains the name of a different feature or action config that we want to enable.- provides contains the same value as a \'provides\' in a different feature or action config that we want to enable. Use this in order to ensure that incompatible features cannot be accidentally activated at the same time, leading to hard to diagnose compiler errors."
- default_value: "[]"
- }
- param {
- name: "action_configs"
- doc: "An action config corresponds to a Bazel action, and allows selection of a tool based on activated features. Action config activation occurs by the same semantics as features: a feature can \'require\' or \'imply\' an action config in the same way that it would another feature.action_name: The name of the Bazel action that this config applies to, e.g. \'c-compile\' or \'c-module-compile\'.enabled: If \'True\', this action is enabled unless a rule type explicitly marks it as unsupported.tools: The tool applied to the action will be the first tool with a feature set that matches the feature configuration. An error will be thrown if no tool matches a provided feature configuration - for that reason, it\'s a good idea to provide a default tool with an empty feature set.flag_sets: If the given action config is enabled, the flag sets will be applied to the corresponding action.implies: A list of features or action configs that are automatically enabled when this action config is enabled. If any of the implied features or action configs cannot be enabled, this action config will (silently) not be enabled either.category_name: The category of artifacts that this selection applies to. This field is compared against a list of categories defined in Bazel. Example categories include \"linked_output\" or the artifact for this selection. Together with the extension it is used to create an artifact name based on the target name.extension: The extension for creating the artifact for this selection. Together with the prefix it is used to create an artifact name based on the target name.None"
- doc: "Ignored."
- default_value: "None"
- }
- param {
- name: "target_system_name"
- doc: "The GNU System Name."
- is_mandatory: true
- }
- param {
- name: "target_cpu"
- doc: "The target architecture string."
- is_mandatory: true
- }
- param {
- name: "target_libc"
- doc: "The libc version string (e.g. \"glibc-2.2.2\")."
- is_mandatory: true
- }
- param {
- name: "compiler"
- doc: "The compiler version string (e.g. \"gcc-4.1.1\")."
- is_mandatory: true
- }
- param {
- name: "abi_version"
- type: "string; or None"
- doc: "The abi in use, which is a gcc version. E.g.: \"gcc-3.4\""
- default_value: "None"
- }
- param {
- name: "abi_libc_version"
- type: "string; or None"
- doc: "The glibc version used by the abi we\'re using."
- default_value: "None"
- }
- param {
- name: "tool_paths"
- doc: "Tool locations.name: Name of the tool.path: Location of the tool; Can be absolute path (in case of non hermetic toolchain), or path relative to the cc_toolchain\'s package.None"
- doc: "The built-in sysroot. If this attribute is not present, Bazel does not allow using a different sysroot, i.e. through the --grte_top option."
- default_value: "None"
- }
- param {
- name: "cc_target_os"
- type: "string; or None"
- doc: "Internal purpose only, do not use."
- default_value: "None"
- }
- return_type: "CcToolchainConfigInfo"
- }
- doc: "Creates a CcToolchainConfigInfo provider"
+ global_variable {
+ name: "cc_semantics_get_cc_runtimes"
}
- field {
- name: "create_compilation_context"
- callable {
- param {
- name: "headers"
- doc: "Set of headers needed to compile this target"
- default_value: "unbound"
- }
- param {
- name: "system_includes"
- doc: "Set of search paths for header files referenced by angle brackets, i.e. #include <foo/bar/header.h>. They can be either relative to the exec root or absolute. Usually passed with -isystem"
- default_value: "unbound"
- }
- param {
- name: "includes"
- doc: "Set of search paths for header files referenced both by angle bracket and quotes.Usually passed with -I"
- default_value: "unbound"
- }
- param {
- name: "quote_includes"
- doc: "Set of search paths for header files referenced by quotes, i.e. #include \"foo/bar/header.h\". They can be either relative to the exec root or absolute. Usually passed with -iquote"
- default_value: "unbound"
- }
- param {
- name: "framework_includes"
- doc: "Set of framework search paths for header files (Apple platform only)"
- default_value: "unbound"
- }
- param {
- name: "defines"
- doc: "Set of defines needed to compile this target. Each define is a string. Propagated transitively to dependents."
- default_value: "unbound"
- }
- param {
- name: "local_defines"
- doc: "Set of defines needed to compile this target. Each define is a string. Not propagated transitively to dependents."
- default_value: "unbound"
- }
- return_type: "CompilationContext"
- }
- doc: "Creates a CompilationContext."
+ global_variable {
+ name: "cc_semantics_get_runtimes_toolchain"
}
- field {
- name: "create_compilation_outputs"
- callable {
- param {
- name: "objects"
- type: "depset; or None"
- doc: "List of object files."
- default_value: "None"
- }
- param {
- name: "pic_objects"
- type: "depset; or None"
- doc: "List of pic object files."
- default_value: "None"
- }
- return_type: "CcCompilationOutputs"
- }
- doc: "Create compilation outputs object."
+ global_variable {
+ name: "cc_semantics_get_stl"
}
- field {
- name: "create_compile_variables"
- callable {
- param {
- name: "cc_toolchain"
- doc: "cc_toolchain for which we are creating build variables."
- is_mandatory: true
- }
- param {
- name: "feature_configuration"
- doc: "Feature configuration to be queried."
- is_mandatory: true
- }
- param {
- name: "source_file"
- doc: "Optional source file for the compilation. Please prefer passing source_file here over appending it to the end of the command line generated from cc_common.get_memory_inefficient_command_line, as then it\'s in the power of the toolchain author to properly specify and position compiler flags."
- default_value: "None"
- }
- param {
- name: "output_file"
- doc: "Optional output file of the compilation. Please prefer passing output_file here over appending it to the end of the command line generated from cc_common.get_memory_inefficient_command_line, as then it\'s in the power of the toolchain author to properly specify and position compiler flags."
- default_value: "None"
- }
- param {
- name: "user_compile_flags"
- type: "sequence of strings; or None"
- doc: "List of additional compilation flags (copts)."
- default_value: "None"
- }
- param {
- name: "include_directories"
- type: "depset; or None"
- doc: "Depset of include directories."
- default_value: "None"
- }
- param {
- name: "quote_include_directories"
- type: "depset; or None"
- doc: "Depset of quote include directories."
- default_value: "None"
- }
- param {
- name: "system_include_directories"
- type: "depset; or None"
- doc: "Depset of system include directories."
- default_value: "None"
- }
- param {
- name: "framework_include_directories"
- type: "depset; or None"
- doc: "Depset of framework include directories."
- default_value: "None"
- }
- param {
- name: "preprocessor_defines"
- type: "depset; or None"
- doc: "Depset of preprocessor defines."
- default_value: "None"
- }
- param {
- name: "thinlto_index"
- type: "string; or None"
- doc: "LTO index file path."
- default_value: "None"
- }
- param {
- name: "thinlto_input_bitcode_file"
- type: "string; or None"
- doc: "Bitcode file that is input to LTO backend."
- default_value: "None"
- }
- param {
- name: "thinlto_output_object_file"
- type: "string; or None"
- doc: "Object file that is output by LTO backend."
- default_value: "None"
- }
- param {
- name: "use_pic"
- doc: "When true the compilation will generate position independent code."
- default_value: "False"
- }
- param {
- name: "add_legacy_cxx_options"
- doc: "Unused."
- default_value: "False"
- }
- param {
- name: "variables_extension"
- type: "dict"
- doc: "A dictionary of additional variables used by compile actions."
- default_value: "unbound"
- }
- return_type: "Variables"
- }
- doc: "Returns variables used for compilation actions."
+ global_variable {
+ name: "cc_toolchain_build_info_files"
}
- field {
- name: "create_library_to_link"
- callable {
- param {
- name: "actions"
- doc: "actions object."
- is_mandatory: true
- }
- param {
- name: "feature_configuration"
- doc: "feature_configuration to be queried."
- default_value: "None"
- }
- param {
- name: "cc_toolchain"
- doc: "CcToolchainInfo provider to be used."
- default_value: "None"
- }
- param {
- name: "static_library"
- type: "File; or None"
- doc: "File of static library to be linked."
- default_value: "None"
- }
- param {
- name: "pic_static_library"
- type: "File; or None"
- doc: "File of pic static library to be linked."
- default_value: "None"
- }
- param {
- name: "dynamic_library"
- type: "File; or None"
- doc: "File of dynamic library to be linked. Always used for runtime and used for linking if interface_library is not passed."
- default_value: "None"
- }
- param {
- name: "interface_library"
- type: "File; or None"
- doc: "File of interface library to be linked."
- default_value: "None"
- }
- param {
- name: "pic_objects"
- type: "sequence of Files"
- doc: "Experimental, do not use"
- default_value: "unbound"
- }
- param {
- name: "objects"
- type: "sequence of Files"
- doc: "Experimental, do not use"
- default_value: "unbound"
- }
- param {
- name: "alwayslink"
- doc: "Whether to link the static library/objects in the --whole_archive block."
- default_value: "False"
- }
- param {
- name: "dynamic_library_symlink_path"
- type: "string"
- doc: "Override the default path of the dynamic library link in the solib directory. Empty string to use the default."
- default_value: "\'\'"
- }
- param {
- name: "interface_library_symlink_path"
- doc: "Override the default path of the interface library link in the solib directory. Empty string to use the default."
- default_value: "\'\'"
- }
- return_type: "LibraryToLink"
- }
- doc: "Creates LibraryToLink"
+ global_variable {
+ name: "cc_toolchain_strip_files"
}
- field {
- name: "create_link_variables"
- callable {
- param {
- name: "cc_toolchain"
- doc: "cc_toolchain for which we are creating build variables."
- is_mandatory: true
- }
- param {
- name: "feature_configuration"
- doc: "Feature configuration to be queried."
- is_mandatory: true
- }
- param {
- name: "library_search_directories"
- type: "None; or depset"
- doc: "Depset of directories where linker will look for libraries at link time."
- default_value: "None"
- }
- param {
- name: "runtime_library_search_directories"
- type: "None; or depset"
- doc: "Depset of directories where loader will look for libraries at runtime."
- default_value: "None"
- }
- param {
- name: "user_link_flags"
- type: "None; or sequence"
- doc: "List of additional link flags (linkopts)."
- default_value: "None"
- }
- param {
- name: "output_file"
- doc: "Optional output file path."
- default_value: "None"
- }
- param {
- name: "param_file"
- doc: "Optional param file path."
- default_value: "None"
- }
- param {
- name: "def_file"
- doc: "Optional .def file path."
- default_value: "None"
- }
- param {
- name: "is_using_linker"
- doc: "True when using linker, False when archiver. Caller is responsible for keeping this in sync with action name used (is_using_linker = True for linking executable or dynamic library, is_using_linker = False for archiving static library)."
- default_value: "True"
- }
- param {
- name: "is_linking_dynamic_library"
- doc: "True when creating dynamic library, False when executable or static library. Caller is responsible for keeping this in sync with action name used. This field will be removed once b/65151735 is fixed."
- default_value: "False"
- }
- param {
- name: "must_keep_debug"
- doc: "When set to False, bazel will expose \'strip_debug_symbols\' variable, which is usually used to use the linker to strip debug symbols from the output file."
- default_value: "True"
- }
- param {
- name: "use_test_only_flags"
- doc: "When set to true, \'is_cc_test\' variable will be set."
- default_value: "False"
- }
- param {
- name: "is_static_linking_mode"
- doc: "Unused."
- default_value: "True"
- }
- return_type: "Variables"
- }
- doc: "Returns link variables used for linking actions."
+ global_variable {
+ name: "compilation_outputs"
}
- field {
- name: "create_linker_input"
- callable {
- param {
- name: "owner"
- doc: "The label of the target that produced all files used in this input."
- is_mandatory: true
- }
- param {
- name: "libraries"
- type: "None; or depset"
- doc: "List of LibraryToLink."
- default_value: "None"
- }
- param {
- name: "user_link_flags"
- type: "None; or depset of strings; or sequence of strings"
- doc: "User link flags passed as strings. Accepts either [String], [[String]] or depset(String). The latter is discouraged as it\'s only kept for compatibility purposes, the depset is flattened. If you want to propagate user_link_flags via unflattened depsets() wrap them in a LinkerInput so that they are not flattened till the end."
- default_value: "None"
- }
- param {
- name: "additional_inputs"
- type: "None; or depset"
- doc: "For additional inputs to the linking action, e.g.: linking scripts."
- default_value: "None"
- }
- return_type: "LinkerInput"
+ global_variable {
+ name: "compilation_outputs_gcno_files"
+ }
+ global_variable {
+ name: "compilation_outputs_pic_gcno_files"
+ }
+ global_variable {
+ name: "compile"
+ }
+ global_variable {
+ name: "copy_without_caching"
+ }
+ global_variable {
+ name: "create_linking_context_from_compilation_outputs"
+ }
+ global_variable {
+ name: "create_repo_mapping_manifest"
+ }
+ global_variable {
+ name: "create_sources_only_manifest"
+ }
+ global_variable {
+ name: "declare_constant_metadata_file"
+ }
+ global_variable {
+ name: "declare_shareable_artifact"
+ }
+ global_variable {
+ name: "expand_location_and_make_variables"
+ }
+ global_variable {
+ name: "extra_libraries_build_libraries"
+ }
+ global_variable {
+ name: "get_current_os_name"
+ }
+ global_variable {
+ name: "get_label_repo_runfiles_path"
+ }
+ global_variable {
+ name: "get_legacy_external_runfiles"
+ }
+ global_variable {
+ name: "get_rule_name"
+ }
+ global_variable {
+ name: "is_available_for"
+ }
+ global_variable {
+ name: "is_bzlmod_enabled"
+ }
+ global_variable {
+ name: "is_singleton_depset"
+ }
+ global_variable {
+ name: "is_tool_configuration"
+ }
+ global_variable {
+ name: "link"
+ }
+ global_variable {
+ name: "linking_context_extra_link_time_libraries"
+ }
+ global_variable {
+ name: "linking_context_linkstamps"
+ }
+ global_variable {
+ name: "linkstamp_file"
+ }
+ global_variable {
+ name: "make_runfiles_respect_legacy_external_runfiles"
+ }
+ global_variable {
+ name: "merge_debug_context"
+ }
+ global_variable {
+ name: "merge_linking_contexts"
+ }
+ global_variable {
+ name: "merge_runfiles_with_generated_inits_empty_files_supplier"
+ }
+ global_variable {
+ name: "regex_match"
+ }
+ global_variable {
+ name: "runfiles_enabled"
+ }
+ global_variable {
+ name: "share_native_deps"
+ }
+ global_variable {
+ name: "stamp_binaries"
+ }
+ global_variable {
+ name: "strip_opts"
+ }
+}
+global {
+ name: "repository_rule"
+ callable {
+ param {
+ name: "implementation"
+ doc: "the function that implements this rule. Must have a single parameter, repository_ctx. The function is called during the loading phase for each instance of the rule."
+ is_mandatory: true
+ }
+ param {
+ name: "attrs"
+ doc: "A dictionary to declare all the attributes of the repository rule. It maps from an attribute name to an attribute object (see\nattr module). Attributes starting with _ are private, and can be used to add an implicit dependency on a label to a file (a repository rule cannot depend on a generated artifact). The attribute name is implicitly added and must not be specified.\nNone to the default value.repository_ctx.getenv instead.
Provides a list of environment variable that this repository rule depends on. If an environment variable in that list change, the repository will be refetched."
+ default_value: "[]"
+ }
+ param {
+ name: "configure"
+ doc: "Indicate that the repository inspects the system for configuration purpose"
+ default_value: "False"
+ }
+ param {
+ name: "remotable"
+ doc: "Compatible with remote execution"
+ default_value: "False"
+ }
+ param {
+ name: "doc"
+ doc: "A description of the repository rule that can be extracted by documentation generating tools."
+ default_value: "None"
}
- doc: "Creates a LinkerInput."
}
- field {
- name: "create_linking_context"
- callable {
- param {
- name: "linker_inputs"
- type: "None; or depset"
- doc: "Depset of LinkerInput."
- default_value: "None"
- }
- param {
- name: "libraries_to_link"
- type: "None; or sequence"
- doc: "Deprecated. This parameter is deprecated and will be removed soon. Please do not depend on it. It is disabled with --+incompatible_require_linker_input_cc_api. Use this flag to verify your code is compatible with its imminent removal.
List of LibraryToLink."
- default_value: "None"
- }
- param {
- name: "user_link_flags"
- type: "None; or sequence"
- doc: "Deprecated. This parameter is deprecated and will be removed soon. Please do not depend on it. It is disabled with --+incompatible_require_linker_input_cc_api. Use this flag to verify your code is compatible with its imminent removal.
List of user link flags passed as strings."
- default_value: "None"
- }
- param {
- name: "additional_inputs"
- type: "None; or sequence"
- doc: "Deprecated. This parameter is deprecated and will be removed soon. Please do not depend on it. It is disabled with --+incompatible_require_linker_input_cc_api. Use this flag to verify your code is compatible with its imminent removal.
For additional inputs to the linking action, e.g.: linking scripts."
- default_value: "None"
- }
- return_type: "LinkingContext"
+ doc: "Creates a new repository rule. Store it in a global value, so that it can be loaded and called from a module_extension() implementation function, or used by use_repo_rule().\n"
+ api_context: BZL
+}
+global {
+ name: "rule"
+ callable {
+ param {
+ name: "implementation"
+ doc: "the Starlark function implementing this rule, must have exactly one parameter: ctx. The function is called during the analysis phase for each instance of the rule. It can access the attributes provided by the user. It must create actions to generate all the declared outputs."
+ is_mandatory: true
+ }
+ param {
+ name: "test"
+ doc: "Whether this rule is a test rule, that is, whether it may be the subject of a blaze test command. All test rules are automatically considered executable; it is unnecessary (and discouraged) to explicitly set executable = True for a test rule. The value defaults to False. See the Rules page for more information."
+ default_value: "unbound"
+ }
+ param {
+ name: "attrs"
+ doc: "A dictionary to declare all the attributes of the rule. It maps from an attribute name to an attribute object (see\nattr module). Attributes starting with _ are private, and can be used to add an implicit dependency on a label. The attribute name is implicitly added and must not be specified. Attributes visibility, deprecation, tags, testonly, and features are implicitly added and cannot be overridden. Most rules need only a handful of attributes. To limit memory usage, there is a cap on the number of attributes that may be declared.\nNone to the default value.OutputGroupInfo or attr.output instead. output and output_list attributes, the user does not specify the labels for these files. See the Rules page for more on predeclared outputs.outputs = _my_func with the definition def _my_func(srcs, deps): ..., the function has access to the attributes srcs and deps. Whether the dictionary is specified directly or via a function, it is interpreted as follows.File in ctx.outputs. The output\'s label has the same package as the rule, and the part after the package is produced by substituting each placeholder of the form \"%{ATTR}\" with a string formed from the value of the attribute ATTR:\"//pkg:a/b.c\" becomes \"a/b\".\"a/b.c\").attr.label_list) used in placeholders are required to have exactly one element. Their conversion is the same as their non-list version (attr.label).%{dirname} and %{basename} expand to those parts of the rule\'s label, excluding its package. For example, in \"//pkg:a/b.c\", the dirname is a and the basename is b.c.\"%{name}\". For example, for a target named \"foo\", the outputs dict {\"bin\": \"%{name}.exe\"} predeclares an output named foo.exe that is accessible in the implementation function as ctx.outputs.bin."
+ default_value: "None"
+ }
+ param {
+ name: "executable"
+ doc: "Whether this rule is considered executable, that is, whether it may be the subject of a blaze run command. It defaults to False. See the Rules page for more information."
+ default_value: "unbound"
+ }
+ param {
+ name: "output_to_genfiles"
+ doc: "If true, the files will be generated in the genfiles directory instead of the bin directory. Unless you need it for compatibility with existing rules (e.g. when generating header files for C++), do not set this flag."
+ default_value: "False"
+ }
+ param {
+ name: "fragments"
+ doc: "List of names of configuration fragments that the rule requires in target configuration."
+ default_value: "[]"
+ }
+ param {
+ name: "host_fragments"
+ doc: "List of names of configuration fragments that the rule requires in host configuration."
+ default_value: "[]"
+ }
+ param {
+ name: "toolchains"
+ doc: "If set, the set of toolchains this rule requires. The list can contain String, Label, or StarlarkToolchainTypeApi objects, in any combination. Toolchains will be found by checking the current platform, and provided to the rule implementation via ctx.toolchain."
+ default_value: "[]"
+ }
+ param {
+ name: "incompatible_use_toolchain_transition"
+ doc: "Deprecated, this is no longer in use and should be removed."
+ default_value: "False"
+ }
+ param {
+ name: "doc"
+ doc: "A description of the rule that can be extracted by documentation generating tools."
+ default_value: "None"
+ }
+ param {
+ name: "provides"
+ doc: "A list of providers that the implementation function must return.*Info object returned by provider(), except that a legacy provider is represented by its string name instead.When a target of the rule is used as a dependency for a target that declares a required provider, it is not necessary to specify that provider here. It is enough that the implementation function returns it. However, it is considered best practice to specify it, even though this is not required. The required_providers field of an aspect does, however, require that providers are specified here."
+ default_value: "[]"
+ }
+ param {
+ name: "dependency_resolution_rule"
+ doc: "If set, the rule can be a dependency through attributes also marked as available in materializers. Every attribute of rules with this flag set must be marked as available in materializers also. This is so that rules so marked cannot depend on rules that are not so marked."
+ default_value: "False"
+ }
+ param {
+ name: "exec_compatible_with"
+ doc: "A list of constraints on the execution platform that apply to all targets of this rule type."
+ default_value: "[]"
+ }
+ param {
+ name: "analysis_test"
+ doc: "If true, then this rule is treated as an analysis test.
"
+ default_value: "False"
+ }
+ param {
+ name: "build_setting"
+ doc: "If set, describes what kind of test=True were set). This supersedes the value of testbuild setting this rule is. See the config module. If this is set, a mandatory attribute named \"build_setting_default\" is automatically added to this rule, with a type corresponding to the value passed in here."
+ default_value: "None"
+ }
+ param {
+ name: "cfg"
+ doc: "If set, points to the configuration transition the rule will apply to its own configuration before analysis."
+ default_value: "None"
+ }
+ param {
+ name: "exec_groups"
+ doc: "Dict of execution group name (string) to exec_groups. If set, allows rules to run actions on multiple execution platforms within a single target. See execution groups documentation for more info."
+ default_value: "None"
+ }
+ param {
+ name: "initializer"
+ doc: "Experimental: the Stalark function initializing the attributes of the rule. name and the values of public attributes defined by the rule (not with generic attributes, for example tags). None as value results in using the default value specified in the attribute definition. None). **kwargs for attributes that are not handled.executable and test from the parent. Values of fragments, toolchains, exec_compatible_with, and exec_groups are merged. Legacy or deprecated parameters may not be set. Incoming configuration transition cfg of parent is applied after thisrule\'s incoming configuration."
+ default_value: "None"
+ }
+ param {
+ name: "extendable"
+ doc: "Experimental: A label of an allowlist defining which rules can extending this rule. It can be set also to True/False to always allow/disallow extending. Bazel defaults to always allowing extensions."
+ default_value: "None"
+ }
+ param {
+ name: "subrules"
+ doc: "Experimental: List of subrules used by this rule."
+ default_value: "[]"
}
- doc: "Creates a LinkingContext."
}
- field {
- name: "create_linking_context_from_compilation_outputs"
- callable {
- param {
- name: "actions"
- doc: "actions object."
- is_mandatory: true
- }
- param {
- name: "feature_configuration"
- doc: "feature_configuration to be queried."
- is_mandatory: true
- }
- param {
- name: "cc_toolchain"
- doc: "CcToolchainInfo provider to be used."
- is_mandatory: true
- }
- param {
- name: "compilation_outputs"
- doc: "Compilation outputs containing object files to link."
- is_mandatory: true
- }
- param {
- name: "user_link_flags"
- doc: "Additional list of linking options."
- default_value: "[]"
- }
+ doc: "Creates a new rule, which can be called from a BUILD file or a macro to create targets._test, while all other rules must not have this suffix. (This restriction applies only to rules, not to their targets.)"
+ api_context: BZL
+}
+global {
+ name: "select"
+ callable {
+ param {
+ name: "x"
+ doc: "A dict that maps configuration conditions to values. Each key is a Label or a label string that identifies a config_setting or constraint_value instance. See the documentation on macros for when to use a Label instead of a string."
+ is_mandatory: true
+ }
+ param {
+ name: "no_match_error"
+ doc: "Optional custom error to report if no condition matches."
+ default_value: "\'\'"
+ }
+ }
+ doc: "select() is the helper function that makes a rule attribute configurable. See build encyclopedia for details."
+ api_context: BZL
+}
+global {
+ name: "struct"
+ callable {
+ param {
+ name: "**kwargs"
+ doc: "Dictionary of arguments."
+ is_star_star_arg: true
+ }
+ }
+ doc: "A generic object with fields.
"
+ default_value: "{}"
+ }
+ param {
+ name: "toolchains"
+ doc: "If set, the set of toolchains this subrule requires. The list can contain String, Label, or StarlarkToolchainTypeApi objects, in any combination. Toolchains will be found by checking the current platform, and provided to the subrule implementation via FilesToRunProvider for label attributes with executable=TrueFile for label attributes with allow_single_file=TrueTarget for all other label attributes[Target] for all label-list attributesctx.toolchains. Note that AEGs need to be enabled on the consuming rule(s) if this parameter is set. In case you haven\'t migrated to AEGs yet, see https://bazel.build/extending/auto-exec-groups#migration-aegs."
+ default_value: "[]"
+ }
+ param {
+ name: "fragments"
+ doc: "List of names of configuration fragments that the subrule requires in target configuration."
+ default_value: "[]"
+ }
+ param {
+ name: "subrules"
+ doc: "List of other subrules needed by this subrule."
+ default_value: "[]"
+ }
+ }
+ doc: "Constructs a new instance of a subrule. The result of this function must be stored in a global variable before it can be used."
+ api_context: BZL
+}
+global {
+ name: "tag_class"
+ callable {
+ param {
+ name: "attrs"
+ doc: "A dictionary to declare all the attributes of this tag class. It maps from an attribute name to an attribute object (see \nattr module).\nrule(), aspect() and repository_rule(),\ndeclared attributes will not convert None to the default value. For the default to be used, the attribute must be omitted entirely by the caller.attrs and populated via attr_values. The implementation function may not register actions. Instead, it must register a pass/fail result via providing AnalysisTestResultInfo."
is_mandatory: true
}
param {
- name: "language"
- doc: "Only C++ supported for now. Do not use this parameter."
- default_value: "\'c++\'"
+ name: "attrs"
+ doc: "Dictionary declaring the attributes. See the rule call. Attributes are allowed to use configuration transitions defined using analysis_test_transition."
+ default_value: "{}"
}
param {
- name: "alwayslink"
- doc: "Whether this library should always be linked."
- default_value: "False"
+ name: "fragments"
+ doc: "List of configuration fragments that are available to the implementation of the analysis test."
+ default_value: "[]"
}
param {
- name: "additional_inputs"
- doc: "For additional inputs to the linking action, e.g.: linking scripts."
+ name: "toolchains"
+ doc: "The set of toolchains the test requires. See the rule call."
default_value: "[]"
}
param {
- name: "disallow_static_libraries"
- doc: "Whether static libraries should be created."
- default_value: "False"
+ name: "attr_values"
+ doc: "Dictionary of attribute values to pass to the implementation."
+ default_value: "{}"
+ }
+ }
+ doc: "Creates a new analysis test target. --analysis_testing_deps_limit flag."
+ api_context: BZL
+ }
+ global_variable {
+ name: "executionInfo"
+ callable {
+ }
+ doc: "testing.ExecutionInfo provider key/constructor"
+ api_context: BZL
+ }
+ global_variable {
+ name: "testEnvironment"
+ callable {
+ param {
+ name: "environment"
+ doc: "A map of string keys and values that represent environment variables and their values. These will be made available during the test execution."
+ is_mandatory: true
}
param {
- name: "disallow_dynamic_library"
- doc: "Whether a dynamic library should be created."
- default_value: "False"
+ name: "inherited_environment"
+ doc: "A sequence of names of environment variables. These variables are made available during the test execution with their current value taken from the shell environment. If a variable is contained in both environment and inherited_environment, the value inherited from the shell environment will take precedence if set."
+ default_value: "[]"
}
- return_type: "tuple"
}
- doc: "Should be used for creating library rules that can propagate information downstream in order to be linked later by a top level rule that does transitive linking to create an executable or dynamic library. Returns tuple of (CcLinkingContext, CcLinkingOutputs)."
- }
- field {
- name: "do_not_use_tools_cpp_compiler_present"
- type: "NoneType"
- doc: "Do not use this field, its only purpose is to help with migration from config_setting.values{\'compiler\') to config_settings.flag_values{\'@bazel_tools//tools/cpp:compiler\'}"
- }
- field {
- name: "get_environment_variables"
- callable {
- param {
- name: "feature_configuration"
- doc: "Feature configuration to be queried."
- is_mandatory: true
- }
- param {
- name: "action_name"
- doc: "Name of the action. Has to be one of the names in @bazel_tools//tools/build_defs/cc:action_names.bzl (https://github.com/bazelbuild/bazel/blob/master/tools/build_defs/cc/action_names.bzl)"
- is_mandatory: true
- }
- param {
- name: "variables"
- doc: "Build variables to be used for template expansion."
- is_mandatory: true
- }
- return_type: "dict"
+ doc: "Deprecated: Use RunEnvironmentInfo instead. Creates a new test environment provider. Use this provider to specify extra environment variables to be made available during test execution."
+ api_context: BZL
+ }
+}
+global {
+ name: "transition"
+ callable {
+ param {
+ name: "implementation"
+ doc: "The function implementing this transition. This function always has two parameters: settings and attr. The settings param is a dictionary whose set of keys is defined by the inputs parameter. So, for each build setting --//foo=bar, if inputs contains //foo, settings will have an entry settings[\'//foo\']=\'bar\'.attr param is a reference to ctx.attr. This gives the implementation function access to the rule\'s attributes to make attribute-parameterized transitions possible.dict from build setting identifier to build setting value; this represents the configuration transition: for each entry in the returned dict, the transition updates that setting to the new value. All other settings are unchanged. This function can also return a list of dicts or a dict of dicts in the case of a split transition."
+ is_mandatory: true
+ }
+ param {
+ name: "inputs"
+ doc: "List of build settings that can be read by this transition. This becomes the key set of the settings parameter of the implementation function parameter."
+ is_mandatory: true
+ }
+ param {
+ name: "outputs"
+ doc: "List of build settings that can be written by this transition. This must be a superset of the key set of the dictionary returned by this transition."
+ is_mandatory: true
+ }
+ }
+ doc: "A transition that reads a set of input build settings and writes a set of output build settings.\ndef _transition_impl(settings, attr):\n # This transition just reads the current CPU value as a demonstration.\n # A real transition could incorporate this into its followup logic.\n current_cpu = settings[\"//command_line_option:cpu\"]\n return {\"//command_line_option:compilation_mode\": \"dbg\"}\n\nbuild_in_debug_mode = transition(\n implementation = _transition_impl,\n inputs = [\"//command_line_option:cpu\"],\n outputs = [\"//command_line_option:compilation_mode\"],\n)
For more details see here.
" + api_context: BZL +} +global { + name: "visibility" + callable { + param { + name: "value" + doc: "A list of package specification strings, or a single package specification string.Package specifications follow the same format as for package_group, except that negative package specifications are not permitted. That is, a specification may have the forms:
\"//foo\": the package //foo\"//foo/...\": the package //foo and all of its subpackages.\"public\" or \"private\": all packages or no packages, respectivelyThe \"@\" syntax is not allowed; all specifications are interpreted relative to the current module\'s repository.
If value is a list of strings, the set of packages granted visibility to this module is the union of the packages represented by each specification. (An empty list has the same effect as private.) If value is a single string, it is treated as if it were the singleton list [value].
Note that the flags --incompatible_package_group_has_public_syntax and --incompatible_fix_package_group_reporoot_syntax have no effect on this argument. The \"public\" and \"private\" values are always available, and \"//...\" is always interpreted as \"all packages in the current repository\"."
+ is_mandatory: true
+ }
+ }
+ doc: "
Sets the load visibility of the .bzl module currently being initialized.
The load visibility of a module governs whether or not other BUILD and .bzl files may load it. (This is distinct from the target visibility of the underlying .bzl source file, which governs whether the file may appear as a dependency of other targets.) Load visibility works at the level of packages: To load a module the file doing the loading must live in a package that has been granted visibility to the module. A module can always be loaded within its own package, regardless of its visibility.
visibility() may only be called once per .bzl file, and only at the top level, not inside a function. The preferred style is to put this call immediately below the load() statements and any brief logic needed to determine the argument.
If the flag --check_bzl_visibility is set to false, load visibility violations will emit warnings but not fail the build."
+ api_context: BZL
+}
+global {
+ name: "aar_import"
+ type: "CLASS: com.google.devtools.build.lib.packages.AutoloadSymbols$1"
+ api_context: BUILD
+}
+global {
+ name: "action_listener"
+ callable {
+ param {
+ name: "name"
+ is_mandatory: true
+ }
+ param {
+ name: "compatible_with"
+ doc: "
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "deprecation" + doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "exec_compatible_with" + doc: "List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "extra_actions" + doc: " A list ofextra_action targets\n this action_listener should add to the build graph.\n E.g. [ \"//my/tools:analyzer\" ].\n"
+ is_mandatory: true
+ }
+ param {
+ name: "features"
+ doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
List of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "mnemonics" + doc: " A list of action mnemonics thisaction_listener should listen\n for, e.g. [ \"Javac\" ].\n \n Mnemonics are not a public interface.\n There\'s no guarantee that the mnemonics and their actions don\'t change.\n
\n" + is_mandatory: true + } + param { + name: "package_metadata" + default_value: "[]" + } + param { + name: "restricted_to" + doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "transitive_configs" + default_value: "[]" + } + param { + name: "visibility" + doc: "List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
\n WARNING: Extra actions are deprecated. Use\n aspects\n instead.\n
\n\n\n An action_listener rule doesn\'t produce any output itself.\n Instead, it allows tool developers to insert\n extra_actions into the build system,\n by providing a mapping from action to extra_action\n .\n
\n This rule\'s arguments map action mnemonics to\n extra_action rules.\n
\n By specifying the option \n --experimental_action_listener=<label>,\n the build will use the specified action_listener to insert\n extra_actions into the build graph.\n
\naction_listener(\n name = \"index_all_languages\",\n mnemonics = [\n \"Javac\",\n \"CppCompile\",\n \"Python\",\n ],\n extra_actions = [\":indexer\"],\n)\n\naction_listener(\n name = \"index_java\",\n mnemonics = [\"Javac\"],\n extra_actions = [\":indexer\"],\n)\n\nextra_action(\n name = \"indexer\",\n tools = [\"//my/tools:indexer\"],\n cmd = \"$(location //my/tools:indexer)\" +\n \"--extra_action_file=$(EXTRA_ACTION_FILE)\",\n)\n\n\n" + api_context: BUILD +} +global { + name: "alias" + callable { + param { + name: "name" + is_mandatory: true + } + param { + name: "actual" + doc: " The target this alias refers to. It does not need to be a rule, it can also be an input\n file.\n" + is_mandatory: true + } + param { + name: "compatible_with" + doc: "
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "deprecation" + doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "transitive_configs" + default_value: "[]" + } + param { + name: "visibility" + doc: "List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
\n The alias rule creates another name a rule can be referred to as.\n
\n Aliasing only works for \"regular\" targets. In particular, package_group\n and test_suite cannot be aliased.\n
\n Aliasing may be of help in large repositories where renaming a target would require making\n changes to lots of files. You can also use alias rule to store a\n select function call if you want to reuse that logic for\n multiple targets.\n
\n\n\n The alias rule has its own visibility declaration. In all other respects, it behaves\n like the rule it references (e.g. testonly on the alias is ignored; the testonly-ness\n of the referenced rule is used instead) with some minor exceptions:\n\n
test_suite\n rule with a single target in its tests\n attribute.\n environment rules are not\n supported. They are not supported in the --target_environment command line\n option, either.\n \nfilegroup(\n name = \"data\",\n srcs = [\"data.txt\"],\n)\n\nalias(\n name = \"other\",\n actual = \":data\",\n)\n\n\n" + api_context: BUILD +} +global { + name: "android_binary" + type: "CLASS: com.google.devtools.build.lib.packages.AutoloadSymbols$1" + api_context: BUILD +} +global { + name: "android_library" + type: "CLASS: com.google.devtools.build.lib.packages.AutoloadSymbols$1" + api_context: BUILD +} +global { + name: "android_local_test" + type: "CLASS: com.google.devtools.build.lib.packages.AutoloadSymbols$1" + api_context: BUILD +} +global { + name: "android_sdk" + type: "CLASS: com.google.devtools.build.lib.packages.AutoloadSymbols$1" + api_context: BUILD +} +global { + name: "android_tools_defaults_jar" + type: "CLASS: com.google.devtools.build.lib.packages.AutoloadSymbols$1" + api_context: BUILD +} +global { + name: "available_xcodes" + callable { + param { + name: "name" + is_mandatory: true + } + param { + name: "compatible_with" + default_value: "[]" + } + param { + name: "default" + doc: "The default Xcode version for this platform." + is_mandatory: true + } + param { + name: "deprecation" + } + param { + name: "exec_compatible_with" + default_value: "[]" + } + param { + name: "exec_properties" + default_value: "{}" + } + param { + name: "expect_failure" + } + param { + name: "features" + default_value: "[]" + } + param { + name: "package_metadata" + default_value: "[]" + } + param { + name: "restricted_to" + default_value: "[]" + } + param { + name: "tags" + default_value: "[]" + } + param { + name: "target_compatible_with" + default_value: "[]" + } + param { + name: "testonly" + default_value: "false" + } + param { + name: "toolchains" + default_value: "[]" + } + param { + name: "transitive_configs" + default_value: "[]" + } + param { + name: "versions" + doc: "The Xcode versions that are available on this platform." + default_value: "[]" + } + param { + name: "visibility" + default_value: "[]" + } + } + doc: "Two targets of this rule can be depended on by an `xcode_config` rule instance\nto indicate the remotely and locally available Xcode versions. This allows\nselection of an official Xcode version from the collectively available Xcodes." + api_context: BUILD +} +global { + name: "cc_binary" + callable { + param { + name: "name" + is_mandatory: true + } + param { + name: "deps" + doc: "\n
List of labels; default is []
\nDependencies for this target. Generally should only list rule targets. (Though\nsome rules permit files to be listed directly in deps, this\nshould be avoided when possible.)\n
\nLanguage-specific rules generally limit the listed targets to those with\nspecific providers.
\n\n\nThe precise semantics of what it means for a target to depend on another using\ndeps are specific to the kind of rule, and the rule-specific\ndocumentation goes into more detail. For rules which process source code,\ndeps generally specifies code dependencies used by the code in\nsrcs.\n
\nMost often, a deps dependency is used to allow one module to use\nsymbols defined in another module written in the same programming language and\nseparately compiled. Cross-language dependencies are also permitted in many\ncases: For example, a java_library target may depend on C++ code\nin a cc_library target, by listing the latter in the\ndeps attribute. See the definition of\ndependencies\nfor more information.\n
List of labels; default is []
\nFiles processed or included by this rule. Generally lists files directly, but\nmay list rule targets (like filegroup or genrule) to\ninclude their default outputs.\n
\nLanguage-specific rules often require that the listed files have particular\nfile extensions.\n
\n" + } + param { + name: "data" + doc: "\nList of labels; default is []
\nFiles needed by this rule at runtime. May list file or rule targets. Generally\nallows any target.\n
\n\n\nThe default outputs and runfiles of targets in the data attribute\nshould appear in the *.runfiles area of any executable which is\noutput by or has a runtime dependency on this target. This may include data\nfiles or binaries used when this target\'s\nsrcs are executed. See the\ndata dependencies\nsection for more information about how to depend on and use data files.\n
\nNew rules should define a data attribute if they process\ninputs which might use other inputs at runtime. Rules\' implementation functions\nmust also populate the target\'s\nrunfiles from the outputs and runfiles of any data attribute,\nas well as runfiles from any dependency attribute which provides either\nsource code or runtime dependencies.\n
\n For example, compiled Windows .res files can be provided here to be embedded in\n the binary target.\n
" + default_value: "[]" + } + param { + name: "args" + doc: "\n List of strings; subject to\n $(location) and\n \"Make variable\" substitution, and\n Bourne shell tokenization;\n nonconfigurable;\n default is []\n
\nCommand line arguments that Bazel will pass to the target when it is executed\neither by the run command or as a test. These arguments are\npassed before the ones that are specified on the bazel run or\nbazel test command line.\n
\nNOTE: The arguments are not passed when you run the target\noutside of Bazel (for example, by manually executing the binary in\nbazel-bin/).\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "conlyopts" + doc: "Add these options to the C compilation command.\nSubject to \"Make variable\" substitution and\nBourne shell tokenization." + default_value: "[]" + } + param { + name: "copts" + doc: "Add these options to the C/C++ compilation command.\nSubject to \"Make variable\" substitution and\nBourne shell tokenization.\n\n Each string in this attribute is added in the given order to COPTS before\n compiling the binary target. The flags take effect only for compiling this target, not\n its dependencies, so be careful about header files included elsewhere.\n All paths should be relative to the workspace, not to the current package.\n This attribute should not be needed outside of third_party.\n
\n If the package declares the feature\n no_copts_tokenization, Bourne shell tokenization applies only to strings\n that consist of a single \"Make\" variable.\n
-D and added to the compile command line to this target,\nas well as to every rule that depends on it. Be very careful, since this may have\nfar-reaching effects. When in doubt, add define values to\nlocal_defines instead."
+ default_value: "[]"
+ }
+ param {
+ name: "deprecation"
+ doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "dynamic_deps" + doc: "These are othercc_shared_library dependencies the current target depends on.\n\n\nThe cc_shared_library implementation will use the list of\ndynamic_deps (transitively, i.e. also the dynamic_deps of the\ncurrent target\'s dynamic_deps) to decide which cc_libraries in\nthe transitive deps should not be linked in because they are already provided\nby a different cc_shared_library."
+ default_value: "[]"
+ }
+ param {
+ name: "env"
+ doc: "
Dictionary of strings; values are subject to\n$(location) and\n\"Make variable\" substitution; default is {}
Specifies additional environment variables to set when the target is\n executed by bazel run.\n
\n This attribute only applies to native rules, like cc_binary, py_binary,\n and sh_binary. It does not apply to Starlark-defined executable rules.\n
\nNOTE: The environment variables are not set when you run the target\noutside of Bazel (for example, by manually executing the binary in\nbazel-bin/).\n
List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "expect_failure" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
-isystem path_to_package/include_entry.\nThis should only be used for third-party libraries that\ndo not conform to the Google style of writing #include statements.\nUnlike COPTS, these flags are added for this rule\nand every rule that depends on it. (Note: not the rules it depends upon!) Be\nvery careful, since this may have far-reaching effects. When in doubt, add\n\"-I\" flags to COPTS instead.\n\nThe added include paths will include generated files as well as\nfiles in the source tree.\n
List of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "link_extra_lib" + doc: "Control linking of extra libraries.\n\n By default, C++ binaries are linked against //tools/cpp:link_extra_lib,\n which by default depends on the label flag //tools/cpp:link_extra_libs.\n Without setting the flag, this library is empty by default. Setting the label flag\n allows linking optional dependencies, such as overrides for weak symbols, interceptors\n for shared library functions, or special runtime libraries (for malloc replacements,\n prefer malloc or --custom_malloc). Setting this attribute to\n None disables this behaviour.\n
LINKOPTS before\nlinking the binary target.\n\n Each element of this list that does not start with $ or - is\n assumed to be the label of a target in deps. The\n list of files generated by that target is appended to the linker\n options. An error is reported if the label is invalid, or is\n not declared in deps.\n
linkshared=True in your rule. By default\nthis option is off.\n\n The presence of this flag means that linking occurs with the -shared flag\n to gcc, and the resulting shared library is suitable for loading into for\n example a Java program. However, for build purposes it will never be linked into the\n dependent binary, as it is assumed that shared libraries built with a\n cc_binary rule are only loaded manually by other programs, so\n it should not be considered a substitute for the cc_library\n rule. For sake of scalability we recommend avoiding this approach altogether and\n simply letting java_library depend on cc_library rules\n instead.\n
\n If you specify both linkopts=[\'-static\'] and linkshared=True,\n you get a single completely self-contained unit. If you specify both\n linkstatic=True and linkshared=True, you get a single, mostly\n self-contained unit.\n
cc_binary and\ncc_test: link the binary in static\nmode. For cc_library.link_static: see below.\nBy default this option is on for cc_binary and off for the rest.
\n If enabled and this is a binary or test, this option tells the build tool to link in\n .a\'s instead of .so\'s for user libraries whenever possible.\n System libraries such as libc (but not the C/C++ runtime libraries,\n see below) are still linked dynamically, as are libraries for which\n there is no static library. So the resulting executable will still be dynamically\n linked, hence only mostly static.\n
\nThere are really three different ways to link an executable:\n
\ngcc -static foo.o libbar.a libbaz.a -lm\".fully_static_link in the\n features attribute.gcc foo.o libfoo.a libbaz.a -lm\".linkstatic=True.gcc foo.o libfoo.so libbaz.so -lm\".linkstatic=False.\nIf the linkstatic attribute or fully_static_link in\nfeatures is used outside of //third_party\nplease include a comment near the rule to explain why.\n
\nThe linkstatic attribute has a different meaning if used on a\ncc_library() rule.\nFor a C++ library, linkstatic=True indicates that only\nstatic linking is allowed, so no .so will be produced. linkstatic=False does\nnot prevent static libraries from being created. The attribute is meant to control the\ncreation of dynamic libraries.\n
\nThere should be very little code built with linkstatic=False in production.\nIf linkstatic=False, then the build tool will create symlinks to\ndepended-upon shared libraries in the *.runfiles area.\n
-D and added to the compile command line for this target,\nbut not to its dependents."
+ default_value: "[]"
+ }
+ param {
+ name: "malloc"
+ doc: "Override the default dependency on malloc.\n\n By default, C++ binaries are linked against //tools/cpp:malloc,\n which is an empty library so the binary ends up using libc malloc.\n This label must refer to a cc_library. If compilation is for a non-C++\n rule, this option has no effect. The value of this attribute is ignored if\n linkshared=True is specified.\n
\nC++ Standard has no restriction about module interface file extension\n
The use is guarded by the flag\n--experimental_cpp_modules.
COPTS that match this regular expression\n(including values explicitly specified in the rule\'s copts attribute)\nwill be removed from COPTS for purposes of compiling this rule.\nThis attribute should not be needed or used\noutside of third_party. The values are not preprocessed\nin any way other than the \"Make\" variable substitution."
+ }
+ param {
+ name: "output_licenses"
+ doc: "List of strings; default is []
\nThe licenses of the output files that this binary generates.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n\n" + } + param { + name: "package_metadata" + default_value: "[]" + } + param { + name: "reexport_deps" + default_value: "[]" + } + param { + name: "restricted_to" + doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
stamp = 1: Always stamp the build information into the binary, even in\n --nostamp builds. This\n setting should be avoided, since it potentially kills remote caching for the\n binary and any downstream actions that depend on it.\nstamp = 0: Always replace build information by constant values. This\n gives good build result caching.\nstamp = -1: Embedding of build information is controlled by the\n --[no]stamp flag.\nStamped binaries are not rebuilt unless their dependencies change.
" + default_value: "0" + } + param { + name: "tags" + doc: "\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "toolchains" + doc: "List of labels;\n nonconfigurable; default is []
\n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n
@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific cc_toolchain or java_toolchain a\n target will use.\n
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
This attribute should only be used when Windows is the target platform.\nIt can be used to \nexport symbols during linking a shared library.
" + is_mandatory: true + } + } + doc: "It produces an executable binary.
\n\nname of the target should be the same as the name of the\nsource file that is the main entry point of the application (minus the extension).\nFor example, if your entry point is in main.cc, then your name should\nbe main.\n\nname.stripped (only built if explicitly requested): A stripped\n version of the binary. strip -g is run on the binary to remove debug\n symbols. Additional strip options can be provided on the command line using\n --stripopt=-foo.name.dwp (only built if explicitly requested): If\n Fission is enabled: a debug\n information package file suitable for debugging remotely deployed binaries. Else: an\n empty file.List of labels; default is []
\nDependencies for this target. Generally should only list rule targets. (Though\nsome rules permit files to be listed directly in deps, this\nshould be avoided when possible.)\n
\nLanguage-specific rules generally limit the listed targets to those with\nspecific providers.
\n\n\nThe precise semantics of what it means for a target to depend on another using\ndeps are specific to the kind of rule, and the rule-specific\ndocumentation goes into more detail. For rules which process source code,\ndeps generally specifies code dependencies used by the code in\nsrcs.\n
\nMost often, a deps dependency is used to allow one module to use\nsymbols defined in another module written in the same programming language and\nseparately compiled. Cross-language dependencies are also permitted in many\ncases: For example, a java_library target may depend on C++ code\nin a cc_library target, by listing the latter in the\ndeps attribute. See the definition of\ndependencies\nfor more information.\n
List of labels; default is []
\nFiles needed by this rule at runtime. May list file or rule targets. Generally\nallows any target.\n
\n\n\nThe default outputs and runfiles of targets in the data attribute\nshould appear in the *.runfiles area of any executable which is\noutput by or has a runtime dependency on this target. This may include data\nfiles or binaries used when this target\'s\nsrcs are executed. See the\ndata dependencies\nsection for more information about how to depend on and use data files.\n
\nNew rules should define a data attribute if they process\ninputs which might use other inputs at runtime. Rules\' implementation functions\nmust also populate the target\'s\nrunfiles from the outputs and runfiles of any data attribute,\nas well as runfiles from any dependency attribute which provides either\nsource code or runtime dependencies.\n
If alwayslink doesn\'t work with VS 2017 on Windows, that is due to a\nknown issue,\nplease upgrade your VS 2017 to the latest version.
" + default_value: "false" + } + param { + name: "compatible_with" + doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "deprecation" + doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "exec_compatible_with" + doc: "List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "expect_failure" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
-isystem path_to_package/include_entry.\nThis should only be used for third-party libraries that\ndo not conform to the Google style of writing #include statements.\nUnlike COPTS, these flags are added for this rule\nand every rule that depends on it. (Note: not the rules it depends upon!) Be\nvery careful, since this may have far-reaching effects. When in doubt, add\n\"-I\" flags to COPTS instead.\n\nThe default include path doesn\'t include generated\nfiles. If you need to #include a generated header\nfile, list it in the srcs.\n
Permitted file types:\n .ifso,\n .tbd,\n .lib,\n .so\n or .dylib\n
LINKOPTS before\nlinking the binary target.\n\n Each element of this list that does not start with $ or - is\n assumed to be the label of a target in deps. The\n list of files generated by that target is appended to the linker\n options. An error is reported if the label is invalid, or is\n not declared in deps.\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
Permitted file types:\n .so,\n .dll\n or .dylib\n
Permitted file types:\n .a,\n .pic.a\n or .lib\n
interface_library should be specified and\nshared_library should be empty."
+ default_value: "false"
+ }
+ param {
+ name: "tags"
+ doc: "\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "toolchains" + doc: "List of labels;\n nonconfigurable; default is []
\n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n
@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific cc_toolchain or java_toolchain a\n target will use.\n
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
\ncc_import rules allows users to import precompiled C/C++ libraries.\n
\nThe following are the typical use cases:
\n\n1. Linking a static library\n
\ncc_import(\n name = \"mylib\",\n hdrs = [\"mylib.h\"],\n static_library = \"libmylib.a\",\n # If alwayslink is turned on,\n # libmylib.a will be forcely linked into any binary that depends on it.\n # alwayslink = True,\n)\n\n\n2. Linking a shared library (Unix)\n\ncc_import(\n name = \"mylib\",\n hdrs = [\"mylib.h\"],\n shared_library = \"libmylib.so\",\n)\n\n\n3. Linking a shared library with interface library\n\nOn Unix:\n
\ncc_import(\n name = \"mylib\",\n hdrs = [\"mylib.h\"],\n # libmylib.ifso is an interface library for libmylib.so which will be passed to linker\n interface_library = \"libmylib.ifso\",\n # libmylib.so will be available for runtime\n shared_library = \"libmylib.so\",\n)\n\n\nOn Windows:\n
\ncc_import(\n name = \"mylib\",\n hdrs = [\"mylib.h\"],\n # mylib.lib is an import library for mylib.dll which will be passed to linker\n interface_library = \"mylib.lib\",\n # mylib.dll will be available for runtime\n shared_library = \"mylib.dll\",\n)\n\n\n4. Linking a shared library with system_provided=True\n\nOn Unix:\n
\ncc_import(\n name = \"mylib\",\n hdrs = [\"mylib.h\"],\n interface_library = \"libmylib.ifso\", # Or we can also use libmylib.so as its own interface library\n # libmylib.so is provided by system environment, for example it can be found in LD_LIBRARY_PATH.\n # This indicates that Bazel is not responsible for making libmylib.so available.\n system_provided = True,\n)\n\n\nOn Windows:\n
\ncc_import(\n name = \"mylib\",\n hdrs = [\"mylib.h\"],\n # mylib.lib is an import library for mylib.dll which will be passed to linker\n interface_library = \"mylib.lib\",\n # mylib.dll is provided by system environment, for example it can be found in PATH.\n # This indicates that Bazel is not responsible for making mylib.dll available.\n system_provided = True,\n)\n\n\n5. Linking to static or shared library\n\nOn Unix:\n
\ncc_import(\n name = \"mylib\",\n hdrs = [\"mylib.h\"],\n static_library = \"libmylib.a\",\n shared_library = \"libmylib.so\",\n)\n\n\nOn Windows:\n
\ncc_import(\n name = \"mylib\",\n hdrs = [\"mylib.h\"],\n static_library = \"libmylib.lib\", # A normal static library\n interface_library = \"mylib.lib\", # An import library for mylib.dll\n shared_library = \"mylib.dll\",\n)\n\n\nThe remaining is the same on Unix and Windows:\n
\n# first will link to libmylib.a (or libmylib.lib)\ncc_binary(\n name = \"first\",\n srcs = [\"first.cc\"],\n deps = [\":mylib\"],\n linkstatic = True, # default value\n)\n\n# second will link to libmylib.so (or libmylib.lib)\ncc_binary(\n name = \"second\",\n srcs = [\"second.cc\"],\n deps = [\":mylib\"],\n linkstatic = False,\n)\n\n\n\ncc_import supports an include attribute. For example:\n
\ncc_import(\n name = \"curl_lib\",\n hdrs = glob([\"vendor/curl/include/curl/*.h\"]),\n includes = [\"vendor/curl/include\"],\n shared_library = \"vendor/curl/lib/.libs/libcurl.dylib\",\n)\n\n"
+ api_context: BUILD
+}
+global {
+ name: "cc_libc_top_alias"
+ callable {
+ param {
+ name: "name"
+ is_mandatory: true
+ }
+ param {
+ name: "compatible_with"
+ default_value: "[]"
+ }
+ param {
+ name: "deprecation"
+ }
+ param {
+ name: "features"
+ default_value: "[]"
+ }
+ param {
+ name: "package_metadata"
+ default_value: "[]"
+ }
+ param {
+ name: "restricted_to"
+ default_value: "[]"
+ }
+ param {
+ name: "tags"
+ default_value: "[]"
+ }
+ param {
+ name: "target_compatible_with"
+ default_value: "[]"
+ }
+ param {
+ name: "testonly"
+ default_value: "false"
+ }
+ param {
+ name: "transitive_configs"
+ default_value: "[]"
+ }
+ param {
+ name: "visibility"
+ default_value: "[]"
+ }
+ }
+ api_context: BUILD
+}
+global {
+ name: "cc_library"
+ callable {
+ param {
+ name: "name"
+ is_mandatory: true
+ }
+ param {
+ name: "deps"
+ doc: "\nList of labels; default is []
\nDependencies for this target. Generally should only list rule targets. (Though\nsome rules permit files to be listed directly in deps, this\nshould be avoided when possible.)\n
\nLanguage-specific rules generally limit the listed targets to those with\nspecific providers.
\n\n\nThe precise semantics of what it means for a target to depend on another using\ndeps are specific to the kind of rule, and the rule-specific\ndocumentation goes into more detail. For rules which process source code,\ndeps generally specifies code dependencies used by the code in\nsrcs.\n
\nMost often, a deps dependency is used to allow one module to use\nsymbols defined in another module written in the same programming language and\nseparately compiled. Cross-language dependencies are also permitted in many\ncases: For example, a java_library target may depend on C++ code\nin a cc_library target, by listing the latter in the\ndeps attribute. See the definition of\ndependencies\nfor more information.\n
List of labels; default is []
\nFiles processed or included by this rule. Generally lists files directly, but\nmay list rule targets (like filegroup or genrule) to\ninclude their default outputs.\n
\nLanguage-specific rules often require that the listed files have particular\nfile extensions.\n
\n" + } + param { + name: "data" + doc: "\nList of labels; default is []
\nFiles needed by this rule at runtime. May list file or rule targets. Generally\nallows any target.\n
\n\n\nThe default outputs and runfiles of targets in the data attribute\nshould appear in the *.runfiles area of any executable which is\noutput by or has a runtime dependency on this target. This may include data\nfiles or binaries used when this target\'s\nsrcs are executed. See the\ndata dependencies\nsection for more information about how to depend on and use data files.\n
\nNew rules should define a data attribute if they process\ninputs which might use other inputs at runtime. Rules\' implementation functions\nmust also populate the target\'s\nrunfiles from the outputs and runfiles of any data attribute,\nas well as runfiles from any dependency attribute which provides either\nsource code or runtime dependencies.\n
This is the strongly preferred location for declaring header files that\n describe the interface for the library. These headers will be made\n available for inclusion by sources in this rule or in dependent rules.\n Headers not meant to be included by a client of this library should be\n listed in the srcs attribute instead, even if they are\n included by a published header. See \"Header inclusion\n checking\" for a more detailed description.
Permitted headers file types:\n .h,\n .hh,\n .hpp,\n .hxx.\n
\n For example, compiled Windows .res files can be provided here to be embedded in\n the binary target.\n
" + default_value: "[]" + } + param { + name: "alwayslink" + doc: "If 1, any binary that depends (directly or indirectly) on this C++\nlibrary will link in all the object files for the files listed in\nsrcs, even if some contain no symbols referenced by the binary.\nThis is useful if your code isn\'t explicitly called by code in\nthe binary, e.g., if your code registers to receive some callback\nprovided by some service.\n\nIf alwayslink doesn\'t work with VS 2017 on Windows, that is due to a\nknown issue,\nplease upgrade your VS 2017 to the latest version.
" + default_value: "false" + } + param { + name: "compatible_with" + doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "conlyopts" + doc: "Add these options to the C compilation command.\nSubject to \"Make variable\" substitution and\nBourne shell tokenization." + default_value: "[]" + } + param { + name: "copts" + doc: "Add these options to the C/C++ compilation command.\nSubject to \"Make variable\" substitution and\nBourne shell tokenization.\n\n Each string in this attribute is added in the given order to COPTS before\n compiling the binary target. The flags take effect only for compiling this target, not\n its dependencies, so be careful about header files included elsewhere.\n All paths should be relative to the workspace, not to the current package.\n This attribute should not be needed outside of third_party.\n
\n If the package declares the feature\n no_copts_tokenization, Bourne shell tokenization applies only to strings\n that consist of a single \"Make\" variable.\n
-D and added to the compile command line to this target,\nas well as to every rule that depends on it. Be very careful, since this may have\nfar-reaching effects. When in doubt, add define values to\nlocal_defines instead."
+ default_value: "[]"
+ }
+ param {
+ name: "deprecation"
+ doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "exec_compatible_with" + doc: "List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "expect_failure" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
deps, the headers and include paths of these libraries (and all their\ntransitive deps) are only used for compilation of this library, and not libraries that\ndepend on it. Libraries specified with implementation_deps are still linked in\nbinary targets that depend on this library."
+ default_value: "[]"
+ }
+ param {
+ name: "include_prefix"
+ doc: "The prefix to add to the paths of the headers of this rule.\n\nWhen set, the headers in the hdrs attribute of this rule are accessible\nat is the value of this attribute prepended to their repository-relative path.\n\n
The prefix in the strip_include_prefix attribute is removed before this\nprefix is added.\n\n
This attribute is only legal under third_party."
+ }
+ param {
+ name: "includes"
+ doc: "List of include dirs to be added to the compile line.\nSubject to \"Make variable\" substitution.\nEach string is prepended with the package path and passed to the C++ toolchain for\nexpansion via the \"include_paths\" CROSSTOOL feature. A toolchain running on a POSIX system\nwith typical feature definitions will produce\n-isystem path_to_package/include_entry.\nThis should only be used for third-party libraries that\ndo not conform to the Google style of writing #include statements.\nUnlike COPTS, these flags are added for this rule\nand every rule that depends on it. (Note: not the rules it depends upon!) Be\nvery careful, since this may have far-reaching effects. When in doubt, add\n\"-I\" flags to COPTS instead.\n
\nThe added include paths will include generated files as well as\nfiles in the source tree.\n
List of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "linkopts" + doc: "Seecc_binary.linkopts.\nThe linkopts attribute is also applied to any target that\ndepends, directly or indirectly, on this library via deps\nattributes (or via other attributes that are treated similarly:\nthe malloc\nattribute of cc_binary). Dependency\nlinkopts take precedence over dependent linkopts (i.e. dependency linkopts\nappear later in the command line). Linkopts specified in\n--linkopt\ntake precedence over rule linkopts.\n\n\nNote that the linkopts attribute only applies\nwhen creating .so files or executables, not\nwhen creating .a or .lo files.\nSo if the linkstatic=True attribute is set, the\nlinkopts attribute has no effect on the creation of\nthis library, only on other targets which depend on this library.\n
\nAlso, it is important to note that \"-Wl,-soname\" or \"-Xlinker -soname\"\noptions are not supported and should never be specified in this attribute.\n
\n The .so files produced by cc_library\nrules are not linked against the libraries that they depend\non. If you\'re trying to create a shared library for use\noutside of the main repository, e.g. for manual use\nwith dlopen() or LD_PRELOAD,\nit may be better to use a cc_binary rule\nwith the linkshared=True attribute.\nSee cc_binary.linkshared.\n
base package."
+ is_mandatory: true
+ }
+ param {
+ name: "linkstatic"
+ doc: "For cc_binary and\ncc_test: link the binary in static\nmode. For cc_library.link_static: see below.\nBy default this option is on for cc_binary and off for the rest.
\n If enabled and this is a binary or test, this option tells the build tool to link in\n .a\'s instead of .so\'s for user libraries whenever possible.\n System libraries such as libc (but not the C/C++ runtime libraries,\n see below) are still linked dynamically, as are libraries for which\n there is no static library. So the resulting executable will still be dynamically\n linked, hence only mostly static.\n
\nThere are really three different ways to link an executable:\n
\ngcc -static foo.o libbar.a libbaz.a -lm\".fully_static_link in the\n features attribute.gcc foo.o libfoo.a libbaz.a -lm\".linkstatic=True.gcc foo.o libfoo.so libbaz.so -lm\".linkstatic=False.\nIf the linkstatic attribute or fully_static_link in\nfeatures is used outside of //third_party\nplease include a comment near the rule to explain why.\n
\nThe linkstatic attribute has a different meaning if used on a\ncc_library() rule.\nFor a C++ library, linkstatic=True indicates that only\nstatic linking is allowed, so no .so will be produced. linkstatic=False does\nnot prevent static libraries from being created. The attribute is meant to control the\ncreation of dynamic libraries.\n
\nThere should be very little code built with linkstatic=False in production.\nIf linkstatic=False, then the build tool will create symlinks to\ndepended-upon shared libraries in the *.runfiles area.\n
-D and added to the compile command line for this target,\nbut not to its dependents."
+ default_value: "[]"
+ }
+ param {
+ name: "module_interfaces"
+ doc: "The list of files are regarded as C++20 Modules Interface.\n\n\nC++ Standard has no restriction about module interface file extension\n
The use is guarded by the flag\n--experimental_cpp_modules.
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
When set, the headers in the hdrs attribute of this rule are accessible\nat their path with this prefix cut off.\n\n
If it\'s a relative path, it\'s taken as a package-relative one. If it\'s an absolute one,\nit\'s understood as a repository-relative path.\n\n
The prefix in the include_prefix attribute is added after this prefix is\nstripped.\n\n
This attribute is only legal under third_party."
+ }
+ param {
+ name: "tags"
+ doc: "
\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "textual_hdrs" + doc: "The list of header files published by\nthis library to be textually included by sources in dependent rules.\nThis is the location for declaring header files that cannot be compiled on their own;\n that is, they always need to be textually included by other source files to build valid\n code.
" + default_value: "[]" + } + param { + name: "toolchains" + doc: "List of labels;\n nonconfigurable; default is []
\n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n
@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific cc_toolchain or java_toolchain a\n target will use.\n
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
This attribute should only be used when Windows is the target platform.\nIt can be used to \nexport symbols during linking a shared library.
" + is_mandatory: true + } + } + doc: "Use cc_library() for C++-compiled libraries.\n The result is either a .so, .lo,\n or .a, depending on what is needed.\n
\n If you build something with static linking that depends on\n a cc_library, the output of a depended-on library rule\n is the .a file. If you specify\n alwayslink=True, you get the .lo file.\n
\n The actual output file name is libfoo.so for\n the shared library, where foo is the name of the rule. The\n other kinds of libraries end with .lo and .a,\n respectively. If you need a specific shared library name, for\n example, to define a Python module, use a genrule to copy the library\n to the desired name.\n
\n All header files that are used in the build must be declared in\n the hdrs or srcs of cc_* rules.\n This is enforced.\n
\n For cc_library rules, headers in hdrs comprise the\n public interface of the library and can be directly included both\n from the files in hdrs and srcs of the library\n itself as well as from files in hdrs and srcs\n of cc_* rules that list the library in their deps.\n Headers in srcs must only be directly included from the files\n in hdrs and srcs of the library itself. When\n deciding whether to put a header into hdrs or srcs,\n you should ask whether you want consumers of this library to be able to\n directly include it. This is roughly the same decision as\n between public and private visibility in programming languages.\n
\n cc_binary and cc_test rules do not have an exported\n interface, so they also do not have a hdrs attribute. All headers\n that belong to the binary or test directly should be listed in\n the srcs.\n
\n To illustrate these rules, look at the following example.\n
\n\n\ncc_binary(\n name = \"foo\",\n srcs = [\n \"foo.cc\",\n \"foo.h\",\n ],\n deps = [\":bar\"],\n)\n\ncc_library(\n name = \"bar\",\n srcs = [\n \"bar.cc\",\n \"bar-impl.h\",\n ],\n hdrs = [\"bar.h\"],\n deps = [\":baz\"],\n)\n\ncc_library(\n name = \"baz\",\n srcs = [\n \"baz.cc\",\n \"baz-impl.h\",\n ],\n hdrs = [\"baz.h\"],\n)\n\n\n\n The allowed direct inclusions in this example are listed in the table below.\n For example foo.cc is allowed to directly\n include foo.h and bar.h, but not baz.h.\n
| Including file | Allowed inclusions |
|---|---|
| foo.h | bar.h |
| foo.cc | foo.h bar.h |
| bar.h | bar-impl.h baz.h |
| bar-impl.h | bar.h baz.h |
| bar.cc | bar.h bar-impl.h baz.h |
| baz.h | baz-impl.h |
| baz-impl.h | baz.h |
| baz.cc | baz.h baz-impl.h |
\n The inclusion checking rules only apply to direct\n inclusions. In the example above foo.cc is allowed to\n include bar.h, which may include baz.h, which in\n turn is allowed to include baz-impl.h. Technically, the\n compilation of a .cc file may transitively include any header\n file in the hdrs or srcs in\n any cc_library in the transitive deps closure. In\n this case the compiler may read baz.h and baz-impl.h\n when compiling foo.cc, but foo.cc must not\n contain #include \"baz.h\". For that to be\n allowed, baz must be added to the deps\n of foo.\n
\n Bazel depends on toolchain support to enforce the inclusion checking rules.\n The layering_check feature has to be supported by the toolchain\n and requested explicitly, for example via the\n --features=layering_check command-line flag or the\n features parameter of the\n package function. The toolchains\n provided by Bazel only support this feature with clang on Unix and macOS.\n
\n We use the alwayslink flag to force the linker to link in\n this code although the main binary code doesn\'t reference it.\n
\ncc_library(\n name = \"ast_inspector_lib\",\n srcs = [\"ast_inspector_lib.cc\"],\n hdrs = [\"ast_inspector_lib.h\"],\n visibility = [\"//visibility:public\"],\n deps = [\"//third_party/llvm/llvm/tools/clang:frontend\"],\n # alwayslink as we want to be able to call things in this library at\n # debug time, even if they aren\'t used anywhere in the code.\n alwayslink = 1,\n)\n\n\n\nThe following example comes from\n third_party/python2_4_3/BUILD.\n Some of the code uses the dl library (to load\n another, dynamic library), so this\n rule specifies the -ldl link option to link the\n dl library.\n
\ncc_library(\n name = \"python2_4_3\",\n linkopts = [\n \"-ldl\",\n \"-lutil\",\n ],\n deps = [\"//third_party/expat\"],\n)\n\n\nThe following example comes from third_party/kde/BUILD.\n We keep pre-built .so files in the depot.\n The header files live in a subdirectory named include.\n
\ncc_library(\n name = \"kde\",\n srcs = [\n \"lib/libDCOP.so\",\n \"lib/libkdesu.so\",\n \"lib/libkhtml.so\",\n \"lib/libkparts.so\",\n ...more .so files...,\n ],\n includes = [\"include\"],\n deps = [\"//third_party/X11\"],\n)\n\n\nThe following example comes from third_party/gles/BUILD.\n Third-party code often needs some defines and\n linkopts.\n
\ncc_library(\n name = \"gles\",\n srcs = [\n \"GLES/egl.h\",\n \"GLES/gl.h\",\n \"ddx.c\",\n \"egl.c\",\n ],\n defines = [\n \"USE_FLOAT\",\n \"__GL_FLOAT\",\n \"__GL_COMMON\",\n ],\n linkopts = [\"-ldl\"], # uses dlopen(), dl library\n deps = [\n \"es\",\n \"//third_party/X11\",\n ],\n)\n"
+ api_context: BUILD
+}
+global {
+ name: "cc_proto_library"
+ callable {
+ param {
+ name: "**kwattrs"
+ is_star_star_arg: true
+ }
+ }
+ doc: "\ncc_proto_library generates C++ code from .proto files.\n
\ndeps must point to proto_library\n rules.\n
\nExample:\n
\n\n\n\ncc_library(\n name = \"lib\",\n deps = [\":foo_cc_proto\"],\n)\n\ncc_proto_library(\n name = \"foo_cc_proto\",\n deps = [\":foo_proto\"],\n)\n\nproto_library(\n name = \"foo_proto\",\n)\n\n"
+ api_context: BUILD
+}
+global {
+ name: "cc_shared_library"
+ callable {
+ param {
+ name: "name"
+ is_mandatory: true
+ }
+ param {
+ name: "deps"
+ doc: "\nList of labels; default is []
\nDependencies for this target. Generally should only list rule targets. (Though\nsome rules permit files to be listed directly in deps, this\nshould be avoided when possible.)\n
\nLanguage-specific rules generally limit the listed targets to those with\nspecific providers.
\n\n\nThe precise semantics of what it means for a target to depend on another using\ndeps are specific to the kind of rule, and the rule-specific\ndocumentation goes into more detail. For rules which process source code,\ndeps generally specifies code dependencies used by the code in\nsrcs.\n
\nMost often, a deps dependency is used to allow one module to use\nsymbols defined in another module written in the same programming language and\nseparately compiled. Cross-language dependencies are also permitted in many\ncases: For example, a java_library target may depend on C++ code\nin a cc_library target, by listing the latter in the\ndeps attribute. See the definition of\ndependencies\nfor more information.\n
user_link_flags attribute."
+ default_value: "[]"
+ }
+ param {
+ name: "compatible_with"
+ doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "deprecation" + doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "dynamic_deps" + doc: "These are othercc_shared_library dependencies the current target depends on.\n\n\nThe cc_shared_library implementation will use the list of\ndynamic_deps (transitively, i.e. also the dynamic_deps of the\ncurrent target\'s dynamic_deps) to decide which cc_libraries in\nthe transitive deps should not be linked in because they are already provided\nby a different cc_shared_library.\n
List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "expect_failure" + } + param { + name: "exports_filter" + doc: "This attribute contains a list of targets that are claimed to be exported by the current\nshared library.\n\n\nAny target deps is already understood to be exported by the shared library.\nThis attribute should be used to list any targets that are exported by the shared library\nbut are transitive dependencies of deps.\n
\nNote that this attribute is not actually adding a dependency edge to those targets, the\ndependency edge should instead be created by deps.The entries in this\nattribute are just strings. Keep in mind that when placing a target in this attribute,\nthis is considered a claim that the shared library exports the symbols from that target.\nThe cc_shared_library logic doesn\'t actually handle telling the linker which\nsymbols should be exported.\n
The following syntax is allowed:
\n//foo:__pkg__ to account for any target in foo/BUILD
//foo:__subpackages__ to account for any target in foo/BUILD or any other\npackage below foo/ like foo/bar/BUILD
List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "toolchains" + doc: "List of labels;\n nonconfigurable; default is []
\n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n
@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific cc_toolchain or java_toolchain a\n target will use.\n
\n cc_shared_library(\n name = \"foo_shared\",\n additional_linker_inputs = select({\n \"//src/conditions:linux\": [\n \":foo.lds\",\n \":additional_script.txt\",\n ],\n \"//conditions:default\": []}),\n user_link_flags = select({\n \"//src/conditions:linux\": [\n \"-Wl,-rpath,kittens\",\n \"-Wl,--version-script=$(location :foo.lds)\",\n \"-Wl,--script=$(location :additional_script.txt)\",\n ],\n \"//conditions:default\": []}),\n ...\n )\n"
+ default_value: "[]"
+ }
+ param {
+ name: "visibility"
+ doc: "List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
This attribute should only be used when Windows is the target platform.\nIt can be used to \nexport symbols during linking a shared library.
" + is_mandatory: true + } + } + doc: "It produces a shared library.
\n\n\ncc_shared_library(\n name = \"foo_shared\",\n deps = [\n \":foo\",\n ],\n dynamic_deps = [\n \":bar_shared\",\n ],\n additional_linker_inputs = [\n \":foo.lds\",\n ],\n user_link_flags = [\n \"-Wl,--version-script=$(location :foo.lds)\",\n ],\n)\ncc_library(\n name = \"foo\",\n srcs = [\"foo.cc\"],\n hdrs = [\"foo.h\"],\n deps = [\n \":bar\",\n \":baz\",\n ],\n)\ncc_shared_library(\n name = \"bar_shared\",\n shared_lib_name = \"bar.so\",\n deps = [\":bar\"],\n)\ncc_library(\n name = \"bar\",\n srcs = [\"bar.cc\"],\n hdrs = [\"bar.h\"],\n)\ncc_library(\n name = \"baz\",\n srcs = [\"baz.cc\"],\n hdrs = [\"baz.h\"],\n)\n\n\n
In the example foo_shared statically links foo\nand baz, the latter being a transitive dependency. It doesn\'t\nlink bar because it is already provided dynamically by the\ndynamic_dep bar_shared.
foo_shared uses a linker script *.lds file to control which\nsymbols should be exported. The cc_shared_library rule logic does\nnot control which symbols get exported, it only uses what is assumed to be\nexported to give errors during analysis phase if two shared libraries export the\nsame targets.
Every direct dependency of cc_shared_library is assumed to be\nexported. Therefore, Bazel assumes during analysis that foo is being\nexported by foo_shared. baz is not assumed to be exported\nby foo_shared. Every target matched by the exports_filter\nis also assumed to be exported.
Every single cc_library in the example should appear at most in one\ncc_shared_library. If we wanted to link baz also into\nbar_shared we would need to add\ntags = [\"LINKABLE_MORE_THAN_ONCE\"] to baz.
Due to the shared_lib_name attribute, the file produced by\nbar_shared will have the name bar.so as opposed\nto the name libbar.so that it would have by default on Linux.
Two shared libraries in dependencies export the same symbols.This will happen whenever you are creating a target with two different\ncc_shared_library dependencies that export the same target. To fix this\nyou need to stop the libraries from being exported in one of the\ncc_shared_library dependencies.
Two shared libraries in dependencies link the same library staticallyThis will happen whenever you are creating a new cc_shared_library with two\ndifferent cc_shared_library dependencies that link the same target statically.\nSimilar to the error with exports.
One way to fix this is to stop linking the library into one of the\ncc_shared_library dependencies. At the same time, the one that still links it\nneeds to export the library so that the one not linking it keeps visibility to\nthe symbols. Another way is to pull out a third library that exports the target.\nA third way is to tag the culprit cc_library with LINKABLE_MORE_THAN_ONCE\nbut this fix should be rare and you should absolutely make sure that the\ncc_library is indeed safe to link more than once.
\'//foo:foo\' is already linked statically in \'//bar:bar\' but not exported`This means that a library in the transitive closure of your deps is reachable\nwithout going through one of the cc_shared_library dependencies but is already\nlinked into a different cc_shared_library in dynamic_deps and is not\nexported.
The solution is to export it from the cc_shared_library dependency or pull out\na third cc_shared_library that exports it.
Do not place libraries which only contain a precompiled dynamic library in deps.\nIf you have a precompiled dynamic library, this doesn\'t need to and cannot be\nlinked statically into the current cc_shared_library target that you are\ncurrently creating. Therefore, it doesn\'t belong in deps of the\ncc_shared_library. If this precompiled dynamic library is a dependency of one\nof your cc_libraries, then the cc_library needs to depend on it\ndirectly.
Trying to export a library already exported by a different shared libraryYou will see this error if on the current rule you are claiming to export a\ntarget that is already being exported by one of your dynamic dependencies.
\n\nTo fix this, remove the target from deps and just rely on it from the dynamic\ndependency or make sure that the exports_filter doesn\'t catch this target.
Dependencies that do not provide any object files are not included in the static\nlibrary, but their labels are collected in the file provided by the\nlinkdeps output group.
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "deprecation" + doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "exec_compatible_with" + doc: "List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "expect_failure" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "toolchains" + doc: "List of labels;\n nonconfigurable; default is []
\n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n
@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific cc_toolchain or java_toolchain a\n target will use.\n
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
\n--experimental_cc_static_library flag.\n\nProduces a static library from a list of targets and their transitive dependencies.\n\nThe resulting static library contains the object files of the targets listed in\ndeps as well as their transitive dependencies, with preference given to\nPIC objects.
linkdepsA text file containing the labels of those transitive dependencies of targets listed in\ndeps that did not contribute any object files to the static library, but do\nprovide at least one static, dynamic or interface library. The resulting static library\nmay require these libraries to be available at link time.
linkoptsA text file containing the user-provided linkopts of all transitive\ndependencies of targets listed in deps.\n\n
By default, the cc_static_library rule checks that the resulting static\nlibrary does not contain any duplicate symbols. If it does, the build fails with an error\nmessage that lists the duplicate symbols and the object files containing them.
This check can be disabled per target or per package by setting\nfeatures = [\"-symbol_check\"] or globally via\n--features=-symbol_check.
symbol_checkThe auto-configured C++ toolchains shipped with Bazel support the\nsymbol_check feature on all platforms. Custom toolchains can add support for\nit in one of two ways:
ACTION_NAMES.validate_static_library action and\n enabling it with the symbol_check feature. The tool set in the action is\n invoked with two arguments, the static library to check for duplicate symbols and the\n path of a file that must be created if the check passes.symbol_check feature add archiver flags that cause the\n action creating the static library to fail on duplicate symbols.These can be cc_library or objc_library\ntargets.
All .cc, .c, and .cpp files will\n be compiled. These might be generated files: if a named file is in\n the outs of some other rule, this cc_library\n will automatically depend on that other rule.\n
Pure assembler files (.s, .asm) are not preprocessed and are typically built using\nthe assembler. Preprocessed assembly files (.S) are preprocessed and are typically built\nusing the C/C++ compiler.\n
\nA .h file will not be compiled, but will be available for\n inclusion by sources in this rule. Both .cc and\n .h files can directly include headers listed in\n these srcs or in the hdrs of this rule or any\n rule listed in the deps argument.\n
All #included files must be mentioned in the\n hdrs attribute of this or referenced cc_library\n rules, or they should be listed in srcs if they are private\n to this library. See \"Header inclusion checking\" for\n a more detailed description.\n
.so, .lo, and .a files are\n pre-compiled files. Your library might have these as\n srcs if it uses third-party code for which we don\'t\n have source code.\n
If the srcs attribute includes the label of another rule,\n cc_library will use the output files of that rule as source files to\n compile. This is useful for one-off generation of source code (for more than occasional\n use, it\'s better to implement a Starlark rule class and use the cc_common\n API)\n
\n Permitted srcs file types:\n
.c, .cc, .cpp,\n .cxx, .c++, .C.h, .hh, .hpp,\n .hxx, .inc, .inl, .H.S.a, .pic.a.lo, .pic.lo.so,\n .so.version.o, .pic.o\n ... and any rules that produce those files (e.g. cc_embed_data).\n Different extensions denote different programming languages in\n accordance with gcc convention.\n
data\nat Typical attributes defined by\nmost build rules.\nIf a data is the name of a generated file, then this\n cc_library rule automatically depends on the generating\n rule.\n
If a data is a rule name, then this\n cc_library rule automatically depends on that rule,\n and that rule\'s outs are automatically added to\n this cc_library\'s data files.\n
Your C++ code can access these data files like so:
\n\n const std::string path = devtools_build::GetDataDependencyFilepath(\n \"my/test/data/file\");\n"
+ default_value: "[]"
+ }
+ param {
+ name: "additional_linker_inputs"
+ doc: "Pass these files to the C++ linker command.\n\n For example, compiled Windows .res files can be provided here to be embedded in\n the binary target.\n
" + default_value: "[]" + } + param { + name: "args" + default_value: "[]" + } + param { + name: "compatible_with" + default_value: "[]" + } + param { + name: "conlyopts" + doc: "Add these options to the C compilation command.\nSubject to \"Make variable\" substitution and\nBourne shell tokenization." + default_value: "[]" + } + param { + name: "copts" + doc: "Add these options to the C/C++ compilation command.\nSubject to \"Make variable\" substitution and\nBourne shell tokenization.\n\n Each string in this attribute is added in the given order to COPTS before\n compiling the binary target. The flags take effect only for compiling this target, not\n its dependencies, so be careful about header files included elsewhere.\n All paths should be relative to the workspace, not to the current package.\n This attribute should not be needed outside of third_party.\n
\n If the package declares the feature\n no_copts_tokenization, Bourne shell tokenization applies only to strings\n that consist of a single \"Make\" variable.\n
-D and added to the compile command line to this target,\nas well as to every rule that depends on it. Be very careful, since this may have\nfar-reaching effects. When in doubt, add define values to\nlocal_defines instead."
+ default_value: "[]"
+ }
+ param {
+ name: "deprecation"
+ }
+ param {
+ name: "distribs"
+ default_value: "[]"
+ }
+ param {
+ name: "dynamic_deps"
+ doc: "These are other cc_shared_library dependencies the current target depends on.\n\n\nThe cc_shared_library implementation will use the list of\ndynamic_deps (transitively, i.e. also the dynamic_deps of the\ncurrent target\'s dynamic_deps) to decide which cc_libraries in\nthe transitive deps should not be linked in because they are already provided\nby a different cc_shared_library."
+ default_value: "[]"
+ }
+ param {
+ name: "env"
+ default_value: "{}"
+ }
+ param {
+ name: "env_inherit"
+ default_value: "[]"
+ }
+ param {
+ name: "exec_compatible_with"
+ default_value: "[]"
+ }
+ param {
+ name: "exec_properties"
+ default_value: "{}"
+ }
+ param {
+ name: "expect_failure"
+ }
+ param {
+ name: "features"
+ default_value: "[]"
+ }
+ param {
+ name: "flaky"
+ default_value: "false"
+ }
+ param {
+ name: "hdrs_check"
+ doc: "Deprecated, no-op."
+ }
+ param {
+ name: "includes"
+ doc: "List of include dirs to be added to the compile line.\nSubject to \"Make variable\" substitution.\nEach string is prepended with the package path and passed to the C++ toolchain for\nexpansion via the \"include_paths\" CROSSTOOL feature. A toolchain running on a POSIX system\nwith typical feature definitions will produce\n-isystem path_to_package/include_entry.\nThis should only be used for third-party libraries that\ndo not conform to the Google style of writing #include statements.\nUnlike COPTS, these flags are added for this rule\nand every rule that depends on it. (Note: not the rules it depends upon!) Be\nvery careful, since this may have far-reaching effects. When in doubt, add\n\"-I\" flags to COPTS instead.\n
\nThe added include paths will include generated files as well as\nfiles in the source tree.\n
\n By default, C++ binaries are linked against //tools/cpp:link_extra_lib,\n which by default depends on the label flag //tools/cpp:link_extra_libs.\n Without setting the flag, this library is empty by default. Setting the label flag\n allows linking optional dependencies, such as overrides for weak symbols, interceptors\n for shared library functions, or special runtime libraries (for malloc replacements,\n prefer malloc or --custom_malloc). Setting this attribute to\n None disables this behaviour.\n
LINKOPTS before\nlinking the binary target.\n\n Each element of this list that does not start with $ or - is\n assumed to be the label of a target in deps. The\n list of files generated by that target is appended to the linker\n options. An error is reported if the label is invalid, or is\n not declared in deps.\n
linkshared=True in your rule. By default\nthis option is off.\n\n The presence of this flag means that linking occurs with the -shared flag\n to gcc, and the resulting shared library is suitable for loading into for\n example a Java program. However, for build purposes it will never be linked into the\n dependent binary, as it is assumed that shared libraries built with a\n cc_binary rule are only loaded manually by other programs, so\n it should not be considered a substitute for the cc_library\n rule. For sake of scalability we recommend avoiding this approach altogether and\n simply letting java_library depend on cc_library rules\n instead.\n
\n If you specify both linkopts=[\'-static\'] and linkshared=True,\n you get a single completely self-contained unit. If you specify both\n linkstatic=True and linkshared=True, you get a single, mostly\n self-contained unit.\n
cc_binary and\ncc_test: link the binary in static\nmode. For cc_library.link_static: see below.\nBy default this option is on for cc_binary and off for the rest.
\n If enabled and this is a binary or test, this option tells the build tool to link in\n .a\'s instead of .so\'s for user libraries whenever possible.\n System libraries such as libc (but not the C/C++ runtime libraries,\n see below) are still linked dynamically, as are libraries for which\n there is no static library. So the resulting executable will still be dynamically\n linked, hence only mostly static.\n
\nThere are really three different ways to link an executable:\n
\ngcc -static foo.o libbar.a libbaz.a -lm\".fully_static_link in the\n features attribute.gcc foo.o libfoo.a libbaz.a -lm\".linkstatic=True.gcc foo.o libfoo.so libbaz.so -lm\".linkstatic=False.\nIf the linkstatic attribute or fully_static_link in\nfeatures is used outside of //third_party\nplease include a comment near the rule to explain why.\n
\nThe linkstatic attribute has a different meaning if used on a\ncc_library() rule.\nFor a C++ library, linkstatic=True indicates that only\nstatic linking is allowed, so no .so will be produced. linkstatic=False does\nnot prevent static libraries from being created. The attribute is meant to control the\ncreation of dynamic libraries.\n
\nThere should be very little code built with linkstatic=False in production.\nIf linkstatic=False, then the build tool will create symlinks to\ndepended-upon shared libraries in the *.runfiles area.\n
-D and added to the compile command line for this target,\nbut not to its dependents."
+ default_value: "[]"
+ }
+ param {
+ name: "malloc"
+ doc: "Override the default dependency on malloc.\n\n By default, C++ binaries are linked against //tools/cpp:malloc,\n which is an empty library so the binary ends up using libc malloc.\n This label must refer to a cc_library. If compilation is for a non-C++\n rule, this option has no effect. The value of this attribute is ignored if\n linkshared=True is specified.\n
\nC++ Standard has no restriction about module interface file extension\n
The use is guarded by the flag\n--experimental_cpp_modules.
COPTS that match this regular expression\n(including values explicitly specified in the rule\'s copts attribute)\nwill be removed from COPTS for purposes of compiling this rule.\nThis attribute should not be needed or used\noutside of third_party. The values are not preprocessed\nin any way other than the \"Make\" variable substitution."
+ }
+ param {
+ name: "package_metadata"
+ default_value: "[]"
+ }
+ param {
+ name: "reexport_deps"
+ default_value: "[]"
+ }
+ param {
+ name: "restricted_to"
+ default_value: "[]"
+ }
+ param {
+ name: "shard_count"
+ default_value: "0"
+ }
+ param {
+ name: "size"
+ }
+ param {
+ name: "stamp"
+ doc: "Whether to encode build information into the binary. Possible values:\nstamp = 1: Always stamp the build information into the binary, even in\n --nostamp builds. This\n setting should be avoided, since it potentially kills remote caching for the\n binary and any downstream actions that depend on it.\nstamp = 0: Always replace build information by constant values. This\n gives good build result caching.\nstamp = -1: Embedding of build information is controlled by the\n --[no]stamp flag.\nStamped binaries are not rebuilt unless their dependencies change.
" + default_value: "0" + } + param { + name: "tags" + default_value: "[]" + } + param { + name: "target_compatible_with" + default_value: "[]" + } + param { + name: "testonly" + default_value: "false" + } + param { + name: "timeout" + } + param { + name: "toolchains" + default_value: "[]" + } + param { + name: "transitive_configs" + default_value: "[]" + } + param { + name: "visibility" + default_value: "[]" + } + param { + name: "win_def_file" + doc: "The Windows DEF file to be passed to linker.\nThis attribute should only be used when Windows is the target platform.\nIt can be used to \nexport symbols during linking a shared library.
" + is_mandatory: true + } + } + doc: "\nA cc_test() rule compiles a test. Here, a test\nis a binary wrapper around some testing code.\n
By default, C++ tests are dynamically linked.
\n To statically link a unit test, specify\n linkstatic=True.\n It would probably be good to comment why your test needs\n linkstatic; this is probably not obvious.
name.stripped (only built if explicitly requested): A stripped\n version of the binary. strip -g is run on the binary to remove debug\n symbols. Additional strip options can be provided on the command line using\n --stripopt=-foo.name.dwp (only built if explicitly requested): If\n Fission is enabled: a debug\n information package file suitable for debugging remotely deployed binaries. Else: an\n empty file.\nSee the cc_binary() arguments, except that\nthe stamp argument is set to 0 by default for tests and\nthat cc_test has extra \nattributes common to all test rules (*_test).
all_files is a superset\nof all other artifact-providing attributes (e.g. linkstamp compilation needs both compile\nand link files, so it takes all_files).\n\n\nThis is what cc_toolchain.files contains, and this is used by all Starlark\nrules using C++ toolchain.
This will be used when \'static_link_cpp_runtimes\' feature is enabled, and we\'re linking\ndependencies dynamically.
" + is_mandatory: true + } + param { + name: "exec_compatible_with" + default_value: "[]" + } + param { + name: "exec_properties" + default_value: "{}" + } + param { + name: "exec_transition_for_inputs" + doc: "Deprecated. No-op." + default_value: "false" + } + param { + name: "expect_failure" + } + param { + name: "features" + default_value: "[]" + } + param { + name: "libc_top" + doc: "A collection of artifacts for libc passed as inputs to compile/linking actions." + is_mandatory: true + } + param { + name: "licenses" + default_value: "[]" + } + param { + name: "linker_files" + doc: "Collection of all cc_toolchain artifacts required for linking actions." + is_mandatory: true + } + param { + name: "module_map" + doc: "Module map artifact to be used for modular builds." + is_mandatory: true + } + param { + name: "objcopy_files" + doc: "Collection of all cc_toolchain artifacts required for objcopy actions." + is_mandatory: true + } + param { + name: "output_licenses" + default_value: "[]" + } + param { + name: "package_metadata" + default_value: "[]" + } + param { + name: "restricted_to" + default_value: "[]" + } + param { + name: "static_runtime_lib" + doc: "Static library artifact for the C++ runtime library (e.g. libstdc++.a).\n\nThis will be used when \'static_link_cpp_runtimes\' feature is enabled, and we\'re linking\ndependencies statically.
" + is_mandatory: true + } + param { + name: "strip_files" + doc: "Collection of all cc_toolchain artifacts required for strip actions." + is_mandatory: true + } + param { + name: "supports_header_parsing" + doc: "Set to True when cc_toolchain supports header parsing actions." + default_value: "false" + } + param { + name: "supports_param_files" + doc: "Set to True when cc_toolchain supports using param files for linking actions." + default_value: "false" + } + param { + name: "tags" + default_value: "[]" + } + param { + name: "target_compatible_with" + default_value: "[]" + } + param { + name: "testonly" + default_value: "false" + } + param { + name: "toolchain_config" + doc: "The label of the rule providingcc_toolchain_config_info."
+ is_mandatory: true
+ }
+ param {
+ name: "toolchain_identifier"
+ doc: "The identifier used to match this cc_toolchain with the corresponding\ncrosstool_config.toolchain.\n\n\n Until issue #5380 is fixed\n this is the recommended way of associating cc_toolchain with\n CROSSTOOL.toolchain. It will be replaced by the toolchain_config\n attribute (#5380).
Represents a C++ toolchain.
\n\n\n This rule is responsible for:\n\n
all_files, compiler_files,\n linker_files, or other attributes ending with _files). These are\n most commonly filegroups globbing all required files.\n CcToolchainConfigInfo provider (details below).\n \n Use toolchain_config attribute to configure the C++ toolchain.\n See also this\n \n page\n for elaborate C++ toolchain configuration and toolchain selection documentation.\n
\n Use tags = [\"manual\"] in order to prevent toolchains from being built and configured\n unnecessarily when invoking bazel build //...\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "deprecation" + doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
List of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "package_metadata" + default_value: "[]" + } + param { + name: "restricted_to" + doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "toolchains" + doc: "List of labels;\n nonconfigurable; default is []
\n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n
@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific cc_toolchain or java_toolchain a\n target will use.\n
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
Deprecated: the rule is a no-op and will be removed.\n"
+ api_context: BUILD
+}
+global {
+ name: "config_feature_flag"
+ callable {
+ param {
+ name: "name"
+ is_mandatory: true
+ }
+ param {
+ name: "allowed_values"
+ is_mandatory: true
+ }
+ param {
+ name: "default_value"
+ }
+ param {
+ name: "deprecation"
+ }
+ param {
+ name: "distribs"
+ default_value: "[]"
+ }
+ param {
+ name: "features"
+ default_value: "[]"
+ }
+ param {
+ name: "licenses"
+ default_value: "[none]"
+ }
+ param {
+ name: "package_metadata"
+ default_value: "[]"
+ }
+ param {
+ name: "scope"
+ }
+ param {
+ name: "tags"
+ default_value: "[]"
+ }
+ param {
+ name: "testonly"
+ default_value: "false"
+ }
+ param {
+ name: "visibility"
+ default_value: "[]"
+ }
+ }
+ api_context: BUILD
+}
+global {
+ name: "config_setting"
+ callable {
+ param {
+ name: "name"
+ is_mandatory: true
+ }
+ param {
+ name: "constraint_values"
+ doc: " The minimum set of constraint_values that the target platform must specify\n in order to match this config_setting. (The execution platform is not\n considered here.) Any additional constraint values that the platform has are ignored. See\n \n Configurable Build Attributes for details.\n\n
If two config_settings match in the same select and one has\n all the same flags and constraint_settings as the other plus additional ones,\n the one with more settings is chosen. This is known as \"specialization\". For example,\n a config_setting matching x86 and Linux specializes\n a config_setting matching x86.\n\n
If two config_settings match and both have constraint_values\n not present in the other, this is an error.\n"
+ default_value: "[]"
+ }
+ param {
+ name: "define_values"
+ doc: " The same as values but\n specifically for the --define flag.\n\n
--define is special because its syntax (--define KEY=VAL)\n means KEY=VAL is a value from a Bazel flag perspective.\n
That means:\n\n
\n config_setting(\n name = \"a_and_b\",\n values = {\n \"define\": \"a=1\",\n \"define\": \"b=2\",\n })\n \n\n doesn\'t work because the same key (define) appears twice in the\n dictionary. This attribute solves that problem:\n\n
\n config_setting(\n name = \"a_and_b\",\n define_values = {\n \"a\": \"1\",\n \"b\": \"2\",\n })\n \n\n correctly matches bazel build //foo --define a=1 --define b=2.\n\n
--define can still appear in\n values with normal flag syntax,\n and can be mixed freely with this attribute as long as dictionary keys remain distinct.\n"
+ default_value: "{}"
+ }
+ param {
+ name: "deprecation"
+ doc: "
String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
values but\n for \n user-defined build flags.\n\n This is a distinct attribute because user-defined flags are referenced as labels while\n built-in flags are referenced as arbitrary strings.\n\n" + default_value: "{}" + } + param { + name: "licenses" + doc: "\n
List of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "package_metadata" + default_value: "[]" + } + param { + name: "tags" + doc: "\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "transitive_configs" + default_value: "[]" + } + param { + name: "values" + doc: " The set of configuration values that match this rule (expressed as build flags)\n\nThis rule inherits the configuration of the configured target that\n references it in a select statement. It is considered to\n \"match\" a Bazel invocation if, for every entry in the dictionary, its\n configuration matches the entry\'s expected value. For example\n values = {\"compilation_mode\": \"opt\"} matches the invocations\n bazel build --compilation_mode=opt ... and\n bazel build -c opt ... on target-configured rules.\n
For convenience\'s sake, configuration values are specified as build flags (without\n the preceding \"--\"). But keep in mind that the two are not the same. This\n is because targets can be built in multiple configurations within the same\n build. For example, an exec configuration\'s \"cpu\" matches the value of\n --host_cpu, not --cpu. So different instances of the\n same config_setting may match the same invocation differently\n depending on the configuration of the rule using them.\n
If a flag is not explicitly set at the command line, its default value is used.\n If a key appears multiple times in the dictionary, only the last instance is used.\n If a key references a flag that can be set multiple times on the command line (e.g.\n bazel build --copt=foo --copt=bar --copt=baz ...), a match occurs if\n any of those settings match.\n
\n" + default_value: "{}" + } + param { + name: "visibility" + doc: "
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
\n Matches an expected configuration state (expressed as build flags or platform constraints) for\n the purpose of triggering configurable attributes. See select for\n how to consume this rule and \n Configurable attributes for an overview of the general feature.\n\n
The following matches any build that sets --compilation_mode=opt or\n -c opt (either explicitly at the command line or implicitly from .bazelrc files):\n
\n config_setting(\n name = \"simple\",\n values = {\"compilation_mode\": \"opt\"}\n )\n \n\n The following matches any build that targets ARM and applies the custom define\n FOO=bar (for instance, bazel build --cpu=arm --define FOO=bar ...):\n
\n config_setting(\n name = \"two_conditions\",\n values = {\n \"cpu\": \"arm\",\n \"define\": \"FOO=bar\"\n }\n )\n \n\n The following matches any build that sets\n user-defined flag\n --//custom_flags:foo=1 (either explicitly at the command line or implicitly from\n .bazelrc files):\n
\n config_setting(\n name = \"my_custom_flag_is_set\",\n flag_values = { \"//custom_flags:foo\": \"1\" },\n )\n \n\n The following matches any build that targets a platform with an x86_64 architecture and glibc\n version 2.25, assuming the existence of a constraint_value with label\n //example:glibc_2_25. Note that a platform still matches if it defines additional\n constraint values beyond these two.\n
\n config_setting(\n name = \"64bit_glibc_2_25\",\n constraint_values = [\n \"@platforms//cpu:x86_64\",\n \"//example:glibc_2_25\",\n ]\n )\n\n\n In all these cases, it\'s possible for the configuration to change within the build, for example if\n a target needs to be built for a different platform than its dep. This means that even when a\n
config_setting doesn\'t match the top-level command-line flags, it may still match\n some build targets.\n\n config_settings match the current configuration state.\n --compilation_mode vs.\n -c), values definitions must use the full form. These automatically\n match invocations using either form.\n --copt=-Da --copt=-Db or a list-typed\n \n Starlark flag), values = { \"flag\": \"a\" } matches if \"a\" is\n present anywhere in the actual list.\n\n \n values = { \"myflag\": \"a,b\" } works the same way: this matches\n --myflag=a --myflag=b, --myflag=a --myflag=b --myflag=c,\n --myflag=a,b, and --myflag=c,b,a. Exact semantics vary between\n flags. For example, --copt doesn\'t support multiple values in the same\n instance: --copt=a,b produces [\"a,b\"] while --copt=a\n --copt=b produces [\"a\", \"b\"] (so values = { \"copt\": \"a,b\" }\n matches the former but not the latter). But --ios_multi_cpus (for Apple rules)\n does: -ios_multi_cpus=a,b and ios_multi_cpus=a --ios_multi_cpus=b\n both produce [\"a\", \"b\"]. Check flag definitions and test your\n conditions carefully to verify exact expectations.\n
--define, but this offers weaker\n support and is not recommended. See\n here for more discussion.\n config_setting definitions in different packages.\n Instead, reference a common config_setting that defined in a canonical package.\n values,\n define_values, and\n constraint_values\n can be used in any combination in the same config_setting but at least one must\n be set for any given config_setting.\n constraint_value it points to must be defined in the\n same package as this constraint_setting.\n\n If a constraint setting has a default value, then whenever a platform does not include\n any constraint value for that setting, it is the same as if the platform had specified the\n default value. Otherwise, if there is no default value, the constraint setting is considered\n to be unspecified by that platform. In that case, the platform would not match against any\n constraint list (such as for a config_setting) that requires a particular value\n for that setting.\n"
+ is_mandatory: true
+ }
+ param {
+ name: "deprecation"
+ doc: "
String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
List of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "tags" + doc: "\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "transitive_configs" + default_value: "[]" + } + param { + name: "visibility" + doc: "List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
This rule is used to introduce a new constraint type for which a platform may specify a value.\nFor instance, you might define a constraint_setting named \"glibc_version\" to represent\nthe capability for platforms to have different versions of the glibc library installed.\n\nFor more details, see the\nPlatforms page.\n\n
Each constraint_setting has an extensible set of associated\nconstraint_values. Usually these are defined in the same package, but sometimes a\ndifferent package will introduce new values for an existing setting. For instance, the predefined\nsetting @platforms//cpu:cpu can be extended with a custom value in order to\ndefine a platform targeting an obscure cpu architecture.\n\n"
+ api_context: BUILD
+}
+global {
+ name: "constraint_value"
+ callable {
+ param {
+ name: "name"
+ is_mandatory: true
+ }
+ param {
+ name: "constraint_setting"
+ doc: " The constraint_setting for which this constraint_value is a\n possible choice.\n"
+ is_mandatory: true
+ }
+ param {
+ name: "deprecation"
+ doc: "
String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
List of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "tags" + doc: "\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "transitive_configs" + default_value: "[]" + } + param { + name: "visibility" + doc: "List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
The following creates a new possible value for the predefined constraint_value\nrepresenting cpu architecture.\n
\nconstraint_value(\n name = \"mips\",\n constraint_setting = \"@platforms//cpu:cpu\",\n)\n\n\nPlatforms can then declare that they have the
mips architecture as an alternative to\nx86_64, arm, and so on.\n\n"
+ api_context: BUILD
+}
+global {
+ name: "depset"
+ callable {
+ param {
+ name: "direct"
+ doc: "A list of direct elements of a depset. "
+ default_value: "None"
+ }
+ param {
+ name: "order"
+ doc: "The traversal strategy for the new depset. See here for the possible values."
+ default_value: "\"default\""
+ }
+ param {
+ name: "transitive"
+ doc: "A list of depsets whose elements will become indirect elements of the depset."
+ default_value: "None"
+ }
+ }
+ doc: "Creates a depset. The direct parameter is a list of direct elements of the depset, and transitive parameter is a list of depsets whose elements become indirect elements of the created depset. The order in which elements are returned when the depset is converted to a list is specified by the order parameter. See the Depsets overview for more information.\nAll elements (direct and indirect) of a depset must be of the same type, as obtained by the expression type(x).\n
Because a hash-based set is used to eliminate duplicates during iteration, all elements of a depset should be hashable. However, this invariant is not currently checked consistently in all constructors. Use the --incompatible_always_check_depset_elements flag to enable consistent checking; this will be the default behavior in future releases; see Issue 10313.\n
In addition, elements must currently be immutable, though this restriction will be relaxed in future.\n
The order of the created depset should be compatible with the order of its transitive depsets. \"default\" order is compatible with any other order, all other orders are only compatible with themselves."
+ api_context: BUILD
+}
+global {
+ name: "environment"
+ callable {
+ param {
+ name: "name"
+ is_mandatory: true
+ }
+ param {
+ name: "deprecation"
+ }
+ param {
+ name: "distribs"
+ default_value: "[]"
+ }
+ param {
+ name: "features"
+ default_value: "[]"
+ }
+ param {
+ name: "fulfills"
+ default_value: "[]"
+ }
+ param {
+ name: "licenses"
+ default_value: "[none]"
+ }
+ param {
+ name: "package_metadata"
+ default_value: "[]"
+ }
+ param {
+ name: "tags"
+ default_value: "[]"
+ }
+ param {
+ name: "testonly"
+ default_value: "false"
+ }
+ param {
+ name: "transitive_configs"
+ default_value: "[]"
+ }
+ param {
+ name: "visibility"
+ default_value: "[]"
+ }
+ }
+ api_context: BUILD
+}
+global {
+ name: "environment_group"
+ callable {
+ param {
+ name: "name"
+ doc: "The name of the rule."
+ is_mandatory: true
+ }
+ param {
+ name: "environments"
+ doc: "A list of Labels for the environments to be grouped, from the same package."
+ is_mandatory: true
+ }
+ param {
+ name: "defaults"
+ doc: "A list of Labels."
+ is_mandatory: true
+ }
+ }
+ doc: "Defines a set of related environments that can be tagged onto rules to preventincompatible rules from depending on each other."
+ api_context: BUILD
+}
+global {
+ name: "existing_rule"
+ callable {
+ param {
+ name: "name"
+ doc: "The name of the target."
+ is_mandatory: true
+ }
+ }
+ doc: "Returns an immutable dict-like object that describes the attributes of a rule instantiated in this thread\'s package, or None if no rule instance of that name exists.
Here, an immutable dict-like object means a deeply immutable object x supporting dict-like iteration, len(x), name in x, x[name], x.get(name), x.items(), x.keys(), and x.values().
The result contains an entry for each attribute, with the exception of private ones (whose names do not start with a letter) and a few unrepresentable legacy attribute types. In addition, the dict contains entries for the rule instance\'s name and kind (for example, \'cc_binary\').
The values of the result represent attribute values as follows:
\':foo\' for targets in the same package or \'//pkg:name\' for targets in a different package.select values are returned with their contents transformed as described above.If possible, use this function only in implementation functions of rule finalizer symbolic macros. Use of this function in other contexts is not recommened, and will be disabled in a future Bazel release; it makes BUILD files brittle and order-dependent. Also, beware that it differs subtly from the two other conversions of rule attribute values from internal form to Starlark: one used by computed defaults, the other used by ctx.attr.foo."
+ api_context: BUILD
+}
+global {
+ name: "existing_rules"
+ callable {
+ }
+ doc: "Returns an immutable dict-like object describing the rules so far instantiated in this thread\'s package. Each entry of the dict-like object maps the name of the rule instance to the result that would be returned by existing_rule(name).
Here, an immutable dict-like object means a deeply immutable object x supporting dict-like iteration, len(x), name in x, x[name], x.get(name), x.items(), x.keys(), and x.values().
If possible, use this function only in implementation functions of rule finalizer symbolic macros. Use of this function in other contexts is not recommened, and will be disabled in a future Bazel release; it makes BUILD files brittle and order-dependent."
+ api_context: BUILD
+}
+global {
+ name: "exports_files"
+ callable {
+ param {
+ name: "srcs"
+ doc: "The list of files to export."
+ is_mandatory: true
+ }
+ param {
+ name: "visibility"
+ doc: "A visibility declaration can to be specified. The files will be visible to the targets specified. If no visibility is specified, the files will be visible to every package."
+ default_value: "None"
+ }
+ param {
+ name: "licenses"
+ doc: "Licenses to be specified."
+ default_value: "None"
+ }
+ }
+ doc: "Specifies a list of files belonging to this package that are exported to other packages."
+ api_context: BUILD
+}
+global {
+ name: "extra_action"
+ callable {
+ param {
+ name: "name"
+ is_mandatory: true
+ }
+ param {
+ name: "data"
+ doc: "\n
List of labels; default is []
\nFiles needed by this rule at runtime. May list file or rule targets. Generally\nallows any target.\n
\n\n\nThe default outputs and runfiles of targets in the data attribute\nshould appear in the *.runfiles area of any executable which is\noutput by or has a runtime dependency on this target. This may include data\nfiles or binaries used when this target\'s\nsrcs are executed. See the\ndata dependencies\nsection for more information about how to depend on and use data files.\n
\nNew rules should define a data attribute if they process\ninputs which might use other inputs at runtime. Rules\' implementation functions\nmust also populate the target\'s\nrunfiles from the outputs and runfiles of any data attribute,\nas well as runfiles from any dependency attribute which provides either\nsource code or runtime dependencies.\n
\n Like genrule cmd attribute with the following\n differences:\n
\n\n No heuristic label expansion. Only labels using $(location ...) are expanded.\n
\n\n An additional pass is applied to the string to replace all\n occurrences of the outputs created from the out_templates\n attribute. All occurrences of $(output out_template)\n are replaced with the path to the file denoted by label.\n
\n E.g. out_template $(ACTION_ID).analysis\n can be matched with $(output $(ACTION_ID).analysis).\n
\n In effect, this is the same substitution as $(location)\n but with a different scope.\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "deprecation" + doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "exec_compatible_with" + doc: "List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
List of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "out_templates" + doc: " A list of templates for files generated by theextra_action command.\n \n The template can use the following variables:\n
extra_action.\n Used to generate a unique output file.\n extra_action requires the output of the\n original action to be present as input to this extra_action.\n \n When true (default false), the extra_action can assume that the\n original action outputs are available as part of its inputs.\n
\n" + default_value: "false" + } + param { + name: "restricted_to" + doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "toolchains" + doc: "List of labels;\n nonconfigurable; default is []
\n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n
@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific cc_toolchain or java_toolchain a\n target will use.\n
tool dependencies for this rule.\n \n See the definition of dependencies for more\n information.\n
\n\n The build system ensures these prerequisites are built before running the\n extra_action command; they are built using the\n execconfiguration,\n since they must run as a tool during the build itself. The path of an individual\n tools target //x:y can be obtained using\n $(location //x:y).\n
\n All tools and their data dependencies are consolidated into a single tree\n within which the command can use relative paths. The working directory will\n be the root of that unified tree.\n
\n" + default_value: "[]" + } + param { + name: "transitive_configs" + default_value: "[]" + } + param { + name: "visibility" + doc: "List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
\n WARNING: Extra actions are deprecated. Use\n aspects\n instead.\n
\n\n\n An extra_action rule doesn\'t produce any meaningful output\n when specified as a regular build target. Instead, it allows tool developers\n to insert additional actions into the build graph that shadow existing actions.\n
\n See action_listener for details\n on how to enable extra_actions.\n
\n The extra_actions run as a command-line. The command-line tool gets\n access to a file containing a protocol buffer as $(EXTRA_ACTION_FILE)\n with detailed information on the original action it is shadowing.\n It also has access to all the input files the original action has access to.\n See extra_actions_base.proto\n for details on the data stored inside the protocol buffer. Each proto file\n contains an ExtraActionInfo message.\n
\n Just like all other actions, extra actions are sandboxed, and should be designed to handle that.\n
\n\n" + api_context: BUILD +} +global { + name: "fdo_prefetch_hints" + callable { + param { + name: "name" + is_mandatory: true + } + param { + name: "compatible_with" + default_value: "[]" + } + param { + name: "deprecation" + } + param { + name: "exec_compatible_with" + default_value: "[]" + } + param { + name: "exec_properties" + default_value: "{}" + } + param { + name: "expect_failure" + } + param { + name: "features" + default_value: "[]" + } + param { + name: "package_metadata" + default_value: "[]" + } + param { + name: "profile" + doc: "Label of the hints profile. The hints file has the .afdo extension\nThe label can also point to an fdo_absolute_path_profile rule." + is_mandatory: true + } + param { + name: "restricted_to" + default_value: "[]" + } + param { + name: "tags" + default_value: "[]" + } + param { + name: "target_compatible_with" + default_value: "[]" + } + param { + name: "testonly" + default_value: "false" + } + param { + name: "toolchains" + default_value: "[]" + } + param { + name: "transitive_configs" + default_value: "[]" + } + param { + name: "visibility" + default_value: "[]" + } + } + doc: "Represents an FDO prefetch hints profile that is either in the workspace.\nExamples:
\n\n\nfdo_prefetch_hints(\n name = \"hints\",\n profile = \"//path/to/hints:profile.afdo\",\n)\n"
+ api_context: BUILD
+}
+global {
+ name: "fdo_profile"
+ callable {
+ param {
+ name: "name"
+ is_mandatory: true
+ }
+ param {
+ name: "compatible_with"
+ default_value: "[]"
+ }
+ param {
+ name: "deprecation"
+ }
+ param {
+ name: "exec_compatible_with"
+ default_value: "[]"
+ }
+ param {
+ name: "exec_properties"
+ default_value: "{}"
+ }
+ param {
+ name: "expect_failure"
+ }
+ param {
+ name: "features"
+ default_value: "[]"
+ }
+ param {
+ name: "memprof_profile"
+ doc: "Label of the MemProf profile. The profile is expected to have\neither a .profdata extension (for an indexed/symbolized memprof\nprofile), or a .zip extension for a zipfile containing a memprof.profdata\nfile."
+ is_mandatory: true
+ }
+ param {
+ name: "package_metadata"
+ default_value: "[]"
+ }
+ param {
+ name: "profile"
+ doc: "Label of the FDO profile or a rule which generates it. The FDO file can have one of the\nfollowing extensions: .profraw for unindexed LLVM profile, .profdata for indexed LLVM\nprofile, .zip that holds an LLVM profraw profile, .afdo for AutoFDO profile, .xfdo for\nXBinary profile. The label can also point to an fdo_absolute_path_profile rule."
+ is_mandatory: true
+ }
+ param {
+ name: "proto_profile"
+ doc: "Label of the protobuf profile."
+ is_mandatory: true
+ }
+ param {
+ name: "restricted_to"
+ default_value: "[]"
+ }
+ param {
+ name: "tags"
+ default_value: "[]"
+ }
+ param {
+ name: "target_compatible_with"
+ default_value: "[]"
+ }
+ param {
+ name: "testonly"
+ default_value: "false"
+ }
+ param {
+ name: "toolchains"
+ default_value: "[]"
+ }
+ param {
+ name: "transitive_configs"
+ default_value: "[]"
+ }
+ param {
+ name: "visibility"
+ default_value: "[]"
+ }
+ }
+ doc: "Represents an FDO profile that is in the workspace.\nExample:
\n\n\nfdo_profile(\n name = \"fdo\",\n profile = \"//path/to/fdo:profile.zip\",\n)\n"
+ api_context: BUILD
+}
+global {
+ name: "filegroup"
+ callable {
+ param {
+ name: "name"
+ is_mandatory: true
+ }
+ param {
+ name: "srcs"
+ doc: " The list of targets that are members of the file group.\n \n It is common to use the result of a glob expression for\n the value of the srcs attribute.\n
\n Targets named in the data attribute will be added to the\n runfiles of this filegroup rule. When the\n filegroup is referenced in the data attribute of\n another rule its runfiles will be added to the runfiles\n of the depending rule. See the data dependencies\n section and general documentation of\n data for more information about how to depend on and use data files.\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "deprecation" + doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
List of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "output_group" + doc: " The output group from which to gather artifacts from sources. If this attribute is\n specified, artifacts from the specified output group of the dependencies will be exported\n instead of the default output group.\nAn \"output group\" is a category of output artifacts of a target, specified in that\n rule\'s implementation.\n
\n" + } + param { + name: "output_licenses" + default_value: "[none]" + } + param { + name: "package_metadata" + default_value: "[]" + } + param { + name: "restricted_to" + doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "transitive_configs" + default_value: "[]" + } + param { + name: "visibility" + doc: "List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
\n Use filegroup to gather the outputs of a set of targets under a single\n label.\n
\n filegroup is not a substitute for listing targets on the command line or\n in an attribute of another rule, because targets have many properties other than their\n outputs, which are not collected in the same way. However, it\'s still useful in quite\n a few cases, for example, in the srcs attribute of a genrule, or\n the data attribute of a *_binary rule.\n
\n Using filegroup is encouraged instead of referencing directories directly.\n Directly referencing directories is discouraged because the build system does not have\n full knowledge of all files below the directory, so it may not rebuild when these files change.\n When combined with glob, filegroup can ensure that all\n files are explicitly known to the build system.\n
\n To create a filegroup consisting of two source files, do\n
\nfilegroup(\n name = \"mygroup\",\n srcs = [\n \"a_file.txt\",\n \"//a/library:target\",\n \"//a/binary:target\",\n ],\n)\n\n
\n Or, use a glob to fully crawl a testdata directory:\n
\nfilegroup(\n name = \"exported_testdata\",\n srcs = glob([\n \"testdata/*.dat\",\n \"testdata/logs/**/*.log\",\n ]),\n)\n\n
\n To make use of these definitions, reference the filegroup with a label from any rule:\n
\ncc_library(\n name = \"my_library\",\n srcs = [\"foo.cc\"],\n data = [\n \"//my_package:exported_testdata\",\n \"//my_package:mygroup\",\n ],\n)\n\n\n" + api_context: BUILD +} +global { + name: "genquery" + callable { + param { + name: "name" + is_mandatory: true + } + param { + name: "deps" + doc: "\n
List of labels; default is []
\nDependencies for this target. Generally should only list rule targets. (Though\nsome rules permit files to be listed directly in deps, this\nshould be avoided when possible.)\n
\nLanguage-specific rules generally limit the listed targets to those with\nspecific providers.
\n\n\nThe precise semantics of what it means for a target to depend on another using\ndeps are specific to the kind of rule, and the rule-specific\ndocumentation goes into more detail. For rules which process source code,\ndeps generally specifies code dependencies used by the code in\nsrcs.\n
\nMost often, a deps dependency is used to allow one module to use\nsymbols defined in another module written in the same programming language and\nseparately compiled. Cross-language dependencies are also permitted in many\ncases: For example, a java_library target may depend on C++ code\nin a cc_library target, by listing the latter in the\ndeps attribute. See the definition of\ndependencies\nfor more information.\n
List of labels; default is []
\nFiles needed by this rule at runtime. May list file or rule targets. Generally\nallows any target.\n
\n\n\nThe default outputs and runfiles of targets in the data attribute\nshould appear in the *.runfiles area of any executable which is\noutput by or has a runtime dependency on this target. This may include data\nfiles or binaries used when this target\'s\nsrcs are executed. See the\ndata dependencies\nsection for more information about how to depend on and use data files.\n
\nNew rules should define a data attribute if they process\ninputs which might use other inputs at runtime. Rules\' implementation functions\nmust also populate the target\'s\nrunfiles from the outputs and runfiles of any data attribute,\nas well as runfiles from any dependency attribute which provides either\nsource code or runtime dependencies.\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "compressed_output" + doc: " IfTrue, query output is written in GZIP file format. This setting can be used\n to avoid spikes in Bazel\'s memory use when the query output is expected to be large. Bazel\n already internally compresses query outputs greater than 220 bytes regardless of\n the value of this setting, so setting this to True may not reduce retained\n heap. However, it allows Bazel to skip decompression when writing the output file,\n which can be memory-intensive.\n"
+ default_value: "false"
+ }
+ param {
+ name: "deprecation"
+ doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "exec_compatible_with" + doc: "List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "expression" + doc: " The query to be executed. In contrast to the command line and other places in BUILD files,\n labels here are resolved relative to the root directory of the workspace. For example, the\n label:b in this attribute in the file a/BUILD will refer to the\n target //:b.\n"
+ is_mandatory: true
+ }
+ param {
+ name: "features"
+ doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
List of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "opts" + doc: " The options that are passed to the query engine. These correspond to the command line\n options that can be passed tobazel query. Some query options are not allowed\n here: --keep_going, --query_file, --universe_scope,\n --order_results and --order_output. Options not specified here\n will have their default values just like on the command line of bazel query.\n"
+ default_value: "[]"
+ }
+ param {
+ name: "package_metadata"
+ default_value: "[]"
+ }
+ param {
+ name: "restricted_to"
+ doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "transitive_configs" + default_value: "[]" + } + param { + name: "visibility" + doc: "List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
\n genquery() runs a query specified in the\n Bazel query language and dumps the result\n into a file.\n
\n In order to keep the build consistent, the query is allowed only to visit\n the transitive closure of the targets specified in the scope\n attribute. Queries violating this rule will fail during execution if\n strict is unspecified or true (if strict is false,\n the out of scope targets will simply be skipped with a warning). The\n easiest way to make sure this does not happen is to mention the same labels\n in the scope as in the query expression.\n
\n The only difference between the queries allowed here and on the command\n line is that queries containing wildcard target specifications (e.g.\n //pkg:* or //pkg:all) are not allowed here.\n The reasons for this are two-fold: first, because genquery has\n to specify a scope to prevent targets outside the transitive closure of the\n query to influence its output; and, second, because BUILD files\n do not support wildcard dependencies (e.g. deps=[\"//a/...\"]\n is not allowed).\n
\n The genquery\'s output is ordered lexicographically in order to enforce deterministic output,\n with the exception of --output=graph|minrank|maxrank or when somepath\n is used as the top-level function.\n
\n The name of the output file is the name of the rule.\n
\n\n\n This example writes the list of the labels in the transitive closure of the\n specified target to a file.\n
\n\n\ngenquery(\n name = \"kiwi-deps\",\n expression = \"deps(//kiwi:kiwi_lib)\",\n scope = [\"//kiwi:kiwi_lib\"],\n)\n\n\n" + api_context: BUILD +} +global { + name: "genrule" + callable { + param { + name: "name" + is_mandatory: true + } + param { + name: "srcs" + doc: " A list of inputs for this rule, such as source files to process.\n
\n This attributes is not suitable to list tools executed by the cmd; use\n the tools attribute for them instead.\n \n
\n The build system ensures these prerequisites are built before running the genrule\n command; they are built using the same configuration as the original build request. The\n names of the files of these prerequisites are available to the command as a\n space-separated list in $(SRCS); alternatively the path of an individual\n srcs target //x:y can be obtained using $(location\n //x:y), or using $< provided it\'s the only entry in\n srcs.\n
\n Output files must not cross package boundaries.\n Output filenames are interpreted as relative to the package.\n
\n\n If the executable flag is set, outs must contain exactly one\n label.\n
\n The genrule command is expected to create each output file at a predetermined location.\n The location is available in cmd using genrule-specific \"Make\"\n variables ($@, $(OUTS), $(@D) or \n $(RULEDIR)) or using \n $(location) substitution.\n
$(location)\n and \"Make\" variable substitution.\n $(location)\n substitution is applied, replacing all occurrences of $(location \n label) and of $(locations label) (and similar\n constructions using related variables execpath, execpaths,\n rootpath and rootpaths).\n $(JAVA), $(JAVAC) and\n $(JAVABASE) expand under the exec configuration, so Java invocations\n that run as part of a build step can correctly load shared libraries and other\n dependencies.\n cmd_bash, cmd_ps and cmd_bat,\n if none of them are applicable.\n \n \n If the command line length exceeds the platform limit (64K on Linux/macOS, 8K on Windows),\n then genrule will write the command to a script and execute that script to work around. This\n applies to all cmd attributes (cmd, cmd_bash, cmd_ps,\n cmd_bat).\n
This attribute has higher priority than cmd. The command is expanded and\n runs in the exact same way as the cmd attribute.\n
This attribute has higher priority than cmd and cmd_bash.\n The command runs in the similar way as the cmd attribute, with the\n following differences:\n
cmd.exe /c with the following default arguments:\n /S - strip first and last quotes and execute everything else as is.\n /E:ON - enable extended command set.\n /V:ON - enable delayed variable expansion\n /D - ignore AutoRun registry entries.\n This attribute has higher priority than cmd, cmd_bash and\n cmd_bat. The command runs in the similar way as the cmd\n attribute, with the following differences:\n
powershell.exe /c.\n To make Powershell easier to use and less error-prone, we run the following\n commands to set up the environment before executing Powershell command in genrule.\n
\nSet-ExecutionPolicy -Scope CurrentUser RemoteSigned - allow running\n unsigned scripts.\n $errorActionPreference=\'Stop\' - In case there are multiple commands\n separated by ;, the action exits immediately if a Powershell CmdLet fails,\n but this does NOT work for external command.\n $PSDefaultParameterValues[\'*:Encoding\'] = \'utf8\' - change the default\n encoding from utf-16 to utf-8.\n List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "deprecation" + doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "exec_compatible_with" + doc: "List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "executable" + doc: " Declare output to be executable.\n\n Setting this flag to True means the output is an executable file and can be run using the\n run command. The genrule must produce exactly one output in this case.\n If this attribute is set, run will try executing the file regardless of\n its content.\n
Declaring data dependencies for the generated executable is not supported.
\n" + default_value: "false" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
List of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "local" + doc: "\n If set to True, this option forces this genrule to run using the \"local\"\n strategy, which means no remote execution, no sandboxing, no persistent workers.\n
\n This is equivalent to providing \'local\' as a tag (tags=[\"local\"]).\n
\n A progress message that will be printed as this build step is executed. By default, the\n message is \"Generating output\" (or something equally bland) but you may provide a\n more specific one. Use this attribute instead of echo or other print\n statements in your cmd command, as this allows the build tool to control\n whether such progress messages are printed or not.\n
common attributes\n \n"
+ default_value: "[none]"
+ }
+ param {
+ name: "output_to_bindir"
+ doc: " \n If set to True, this option causes output files to be written into the bin\n directory instead of the genfiles directory.\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "toolchains" + doc: "\n The set of targets whose Make variables this genrule\n is allowed to access, or the toolchain_type\n targets that this genrule will access.\n
\n Toolchains accessed via toolchain_type must also provide a\n TemplateVariableInfo provider, which the target can use to access toolchain\n details.\n
\n The build system ensures these prerequisites are built before running the genrule command;\n they are built using the exec\n configuration, since these tools are executed as part of the build. The path of an\n individual tools target //x:y can be obtained using\n $(location //x:y).\n
\n Any *_binary or tool to be executed by cmd must appear in this\n list, not in srcs, to ensure they are built in the correct configuration.\n
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
A genrule generates one or more files using a user-defined Bash command.
\n Genrules are generic build rules that you can use if there\'s no specific rule for the task.\n For example, you could run a Bash one-liner. If however you need to compile C++ files, stick\n to the existing cc_* rules, because all the heavy lifting has already been done\n for you.\n
\n Note that genrule requires a shell to interpret the command argument.\n It is also easy to reference arbitrary programs available on the PATH, however this makes the\n command non-hermetic and may not be reproducible.\n If you only need to run a single tool, consider using\n run_binary\n instead.\n
\n\n Like every other action, the action created by genrules should not assume anything about their\n working directory; all Bazel guarantees is that their declared inputs will be available at the\n path that $(location) returns for their label. For example, if the action is run in a\n sandbox or remotely, the implementation of the sandbox or the remote execution will determine the\n working directory. If run directly (using the standalone strategy), the working\n directory will be the execution root, i.e. the result of bazel info execution_root.\n
\n Do not use a genrule for running tests. There are special dispensations for tests and test\n results, including caching policies and environment variables. Tests generally need to be run\n after the build is complete and on the target architecture, whereas genrules are executed during\n the build and on the exec architecture (the two may be different). If you need a general purpose\n testing rule, use sh_test.\n
\n See the user manual for more info about\n cross-compilation.\n
\n\n While genrules run during a build, their outputs are often used after the build, for deployment or\n testing. Consider the example of compiling C code for a microcontroller: the compiler accepts C\n source files and generates code that runs on a microcontroller. The generated code obviously\n cannot run on the CPU that was used for building it, but the C compiler (if compiled from source)\n itself has to.\n
\n\n The build system uses the exec configuration to describe the machine(s) on which the build runs\n and the target configuration to describe the machine(s) on which the output of the build is\n supposed to run. It provides options to configure each of these and it segregates the\n corresponding files into separate directories to avoid conflicts.\n
\n\n For genrules, the build system ensures that dependencies are built appropriately:\n srcs are built (if necessary) for the target configuration,\n tools are built for the exec configuration, and the output is considered to\n be for the target configuration. It also provides \n \"Make\" variables that genrule commands can pass to the corresponding tools.\n
\n It is intentional that genrule defines no deps attribute: other built-in rules use\n language-dependent meta information passed between the rules to automatically determine how to\n handle dependent rules, but this level of automation is not possible for genrules. Genrules work\n purely at the file and runfiles level.\n
\n Exec-exec compilation: in some cases, the build system needs to run genrules such that the\n output can also be executed during the build. If for example a genrule builds some custom compiler\n which is subsequently used by another genrule, the first one has to produce its output for the\n exec configuration, because that\'s where the compiler will run in the other genrule. In this case,\n the build system does the right thing automatically: it builds the srcs and\n outs of the first genrule for the exec configuration instead of the target\n configuration. See the user manual for more\n info.\n
\n JDK & C++ Tooling: to use a tool from the JDK or the C++ compiler suite, the build system\n provides a set of variables to use. See \"Make\" variable for\n details.\n
\n\n\n The genrule command is executed by a Bash shell that is configured to fail when a command\n or a pipeline fails, using set -e -o pipefail.\n
\n The build tool executes the Bash command in a sanitized process environment that\n defines only core variables such as PATH, PWD,\n TMPDIR, and a few others.\n\n To ensure that builds are reproducible, most variables defined in the user\'s shell\n environment are not passed though to the genrule\'s command. However, Bazel (but not\n Blaze) passes through the value of the user\'s PATH environment variable.\n\n Any change to the value of PATH will cause Bazel to re-execute the command\n on the next build.\n \n
\n A genrule command should not access the network except to connect processes that are\n children of the command itself, though this is not currently enforced.\n
\n\n The build system automatically deletes any existing output files, but creates any necessary parent\n directories before it runs a genrule. It also removes any output files in case of a failure.\n
\n\n$(location) extensively, for outputs, tools and sources. Due to the\n segregation of output files for different configurations, genrules cannot rely on hard-coded\n and/or absolute paths.$$ evaluates to a $, a literal dollar-sign, so in order to invoke a\n shell command containing dollar-signs such as ls $(dirname $x), one must escape it\n thus: ls $$(dirname $$x).srcs will avoid\n unintentionally picking up other outputs of the genrule, but can be tedious if the genrule\n produces many outputs.\n This example generates foo.h. There are no sources, because the command doesn\'t take\n any input. The \"binary\" run by the command is a perl script in the same package as the genrule.\n
\ngenrule(\n name = \"foo\",\n srcs = [],\n outs = [\"foo.h\"],\n cmd = \"./$(location create_foo.pl) > \\\"$@\\\"\",\n tools = [\"create_foo.pl\"],\n)\n\n\n
\n The following example shows how to use a filegroup\n and the outputs of another genrule. Note that using $(SRCS) instead\n of explicit $(location) directives would also work; this example uses the latter for\n sake of demonstration.\n
\ngenrule(\n name = \"concat_all_files\",\n srcs = [\n \"//some:files\", # a filegroup with multiple files in it ==> $(locations)\n \"//other:gen\", # a genrule with a single output ==> $(location)\n ],\n outs = [\"concatenated.txt\"],\n cmd = \"cat $(locations //some:files) $(location //other:gen) > $@\",\n)\n\n\n" + api_context: BUILD +} +global { + name: "glob" + callable { + param { + name: "include" + doc: "The list of glob patterns to include." + default_value: "[]" + } + param { + name: "exclude" + doc: "The list of glob patterns to exclude." + default_value: "[]" + } + param { + name: "exclude_directories" + doc: "A flag whether to exclude directories or not." + default_value: "1" + } + param { + name: "allow_empty" + doc: "Whether we allow glob patterns to match nothing. If `allow_empty` is False, each individual include pattern must match something and also the final result must be non-empty (after the matches of the `exclude` patterns are excluded)." + default_value: "unbound" + } + } + doc: "Glob returns a new, mutable, sorted list of every file in the current package that:
include.exclude (default []).exclude_directories argument is enabled (set to 1), files of type directory will be omitted from the results (default 1)."
+ api_context: BUILD
+}
+global {
+ name: "java_binary"
+ callable {
+ param {
+ name: "deps"
+ doc: "The list of other libraries to be linked in to the target.\nSee general comments about deps at\nTypical attributes defined by\nmost build rules."
+ default_value: "[]"
+ }
+ param {
+ name: "srcs"
+ doc: "The list of source files that are processed to create the target.\nThis attribute is almost always required; see exceptions below.\n\nSource files of type .java are compiled. In case of generated\n.java files it is generally advisable to put the generating rule\'s name\nhere instead of the name of the file itself. This not only improves readability but\nmakes the rule more resilient to future changes: if the generating rule generates\ndifferent files in the future, you only need to fix one place: the outs of\nthe generating rule. You should not list the generating rule in deps\nbecause it is a no-op.\n
\nSource files of type .srcjar are unpacked and compiled. (This is useful if\nyou need to generate a set of .java files with a genrule.)\n
\nRules: if the rule (typically genrule or filegroup) generates\nany of the files listed above, they will be used the same way as described for source\nfiles.\n
\nThis argument is almost always required, except if a\nmain_class attribute specifies a\nclass on the runtime classpath or you specify the runtime_deps argument.\n
data\nat Typical attributes defined by\nmost build rules."
+ default_value: "[]"
+ }
+ param {
+ name: "resources"
+ doc: "A list of data files to include in a Java jar.\n\n\nResources may be source files or generated files.\n
\n\n\nIf resources are specified, they will be bundled in the jar along with the usual\n.class files produced by compilation. The location of the resources inside\nof the jar file is determined by the project structure. Bazel first looks for Maven\'s\nstandard directory layout,\n(a \"src\" directory followed by a \"resources\" directory grandchild). If that is not\nfound, Bazel then looks for the topmost directory named \"java\" or \"javatests\" (so, for\nexample, if a resource is at <workspace root>/x/java/y/java/z, the\npath of the resource will be y/java/z. This heuristic cannot be overridden,\nhowever, the resource_strip_prefix attribute can be used to specify a\nspecific alternative directory for resource files."
+ default_value: "[]"
+ }
+ param {
+ name: "add_exports"
+ doc: "Allow this library to access the given module or package.\n
\nThis corresponds to the javac and JVM --add-exports= flags."
+ default_value: "[]"
+ }
+ param {
+ name: "add_opens"
+ doc: "Allow this library to reflectively access the given module or\npackage.\n
\nThis corresponds to the javac and JVM --add-opens= flags." + default_value: "[]" + } + param { + name: "args" + doc: "
\n List of strings; subject to\n $(location) and\n \"Make variable\" substitution, and\n Bourne shell tokenization;\n nonconfigurable;\n default is []\n
\nCommand line arguments that Bazel will pass to the target when it is executed\neither by the run command or as a test. These arguments are\npassed before the ones that are specified on the bazel run or\nbazel test command line.\n
\nNOTE: The arguments are not passed when you run the target\noutside of Bazel (for example, by manually executing the binary in\nbazel-bin/).\n
\nA list of resources that must be located at the root of the java tree. This attribute\'s\nonly purpose is to support third-party libraries that require that their resources be\nfound on the classpath as exactly \"myconfig.xml\". It is only allowed on\nbinaries and not libraries, due to the danger of namespace conflicts.\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "create_executable" + doc: "Deprecated, usejava_single_jar instead."
+ default_value: "True"
+ }
+ param {
+ name: "deploy_env"
+ doc: "A list of other java_binary targets which represent the deployment\nenvironment for this binary.\nSet this attribute when building a plugin which will be loaded by another\njava_binary.deploy_env."
+ default_value: "[]"
+ }
+ param {
+ name: "deploy_manifest_lines"
+ doc: "A list of lines to add to the META-INF/manifest.mf file generated for the\n*_deploy.jar target. The contents of this attribute are not subject\nto \"Make variable\" substitution."
+ default_value: "[]"
+ }
+ param {
+ name: "deprecation"
+ doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "env" + doc: "Dictionary of strings; values are subject to\n$(location) and\n\"Make variable\" substitution; default is {}
Specifies additional environment variables to set when the target is\n executed by bazel run.\n
\n This attribute only applies to native rules, like cc_binary, py_binary,\n and sh_binary. It does not apply to Starlark-defined executable rules.\n
\nNOTE: The environment variables are not set when you run the target\noutside of Bazel (for example, by manually executing the binary in\nbazel-bin/).\n
List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
These compiler options are passed to javac after the global compiler options.
" + default_value: "[]" + } + param { + name: "jvm_flags" + doc: "A list of flags to embed in the wrapper script generated for running this binary.\nSubject to $(location) and\n\"Make variable\" substitution, and\nBourne shell tokenization.\n\nThe wrapper script for a Java binary includes a CLASSPATH definition\n(to find all the dependent jars) and invokes the right Java interpreter.\nThe command line generated by the wrapper script includes the name of\nthe main class followed by a \"$@\" so you can pass along other\narguments after the classname. However, arguments intended for parsing\nby the JVM must be specified before the classname on the command\nline. The contents of jvm_flags are added to the wrapper\nscript before the classname is listed.
Note that this attribute has no effect on *_deploy.jar\noutputs.
bin/java program included with the JDK.\nThe target must be a cc_binary. Any cc_binary that\nimplements the\n\nJava Invocation API can be specified as a value for this attribute.\n\nBy default, Bazel will use the normal JDK launcher (bin/java or java.exe).
\n\nThe related \n--java_launcher Bazel flag affects only those\njava_binary and java_test targets that have\nnot specified a launcher attribute.
Note that your native (C++, SWIG, JNI) dependencies will be built differently\ndepending on whether you are using the JDK launcher or another launcher:
\n\n{name}_nativedeps.so, where\n{name} is the name attribute of this java_binary rule.\nUnused code is not removed by the linker in this configuration.{name}_nativedeps, where {name}\nis the name attribute of this java_binary rule. In this case,\nthe linker will remove any code it thinks is unused from the resulting binary,\nwhich means any C++ code accessed only via JNI may not be linked in unless\nthat cc_library target specifies alwayslink = True.When using any launcher other than the default JDK launcher, the format\nof the *_deploy.jar output changes. See the main\njava_binary docs for details.
List of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "main_class" + doc: "Name of class withmain() method to use as entry point.\nIf a rule uses this option, it does not need a srcs=[...] list.\nThus, with this attribute one can make an executable from a Java library that already\ncontains one or more main() methods.\n\nThe value of this attribute is a class name, not a source file. The class must be\navailable at runtime: it may be compiled by this rule (from srcs) or\nprovided by direct or transitive dependencies (through runtime_deps or\ndeps). If the class is unavailable, the binary will fail at runtime; there\nis no build-time check.\n
List of strings; default is []
\nThe licenses of the output files that this binary generates.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n\n" + } + param { + name: "plugins" + doc: "Java compiler plugins to run at compile-time.\nEveryjava_plugin specified in this attribute will be run whenever this rule\nis built. A library may also inherit plugins from dependencies that use\nexported_plugins. Resources\ngenerated by the plugin will be included in the resulting jar of this rule."
+ default_value: "[]"
+ }
+ param {
+ name: "resource_strip_prefix"
+ doc: "The path prefix to strip from Java resources.\n\nIf specified, this path prefix is stripped from every file in the resources\nattribute. It is an error for a resource file not to be under this directory. If not\nspecified (the default), the path of resource file is determined according to the same\nlogic as the Java package of source files. For example, a source file at\nstuff/java/foo/bar/a.txt will be located at foo/bar/a.txt.\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
deps, these will appear on the runtime classpath, but unlike\nthem, not on the compile-time classpath. Dependencies needed only at runtime should be\nlisted here. Dependency-analysis tools should ignore targets that appear in both\nruntime_deps and deps."
+ default_value: "[]"
+ }
+ param {
+ name: "stamp"
+ doc: "Whether to encode build information into the binary. Possible values:\nstamp = 1: Always stamp the build information into the binary, even in\n --nostamp builds. This\n setting should be avoided, since it potentially kills remote caching for the\n binary and any downstream actions that depend on it.\nstamp = 0: Always replace build information by constant values. This\n gives good build result caching.\nstamp = -1: Embedding of build information is controlled by the\n --[no]stamp flag.\nStamped binaries are not rebuilt unless their dependencies change.
" + default_value: "-1" + } + param { + name: "tags" + doc: "\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "toolchains" + doc: "List of labels;\n nonconfigurable; default is []
\n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n
@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific cc_toolchain or java_toolchain a\n target will use.\n
If this attribute is set to false, the\nlauncher attribute and the related\n--java_launcher flag\nwill be ignored for this target."
+ default_value: "True"
+ }
+ param {
+ name: "use_testrunner"
+ doc: "Use the test runner (by default\ncom.google.testing.junit.runner.BazelTestRunner) class as the\nmain entry point for a Java program, and provide the test class\nto the test runner as a value of bazel.test_suite\nsystem property.\n\n
\nYou can use this to override the default\nbehavior, which is to use test runner for\njava_test rules,\nand not use it for java_binary rules. It is unlikely\nyou will want to do this. One use is for AllTest\nrules that are invoked by another rule (to set up a database\nbefore running the tests, for example). The AllTest\nrule must be declared as a java_binary, but should\nstill use the test runner as its main entry point.\n\nThe name of a test runner class can be overridden with main_class attribute."
+ default_value: "False"
+ }
+ param {
+ name: "visibility"
+ doc: "
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
\n Builds a Java archive (\"jar file\"), plus a wrapper shell script with the same name as the rule.\n The wrapper shell script uses a classpath that includes, among other things, a jar file for each\n library on which the binary depends. When running the wrapper shell script, any nonempty\n JAVABIN environment variable will take precedence over the version specified via\n Bazel\'s --java_runtime_version flag.\n
\n The wrapper script accepts several unique flags. Refer to\n //src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt\n for a list of configurable flags and environment variables accepted by the wrapper.\n
name.jar: A Java archive, containing the class files and other\n resources corresponding to the binary\'s direct dependencies.name-src.jar: An archive containing the sources (\"source\n jar\").name_deploy.jar: A Java archive suitable for deployment (only\n built if explicitly requested).\n \n Building the <name>_deploy.jar target for your rule\n creates a self-contained jar file with a manifest that allows it to be run with the\n java -jar command or with the wrapper script\'s --singlejar\n option. Using the wrapper script is preferred to java -jar because it\n also passes the JVM flags and the options\n to load native libraries.\n
\n The deploy jar contains all the classes that would be found by a classloader that\n searched the classpath from the binary\'s wrapper script from beginning to end. It also\n contains the native libraries needed for dependencies. These are automatically loaded\n into the JVM at runtime.\n
\nIf your target specifies a launcher\n attribute, then instead of being a normal JAR file, the _deploy.jar will be a\n native binary. This will contain the launcher plus any native (C++) dependencies of\n your rule, all linked into a static binary. The actual jar file\'s bytes will be\n appended to that native binary, creating a single binary blob containing both the\n executable and the Java code. You can execute the resulting jar file directly\n like you would execute any native binary.
\nname_deploy-src.jar: An archive containing the sources\n collected from the transitive closure of the target. These will match the classes in the\n deploy.jar except where jars have no matching source jar.\nIt is good practice to use the name of the source file that is the main entry point of the\napplication (minus the extension). For example, if your entry point is called\nMain.java, then your name could be Main.\n
\n A deps attribute is not allowed in a java_binary rule without\n srcs; such a rule requires a\n main_class provided by\n runtime_deps.\n
The following code snippet illustrates a common mistake:
\n\n\n\njava_binary(\n name = \"DontDoThis\",\n srcs = [\n ...,\n \"GeneratedJavaFile.java\", # a generated .java file\n ],\n deps = [\":generating_rule\",], # rule that generates that file\n)\n\n\n\nDo this instead:
\n\n\n\njava_binary(\n name = \"DoThisInstead\",\n srcs = [\n ...,\n \":generating_rule\",\n ],\n)\n\n"
+ api_context: BUILD
+}
+global {
+ name: "java_import"
+ callable {
+ param {
+ name: "deps"
+ doc: "The list of other libraries to be linked in to the target.\nSee java_library.deps."
+ default_value: "[]"
+ }
+ param {
+ name: "data"
+ doc: "The list of files needed by this rule at runtime."
+ default_value: "[]"
+ }
+ param {
+ name: "add_exports"
+ doc: "Allow this library to access the given module or package.\n\nThis corresponds to the javac and JVM --add-exports= flags."
+ default_value: "[]"
+ }
+ param {
+ name: "add_opens"
+ doc: "Allow this library to reflectively access the given module or\npackage.\n
\nThis corresponds to the javac and JVM --add-opens= flags." + default_value: "[]" + } + param { + name: "compatible_with" + doc: "
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "constraints" + doc: "Extra constraints imposed on this rule as a Java library." + default_value: "[]" + } + param { + name: "deprecation" + doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "exec_compatible_with" + doc: "List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "exports" + doc: "Targets to make available to users of this rule.\nSee java_library.exports." + default_value: "[]" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
List of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "neverlink" + doc: "Only use this library for compilation and not at runtime.\nUseful if the library will be provided by the runtime environment\nduring execution. Examples of libraries like this are IDE APIs\nfor IDE plug-ins ortools.jar for anything running on\na standard JDK."
+ default_value: "False"
+ }
+ param {
+ name: "proguard_specs"
+ doc: "Files to be used as Proguard specification.\nThese will describe the set of specifications to be used by Proguard. If specified,\nthey will be added to any android_binary target depending on this library.\n\nThe files included here must only have idempotent rules, namely -dontnote, -dontwarn,\nassumenosideeffects, and rules that start with -keep. Other options can only appear in\nandroid_binary\'s proguard_specs, to ensure non-tautological merges."
+ default_value: "[]"
+ }
+ param {
+ name: "restricted_to"
+ doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "toolchains" + doc: "List of labels;\n nonconfigurable; default is []
\n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n
@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific cc_toolchain or java_toolchain a\n target will use.\n
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
\n This rule allows the use of precompiled .jar files as\n libraries for java_library and\n java_binary rules.\n
\n\n java_import(\n name = \"maven_model\",\n jars = [\n \"maven_model/maven-aether-provider-3.2.3.jar\",\n \"maven_model/maven-model-3.2.3.jar\",\n \"maven_model/maven-model-builder-3.2.3.jar\",\n ],\n )\n\n"
+ api_context: BUILD
+}
+global {
+ name: "java_library"
+ callable {
+ param {
+ name: "deps"
+ doc: "The list of libraries to link into this library.\nSee general comments about deps at\nTypical attributes defined by\nmost build rules.\n\n The jars built by java_library rules listed in deps will be on\n the compile-time classpath of this rule. Furthermore the transitive closure of their\n deps, runtime_deps and exports will be on the\n runtime classpath.\n
\n By contrast, targets in the data attribute are included in the runfiles but\n on neither the compile-time nor runtime classpath.\n
\nSource files of type .java are compiled. In case of generated\n.java files it is generally advisable to put the generating rule\'s name\nhere instead of the name of the file itself. This not only improves readability but\nmakes the rule more resilient to future changes: if the generating rule generates\ndifferent files in the future, you only need to fix one place: the outs of\nthe generating rule. You should not list the generating rule in deps\nbecause it is a no-op.\n
\nSource files of type .srcjar are unpacked and compiled. (This is useful if\nyou need to generate a set of .java files with a genrule.)\n
\nRules: if the rule (typically genrule or filegroup) generates\nany of the files listed above, they will be used the same way as described for source\nfiles.\n
\nSource files of type .properties are treated as resources.\n
All other files are ignored, as long as there is at least one file of a\nfile type described above. Otherwise an error is raised.
\n\n\nThis argument is almost always required, except if you specify the runtime_deps argument.\n
data at\nTypical attributes defined by\nmost build rules.\n\n When building a java_library, Bazel doesn\'t put these files anywhere; if the\n data files are generated files then Bazel generates them. When building a\n test that depends on this java_library Bazel copies or links the\n data files into the runfiles area.\n
\nResources may be source files or generated files.\n
\n\n\nIf resources are specified, they will be bundled in the jar along with the usual\n.class files produced by compilation. The location of the resources inside\nof the jar file is determined by the project structure. Bazel first looks for Maven\'s\nstandard directory layout,\n(a \"src\" directory followed by a \"resources\" directory grandchild). If that is not\nfound, Bazel then looks for the topmost directory named \"java\" or \"javatests\" (so, for\nexample, if a resource is at <workspace root>/x/java/y/java/z, the\npath of the resource will be y/java/z. This heuristic cannot be overridden,\nhowever, the resource_strip_prefix attribute can be used to specify a\nspecific alternative directory for resource files."
+ default_value: "[]"
+ }
+ param {
+ name: "add_exports"
+ doc: "Allow this library to access the given module or package.\n
\nThis corresponds to the javac and JVM --add-exports= flags."
+ default_value: "[]"
+ }
+ param {
+ name: "add_opens"
+ doc: "Allow this library to reflectively access the given module or\npackage.\n
\nThis corresponds to the javac and JVM --add-opens= flags." + default_value: "[]" + } + param { + name: "bootclasspath" + doc: "Restricted API, do not use!" + default_value: "None" + } + param { + name: "compatible_with" + doc: "
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "deprecation" + doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "exec_compatible_with" + doc: "List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "exported_plugins" + doc: "The list ofjava_plugins (e.g. annotation\nprocessors) to export to libraries that directly depend on this library.\n\n The specified list of java_plugins will be applied to any library which\n directly depends on this library, just as if that library had explicitly declared these\n labels in plugins.\n
\n Listing rules here will make them available to parent rules, as if the parents explicitly\n depended on these rules. This is not true for regular (non-exported) deps.\n
\n Summary: a rule X can access the code in Y if there exists a dependency\n path between them that begins with a deps edge followed by zero or more\n exports edges. Let\'s see some examples to illustrate this.\n
\n Assume A depends on B and B depends on C. In this case\n C is a transitive dependency of A, so changing C\'s sources and rebuilding A will\n correctly rebuild everything. However A will not be able to use classes in C. To allow\n that, either A has to declare C in its deps, or B can make it easier for A\n (and anything that may depend on A) by declaring C in its (B\'s) exports\n attribute.\n
\n The closure of exported libraries is available to all direct parent rules. Take a slightly\n different example: A depends on B, B depends on C and D, and also exports C but not D.\n Now A has access to C but not to D. Now, if C and D exported some libraries, C\' and D\'\n respectively, A could only access C\' but not D\'.\n
\n\n Important: an exported rule is not a regular dependency. Sticking to the previous example,\n if B exports C and wants to also use C, it has to also list it in its own\n deps.\n
List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
These compiler options are passed to javac after the global compiler options.
" + default_value: "[]" + } + param { + name: "licenses" + doc: "\nList of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "neverlink" + doc: "Whether this library should only be used for compilation and not at runtime.\nUseful if the library will be provided by the runtime environment during execution. Examples\nof such libraries are the IDE APIs for IDE plug-ins ortools.jar for anything\nrunning on a standard JDK.\n\n Note that neverlink = True does not prevent the compiler from inlining material\n from this library into compilation targets that depend on it, as permitted by the Java\n Language Specification (e.g., static final constants of String\n or of primitive types). The preferred use case is therefore when the runtime library is\n identical to the compilation library.\n
\n If the runtime library differs from the compilation library then you must ensure that it\n differs only in places that the JLS forbids compilers to inline (and that must hold for\n all future versions of the JLS).\n
" + default_value: "False" + } + param { + name: "plugins" + doc: "Java compiler plugins to run at compile-time.\nEveryjava_plugin specified in this attribute will be run whenever this rule\nis built. A library may also inherit plugins from dependencies that use\nexported_plugins. Resources\ngenerated by the plugin will be included in the resulting jar of this rule."
+ default_value: "[]"
+ }
+ param {
+ name: "proguard_specs"
+ doc: "Files to be used as Proguard specification.\nThese will describe the set of specifications to be used by Proguard. If specified,\nthey will be added to any android_binary target depending on this library.\n\nThe files included here must only have idempotent rules, namely -dontnote, -dontwarn,\nassumenosideeffects, and rules that start with -keep. Other options can only appear in\nandroid_binary\'s proguard_specs, to ensure non-tautological merges."
+ default_value: "[]"
+ }
+ param {
+ name: "resource_strip_prefix"
+ doc: "The path prefix to strip from Java resources.\n\nIf specified, this path prefix is stripped from every file in the resources\nattribute. It is an error for a resource file not to be under this directory. If not\nspecified (the default), the path of resource file is determined according to the same\nlogic as the Java package of source files. For example, a source file at\nstuff/java/foo/bar/a.txt will be located at foo/bar/a.txt.\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
deps, these will appear on the runtime classpath, but unlike\nthem, not on the compile-time classpath. Dependencies needed only at runtime should be\nlisted here. Dependency-analysis tools should ignore targets that appear in both\nruntime_deps and deps."
+ default_value: "[]"
+ }
+ param {
+ name: "tags"
+ doc: "\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "toolchains" + doc: "List of labels;\n nonconfigurable; default is []
\n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n
@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific cc_toolchain or java_toolchain a\n target will use.\n
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
This rule compiles and links sources into a .jar file.
libname.jar: A Java archive containing the class files.libname-src.jar: An archive containing the sources (\"source\n jar\").\njava_lite_proto_library generates Java code from .proto files.\n
\ndeps must point to proto_library\n rules.\n
\nExample:\n
\n\n\n\njava_library(\n name = \"lib\",\n runtime_deps = [\":foo\"],\n)\n\njava_lite_proto_library(\n name = \"foo\",\n deps = [\":bar\"],\n)\n\nproto_library(\n name = \"bar\",\n)\n\n"
+ api_context: BUILD
+}
+global {
+ name: "java_package_configuration"
+ callable {
+ param {
+ name: "data"
+ doc: "The list of files needed by this configuration at runtime."
+ default_value: "[]"
+ }
+ param {
+ name: "compatible_with"
+ doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "deprecation" + doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "exec_compatible_with" + doc: "List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
package_groups\nthe configuration should be applied to."
+ default_value: "[]"
+ }
+ param {
+ name: "restricted_to"
+ doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "toolchains" + doc: "List of labels;\n nonconfigurable; default is []
\n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n
@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific cc_toolchain or java_toolchain a\n target will use.\n
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
\nConfiguration to apply to a set of packages.\nConfigurations can be added to\njava_toolchain.javacoptss.\n
\n\n\njava_package_configuration(\n name = \"my_configuration\",\n packages = [\":my_packages\"],\n javacopts = [\"-Werror\"],\n)\n\npackage_group(\n name = \"my_packages\",\n packages = [\n \"//com/my/project/...\",\n \"-//com/my/project/testing/...\",\n ],\n)\n\njava_toolchain(\n ...,\n package_configuration = [\n \":my_configuration\",\n ]\n)\n\n\n"
+ api_context: BUILD
+}
+global {
+ name: "java_plugin"
+ callable {
+ param {
+ name: "deps"
+ doc: "The list of libraries to link into this library.\nSee general comments about deps at\nTypical attributes defined by\nmost build rules.\n\n The jars built by java_library rules listed in deps will be on\n the compile-time classpath of this rule. Furthermore the transitive closure of their\n deps, runtime_deps and exports will be on the\n runtime classpath.\n
\n By contrast, targets in the data attribute are included in the runfiles but\n on neither the compile-time nor runtime classpath.\n
\nSource files of type .java are compiled. In case of generated\n.java files it is generally advisable to put the generating rule\'s name\nhere instead of the name of the file itself. This not only improves readability but\nmakes the rule more resilient to future changes: if the generating rule generates\ndifferent files in the future, you only need to fix one place: the outs of\nthe generating rule. You should not list the generating rule in deps\nbecause it is a no-op.\n
\nSource files of type .srcjar are unpacked and compiled. (This is useful if\nyou need to generate a set of .java files with a genrule.)\n
\nRules: if the rule (typically genrule or filegroup) generates\nany of the files listed above, they will be used the same way as described for source\nfiles.\n
\nSource files of type .properties are treated as resources.\n
All other files are ignored, as long as there is at least one file of a\nfile type described above. Otherwise an error is raised.
\n\n\nThis argument is almost always required, except if you specify the runtime_deps argument.\n
data at\nTypical attributes defined by\nmost build rules.\n\n When building a java_library, Bazel doesn\'t put these files anywhere; if the\n data files are generated files then Bazel generates them. When building a\n test that depends on this java_library Bazel copies or links the\n data files into the runfiles area.\n
\nResources may be source files or generated files.\n
\n\n\nIf resources are specified, they will be bundled in the jar along with the usual\n.class files produced by compilation. The location of the resources inside\nof the jar file is determined by the project structure. Bazel first looks for Maven\'s\nstandard directory layout,\n(a \"src\" directory followed by a \"resources\" directory grandchild). If that is not\nfound, Bazel then looks for the topmost directory named \"java\" or \"javatests\" (so, for\nexample, if a resource is at <workspace root>/x/java/y/java/z, the\npath of the resource will be y/java/z. This heuristic cannot be overridden,\nhowever, the resource_strip_prefix attribute can be used to specify a\nspecific alternative directory for resource files."
+ default_value: "[]"
+ }
+ param {
+ name: "add_exports"
+ doc: "Allow this library to access the given module or package.\n
\nThis corresponds to the javac and JVM --add-exports= flags."
+ default_value: "[]"
+ }
+ param {
+ name: "add_opens"
+ doc: "Allow this library to reflectively access the given module or\npackage.\n
\nThis corresponds to the javac and JVM --add-opens= flags." + default_value: "[]" + } + param { + name: "bootclasspath" + doc: "Restricted API, do not use!" + default_value: "None" + } + param { + name: "compatible_with" + doc: "
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "deprecation" + doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "exec_compatible_with" + doc: "List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
If a rule uses an API-generating annotation processor, other rules\ndepending on it can refer to the generated code only if their\ncompilation actions are scheduled after the generating rule. This\nattribute instructs Bazel to introduce scheduling constraints when\n--java_header_compilation is enabled.\n
WARNING: This attribute affects build\nperformance, use it only if necessary.
" + default_value: "False" + } + param { + name: "javabuilder_jvm_flags" + doc: "Restricted API, do not use!" + default_value: "[]" + } + param { + name: "javacopts" + doc: "Extra compiler options for this library.\nSubject to \"Make variable\" substitution and\nBourne shell tokenization.\nThese compiler options are passed to javac after the global compiler options.
" + default_value: "[]" + } + param { + name: "licenses" + doc: "\nList of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "neverlink" + doc: "Whether this library should only be used for compilation and not at runtime.\nUseful if the library will be provided by the runtime environment during execution. Examples\nof such libraries are the IDE APIs for IDE plug-ins ortools.jar for anything\nrunning on a standard JDK.\n\n Note that neverlink = True does not prevent the compiler from inlining material\n from this library into compilation targets that depend on it, as permitted by the Java\n Language Specification (e.g., static final constants of String\n or of primitive types). The preferred use case is therefore when the runtime library is\n identical to the compilation library.\n
\n If the runtime library differs from the compilation library then you must ensure that it\n differs only in places that the JLS forbids compilers to inline (and that must hold for\n all future versions of the JLS).\n
" + default_value: "False" + } + param { + name: "output_licenses" + default_value: "[]" + } + param { + name: "plugins" + doc: "Java compiler plugins to run at compile-time.\nEveryjava_plugin specified in this attribute will be run whenever this rule\nis built. A library may also inherit plugins from dependencies that use\nexported_plugins. Resources\ngenerated by the plugin will be included in the resulting jar of this rule."
+ default_value: "[]"
+ }
+ param {
+ name: "processor_class"
+ doc: "The processor class is the fully qualified type of the class that the Java compiler should\nuse as entry point to the annotation processor. If not specified, this rule will not\ncontribute an annotation processor to the Java compiler\'s annotation processing, but its\nruntime classpath will still be included on the compiler\'s annotation processor path. (This\nis primarily intended for use by\nError Prone plugins, which are loaded\nfrom the annotation processor path using\n\njava.util.ServiceLoader.)"
+ default_value: "\"\""
+ }
+ param {
+ name: "proguard_specs"
+ doc: "Files to be used as Proguard specification.\nThese will describe the set of specifications to be used by Proguard. If specified,\nthey will be added to any android_binary target depending on this library.\n\nThe files included here must only have idempotent rules, namely -dontnote, -dontwarn,\nassumenosideeffects, and rules that start with -keep. Other options can only appear in\nandroid_binary\'s proguard_specs, to ensure non-tautological merges."
+ default_value: "[]"
+ }
+ param {
+ name: "resource_strip_prefix"
+ doc: "The path prefix to strip from Java resources.\n\nIf specified, this path prefix is stripped from every file in the resources\nattribute. It is an error for a resource file not to be under this directory. If not\nspecified (the default), the path of resource file is determined according to the same\nlogic as the Java package of source files. For example, a source file at\nstuff/java/foo/bar/a.txt will be located at foo/bar/a.txt.\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "toolchains" + doc: "List of labels;\n nonconfigurable; default is []
\n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n
@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific cc_toolchain or java_toolchain a\n target will use.\n
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
\n java_plugin defines plugins for the Java compiler run by Bazel. The\n only supported kind of plugins are annotation processors. A java_library or\n java_binary rule can run plugins by depending on them via the plugins\n attribute. A java_library can also automatically export plugins to libraries that\n directly depend on it using\n exported_plugins.\n
libname.jar: A Java archive.\n Arguments are identical to java_library, except\n for the addition of the processor_class argument.\n
\njava_proto_library generates Java code from .proto files.\n
\ndeps must point to proto_library\n rules.\n
\nExample:\n
\n\n\n\njava_library(\n name = \"lib\",\n runtime_deps = [\":foo_java_proto\"],\n)\n\njava_proto_library(\n name = \"foo_java_proto\",\n deps = [\":foo_proto\"],\n)\n\nproto_library(\n name = \"foo_proto\",\n)\n\n"
+ api_context: BUILD
+}
+global {
+ name: "java_runtime"
+ callable {
+ param {
+ name: "srcs"
+ doc: "All files in the runtime."
+ default_value: "[]"
+ }
+ param {
+ name: "compatible_with"
+ doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "default_cds" + doc: "Default CDS archive for hermeticjava_runtime. When hermetic\nis enabled for a java_binary target the java_runtime\ndefault CDS is packaged in the hermetic deploy JAR."
+ default_value: "None"
+ }
+ param {
+ name: "deprecation"
+ doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "exec_compatible_with" + doc: "List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
srcs and java attributes must be empty."
+ default_value: "\"\""
+ }
+ param {
+ name: "lib_ct_sym"
+ doc: "The lib/ct.sym file needed for compilation with --release. If not specified and\nthere is exactly one file in srcs whose path ends with\n/lib/ct.sym, that file is used."
+ default_value: "None"
+ }
+ param {
+ name: "lib_modules"
+ doc: "The lib/modules file needed for hermetic deployments."
+ default_value: "None"
+ }
+ param {
+ name: "output_licenses"
+ default_value: "[]"
+ }
+ param {
+ name: "restricted_to"
+ doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "toolchains" + doc: "List of labels;\n nonconfigurable; default is []
\n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n
@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific cc_toolchain or java_toolchain a\n target will use.\n
Runtime.version().feature()."
+ default_value: "0"
+ }
+ param {
+ name: "visibility"
+ doc: "List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
\nSpecifies the configuration for a Java runtime.\n
\n\n\n\n\njava_runtime(\n name = \"jdk-9-ea+153\",\n srcs = glob([\"jdk9-ea+153/**\"]),\n java_home = \"jdk9-ea+153\",\n)\n\n\n"
+ api_context: BUILD
+}
+global {
+ name: "java_test"
+ callable {
+ param {
+ name: "deps"
+ doc: "The list of other libraries to be linked in to the target.\nSee general comments about deps at\nTypical attributes defined by\nmost build rules."
+ default_value: "[]"
+ }
+ param {
+ name: "srcs"
+ doc: "The list of source files that are processed to create the target.\nThis attribute is almost always required; see exceptions below.\n\nSource files of type .java are compiled. In case of generated\n.java files it is generally advisable to put the generating rule\'s name\nhere instead of the name of the file itself. This not only improves readability but\nmakes the rule more resilient to future changes: if the generating rule generates\ndifferent files in the future, you only need to fix one place: the outs of\nthe generating rule. You should not list the generating rule in deps\nbecause it is a no-op.\n
\nSource files of type .srcjar are unpacked and compiled. (This is useful if\nyou need to generate a set of .java files with a genrule.)\n
\nRules: if the rule (typically genrule or filegroup) generates\nany of the files listed above, they will be used the same way as described for source\nfiles.\n
\nThis argument is almost always required, except if a\nmain_class attribute specifies a\nclass on the runtime classpath or you specify the runtime_deps argument.\n
data\nat Typical attributes defined by\nmost build rules."
+ default_value: "[]"
+ }
+ param {
+ name: "resources"
+ doc: "A list of data files to include in a Java jar.\n\n\nResources may be source files or generated files.\n
\n\n\nIf resources are specified, they will be bundled in the jar along with the usual\n.class files produced by compilation. The location of the resources inside\nof the jar file is determined by the project structure. Bazel first looks for Maven\'s\nstandard directory layout,\n(a \"src\" directory followed by a \"resources\" directory grandchild). If that is not\nfound, Bazel then looks for the topmost directory named \"java\" or \"javatests\" (so, for\nexample, if a resource is at <workspace root>/x/java/y/java/z, the\npath of the resource will be y/java/z. This heuristic cannot be overridden,\nhowever, the resource_strip_prefix attribute can be used to specify a\nspecific alternative directory for resource files."
+ default_value: "[]"
+ }
+ param {
+ name: "add_exports"
+ doc: "Allow this library to access the given module or package.\n
\nThis corresponds to the javac and JVM --add-exports= flags."
+ default_value: "[]"
+ }
+ param {
+ name: "add_opens"
+ doc: "Allow this library to reflectively access the given module or\npackage.\n
\nThis corresponds to the javac and JVM --add-opens= flags." + default_value: "[]" + } + param { + name: "args" + doc: "
List of strings; subject to\n$(location) and\n\"Make variable\" substitution, and\nBourne shell tokenization; default is []
Command line arguments that Bazel passes to the target when it is\nexecuted with bazel test.\n\n
\nThese arguments are passed before any --test_arg values\nspecified on the bazel test command line.\n
\nA list of resources that must be located at the root of the java tree. This attribute\'s\nonly purpose is to support third-party libraries that require that their resources be\nfound on the classpath as exactly \"myconfig.xml\". It is only allowed on\nbinaries and not libraries, due to the danger of namespace conflicts.\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "create_executable" + doc: "Deprecated, usejava_single_jar instead."
+ default_value: "True"
+ }
+ param {
+ name: "deploy_manifest_lines"
+ doc: "A list of lines to add to the META-INF/manifest.mf file generated for the\n*_deploy.jar target. The contents of this attribute are not subject\nto \"Make variable\" substitution."
+ default_value: "[]"
+ }
+ param {
+ name: "deprecation"
+ doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "env" + doc: "\n Dictionary of strings; values are subject to\n $(location) and\n \"Make variable\" substitution; default is {}\n
\n Specifies additional environment variables to set when the test is executed by\n bazel test.\n
\n This attribute only applies to native rules, like cc_test,\n py_test, and sh_test. It does not apply to\n Starlark-defined test rules. For your own Starlark rules, you can add an \"env\"\n attribute and use it to populate a\n\n TestEnvironment\n \n Provider.\n
List of strings; default is []
Specifies additional environment variables to inherit from the\n external environment when the test is executed by bazel test.\n
\n This attribute only applies to native rules, like cc_test, py_test,\n and sh_test. It does not apply to Starlark-defined test rules.\n
List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
Boolean; nonconfigurable;\n default is False
\nMarks test as flaky.\n
\n\n\nIf set, executes the test up to three times, marking it as failed only if it\nfails each time. By default, this attribute is set to False and the test is\nexecuted only once. Note, that use of this attribute is generally discouraged -\ntests should pass reliably when their assertions are upheld.\n
\n" + } + param { + name: "javacopts" + doc: "Extra compiler options for this binary.\nSubject to \"Make variable\" substitution and\nBourne shell tokenization.\nThese compiler options are passed to javac after the global compiler options.
" + default_value: "[]" + } + param { + name: "jvm_flags" + doc: "A list of flags to embed in the wrapper script generated for running this binary.\nSubject to $(location) and\n\"Make variable\" substitution, and\nBourne shell tokenization.\n\nThe wrapper script for a Java binary includes a CLASSPATH definition\n(to find all the dependent jars) and invokes the right Java interpreter.\nThe command line generated by the wrapper script includes the name of\nthe main class followed by a \"$@\" so you can pass along other\narguments after the classname. However, arguments intended for parsing\nby the JVM must be specified before the classname on the command\nline. The contents of jvm_flags are added to the wrapper\nscript before the classname is listed.
Note that this attribute has no effect on *_deploy.jar\noutputs.
bin/java program included with the JDK.\nThe target must be a cc_binary. Any cc_binary that\nimplements the\n\nJava Invocation API can be specified as a value for this attribute.\n\nBy default, Bazel will use the normal JDK launcher (bin/java or java.exe).
\n\nThe related \n--java_launcher Bazel flag affects only those\njava_binary and java_test targets that have\nnot specified a launcher attribute.
Note that your native (C++, SWIG, JNI) dependencies will be built differently\ndepending on whether you are using the JDK launcher or another launcher:
\n\n{name}_nativedeps.so, where\n{name} is the name attribute of this java_binary rule.\nUnused code is not removed by the linker in this configuration.{name}_nativedeps, where {name}\nis the name attribute of this java_binary rule. In this case,\nthe linker will remove any code it thinks is unused from the resulting binary,\nwhich means any C++ code accessed only via JNI may not be linked in unless\nthat cc_library target specifies alwayslink = True.When using any launcher other than the default JDK launcher, the format\nof the *_deploy.jar output changes. See the main\njava_binary docs for details.
List of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "local" + doc: "Boolean; nonconfigurable;\n default is False
Forces the test to be run locally, without sandboxing.
\n\nSetting this to True is equivalent to providing \"local\" as a tag\n(tags=[\"local\"]).
main() method to use as entry point.\nIf a rule uses this option, it does not need a srcs=[...] list.\nThus, with this attribute one can make an executable from a Java library that already\ncontains one or more main() methods.\n\nThe value of this attribute is a class name, not a source file. The class must be\navailable at runtime: it may be compiled by this rule (from srcs) or\nprovided by direct or transitive dependencies (through runtime_deps or\ndeps). If the class is unavailable, the binary will fail at runtime; there\nis no build-time check.\n
java_plugin specified in this attribute will be run whenever this rule\nis built. A library may also inherit plugins from dependencies that use\nexported_plugins. Resources\ngenerated by the plugin will be included in the resulting jar of this rule."
+ default_value: "[]"
+ }
+ param {
+ name: "resource_strip_prefix"
+ doc: "The path prefix to strip from Java resources.\n\nIf specified, this path prefix is stripped from every file in the resources\nattribute. It is an error for a resource file not to be under this directory. If not\nspecified (the default), the path of resource file is determined according to the same\nlogic as the Java package of source files. For example, a source file at\nstuff/java/foo/bar/a.txt will be located at foo/bar/a.txt.\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
deps, these will appear on the runtime classpath, but unlike\nthem, not on the compile-time classpath. Dependencies needed only at runtime should be\nlisted here. Dependency-analysis tools should ignore targets that appear in both\nruntime_deps and deps."
+ default_value: "[]"
+ }
+ param {
+ name: "shard_count"
+ doc: "Non-negative integer less than or equal to 50; default is -1
Specifies the number of parallel shards\nto use to run the test.
\n\nIf set, this value will override any heuristics used to determine the number of\nparallel shards with which to run the test. Note that for some test\nrules, this parameter may be required to enable sharding\nin the first place. Also see --test_sharding_strategy.
If test sharding is enabled, the environment variable \nTEST_TOTAL_SHARDS\n will be set to this value when spawning the test.
Sharding requires the test runner to support the test sharding protocol.\nIf it does not, then it will most likely run every test in every shard, which\nis not what you want.
\n\nSee\nTest Sharding\nin the Test Encyclopedia for details on sharding.
\n" + } + param { + name: "size" + doc: "String \"enormous\", \"large\", \"medium\", or\n \"small\"; nonconfigurable;\n default is \"medium\"
Specifies a test target\'s \"heaviness\": how much time/resources it needs to run.
\n\nUnit tests are considered \"small\", integration tests \"medium\", and end-to-end tests \"large\" or\n\"enormous\". Bazel uses the size to determine a default timeout, which can be overridden using the\ntimeout attribute. The timeout is for all tests in the BUILD target, not for each\nindividual test. When the test is run locally, the size is additionally used for\nscheduling purposes: Bazel tries to respect --local_{ram,cpu}_resources and not\noverwhelm the local machine by running lots of heavy tests at the same time.
Test sizes correspond to the following default timeouts and assumed peak local resource\nusages:
\n\n| Size | \nRAM (in MB) | \nCPU (in CPU cores) | \nDefault timeout | \n
|---|---|---|---|
| small | \n20 | \n1 | \nshort (1 minute) | \n
| medium | \n100 | \n1 | \nmoderate (5 minutes) | \n
| large | \n300 | \n1 | \nlong (15 minutes) | \n
| enormous | \n800 | \n1 | \neternal (60 minutes) | \n
\n The environment variable\n TEST_SIZE will be set to\n the value of this attribute when spawning the test.\n
stamp = 1: Always stamp the build information into the binary, even in\n --nostamp builds. This\n setting should be avoided, since it potentially kills remote caching for the\n binary and any downstream actions that depend on it.\nstamp = 0: Always replace build information by constant values. This\n gives good build result caching.\nstamp = -1: Embedding of build information is controlled by the\n --[no]stamp flag.\nStamped binaries are not rebuilt unless their dependencies change.
" + default_value: "0" + } + param { + name: "tags" + doc: "\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "test_class" + doc: "The Java class to be loaded by the test runner.\n By default, if this argument is not defined then the legacy mode is used and the\n test arguments are used instead. Set the --nolegacy_bazel_java_test flag\n to not fallback on the first argument.\n
\n This attribute specifies the name of a Java class to be run by\n this test. It is rare to need to set this. If this argument is omitted,\n it will be inferred using the target\'s name and its\n source-root-relative path. If the test is located outside a known\n source root, Bazel will report an error if test_class\n is unset.\n
\n For JUnit3, the test class needs to either be a subclass of\n junit.framework.TestCase or it needs to have a public\n static suite() method that returns a\n junit.framework.Test (or a subclass of Test).\n For JUnit4, the class needs to be annotated with\n org.junit.runner.RunWith.\n
\n This attribute allows several java_test rules to\n share the same Test\n (TestCase, TestSuite, ...). Typically\n additional information is passed to it\n (e.g. via jvm_flags=[\'-Dkey=value\']) so that its\n behavior differs in each case, such as running a different\n subset of the tests. This attribute also enables the use of\n Java tests outside the javatests tree.\n
Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "timeout" + doc: "String \"short\", \"moderate\", \"long\", or\n \"eternal\"; nonconfigurable; default is derived\n from the test\'s size attribute
\nHow long the test is expected to run before returning.\n
\n\n\nWhile a test\'s size attribute controls resource estimation, a test\'s\ntimeout may be set independently. If not explicitly specified, the\ntimeout is based on the test\'s size. The test\ntimeout can be overridden with the --test_timeout flag, e.g. for\nrunning under certain conditions which are known to be slow. Test timeout values\ncorrespond to the following time periods:\n
| Timeout Value | \nTime Period | \n
|---|---|
| short | \n1 minute | \n
| moderate | \n5 minutes | \n
| long | \n15 minutes | \n
| eternal | \n60 minutes | \n
\nFor times other than the above, the test timeout can be overridden with the\n--test_timeout bazel flag, e.g. for manually running under\nconditions which are known to be slow. The --test_timeout values\nare in seconds. For example --test_timeout=120 will set the test\ntimeout to two minutes.\n
\n The environment variable\n TEST_TIMEOUT will be set\n to the test timeout (in seconds) when spawning the test.\n
List of labels;\n nonconfigurable; default is []
\n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n
@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific cc_toolchain or java_toolchain a\n target will use.\n
If this attribute is set to false, the\nlauncher attribute and the related\n--java_launcher flag\nwill be ignored for this target."
+ default_value: "True"
+ }
+ param {
+ name: "use_testrunner"
+ doc: "Use the test runner (by default\ncom.google.testing.junit.runner.BazelTestRunner) class as the\nmain entry point for a Java program, and provide the test class\nto the test runner as a value of bazel.test_suite\nsystem property.\n\n
\nYou can use this to override the default\nbehavior, which is to use test runner for\njava_test rules,\nand not use it for java_binary rules. It is unlikely\nyou will want to do this. One use is for AllTest\nrules that are invoked by another rule (to set up a database\nbefore running the tests, for example). The AllTest\nrule must be declared as a java_binary, but should\nstill use the test runner as its main entry point.\n\nThe name of a test runner class can be overridden with main_class attribute."
+ default_value: "True"
+ }
+ param {
+ name: "visibility"
+ doc: "
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
\nA java_test() rule compiles a Java test. A test is a binary wrapper around your\ntest code. The test runner\'s main method is invoked instead of the main class being compiled.\n
name.jar: A Java archive.name_deploy.jar: A Java archive suitable\n for deployment. (Only built if explicitly requested.) See the description of the\n name_deploy.jar output from\n java_binary for more details.\nSee the section on java_binary() arguments. This rule also\nsupports all attributes common\nto all test rules (*_test).\n
\n\n\njava_library(\n name = \"tests\",\n srcs = glob([\"*.java\"]),\n deps = [\n \"//java/com/foo/base:testResources\",\n \"//java/com/foo/testing/util\",\n ],\n)\n\njava_test(\n name = \"AllTests\",\n size = \"small\",\n runtime_deps = [\n \":tests\",\n \"//util/mysql\",\n ],\n)\n\n"
+ api_context: BUILD
+}
+global {
+ name: "java_toolchain"
+ callable {
+ param {
+ name: "android_lint_data"
+ doc: "Labels of tools available for label-expansion in android_lint_jvm_opts."
+ default_value: "[]"
+ }
+ param {
+ name: "android_lint_jvm_opts"
+ doc: "The list of arguments for the JVM when invoking Android Lint."
+ default_value: "[]"
+ }
+ param {
+ name: "android_lint_opts"
+ doc: "The list of Android Lint arguments."
+ default_value: "[]"
+ }
+ param {
+ name: "android_lint_package_configuration"
+ doc: "Android Lint Configuration that should be applied to the specified package groups."
+ default_value: "[]"
+ }
+ param {
+ name: "android_lint_runner"
+ doc: "Label of the Android Lint runner, if any."
+ default_value: "None"
+ }
+ param {
+ name: "bootclasspath"
+ doc: "The Java target bootclasspath entries. Corresponds to javac\'s -bootclasspath flag."
+ default_value: "[]"
+ }
+ param {
+ name: "compatible_javacopts"
+ doc: "Internal API, do not use!"
+ default_value: "{}"
+ }
+ param {
+ name: "compatible_with"
+ doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "deprecation" + doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "deps_checker" + doc: "Label of the ImportDepsChecker deploy jar." + default_value: "None" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "exec_compatible_with" + doc: "List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
This tool does not support annotation processing." + default_value: "None" + } + param { + name: "ijar" + doc: "Label of the ijar executable." + default_value: "None" + } + param { + name: "jacocorunner" + doc: "Label of the JacocoCoverageRunner deploy jar." + default_value: "None" + } + param { + name: "java_runtime" + doc: "The java_runtime to use with this toolchain. It defaults to java_runtime\nin execution configuration." + default_value: "None" + } + param { + name: "javabuilder" + doc: "Label of the JavaBuilder deploy jar." + default_value: "None" + } + param { + name: "javabuilder_data" + doc: "Labels of data available for label-expansion in javabuilder_jvm_opts." + default_value: "[]" + } + param { + name: "javabuilder_jvm_opts" + doc: "The list of arguments for the JVM when invoking JavaBuilder." + default_value: "[]" + } + param { + name: "javac_supports_multiplex_workers" + doc: "True if JavaBuilder supports running as a multiplex persistent worker, false if it doesn\'t." + default_value: "True" + } + param { + name: "javac_supports_worker_cancellation" + doc: "True if JavaBuilder supports cancellation of persistent workers, false if it doesn\'t." + default_value: "True" + } + param { + name: "javac_supports_worker_multiplex_sandboxing" + doc: "True if JavaBuilder supports running as a multiplex persistent worker with sandboxing, false if it doesn\'t." + default_value: "False" + } + param { + name: "javac_supports_workers" + doc: "True if JavaBuilder supports running as a persistent worker, false if it doesn\'t." + default_value: "True" + } + param { + name: "javacopts" + doc: "The list of extra arguments for the Java compiler. Please refer to the Java compiler\ndocumentation for the extensive list of possible Java compiler flags." + default_value: "[]" + } + param { + name: "jspecify_implicit_deps" + doc: "Experimental, do not use!" + default_value: "None" + } + param { + name: "jspecify_javacopts" + doc: "Experimental, do not use!" + default_value: "[]" + } + param { + name: "jspecify_packages" + doc: "Experimental, do not use!" + default_value: "[]" + } + param { + name: "jspecify_processor" + doc: "Experimental, do not use!" + default_value: "None" + } + param { + name: "jspecify_processor_class" + doc: "Experimental, do not use!" + default_value: "\"\"" } - doc: "Returns environment variables to be set for given action." - } - field { - name: "get_execution_requirements" - callable { - param { - name: "feature_configuration" - doc: "Feature configuration to be queried." - is_mandatory: true - } - param { - name: "action_name" - doc: "Name of the action. Has to be one of the names in @bazel_tools//tools/build_defs/cc:action_names.bzl (https://github.com/bazelbuild/bazel/blob/master/tools/build_defs/cc/action_names.bzl)" - is_mandatory: true - } - return_type: "sequence" + param { + name: "jspecify_stubs" + doc: "Experimental, do not use!" + default_value: "[]" } - doc: "Returns execution requirements for given action." - } - field { - name: "get_memory_inefficient_command_line" - callable { - param { - name: "feature_configuration" - doc: "Feature configuration to be queried." - is_mandatory: true - } - param { - name: "action_name" - doc: "Name of the action. Has to be one of the names in @bazel_tools//tools/build_defs/cc:action_names.bzl (https://github.com/bazelbuild/bazel/blob/master/tools/build_defs/cc/action_names.bzl)" - is_mandatory: true - } - param { - name: "variables" - doc: "Build variables to be used for template expansions." - is_mandatory: true - } - return_type: "sequence" + param { + name: "jvm_opts" + doc: "The list of arguments for the JVM when invoking the Java compiler. Please refer to the Java\nvirtual machine documentation for the extensive list of possible flags for this option." + default_value: "[]" } - doc: "Returns flattened command line flags for given action, using given variables for expansion. Flattens nested sets and ideally should not be used, or at least should not outlive analysis. Work on memory efficient function returning Args is ongoing." - } - field { - name: "get_tool_for_action" - callable { - param { - name: "feature_configuration" - doc: "Feature configuration to be queried." - is_mandatory: true - } - param { - name: "action_name" - doc: "Name of the action. Has to be one of the names in @bazel_tools//tools/build_defs/cc:action_names.bzl (https://github.com/bazelbuild/bazel/blob/master/tools/build_defs/cc/action_names.bzl)" - is_mandatory: true - } - return_type: "string" + param { + name: "licenses" + doc: "\n
List of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" } - doc: "Returns tool path for given action." - } - field { - name: "is_enabled" - callable { - param { - name: "feature_configuration" - doc: "Feature configuration to be queried." - is_mandatory: true - } - param { - name: "feature_name" - doc: "Name of the feature." - is_mandatory: true - } - return_type: "bool" + param { + name: "misc" + doc: "Deprecated: use javacopts instead" + default_value: "[]" } - doc: "Returns True if given feature is enabled in the feature configuration." - } - field { - name: "link" - callable { - param { - name: "actions" - doc: "actions object."
- is_mandatory: true
- }
- param {
- name: "feature_configuration"
- doc: "feature_configuration to be queried."
- is_mandatory: true
- }
- param {
- name: "cc_toolchain"
- doc: "CcToolchainInfo provider to be used."
- is_mandatory: true
- }
- param {
- name: "compilation_outputs"
- type: "CcCompilationOutputs; or None"
- doc: "Compilation outputs containing object files to link."
- default_value: "None"
- }
- param {
- name: "user_link_flags"
- doc: "Additional list of linker options."
- default_value: "[]"
- }
- param {
- name: "linking_contexts"
- doc: "Linking contexts from dependencies to be linked into the linking context generated by this rule."
- default_value: "[]"
- }
- param {
- name: "name"
- doc: "This is used for naming the output artifacts of actions created by this method."
- is_mandatory: true
- }
- param {
- name: "language"
- doc: "Only C++ supported for now. Do not use this parameter."
- default_value: "\'c++\'"
- }
- param {
- name: "output_type"
- doc: "Can be either \'executable\' or \'dynamic_library\'."
- default_value: "\'executable\'"
- }
- param {
- name: "link_deps_statically"
- doc: " True to link dependencies statically, False dynamically."
- default_value: "True"
- }
- param {
- name: "stamp"
- doc: "Whether to include build information in the linked executable, if output_type is \'executable\'. If 1, build information is always included. If 0 (the default build information is always excluded. If -1, uses the default behavior, which may be overridden by the --[no]stamp flag. This should be unset (or set to 0) when generating the executable output for test rules."
- default_value: "0"
- }
- param {
- name: "additional_inputs"
- type: "sequence; or depset"
- doc: "For additional inputs to the linking action, e.g.: linking scripts."
- default_value: "[]"
- }
- param {
- name: "additional_outputs"
- type: "sequence"
- doc: "For additional outputs to the linking action, e.g.: map files."
- default_value: "unbound"
- }
- return_type: "CcLinkingOutputs"
+ param {
+ name: "oneversion"
+ doc: "Label of the one-version enforcement binary."
+ default_value: "None"
}
- doc: "Should be used for C++ transitive linking."
- }
- field {
- name: "merge_compilation_contexts"
- callable {
- param {
- name: "compilation_contexts"
- doc: "List of CompilationContextss to be merged. The headers of each context will be exported by the direct fields in the returned provider."
- default_value: "[]"
- }
- return_type: "CompilationContext"
+ param {
+ name: "oneversion_allowlist"
+ doc: "Label of the one-version allowlist."
+ default_value: "None"
}
- doc: "Merges multiple CompilationContextss into one."
- }
- field {
- name: "merge_compilation_outputs"
- callable {
- param {
- name: "compilation_outputs"
- default_value: "[]"
- }
- return_type: "CcCompilationOutputs"
+ param {
+ name: "oneversion_allowlist_for_tests"
+ doc: "Label of the one-version allowlist for tests."
+ default_value: "None"
}
- doc: "Merge compilation outputs."
- }
- doc: "Utilities for C++ compilation, linking, and command line generation."
-}
-type {
- name: "config"
- field {
- name: "bool"
- callable {
- param {
- name: "flag"
- doc: "Whether or not this build setting is callable on the command line."
- default_value: "False"
- }
- return_type: "BuildSetting"
+ param {
+ name: "oneversion_whitelist"
+ doc: "Deprecated: use oneversion_allowlist instead"
+ default_value: "None"
}
- doc: "A bool-typed build setting"
- }
- field {
- name: "exec"
- callable {
- param {
- name: "exec_group"
- type: "string; or None"
- doc: "The name of the exec group whose execution platform this transition will use. If not provided, this exec transition will use the target\'s default execution platform."
- default_value: "None"
- }
- return_type: "ExecTransitionFactory"
+ param {
+ name: "package_configuration"
+ doc: "Configuration that should be applied to the specified package groups."
+ default_value: "[]"
}
- doc: "Creates an execution transition."
- }
- field {
- name: "int"
- callable {
- param {
- name: "flag"
- doc: "Whether or not this build setting is callable on the command line."
- default_value: "False"
- }
- return_type: "BuildSetting"
+ param {
+ name: "proguard_allowlister"
+ doc: "Label of the Proguard allowlister."
+ default_value: "\"@bazel_tools//tools/jdk:proguard_whitelister\""
}
- doc: "An integer-typed build setting"
- }
- field {
- name: "string"
- callable {
- param {
- name: "flag"
- doc: "Whether or not this build setting is callable on the command line."
- default_value: "False"
- }
- param {
- name: "allow_multiple"
- doc: "Deprecated, use a string_list setting with repeatable = True instead. If set, this flag is allowed to be set multiple times on the command line. The Value of the flag as accessed in transitions and build setting implementation function will be a list of strings. Insertion order and repeated values are both maintained. This list can be post-processed in the build setting implementation function if different behavior is desired."
- default_value: "False"
- }
- return_type: "BuildSetting"
+ param {
+ name: "reduced_classpath_incompatible_processors"
+ doc: "Internal API, do not use!"
+ default_value: "[]"
}
- doc: "A string-typed build setting"
- }
- field {
- name: "string_list"
- callable {
- param {
- name: "flag"
- doc: "Whether or not this build setting is callable on the command line."
- default_value: "False"
- }
- param {
- name: "repeatable"
- doc: "If set, instead of expecting a comma-separated value, this flag is allowed to be set multiple times on the command line with each individual value treated as a single string to add to the list value. Insertion order and repeated values are both maintained. This list can be post-processed in the build setting implementation function if different behavior is desired."
- default_value: "False"
- }
- return_type: "BuildSetting"
+ param {
+ name: "restricted_to"
+ doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
--//my/setting=foo,bar."
- }
- doc: "This is a top-level module for creating configuration transitions and build setting descriptors which describe what kind of build setting (if any) a rule is. ex: the following rule is marked as a build setting by setting the build_setting parameter of the rule() function. Specifically it is a build setting of type int and is a flag which means this build setting is callable on the command line.
my_rule = rule(\n implementation = _impl,\n build_setting = config.int(flag = True),\n ...\n )" -} -type { - name: "config_common" - field { - name: "FeatureFlagInfo" - type: "Provider" - doc: "The key used to retrieve the provider containing config_feature_flag\'s value." - } - field { - name: "toolchain_type" - callable { - param { - name: "name" - type: "string; or Label" - doc: "The toolchain type that is required." - is_mandatory: true - } - param { - name: "mandatory" - type: "bool" - doc: "Whether the toolchain type is mandatory or optional." - default_value: "True" - } - return_type: "toolchain_type" + param { + name: "singlejar" + doc: "Label of the SingleJar deploy jar." + default_value: "None" } - doc: "Declare a rule\'s dependency on a toolchain type." - } - doc: "Functions for Starlark to interact with Blaze\'s configurability APIs." -} -type { - name: "coverage_common" - field { - name: "instrumented_files_info" - callable { - param { - name: "ctx" - doc: "The rule context." - is_mandatory: true - } - param { - name: "source_attributes" - doc: "A list of attribute names which contain source files processed by this rule." - default_value: "[]" - } - param { - name: "dependency_attributes" - doc: "A list of attribute names which might provide runtime dependencies (either code dependencies or runfiles)." - default_value: "[]" - } - param { - name: "extensions" - type: "sequence of strings; or
None"
- doc: "File extensions used to filter files from source_attributes. For example, \'js\'. If not provided (or None), then all files from source_attributes will be added to instrumented files, if an empty list is provided, then no files from source attributes will be added."
- default_value: "None"
- }
- param {
- name: "metadata_files"
- type: "sequence of Files"
- doc: "Additional files required to generate coverage LCOV files after code execution. e.g. .gcno files for C++."
- default_value: "[]"
- }
- return_type: "InstrumentedFilesInfo"
+ param {
+ name: "source_version"
+ doc: "The Java source version (e.g., \'6\' or \'7\'). It specifies which set of code structures\nare allowed in the Java source code."
+ default_value: "\"\""
+ }
+ param {
+ name: "tags"
+ doc: "\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "target_version" + doc: "The Java target version (e.g., \'6\' or \'7\'). It specifies for which Java runtime the class\nshould be build." + default_value: "\"\"" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "timezone_data" + doc: "Label of a resource jar containing timezone data. If set, the timezone data is added as an\nimplicitly runtime dependency of all java_binary rules." + default_value: "None" + } + param { + name: "toolchains" + doc: "List of labels;\n nonconfigurable; default is []
\n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n
@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific cc_toolchain or java_toolchain a\n target will use.\n
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
\nSpecifies the configuration for the Java compiler. Which toolchain to be used can be changed through\nthe --java_toolchain argument. Normally you should not write those kind of rules unless you want to\ntune your Java compiler.\n
\n\nA simple example would be:\n
\n\n\n\n\njava_toolchain(\n name = \"toolchain\",\n source_version = \"7\",\n target_version = \"7\",\n bootclasspath = [\"//tools/jdk:bootclasspath\"],\n xlint = [ \"classfile\", \"divzero\", \"empty\", \"options\", \"path\" ],\n javacopts = [ \"-g\" ],\n javabuilder = \":JavaBuilder_deploy.jar\",\n)\n\n"
+ api_context: BUILD
}
-type {
- name: "java_common"
- field {
- name: "BootClassPathInfo"
- type: "Provider"
- doc: "The provider used to supply bootclasspath information"
- }
- field {
- name: "JavaRuntimeInfo"
- type: "Provider"
- doc: "The key used to retrieve the provider that contains information about the Java runtime being used."
- }
- field {
- name: "JavaToolchainInfo"
- type: "Provider"
- doc: "The key used to retrieve the provider that contains information about the Java toolchain being used."
- }
- field {
- name: "compile"
+global {
+ name: "json"
+ doc: "Module json is a Starlark module of JSON-related functions."
+ api_context: BUILD
+ global_variable {
+ name: "decode"
callable {
param {
- name: "ctx"
- doc: "The rule context."
+ name: "x"
+ doc: "JSON string to decode."
is_mandatory: true
}
param {
- name: "source_jars"
- type: "sequence of Files"
- doc: "A list of the jars to be compiled. At least one of source_jars or source_files should be specified."
- default_value: "[]"
- }
- param {
- name: "source_files"
- type: "sequence of Files"
- doc: "A list of the Java source files to be compiled. At least one of source_jars or source_files should be specified."
- default_value: "[]"
+ name: "default"
+ doc: "If specified, the value to return when x cannot be decoded."
+ default_value: "unbound"
}
+ }
+ doc: "The decode function has one required positional parameter: a JSON string.\nIt returns the Starlark value that the string denotes.\n\"null\", \"true\" and \"false\" are parsed as None, True, and False.\nx is not a valid JSON encoding and the optional default parameter is specified (including specified as None), this function returns the default value.\nIf x is not a valid JSON encoding and the optional default parameter is not specified, this function fails."
+ api_context: BUILD
+ }
+ global_variable {
+ name: "encode"
+ callable {
param {
- name: "output"
+ name: "x"
is_mandatory: true
}
+ }
+ doc: "The encode function accepts one required positional argument, which it converts to JSON by cases:\n
None"
- doc: "The output source jar. Optional. Defaults to `{output_jar}-src.jar` if unset."
- default_value: "None"
- }
- param {
- name: "javac_opts"
- type: "sequence of strings"
- doc: "A list of the desired javac options. Optional."
- default_value: "[]"
- }
- param {
- name: "deps"
- type: "sequence of structs"
- doc: "A list of dependencies. Optional."
- default_value: "[]"
- }
- param {
- name: "runtime_deps"
- type: "sequence of structs"
- doc: "A list of runtime dependencies. Optional."
- default_value: "[]"
- }
- param {
- name: "exports"
- type: "sequence of structs"
- doc: "A list of exports. Optional."
- default_value: "[]"
- }
- param {
- name: "plugins"
- type: "sequence of structs; or sequence of structs"
- doc: "A list of plugins. Optional."
- default_value: "[]"
- }
- param {
- name: "exported_plugins"
- type: "sequence of structs; or sequence of structs"
- doc: "A list of exported plugins. Optional."
- default_value: "[]"
- }
- param {
- name: "native_libraries"
- type: "sequence of CcInfos"
- doc: "CC native library dependencies that are needed for this library."
- default_value: "[]"
- }
- param {
- name: "annotation_processor_additional_inputs"
- type: "sequence of Files"
- doc: "A list of inputs that the Java compilation action will take in addition to the Java sources for annotation processing."
- default_value: "[]"
- }
- param {
- name: "annotation_processor_additional_outputs"
- type: "sequence of Files"
- doc: "A list of outputs that the Java compilation action will output in addition to the class jar from annotation processing."
- default_value: "[]"
- }
- param {
- name: "strict_deps"
- doc: "A string that specifies how to handle strict deps. Possible values: \'OFF\', \'ERROR\', \'WARN\' and \'DEFAULT\'. For more details see /docs/user-manual#flag--strict_java_deps. By default \'ERROR\'."
- default_value: "\'ERROR\'"
- }
- param {
- name: "java_toolchain"
- doc: "A JavaToolchainInfo to be used for this compilation. Mandatory."
+ name: "x"
is_mandatory: true
}
param {
- name: "bootclasspath"
- doc: "A BootClassPathInfo to be used for this compilation. If present, overrides the bootclasspath associated with the provided java_toolchain. Optional."
- default_value: "None"
- }
- param {
- name: "host_javabase"
- doc: "Deprecated. This parameter is deprecated and will be removed soon. Please do not depend on it. It is disabled with --+incompatible_java_common_parameters. Use this flag to verify your code is compatible with its imminent removal. json.indent(json.encode(x), ...). See indent for description of formatting parameters."
+ api_context: BUILD
+ }
+ global_variable {
+ name: "indent"
+ callable {
param {
- name: "enable_compile_jar_action"
- doc: "Enables header compilation or ijar creation. If set to False, it forces use of the full class jar in the compilation classpaths of any dependants. Doing so is intended for use by non-library targets such as binaries that do not have dependants."
- default_value: "True"
+ name: "s"
+ is_mandatory: true
}
param {
- name: "add_exports"
- type: "sequence of strings"
- doc: "Allow this library to access the given None"
- doc: "Deprecated. This parameter is deprecated and will be removed soon. Please do not depend on it. It is disabled with --+incompatible_java_common_parameters. Use this flag to verify your code is compatible with its imminent removal. None"
- doc: "The output source jar."
- default_value: "None"
- }
- param {
- name: "sources"
- type: "sequence of Files"
- doc: "A list of Java source files to be packed into the source jar."
- default_value: "[]"
- }
- param {
- name: "source_jars"
- type: "sequence of Files"
- doc: "A list of source jars to be packed into the source jar."
- default_value: "[]"
- }
- param {
- name: "java_toolchain"
- doc: "A JavaToolchainInfo to used to find the ijar tool."
- is_mandatory: true
- }
- param {
- name: "host_javabase"
- doc: "Deprecated. This parameter is deprecated and will be removed soon. Please do not depend on it. It is disabled with --+incompatible_java_common_parameters. Use this flag to verify your code is compatible with its imminent removal. JavaInfo#source_jar
None"
- doc: "A target label to stamp the jar with. Used for add_dep support. Typically, you would pass ctx.label to stamp the jar with the current rule\'s label."
- default_value: "None"
- }
- param {
- name: "java_toolchain"
- doc: "A JavaToolchainInfo to used to find the ijar tool."
- is_mandatory: true
- }
- return_type: "File"
+ param {
+ name: "visibility"
+ default_value: "[]"
}
- doc: "Runs ijar on a jar, stripping it of its method bodies. This helps reduce rebuilding of dependent jars during any recompiles consisting only of simple changes to method implementations. The return value is typically passed to JavaInfo#compile_jar."
}
- field {
- name: "stamp_jar"
- callable {
- param {
- name: "actions"
- doc: "ctx.actions"
- is_mandatory: true
- }
- param {
- name: "jar"
- doc: "The jar to run stamp_jar on."
- is_mandatory: true
- }
- param {
- name: "target_label"
- doc: "A target label to stamp the jar with. Used for add_dep support. Typically, you would pass ctx.label to stamp the jar with the current rule\'s label."
- is_mandatory: true
- }
- param {
- name: "java_toolchain"
- doc: "A JavaToolchainInfo to used to find the stamp_jar tool."
- is_mandatory: true
- }
- return_type: "File"
- }
- doc: "Stamps a jar with a target label for add_dep support. The return value is typically passed to JavaInfo#compile_jar. Prefer to use run_ijar when possible."
+ doc: "Represents a MEMPROF profile that is in the workspace.\nExample:
\n\n\nmemprof_profile(\n name = \"memprof\",\n profile = \"//path/to/memprof:profile.afdo\",\n)\n\n"
+ api_context: BUILD
+}
+global {
+ name: "module_name"
+ callable {
}
- doc: "Utilities for Java compilation support in Starlark."
+ doc: "The name of the Bazel module associated with the repo this package is in. If this package is from a repo defined in WORKSPACE instead of MODULE.bazel, this is empty. For repos generated by module extensions, this is the name of the module hosting the extension. It\'s the same as the module.name field seen in module_ctx.modules."
+ api_context: BUILD
}
-type {
- name: "native"
- field {
- name: "existing_rule"
- callable {
- param {
- name: "name"
- doc: "The name of the target."
- is_mandatory: true
- }
- return_type: "unknown"
- }
- doc: "Returns an immutable dict-like object that describes the attributes of a rule instantiated in this thread\'s package, or None if no rule instance of that name exists.Here, an immutable dict-like object means a deeply immutable object x supporting dict-like iteration, len(x), name in x, x[name], x.get(name), x.items(), x.keys(), and x.values().
If the --noincompatible_existing_rules_immutable_view flag is set, instead returns a new mutable dict with the same content.
The result contains an entry for each attribute, with the exception of private ones (whose names do not start with a letter) and a few unrepresentable legacy attribute types. In addition, the dict contains entries for the rule instance\'s name and kind (for example, \'cc_binary\').
The values of the result represent attribute values as follows:
\':foo\' for targets in the same package or \'//pkg:name\' for targets in a different package.select values are returned with their contents transformed as described above.If possible, avoid using this function. It makes BUILD files brittle and order-dependent. Also, beware that it differs subtly from the two other conversions of rule attribute values from internal form to Starlark: one used by computed defaults, the other used by ctx.attr.foo."
- api_context: BZL
+global {
+ name: "module_version"
+ callable {
}
- field {
- name: "existing_rules"
- callable {
- return_type: "unknown"
+ doc: "The version of the Bazel module associated with the repo this package is in. If this package is from a repo defined in WORKSPACE instead of MODULE.bazel, this is empty. For repos generated by module extensions, this is the version of the module hosting the extension. It\'s the same as the module.version field seen in module_ctx.modules."
+ api_context: BUILD
+}
+global {
+ name: "objc_import"
+ callable {
+ param {
+ name: "name"
+ is_mandatory: true
}
- doc: "Returns an immutable dict-like object describing the rules so far instantiated in this thread\'s package. Each entry of the dict-like object maps the name of the rule instance to the result that would be returned by existing_rule(name).
Here, an immutable dict-like object means a deeply immutable object x supporting dict-like iteration, len(x), name in x, x[name], x.get(name), x.items(), x.keys(), and x.values().
If the --noincompatible_existing_rules_immutable_view flag is set, instead returns a new mutable dict with the same content.
Note: If possible, avoid using this function. It makes BUILD files brittle and order-dependent. Furthermore, if the --noincompatible_existing_rules_immutable_view flag is set, this function may be very expensive, especially if called within a loop."
- api_context: BZL
- }
- field {
- name: "exports_files"
- callable {
- param {
- name: "srcs"
- type: "sequence of strings"
- doc: "The list of files to export."
- is_mandatory: true
- }
- param {
- name: "visibility"
- type: "sequence; or None"
- doc: "A visibility declaration can to be specified. The files will be visible to the targets specified. If no visibility is specified, the files will be visible to every package."
- default_value: "None"
- }
- param {
- name: "licenses"
- type: "sequence of strings; or None"
- doc: "Licenses to be specified."
- default_value: "None"
- }
- return_type: "NoneType"
+ param {
+ name: "deps"
+ doc: "\n
List of labels; default is []
\nDependencies for this target. Generally should only list rule targets. (Though\nsome rules permit files to be listed directly in deps, this\nshould be avoided when possible.)\n
\nLanguage-specific rules generally limit the listed targets to those with\nspecific providers.
\n\n\nThe precise semantics of what it means for a target to depend on another using\ndeps are specific to the kind of rule, and the rule-specific\ndocumentation goes into more detail. For rules which process source code,\ndeps generally specifies code dependencies used by the code in\nsrcs.\n
\nMost often, a deps dependency is used to allow one module to use\nsymbols defined in another module written in the same programming language and\nseparately compiled. Cross-language dependencies are also permitted in many\ncases: For example, a java_library target may depend on C++ code\nin a cc_library target, by listing the latter in the\ndeps attribute. See the definition of\ndependencies\nfor more information.\n
\nThese headers describe the public interface for the library and will be\nmade available for inclusion by sources in this rule or in dependent\nrules. Headers not meant to be included by a client of this library\nshould be listed in the srcs attribute instead.\n
\nThese will be compiled separately from the source if modules are enabled." + default_value: "[]" } - doc: "Glob returns a new, mutable, sorted list of every file in the current package that:
include.exclude (default []).exclude_directories argument is enabled (set to 1), files of type directory will be omitted from the results (default 1)."
- api_context: BZL
- }
- field {
- name: "module_name"
- callable {
- return_type: "string"
+ param {
+ name: "alwayslink"
+ doc: "If 1, any bundle or binary that depends (directly or indirectly) on this\nlibrary will link in all the object files for the files listed in\nsrcs and non_arc_srcs, even if some contain no\nsymbols referenced by the binary.\nThis is useful if your code isn\'t explicitly called by code in\nthe binary, e.g., if your code registers to receive some callback\nprovided by some service."
+ default_value: "false"
}
- doc: "The name of the Bazel module associated with the repo this package is in. If this package is from a repo defined in WORKSPACE instead of MODULE.bazel, this is empty. For repos generated by module extensions, this is the name of the module hosting the extension. It\'s the same as the module.name field seen in module_ctx.modules."
- api_context: BZL
- }
- field {
- name: "module_version"
- callable {
- return_type: "string"
+ param {
+ name: "archives"
+ doc: "The list of .a files provided to Objective-C targets that\ndepend on this target."
+ is_mandatory: true
}
- doc: "The version of the Bazel module associated with the repo this package is in. If this package is from a repo defined in WORKSPACE instead of MODULE.bazel, this is empty. For repos generated by module extensions, this is the version of the module hosting the extension. It\'s the same as the module.version field seen in module_ctx.modules."
- api_context: BZL
- }
- field {
- name: "package_group"
- callable {
- param {
- name: "name"
- doc: "The unique name for this rule."
- is_mandatory: true
- }
- param {
- name: "packages"
- type: "sequence of strings"
- doc: "A complete enumeration of packages in this group."
- default_value: "[]"
- }
- param {
- name: "includes"
- type: "sequence of strings"
- doc: "Other package groups that are included in this one."
- default_value: "[]"
- }
- return_type: "NoneType"
+ param {
+ name: "compatible_with"
+ doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" } - doc: "This function defines a set of packages and assigns a label to the group. The label can be referenced invisibility attributes."
- api_context: BZL
- }
- field {
- name: "package_name"
- callable {
- return_type: "string"
+ param {
+ name: "deprecation"
+ doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "exec_compatible_with" + doc: "List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "expect_failure" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
#include/#import search paths to add to this target\nand all depending targets.\n\nThis is to support third party and open-sourced libraries that do not\nspecify the entire workspace path in their\n#import/#include statements.\n\nThe paths are interpreted relative to the package directory, and the\ngenfiles and bin roots (e.g. blaze-genfiles/pkg/includedir\nand blaze-out/pkg/includedir) are included in addition to the\nactual client root.\n
\nUnlike COPTS, these flags are added for this rule\nand every rule that depends on it. (Note: not the rules it depends upon!) Be\nvery careful, since this may have far-reaching effects. When in doubt, add\n\"-iquote\" flags to COPTS instead." + default_value: "[]" + } + param { + name: "package_metadata" + default_value: "[]" + } + param { + name: "restricted_to" + doc: "
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
When linking a top level Apple binary, all SDK frameworks listed in that binary\'s\ntransitive dependency graph are linked."
+ default_value: "[]"
+ }
+ param {
+ name: "sdk_includes"
+ doc: "List of #include/#import search paths to add to this target\nand all depending targets, where each path is relative to\n$(SDKROOT)/usr/include."
+ default_value: "[]"
+ }
+ param {
+ name: "tags"
+ doc: "
\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "textual_hdrs" + doc: "The list of C, C++, Objective-C, and Objective-C++ files that are\nincluded as headers by source files in this rule or by users of this\nlibrary. Unlike hdrs, these will not be compiled separately from the\nsources." + default_value: "[]" + } + param { + name: "toolchains" + doc: "List of labels;\n nonconfigurable; default is []
\n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n
@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific cc_toolchain or java_toolchain a\n target will use.\n
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
some/package/BUILD, its value will be some/package. If the BUILD file calls a function defined in a .bzl file, package_name() will match the caller BUILD file package. This function is equivalent to the deprecated variable PACKAGE_NAME."
- api_context: BZL
}
- field {
- name: "package_relative_label"
- callable {
- param {
- name: "input"
- type: "string; or Label"
- doc: "The input label string or Label object. If a Label object is passed, it\'s returned as is."
- is_mandatory: true
- }
- return_type: "Label"
+ doc: "This rule encapsulates an already-compiled static library in the form of an\n.a file. It also allows exporting headers and resources using the same\nattributes supported by objc_library.
List of labels; default is []
\nDependencies for this target. Generally should only list rule targets. (Though\nsome rules permit files to be listed directly in deps, this\nshould be avoided when possible.)\n
\nLanguage-specific rules generally limit the listed targets to those with\nspecific providers.
\n\n\nThe precise semantics of what it means for a target to depend on another using\ndeps are specific to the kind of rule, and the rule-specific\ndocumentation goes into more detail. For rules which process source code,\ndeps generally specifies code dependencies used by the code in\nsrcs.\n
\nMost often, a deps dependency is used to allow one module to use\nsymbols defined in another module written in the same programming language and\nseparately compiled. Cross-language dependencies are also permitted in many\ncases: For example, a java_library target may depend on C++ code\nin a cc_library target, by listing the latter in the\ndeps attribute. See the definition of\ndependencies\nfor more information.\n
List of labels; default is []
\nFiles processed or included by this rule. Generally lists files directly, but\nmay list rule targets (like filegroup or genrule) to\ninclude their default outputs.\n
\nLanguage-specific rules often require that the listed files have particular\nfile extensions.\n
\n" + } + param { + name: "data" + doc: "\nList of labels; default is []
\nFiles needed by this rule at runtime. May list file or rule targets. Generally\nallows any target.\n
\n\n\nThe default outputs and runfiles of targets in the data attribute\nshould appear in the *.runfiles area of any executable which is\noutput by or has a runtime dependency on this target. This may include data\nfiles or binaries used when this target\'s\nsrcs are executed. See the\ndata dependencies\nsection for more information about how to depend on and use data files.\n
\nNew rules should define a data attribute if they process\ninputs which might use other inputs at runtime. Rules\' implementation functions\nmust also populate the target\'s\nrunfiles from the outputs and runfiles of any data attribute,\nas well as runfiles from any dependency attribute which provides either\nsource code or runtime dependencies.\n
\nThese headers describe the public interface for the library and will be\nmade available for inclusion by sources in this rule or in dependent\nrules. Headers not meant to be included by a client of this library\nshould be listed in the srcs attribute instead.\n
\nThese will be compiled separately from the source if modules are enabled."
+ default_value: "[]"
+ }
+ param {
+ name: "alwayslink"
+ doc: "If 1, any bundle or binary that depends (directly or indirectly) on this\nlibrary will link in all the object files for the files listed in\nsrcs and non_arc_srcs, even if some contain no\nsymbols referenced by the binary.\nThis is useful if your code isn\'t explicitly called by code in\nthe binary, e.g., if your code registers to receive some callback\nprovided by some service."
+ default_value: "false"
+ }
+ param {
+ name: "compatible_with"
+ doc: "
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "conlyopts" + doc: "Extra flags to pass to the compiler for C files.\nSubject to \"Make variable\" substitution and\nBourne shell tokenization.\nThese flags will only apply to this target, and not those upon which\nit depends, or those which depend on it.\n\nNote that for the generated Xcode project, directory paths specified using \"-I\" flags in\ncopts are parsed out, prepended with \"$(WORKSPACE_ROOT)/\" if they are relative paths, and\nadded to the header search paths for the associated Xcode target." + default_value: "[]" + } + param { + name: "copts" + doc: "Extra flags to pass to the compiler.\nSubject to \"Make variable\" substitution and\nBourne shell tokenization.\nThese flags will only apply to this target, and not those upon which\nit depends, or those which depend on it.\n
\nNote that for the generated Xcode project, directory paths specified using \"-I\" flags in\ncopts are parsed out, prepended with \"$(WORKSPACE_ROOT)/\" if they are relative paths, and\nadded to the header search paths for the associated Xcode target." + default_value: "[]" + } + param { + name: "cxxopts" + doc: "Extra flags to pass to the compiler for Objective-C++ and C++ files.\nSubject to \"Make variable\" substitution and\nBourne shell tokenization.\nThese flags will only apply to this target, and not those upon which\nit depends, or those which depend on it.\n
\nNote that for the generated Xcode project, directory paths specified using \"-I\" flags in\ncopts are parsed out, prepended with \"$(WORKSPACE_ROOT)/\" if they are relative paths, and\nadded to the header search paths for the associated Xcode target."
+ default_value: "[]"
+ }
+ param {
+ name: "defines"
+ doc: "Extra -D flags to pass to the compiler. They should be in\nthe form KEY=VALUE or simply KEY and are\npassed not only to the compiler for this target (as copts\nare) but also to all objc_ dependers of this target.\nSubject to \"Make variable\" substitution and\nBourne shell tokenization."
+ default_value: "[]"
+ }
+ param {
+ name: "deprecation"
+ doc: "
String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "enable_modules" + doc: "Enables clang module support (via -fmodules).\nSetting this to 1 will allow you to @import system headers and other targets:\n@import UIKit;\n@import path_to_package_target;" + default_value: "false" + } + param { + name: "exec_compatible_with" + doc: "List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
BUILD file for which the current macro is executing). If the input is already a Label, it is returned unchanged.This function may only be called while evaluating a BUILD file and the macros it directly or indirectly calls; it may not be called in (for instance) a rule implementation function.
The result of this function is the same Label value as would be produced by passing the given string to a label-valued attribute of a target declared in the BUILD file.
Usage note: The difference between this function and Label() is that Label() uses the context of the package of the .bzl file that called it, not the package of the BUILD file. Use Label() when you need to refer to a fixed target that is hardcoded into the macro, such as a compiler. Use package_relative_label() when you need to normalize a label string supplied by the BUILD file to a Label object. (There is no way to convert a string to a Label in the context of a package other than the BUILD file or the calling .bzl file. For that reason, outer macros should always prefer to pass Label objects to inner macros rather than label strings.)"
- api_context: BZL
- }
- field {
- name: "repository_name"
- callable {
- return_type: "string"
+ param {
+ name: "exec_properties"
+ doc: "
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" } - doc: "The name of the repository the rule or build extension is called from. For example, in packages that are called into existence by the WORKSPACE stanzalocal_repository(name=\'local\', path=...) it will be set to @local. In packages in the main repository, it will be set to @. This function is equivalent to the deprecated variable REPOSITORY_NAME."
- api_context: BZL
- }
- field {
- name: "subpackages"
- callable {
- param {
- name: "include"
- type: "sequence of strings"
- doc: "The list of glob patterns to include in subpackages scan."
- is_mandatory: true
- }
- param {
- name: "exclude"
- type: "sequence of strings"
- doc: "The list of glob patterns to exclude from subpackages scan."
- default_value: "[]"
- }
- param {
- name: "allow_empty"
- doc: "Whether we fail if the call returns an empty list. By default empty list indicates potential error in BUILD file where the call to subpackages() is superflous. Setting to true allows this function to succeed in that case."
- default_value: "False"
- }
- return_type: "sequence"
+ param {
+ name: "expect_failure"
}
- doc: "Returns a new mutable list of every direct subpackage of the current package, regardless of file-system directory depth. List returned is sorted and contains the names of subpackages relative to the current package. It is advised to prefer using the methods in bazel_skylib.subpackages module rather than calling this function directly."
- api_context: BZL
- }
- doc: "A built-in module to support native rules and other package helper functions. All native rules appear as functions in this module, e.g. native.cc_library. Note that the native module is only available in the loading phase (i.e. for macros, not for rule implementations). Attributes will ignore None values, and treat them as if the attribute was unset.--experimental_platforms_api"
- }
- field {
- name: "ConstraintValueInfo"
- type: "Provider"
- doc: "The constructor/key for the ConstraintValueInfo provider.--experimental_platforms_api"
- }
- field {
- name: "PlatformInfo"
- type: "Provider"
- doc: "The constructor/key for the PlatformInfo provider.--experimental_platforms_api"
- }
- field {
- name: "TemplateVariableInfo"
- type: "Provider"
- doc: "The constructor/key for the TemplateVariableInfo provider."
- }
- field {
- name: "ToolchainInfo"
- type: "Provider"
- doc: "The constructor/key for the ToolchainInfo provider."
- }
- doc: "Functions for Starlark to interact with the platform APIs."
-}
-type {
- name: "proto"
- field {
- name: "encode_text"
- callable {
- param {
- name: "x"
- is_mandatory: true
- }
- return_type: "string"
+ param {
+ name: "features"
+ doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
A struct is converted to a message. Fields are emitted in name order.\nEach struct field whose value is None is ignored.\n
A sequence (such as a list or tuple) is converted to a repeated field.\nIts elements must not be sequences or dicts.\n
A dict is converted to a repeated field of messages with fields named \'key\' and \'value\'.\nEntries are emitted in iteration (insertion) order.\nThe dict\'s keys must be strings or ints, and its values must not be sequences or dicts.\nExamples:
proto.encode_text(struct(field=123))\n# field: 123\n\nproto.encode_text(struct(field=True))\n# field: true\n\nproto.encode_text(struct(field=[1, 2, 3]))\n# field: 1\n# field: 2\n# field: 3\n\nproto.encode_text(struct(field=\'text\', ignored_field=None))\n# field: \"text\"\n\nproto.encode_text(struct(field=struct(inner_field=\'text\', ignored_field=None)))\n# field {\n# inner_field: \"text\"\n# }\n\nproto.encode_text(struct(field=[struct(inner_field=1), struct(inner_field=2)]))\n# field {\n# inner_field: 1\n# }\n# field {\n# inner_field: 2\n# }\n\nproto.encode_text(struct(field=struct(inner_field=struct(inner_inner_field=\'text\'))))\n# field {\n# inner_field {\n# inner_inner_field: \"text\"\n# }\n# }\n\nproto.encode_text(struct(foo={4: 3, 2: 1}))\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\n"
- }
- doc: "A module for protocol message processing."
-}
-type {
- name: "proto_common"
- doc: "Utilities for protocol buffers. Please consider using load(\"@rules_proto//proto:defs.bzl\", \"proto_common\") to load this symbol from rules_proto.
deps, the headers and include paths of these libraries (and all their\ntransitive deps) are only used for compilation of this library, and not libraries that\ndepend on it. Libraries specified with implementation_deps are still linked\nin binary targets that depend on this library."
+ default_value: "[]"
}
- doc: "testing.ExecutionInfo provider key/constructor"
- }
- field {
- name: "TestEnvironment"
- callable {
- param {
- name: "environment"
- doc: "A map of string keys and values that represent environment variables and their values. These will be made available during the test execution."
- is_mandatory: true
- }
- param {
- name: "inherited_environment"
- type: "sequence of strings"
- doc: "A sequence of names of environment variables. These variables are made available during the test execution with their current value taken from the shell environment. If a variable is contained in both environment and inherited_environment, the value inherited from the shell environment will take precedence if set."
- default_value: "[]"
- }
- return_type: "RunEnvironmentInfo"
+ param {
+ name: "includes"
+ doc: "List of #include/#import search paths to add to this target\nand all depending targets.\n\nThis is to support third party and open-sourced libraries that do not\nspecify the entire workspace path in their\n#import/#include statements.\n\nThe paths are interpreted relative to the package directory, and the\ngenfiles and bin roots (e.g. blaze-genfiles/pkg/includedir\nand blaze-out/pkg/includedir) are included in addition to the\nactual client root.\n
\nUnlike COPTS, these flags are added for this rule\nand every rule that depends on it. (Note: not the rules it depends upon!) Be\nvery careful, since this may have far-reaching effects. When in doubt, add\n\"-iquote\" flags to COPTS instead."
+ default_value: "[]"
}
- doc: "Deprecated: Use RunEnvironmentInfo instead. Creates a new test environment provider. Use this provider to specify extra environment variables to be made available during test execution."
- }
- field {
- name: "analysis_test"
- callable {
- param {
- name: "name"
- doc: "Name of the target. It should be a Starlark identifier, matching pattern \'[A-Za-z_][A-Za-z0-9_]*\'."
- is_mandatory: true
- }
- param {
- name: "implementation"
- doc: "The Starlark function implementing this analysis test. It must have exactly one parameter: ctx. The function is called during the analysis phase. It can access the attributes declared by attrs and populated via attr_values. The implementation function may not register actions. Instead, it must register a pass/fail result via providing AnalysisTestResultInfo."
- is_mandatory: true
- }
- param {
- name: "attrs"
- type: "dict"
- doc: "Dictionary declaring the attributes. See the rule call. Attributes are allowed to use configuration transitions defined using analysis_test_transition."
- default_value: "{}"
- }
- param {
- name: "fragments"
- type: "sequence of strings"
- doc: "List of configuration fragments that are available to the implementation of the analysis test."
- default_value: "[]"
- }
- param {
- name: "toolchains"
- type: "sequence"
- doc: "The set of toolchains the test requires. See the rule call."
- default_value: "[]"
- }
- param {
- name: "attr_values"
- type: "dict of strings"
- doc: "Dictionary of attribute values to pass to the implementation."
- default_value: "{}"
- }
- return_type: "NoneType"
+ param {
+ name: "linkopts"
+ doc: "Extra flags to pass to the linker."
+ default_value: "[]"
}
- doc: "Creates a new analysis test target.
The number of transitive dependencies of the test are limited. The limit is controlled by --analysis_testing_deps_limit flag."
- }
- doc: "Helper methods for Starlark to access testing infrastructure."
-}
-type {
- name: "bool"
- doc: "A type to represent booleans. There are only two possible values: True and False. Any value can be converted to a boolean using the bool function."
-}
-type {
- name: "builtin_function_or_method"
- doc: "The type of a built-in function, defined by Java code."
-}
-type {
- name: "dict"
- field {
- name: "clear"
- callable {
- return_type: "NoneType"
+ param {
+ name: "module_map"
+ doc: "custom Clang module map for this target. Use of a custom module map is discouraged. Most\nusers should use module maps generated by Bazel.\nIf specified, Bazel will not generate a module map for this target, but will pass the\nprovided module map to the compiler."
+ is_mandatory: true
}
- doc: "Remove all items from the dictionary."
- }
- field {
- name: "get"
- callable {
- param {
- name: "key"
- doc: "The key to look for."
- is_mandatory: true
- }
- param {
- name: "default"
- doc: "The default value to use (instead of None) if the key is not found."
- default_value: "None"
- }
- return_type: "unknown"
+ param {
+ name: "module_name"
+ doc: "Sets the module name for this target. By default the module name is the target path with\nall special symbols replaced by _, e.g. //foo/baz:bar can be imported as foo_baz_bar."
}
- doc: "Returns the value for key if key is in the dictionary, else default. If default is not given, it defaults to None, so that this method never throws an error."
- }
- field {
- name: "items"
- callable {
- return_type: "list"
+ param {
+ name: "non_arc_srcs"
+ doc: "The list of Objective-C files that are processed to create the\nlibrary target that DO NOT use Automatic Reference Counting (ARC).\nThe files in this attribute are treated very similar to those in the\nsrcs attribute, but are compiled without ARC enabled."
+ default_value: "[]"
}
- doc: "Returns the list of key-value tuples:
{2: \"a\", 4: \"b\", 1: \"c\"}.items() == [(2, \"a\"), (4, \"b\"), (1, \"c\")]\n"
- }
- field {
- name: "keys"
- callable {
- return_type: "list"
+ param {
+ name: "package_metadata"
+ default_value: "[]"
}
- doc: "Returns the list of keys:{2: \"a\", 4: \"b\", 1: \"c\"}.keys() == [2, 4, 1]\n"
- }
- field {
- name: "pop"
- callable {
- param {
- name: "key"
- doc: "The key."
- is_mandatory: true
- }
- param {
- name: "default"
- doc: "a default value if the key is absent."
- default_value: "unbound"
- }
- return_type: "unknown"
+ param {
+ name: "pch"
+ doc: "Header file to prepend to every source file being compiled (both arc\nand non-arc).\nUse of pch files is actively discouraged in BUILD files, and this should be\nconsidered deprecated. Since pch files are not actually precompiled this is not\na build-speed enhancement, and instead is just a global dependency. From a build\nefficiency point of view you are actually better including what you need directly\nin your sources where you need it."
+ is_mandatory: true
}
- doc: "Removes a key from the dict, and returns the associated value. If no entry with that key was found, remove nothing and return the specified default value; if no default value was specified, fail instead."
- }
- field {
- name: "popitem"
- callable {
- return_type: "tuple"
+ param {
+ name: "restricted_to"
+ doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
(key, value) pair from the dictionary. popitem is useful to destructively iterate over a dictionary, as often used in set algorithms. If the dictionary is empty, the popitem call fails."
- }
- field {
- name: "setdefault"
- callable {
- param {
- name: "key"
- doc: "The key."
- is_mandatory: true
- }
- param {
- name: "default"
- doc: "a default value if the key is absent."
- default_value: "None"
- }
- return_type: "unknown"
+ param {
+ name: "sdk_dylibs"
+ doc: "Names of SDK .dylib libraries to link with. For instance, \"libz\" or\n\"libarchive\".\n\n\"libc++\" is included automatically if the binary has any C++ or\nObjective-C++ sources in its dependency tree. When linking a binary,\nall libraries named in that binary\'s transitive dependency graph are\nused."
+ default_value: "[]"
}
- doc: "If key is in the dictionary, return its value. If not, insert key with a value of default and return default. default defaults to None."
- }
- field {
- name: "update"
- callable {
- param {
- name: "pairs"
- doc: "Either a dictionary or a list of entries. Entries must be tuples or lists with exactly two elements: key, value."
- default_value: "[]"
- }
- param {
- name: "**kwargs"
- doc: "Dictionary of additional entries."
- is_mandatory: true
- is_star_star_arg: true
- }
- return_type: "NoneType"
+ param {
+ name: "sdk_frameworks"
+ doc: "Names of SDK frameworks to link with (e.g. \"AddressBook\", \"QuartzCore\").\n\n When linking a top level Apple binary, all SDK frameworks listed in that binary\'s\ntransitive dependency graph are linked."
+ default_value: "[]"
}
- doc: "Updates the dictionary first with the optional positional argument, pairs, then with the optional keyword arguments\nIf the positional argument is present, it must be a dict, iterable, or None.\nIf it is a dict, then its key/value pairs are inserted into this dict. If it is an iterable, it must provide a sequence of pairs (or other iterables of length 2), each of which is treated as a key/value pair to be inserted.\nEach keyword argument name=value causes the name/value pair to be inserted into this dict."
- }
- field {
- name: "values"
- callable {
- return_type: "list"
+ param {
+ name: "sdk_includes"
+ doc: "List of #include/#import search paths to add to this target\nand all depending targets, where each path is relative to\n$(SDKROOT)/usr/include."
+ default_value: "[]"
}
- doc: "Returns the list of values:
{2: \"a\", 4: \"b\", 1: \"c\"}.values() == [\"a\", \"b\", \"c\"]\n"
- }
- doc: "dict is a built-in type representing an associative mapping or dictionary. A dictionary supports indexing using d[k] and key membership testing using k in d; both operations take constant time. Unfrozen dictionaries are mutable, and may be updated by assigning to d[k] or by calling certain methods. Dictionaries are iterable; iteration yields the sequence of keys in insertion order. Iteration order is unaffected by updating the value associated with an existing key, but is affected by removing then reinserting a key.\nd = {0: 0, 2: 2, 1: 1}\n[k for k in d] # [0, 2, 1]\nd.pop(2)\nd[0], d[2] = \"a\", \"b\"\n0 in d, \"a\" in d # (True, False)\n[(k, v) for k, v in d.items()] # [(0, \"a\"), (1, 1), (2, \"b\")]\n\nThere are four ways to construct a dictionary:\n
{k: v, ...} yields a new dictionary with the specified key/value entries, inserted in the order they appear in the expression. Evaluation fails if any two key expressions yield the same value.\n{k: v for vars in seq} yields a new dictionary into which each key/value pair is inserted in loop iteration order. Duplicates are permitted: the first insertion of a given key determines its position in the sequence, and the last determines its associated value.\n\n{k: v for k, v in ((\"a\", 0), (\"b\", 1), (\"a\", 2))} # {\"a\": 2, \"b\": 1}\n{i: 2*i for i in range(3)} # {0: 0, 1: 2, 2: 4}\n\nx | y yields a new dictionary by combining two existing dictionaries. If the two dictionaries have a key k in common, the right hand side dictionary\'s value of the key (in other words, y[k]) wins. The |= variant of the union operator modifies a dictionary in-place. Example:d = {\"foo\": \"FOO\", \"bar\": \"BAR\"} | {\"foo\": \"FOO2\", \"baz\": \"BAZ\"}\n# d == {\"foo\": \"FOO2\", \"bar\": \"BAR\", \"baz\": \"BAZ\"}\nd = {\"a\": 1, \"b\": 2}\nd |= {\"b\": 3, \"c\": 4}\n# d == {\"a\": 1, \"b\": 3, \"c\": 4}153\n0x2A # hexadecimal literal\n0o54 # octal literal\n23 * 2 + 5\n100 / -7\n100 % -7 # -5 (unlike in some other languages)\nint(\"18\")\n" -} -type { - name: "json" - field { - name: "decode" - callable { - param { - name: "x" - doc: "JSON string to decode." - is_mandatory: true - } - param { - name: "default" - doc: "If specified, the value to return when
x cannot be decoded."
- default_value: "unbound"
- }
- return_type: "unknown"
+ param {
+ name: "stamp"
+ default_value: "false"
}
- doc: "The decode function has one required positional parameter: a JSON string.\nIt returns the Starlark value that the string denotes.\n\"null\", \"true\" and \"false\" are parsed as None, True, and False.\nx is not a valid JSON encoding and the optional default parameter is specified (including specified as None), this function returns the default value.\nIf x is not a valid JSON encoding and the optional default parameter is not specified, this function fails."
- }
- field {
- name: "encode"
- callable {
- param {
- name: "x"
- is_mandatory: true
- }
- return_type: "string"
+ param {
+ name: "tags"
+ doc: "\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n The encode function accepts one required positional argument, which it converts to JSON by cases:\n
\nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" } - doc: "The encode_indent function is equivalent tojson.indent(json.encode(x), ...). See indent for description of formatting parameters."
- }
- field {
- name: "indent"
- callable {
- param {
- name: "s"
- is_mandatory: true
- }
- param {
- name: "prefix"
- default_value: "\'\'"
- }
- param {
- name: "indent"
- default_value: "\'\\t\'"
- }
- return_type: "string"
+ param {
+ name: "testonly"
+ doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" } - doc: "The indent function returns the indented form of a valid JSON-encoded string.\nEach array element or object field appears on a new line, beginning with the prefix string followed by one or more copies of the indent string, according to its nesting depth.\nThe function accepts one required positional parameter, the JSON string,\nand two optional keyword-only string parameters, prefix and indent,\nthat specify a prefix of each new line, and the unit of indentation.\nIf the input is not valid, the function may fail or return invalid output.\n" - } - doc: "Module json is a Starlark module of JSON-related functions." -} -type { - name: "list" - field { - name: "append" - callable { - param { - name: "item" - doc: "Item to add at the end." - is_mandatory: true - } - return_type: "NoneType" + param { + name: "textual_hdrs" + doc: "The list of C, C++, Objective-C, and Objective-C++ files that are\nincluded as headers by source files in this rule or by users of this\nlibrary. Unlike hdrs, these will not be compiled separately from the\nsources." + default_value: "[]" } - doc: "Adds an item to the end of the list." - } - field { - name: "clear" - callable { - return_type: "NoneType" + param { + name: "toolchains" + doc: "List of labels;\n nonconfigurable; default is []
\n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n
@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific cc_toolchain or java_toolchain a\n target will use.\n
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
None"
- doc: "The start index of the list portion to inspect."
- default_value: "None"
- }
- param {
- name: "end"
- type: "int; or None"
- doc: "The end index of the list portion to inspect."
- default_value: "None"
- }
- return_type: "int"
+ doc: "This rule produces a static library from the given Objective-C source files.
" + api_context: BUILD +} +global { + name: "package" + callable { + param { + name: "**kwargs" + doc: "See thepackage() function in the Build Encyclopedia for applicable arguments."
+ is_star_star_arg: true
}
- doc: "Returns the index in the list of the first item whose value is x. It is an error if there is no such item."
}
- field {
- name: "insert"
- callable {
- param {
- name: "index"
- doc: "The index of the given position."
- is_mandatory: true
- }
- param {
- name: "item"
- doc: "The item."
- is_mandatory: true
- }
- return_type: "NoneType"
+ doc: "Declares metadata that applies to every rule in the package. It must be called at most once within a package (BUILD file). If called, it should be the first call in the BUILD file, right after the load() statements."
+ api_context: BUILD
+}
+global {
+ name: "package_group"
+ callable {
+ param {
+ name: "name"
+ doc: "The unique name for this rule."
+ is_mandatory: true
}
- doc: "Inserts an item at a given position."
- }
- field {
- name: "pop"
- callable {
- param {
- name: "i"
- type: "int; or None"
- doc: "The index of the item."
- default_value: "-1"
- }
- return_type: "unknown"
+ param {
+ name: "packages"
+ doc: "A complete enumeration of packages in this group."
+ default_value: "[]"
}
- doc: "Removes the item at the given position in the list, and returns it. If no index is specified, it removes and returns the last item in the list."
- }
- field {
- name: "remove"
- callable {
- param {
- name: "x"
- doc: "The object to remove."
- is_mandatory: true
- }
- return_type: "NoneType"
+ param {
+ name: "includes"
+ doc: "Other package groups that are included in this one."
+ default_value: "[]"
}
- doc: "Removes the first item from the list whose value is x. It is an error if there is no such item."
}
- doc: "The built-in list type. Example list expressions:x = [1, 2, 3]Accessing elements is possible using indexing (starts from
0):e = x[1] # e == 2Lists support the
+ operator to concatenate two lists. Example:x = [1, 2] + [3, 4] # x == [1, 2, 3, 4]\nx = [\"a\", \"b\"]\nx += [\"c\"] # x == [\"a\", \"b\", \"c\"]Similar to strings, lists support slice operations:
[\'a\', \'b\', \'c\', \'d\'][1:3] # [\'b\', \'c\']\n[\'a\', \'b\', \'c\', \'d\'][::2] # [\'a\', \'c\']\n[\'a\', \'b\', \'c\', \'d\'][3:0:-1] # [\'d\', \'c\', \'b\']Lists are mutable, as in Python." + doc: "This function defines a set of packages and assigns a label to the group. The label can be referenced in
visibility attributes."
+ api_context: BUILD
}
-type {
- name: "range"
- doc: "A language built-in type to support ranges. Example of range literal:x = range(1, 10, 3)Accessing elements is possible using indexing (starts from
0):e = x[1] # e == 2Ranges do not support the
+ operator for concatenation.Similar to strings, ranges support slice operations:range(10)[1:3] # range(1, 3)\nrange(10)[::2] # range(0, 10, 2)\nrange(10)[3:0:-1] # range(3, 0, -1)Ranges are immutable, as in Python 3." +global { + name: "package_name" + callable { + } + doc: "The name of the package being evaluated, without the repository name. For example, in the BUILD file
some/package/BUILD, its value will be some/package. If the BUILD file calls a function defined in a .bzl file, package_name() will match the caller BUILD file package."
+ api_context: BUILD
}
-type {
- name: "string"
- field {
- name: "capitalize"
- callable {
- return_type: "string"
+global {
+ name: "package_relative_label"
+ callable {
+ param {
+ name: "input"
+ doc: "The input label string or Label object. If a Label object is passed, it\'s returned as is."
+ is_mandatory: true
}
- doc: "Returns a copy of the string with its first character (if any) capitalized and the rest lowercased. This method does not support non-ascii characters. "
}
- field {
- name: "count"
- callable {
- param {
- name: "sub"
- doc: "The substring to count."
- is_mandatory: true
- }
- param {
- name: "start"
- type: "int; or None"
- doc: "Restrict to search from this position."
- default_value: "0"
- }
- param {
- name: "end"
- type: "int; or None"
- doc: "optional position before which to restrict to search."
- default_value: "None"
- }
- return_type: "int"
+ doc: "Converts the input string into a Label object, in the context of the package currently being initialized (that is, the BUILD file for which the current macro is executing). If the input is already a Label, it is returned unchanged.This function may only be called while evaluating a BUILD file and the macros it directly or indirectly calls; it may not be called in (for instance) a rule implementation function.
The result of this function is the same Label value as would be produced by passing the given string to a label-valued attribute of a target declared in the BUILD file.
Usage note: The difference between this function and Label() is that Label() uses the context of the package of the .bzl file that called it, not the package of the BUILD file. Use Label() when you need to refer to a fixed target that is hardcoded into the macro, such as a compiler. Use package_relative_label() when you need to normalize a label string supplied by the BUILD file to a Label object. (There is no way to convert a string to a Label in the context of a package other than the BUILD file or the calling .bzl file. For that reason, outer macros should always prefer to pass Label objects to inner macros rather than label strings.)"
+ api_context: BUILD
+}
+global {
+ name: "platform"
+ callable {
+ param {
+ name: "name"
+ is_mandatory: true
}
- doc: "Returns the number of (non-overlapping) occurrences of substring sub in string, optionally restricting to [start:end], start being inclusive and end being exclusive."
- }
- field {
- name: "elems"
- callable {
- return_type: "sequence"
+ param {
+ name: "allowed_toolchain_types"
+ default_value: "[]"
}
- doc: "Returns an iterable value containing successive 1-element substrings of the string. Equivalent to [s[i] for i in range(len(s))], except that the returned value might not be a list."
- }
- field {
- name: "endswith"
- callable {
- param {
- name: "sub"
- type: "string; or tuple of strings"
- doc: "The suffix (or tuple of alternative suffixes) to match."
- is_mandatory: true
- }
- param {
- name: "start"
- type: "int; or None"
- doc: "Test beginning at this position."
- default_value: "0"
- }
- param {
- name: "end"
- type: "int; or None"
- doc: "optional position at which to stop comparing."
- default_value: "None"
- }
- return_type: "bool"
+ param {
+ name: "check_toolchain_types"
+ default_value: "false"
}
- doc: "Returns True if the string ends with sub, otherwise False, optionally restricting to [start:end], start being inclusive and end being exclusive."
- }
- field {
- name: "find"
- callable {
- param {
- name: "sub"
- doc: "The substring to find."
- is_mandatory: true
- }
- param {
- name: "start"
- type: "int; or None"
- doc: "Restrict to search from this position."
- default_value: "0"
- }
- param {
- name: "end"
- type: "int; or None"
- doc: "optional position before which to restrict to search."
- default_value: "None"
- }
- return_type: "int"
+ param {
+ name: "constraint_values"
+ doc: " The combination of constraint choices that this platform comprises. In order for a platform\n to apply to a given environment, the environment must have at least the values in this list.\n\n
Each constraint_value in this list must be for a different\n constraint_setting. For example, you cannot define a platform that requires the\n cpu architecture to be both @platforms//cpu:x86_64 and\n @platforms//cpu:arm.\n"
+ default_value: "[]"
}
- doc: "Returns the first index where sub is found, or -1 if no such index exists, optionally restricting to [start:end], start being inclusive and end being exclusive."
- }
- field {
- name: "format"
- callable {
- param {
- name: "*args"
- doc: "List of arguments."
- default_value: "()"
- is_star_arg: true
- }
- param {
- name: "**kwargs"
- doc: "Dictionary of arguments."
- default_value: "{}"
- is_star_star_arg: true
- }
- return_type: "string"
+ param {
+ name: "deprecation"
+ doc: "
String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" } - doc: "Perform string interpolation. Format strings contain replacement fields surrounded by curly braces{}. Anything that is not contained in braces is considered literal text, which is copied unchanged to the output.If you need to include a brace character in the literal text, it can be escaped by doubling: {{ and }}A replacement field can be either a name, a number, or empty. Values are converted to strings using the str function.# Access in order:\n\"{} < {}\".format(4, 5) == \"4 < 5\"\n# Access by position:\n\"{1}, {0}\".format(2, 1) == \"1, 2\"\n# Access by name:\n\"x{key}x\".format(key = 2) == \"x2x\"\n"
- }
- field {
- name: "index"
- callable {
- param {
- name: "sub"
- doc: "The substring to find."
- is_mandatory: true
- }
- param {
- name: "start"
- type: "int; or None"
- doc: "Restrict to search from this position."
- default_value: "0"
- }
- param {
- name: "end"
- type: "int; or None"
- doc: "optional position before which to restrict to search."
- default_value: "None"
- }
- return_type: "int"
+ param {
+ name: "distribs"
+ doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" } - doc: "Returns the first index wheresub is found, or raises an error if no such index exists, optionally restricting to [start:end]start being inclusive and end being exclusive."
- }
- field {
- name: "isalnum"
- callable {
- return_type: "bool"
+ param {
+ name: "exec_properties"
+ doc: " A map of strings that affect the way actions are executed remotely. Bazel makes no attempt\n to interpret this, it is treated as opaque data that\'s forwarded via the Platform field of\n the remote execution protocol.\n\n This includes any data from the parent platform\'s exec_properties attributes.\n If the child and parent platform define the same keys, the child\'s values are kept. Any\n keys associated with a value that is an empty string are removed from the dictionary.\n\n This attribute is a full replacement for the deprecated\n remote_execution_properties.\n"
+ default_value: "{}"
}
- doc: "Returns True if all characters in the string are alphanumeric ([a-zA-Z0-9]) and there is at least one character."
- }
- field {
- name: "isalpha"
- callable {
- return_type: "bool"
+ param {
+ name: "features"
+ doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
List of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" } - doc: "Returns True if all cased characters in the string are lowercase and there is at least one character." - } - field { - name: "isspace" - callable { - return_type: "bool" + param { + name: "parents" + doc: " The label of aplatform target that this platform should inherit from. Although\n the attribute takes a list, there should be no more than one platform present. Any\n constraint_settings not set directly on this platform will be found in the parent platform.\n See the section on Platform Inheritance for details.\n"
+ default_value: "[]"
}
- doc: "Returns True if all characters are white space characters and the string contains at least one character."
- }
- field {
- name: "istitle"
- callable {
- return_type: "bool"
+ param {
+ name: "remote_execution_properties"
+ doc: " DEPRECATED. Please use exec_properties attribute instead.\n\n A string used to configure a remote execution platform. Actual builds make no attempt to\n interpret this, it is treated as opaque data that can be used by a specific SpawnRunner.\n This can include data from the parent platform\'s \"remote_execution_properties\" attribute,\n by using the macro \"{PARENT_REMOTE_EXECUTION_PROPERTIES}\". See the section on\n Platform Inheritance for details.\n"
}
- doc: "Returns True if the string is in title case and it contains at least one character. This means that every uppercase character must follow an uncased one (e.g. whitespace) and every lowercase character must follow a cased one (e.g. uppercase or lowercase)."
- }
- field {
- name: "isupper"
- callable {
- return_type: "bool"
+ param {
+ name: "required_settings"
+ doc: " A list of config_settings that must be satisfied by the target configuration\n in order for this platform to be used as an execution platform during toolchain resolution.\n\n Required settings are not inherited from parent platforms.\n"
+ default_value: "[]"
}
- doc: "Returns True if all cased characters in the string are uppercase and there is at least one character."
- }
- field {
- name: "join"
- callable {
- param {
- name: "elements"
- doc: "The objects to join."
- is_mandatory: true
- }
- return_type: "string"
+ param {
+ name: "tags"
+ doc: "\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \"|\".join([\"a\", \"b\", \"c\"]) == \"a|b|c\"" - } - field { - name: "lower" - callable { - return_type: "string" + param { + name: "testonly" + doc: "
Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" } - doc: "Returns the lower case version of this string." - } - field { - name: "lstrip" - callable { - param { - name: "chars" - type: "string; orNone"
- doc: "The characters to remove, or all whitespace if None."
- default_value: "None"
- }
- return_type: "string"
+ param {
+ name: "transitive_configs"
+ default_value: "[]"
}
- doc: "Returns a copy of the string where leading characters that appear in chars are removed. Note that chars is not a prefix: all combinations of its value are removed:\"abcba\".lstrip(\"ba\") == \"cba\"" - } - field { - name: "partition" - callable { - param { - name: "sep" - doc: "The string to split on." - is_mandatory: true - } - return_type: "tuple" + param { + name: "visibility" + doc: "
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
sep and returns the resulting partition as a three-element tuple of the form (before, separator, after). If the input string does not contain the separator, partition returns (self, \'\', \'\')."
}
- field {
- name: "removeprefix"
- callable {
- param {
- name: "prefix"
- doc: "The prefix to remove if present."
- is_mandatory: true
- }
- return_type: "string"
+ doc: "\nThis rule defines a new platform -- a named collection of constraint choices\n(such as cpu architecture or compiler version) describing an environment in\nwhich part of the build may run.\n\nFor more details, see the Platforms page.\n\n\n
\n This defines a platform that describes any environment running Linux on ARM.\n
\n\nplatform(\n name = \"linux_arm\",\n constraint_values = [\n \"@platforms//os:linux\",\n \"@platforms//cpu:arm\",\n ],\n)\n\n\n
\n Platforms may use the flags attribute to specify a list of flags that will be added\n to the configuration whenever the platform is used as the target platform (i.e., as the value of\n the --platforms flag).\n
\n Flags set from the platform effectively have the highest precedence and overwrite any previous\n value for that flag, from the command line, rc file, or transition.\n
\n\n\nplatform(\n name = \"foo\",\n flags = [\n \"--dynamic_mode=fully\",\n \"--//bool_flag\",\n \"--no//package:other_bool_flag\",\n ],\n)\n\n\n
\n This defines a platform named foo. When this is the target platform (either because\n the user specified --platforms//:foo, because a transition set the\n //command_line_option:platforms flag to [\"//:foo\"], or because\n //:foo was used as an execution platform), then the given flags will be set in the\n configuration.\n
\n Some flags will accumulate values when they are repeated, such as --features,\n --copt, any Starlark flag created as config.string(repeatable = True).\n These flags are not compatible with setting the flags from the platform: instead, all previous\n values will be removed and overwritten with the values from the platform.\n
\n As an example, given the following platform, the invocation build --platforms=//:repeat_demo\n --features feature_a --features feature_b will end up with the value of the\n --feature flag being [\"feature_c\", \"feature_d\"], removing the features\n set on the command line.\n
\nplatform(\n name = \"repeat_demo\",\n flags = [\n \"--features=feature_c\",\n \"--features=feature_d\",\n ],\n)\n\n\n
\n For this reason, it is discouraged to use repeatable flags in the flags attribute.\n
\n Platforms may use the parents attribute to specify another platform that they will\n inherit constraint values from. Although the parents attribute takes a list, no\n more than a single value is currently supported, and specifying multiple parents is an error.\n
\n When checking for the value of a constraint setting in a platform, first the values directly set\n (via the constraint_values attribute) are checked, and then the constraint values on\n the parent. This continues recursively up the chain of parent platforms. In this manner, any\n values set directly on a platform will override the values set on the parent.\n
\n Platforms inherit the exec_properties attribute from the parent platform.\n The dictionary entries in exec_properties of the parent and child platforms\n will be combined.\n If the same key appears in both the parent\'s and the child\'s exec_properties,\n the child\'s value will be used. If the child platform specifies an empty string as a value, the\n corresponding property will be unset.\n
\n Platforms can also inherit the (deprecated) remote_execution_properties attribute\n from the parent platform. Note: new code should use exec_properties instead. The\n logic described below is maintained to be compatible with legacy behavior but will be removed\n in the future.\n\n The logic for setting the remote_execution_platform is as follows when there\n is a parent platform:\n\n
remote_execution_property is not set on the child platform, the parent\'s\n remote_execution_properties will be used.\n remote_execution_property is set on the child platform, and contains the\n literal string {PARENT_REMOTE_EXECUTION_PROPERTIES}, that macro will be\n replaced with the contents of the parent\'s remote_execution_property attribute.\n remote_execution_property is set on the child platform, and does not contain\n the macro, the child\'s remote_execution_property will be used unchanged.\n \n Since remote_execution_properties is deprecated and will be phased out, mixing\n remote_execution_properties and exec_properties in the same\n inheritance chain is not allowed.\n Prefer to use exec_properties over the deprecated\n remote_execution_properties.\n
\nplatform(\n name = \"parent\",\n constraint_values = [\n \"@platforms//os:linux\",\n \"@platforms//cpu:arm\",\n ],\n)\nplatform(\n name = \"child_a\",\n parents = [\":parent\"],\n constraint_values = [\n \"@platforms//cpu:x86_64\",\n ],\n)\nplatform(\n name = \"child_b\",\n parents = [\":parent\"],\n)\n\n\n
\n In this example, the child platforms have the following properties:\n\n
child_a has the constraint values @platforms//os:linux (inherited\n from the parent) and @platforms//cpu:x86_64 (set directly on the platform).\n child_b inherits all constraint values from the parent, and doesn\'t set any of\n its own.\n \nplatform(\n name = \"parent\",\n exec_properties = {\n \"k1\": \"v1\",\n \"k2\": \"v2\",\n },\n)\nplatform(\n name = \"child_a\",\n parents = [\":parent\"],\n)\nplatform(\n name = \"child_b\",\n parents = [\":parent\"],\n exec_properties = {\n \"k1\": \"child\"\n }\n)\nplatform(\n name = \"child_c\",\n parents = [\":parent\"],\n exec_properties = {\n \"k1\": \"\"\n }\n)\nplatform(\n name = \"child_d\",\n parents = [\":parent\"],\n exec_properties = {\n \"k3\": \"v3\"\n }\n)\n\n\n\n In this example, the child platforms have the following properties:\n\n
child_a inherits the \"exec_properties\" of the parent and does not set its own.\n child_b inherits the parent\'s exec_properties and overrides the\n value of k1. Its exec_properties will be:\n { \"k1\": \"child\", \"k2\": \"v2\" }.\n child_c inherits the parent\'s exec_properties and unsets\n k1. Its exec_properties will be:\n { \"k2\": \"v2\" }.\n child_d inherits the parent\'s exec_properties and adds a new\n property. Its exec_properties will be:\n { \"k1\": \"v1\", \"k2\": \"v2\", \"k3\": \"v3\" }.\n prefix, returns a new string with the prefix removed. Otherwise, returns the string."
- }
- field {
- name: "removesuffix"
- callable {
- param {
- name: "suffix"
- doc: "The suffix to remove if present."
- is_mandatory: true
- }
- return_type: "string"
+ param {
+ name: "cc_profile"
+ doc: "Label of the profile passed to the various compile actions. This file has\nthe .txt extension."
+ is_mandatory: true
}
- doc: "If the string ends with suffix, returns a new string with the suffix removed. Otherwise, returns the string."
- }
- field {
- name: "replace"
- callable {
- param {
- name: "old"
- doc: "The string to be replaced."
- is_mandatory: true
- }
- param {
- name: "new"
- doc: "The string to replace with."
- is_mandatory: true
- }
- param {
- name: "count"
- doc: "The maximum number of replacements. If omitted, or if the value is negative, there is no limit."
- default_value: "-1"
- }
- return_type: "string"
+ param {
+ name: "compatible_with"
+ default_value: "[]"
}
- doc: "Returns a copy of the string in which the occurrences of old have been replaced with new, optionally restricting the number of replacements to count."
- }
- field {
- name: "rfind"
- callable {
- param {
- name: "sub"
- doc: "The substring to find."
- is_mandatory: true
- }
- param {
- name: "start"
- type: "int; or None"
- doc: "Restrict to search from this position."
- default_value: "0"
- }
- param {
- name: "end"
- type: "int; or None"
- doc: "optional position before which to restrict to search."
- default_value: "None"
- }
- return_type: "int"
+ param {
+ name: "deprecation"
+ }
+ param {
+ name: "exec_compatible_with"
+ default_value: "[]"
+ }
+ param {
+ name: "exec_properties"
+ default_value: "{}"
+ }
+ param {
+ name: "expect_failure"
+ }
+ param {
+ name: "features"
+ default_value: "[]"
+ }
+ param {
+ name: "ld_profile"
+ doc: "Label of the profile passed to the link action. This file has\nthe .txt extension."
+ is_mandatory: true
+ }
+ param {
+ name: "package_metadata"
+ default_value: "[]"
+ }
+ param {
+ name: "restricted_to"
+ default_value: "[]"
}
- doc: "Returns the last index where sub is found, or -1 if no such index exists, optionally restricting to [start:end], start being inclusive and end being exclusive."
- }
- field {
- name: "rindex"
- callable {
- param {
- name: "sub"
- doc: "The substring to find."
- is_mandatory: true
- }
- param {
- name: "start"
- type: "int; or None"
- doc: "Restrict to search from this position."
- default_value: "0"
- }
- param {
- name: "end"
- type: "int; or None"
- doc: "optional position before which to restrict to search."
- default_value: "None"
- }
- return_type: "int"
+ param {
+ name: "tags"
+ default_value: "[]"
}
- doc: "Returns the last index where sub is found, or raises an error if no such index exists, optionally restricting to [start:end], start being inclusive and end being exclusive."
- }
- field {
- name: "rpartition"
- callable {
- param {
- name: "sep"
- doc: "The string to split on."
- is_mandatory: true
- }
- return_type: "tuple"
+ param {
+ name: "target_compatible_with"
+ default_value: "[]"
}
- doc: "Splits the input string at the last occurrence of the separator sep and returns the resulting partition as a three-element tuple of the form (before, separator, after). If the input string does not contain the separator, rpartition returns (\'\', \'\', self)."
- }
- field {
- name: "rsplit"
- callable {
- param {
- name: "sep"
- doc: "The string to split on."
- is_mandatory: true
- }
- param {
- name: "maxsplit"
- type: "int; or None"
- doc: "The maximum number of splits."
- default_value: "None"
- }
- return_type: "list"
+ param {
+ name: "testonly"
+ default_value: "false"
}
- doc: "Returns a list of all the words in the string, using sep as the separator, optionally limiting the number of splits to maxsplit. Except for splitting from the right, this method behaves like split()."
- }
- field {
- name: "rstrip"
- callable {
- param {
- name: "chars"
- type: "string; or None"
- doc: "The characters to remove, or all whitespace if None."
- default_value: "None"
- }
- return_type: "string"
+ param {
+ name: "toolchains"
+ default_value: "[]"
}
- doc: "Returns a copy of the string where trailing characters that appear in chars are removed. Note that chars is not a suffix: all combinations of its value are removed:\"abcbaa\".rstrip(\"ab\") == \"abc\"" - } - field { - name: "split" - callable { - param { - name: "sep" - doc: "The string to split on." - is_mandatory: true - } - param { - name: "maxsplit" - type: "int; or
None"
- doc: "The maximum number of splits."
- default_value: "None"
- }
- return_type: "list"
+ param {
+ name: "transitive_configs"
+ default_value: "[]"
}
- doc: "Returns a list of all the words in the string, using sep as the separator, optionally limiting the number of splits to maxsplit."
- }
- field {
- name: "splitlines"
- callable {
- param {
- name: "keepends"
- doc: "Whether the line breaks should be included in the resulting list."
- default_value: "False"
- }
- return_type: "sequence"
+ param {
+ name: "visibility"
+ default_value: "[]"
}
- doc: "Splits the string at line boundaries (\'\\n\', \'\\r\\n\', \'\\r\') and returns the result as a new mutable list."
}
- field {
- name: "startswith"
+ doc: "Represents a Propeller optimization profile in the workspace.\nExample:
\n\n\npropeller_optimize(\n name = \"layout\",\n cc_profile = \"//path:cc_profile.txt\",\n ld_profile = \"//path:ld_profile.txt\"\n)\n"
+ api_context: BUILD
+}
+global {
+ name: "proto"
+ doc: "A module for protocol message processing."
+ api_context: BUILD
+ global_variable {
+ name: "encodeText"
callable {
param {
- name: "sub"
- type: "string; or tuple of strings"
- doc: "The prefix (or tuple of alternative prefixes) to match."
+ name: "x"
is_mandatory: true
}
- param {
- name: "start"
- type: "int; or None"
- doc: "Test beginning at this position."
- default_value: "0"
- }
- param {
- name: "end"
- type: "int; or None"
- doc: "Stop comparing at this position."
- default_value: "None"
- }
- return_type: "bool"
- }
- doc: "Returns True if the string starts with sub, otherwise False, optionally restricting to [start:end], start being inclusive and end being exclusive."
- }
- field {
- name: "strip"
- callable {
- param {
- name: "chars"
- type: "string; or None"
- doc: "The characters to remove, or all whitespace if None."
- default_value: "None"
- }
- return_type: "string"
- }
- doc: "Returns a copy of the string where leading or trailing characters that appear in chars are removed. Note that chars is neither a prefix nor a suffix: all combinations of its value are removed:\"aabcbcbaa\".strip(\"ab\") == \"cbc\"" - } - field { - name: "title" - callable { - return_type: "string" - } - doc: "Converts the input string into title case, i.e. every word starts with an uppercase letter while the remaining letters are lowercase. In this context, a word means strictly a sequence of letters. This method does not support supplementary Unicode characters." - } - field { - name: "upper" - callable { - return_type: "string" } - doc: "Returns the upper case version of this string." + doc: "Returns the struct argument\'s encoding as a text-format protocol message.\nThe data structure must be recursively composed of strings, ints, floats, or bools, or structs, sequences, and dicts of these types.\n
A struct is converted to a message. Fields are emitted in name order.\nEach struct field whose value is None is ignored.\n
A sequence (such as a list or tuple) is converted to a repeated field.\nIts elements must not be sequences or dicts.\n
A dict is converted to a repeated field of messages with fields named \'key\' and \'value\'.\nEntries are emitted in iteration (insertion) order.\nThe dict\'s keys must be strings or ints, and its values must not be sequences or dicts.\nExamples:
proto.encode_text(struct(field=123))\n# field: 123\n\nproto.encode_text(struct(field=True))\n# field: true\n\nproto.encode_text(struct(field=[1, 2, 3]))\n# field: 1\n# field: 2\n# field: 3\n\nproto.encode_text(struct(field=\'text\', ignored_field=None))\n# field: \"text\"\n\nproto.encode_text(struct(field=struct(inner_field=\'text\', ignored_field=None)))\n# field {\n# inner_field: \"text\"\n# }\n\nproto.encode_text(struct(field=[struct(inner_field=1), struct(inner_field=2)]))\n# field {\n# inner_field: 1\n# }\n# field {\n# inner_field: 2\n# }\n\nproto.encode_text(struct(field=struct(inner_field=struct(inner_inner_field=\'text\'))))\n# field {\n# inner_field {\n# inner_inner_field: \"text\"\n# }\n# }\n\nproto.encode_text(struct(foo={4: 3, 2: 1}))\n# foo: {\n# key: 4\n# value: 3\n# }\n# foo: {\n# key: 2\n# value: 1\n# }\n"
+ api_context: BUILD
}
- doc: "A language built-in type to support strings. Examples of string literals:a = \'abc\\ndef\'\nb = \"ab\'cd\"\nc = \"\"\"multiline string\"\"\"\n\n# Strings support slicing (negative index starts from the end):\nx = \"hello\"[2:4] # \"ll\"\ny = \"hello\"[1:-1] # \"ell\"\nz = \"hello\"[:4] # \"hell\"# Slice steps can be used, too:\ns = \"hello\"[::2] # \"hlo\"\nt = \"hello\"[3:0:-1] # \"lle\"\nStrings are not directly iterable, use the
.elems() method to iterate over their characters. Examples:\"bc\" in \"abcd\" # evaluates to True\nx = [c for c in \"abc\".elems()] # x == [\"a\", \"b\", \"c\"]\nImplicit concatenation of strings is not allowed; use the
+ operator instead. Comparison operators perform a lexicographical comparison; use == to test for equality."
-}
-type {
- name: "tuple"
- doc: "The built-in tuple type. Example tuple expressions:x = (1, 2, 3)Accessing elements is possible using indexing (starts from
0):e = x[1] # e == 2Lists support the
+ operator to concatenate two tuples. Example:x = (1, 2) + (3, 4) # x == (1, 2, 3, 4)\nx = (\"a\", \"b\")\nx += (\"c\",) # x == (\"a\", \"b\", \"c\")Similar to lists, tuples support slice operations:
(\'a\', \'b\', \'c\', \'d\')[1:3] # (\'b\', \'c\')\n(\'a\', \'b\', \'c\', \'d\')[::2] # (\'a\', \'c\')\n(\'a\', \'b\', \'c\', \'d\')[3:0:-1] # (\'d\', \'c\', \'b\')Tuples are immutable, therefore
x[1] = \"a\" is not supported."
}
global {
- name: "existing_rule"
+ name: "proto_lang_toolchain"
callable {
param {
name: "name"
- doc: "The name of the target."
is_mandatory: true
}
- return_type: "unknown"
+ param {
+ name: "toolchain_type"
+ default_value: "None"
+ }
+ param {
+ name: "exec_compatible_with"
+ doc: "List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
\nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "**attrs" + is_star_star_arg: true + } } - doc: "Returns an immutable dict-like object that describes the attributes of a rule instantiated in this thread\'s package, orNone if no rule instance of that name exists.Here, an immutable dict-like object means a deeply immutable object x supporting dict-like iteration, len(x), name in x, x[name], x.get(name), x.items(), x.keys(), and x.values().
If the --noincompatible_existing_rules_immutable_view flag is set, instead returns a new mutable dict with the same content.
The result contains an entry for each attribute, with the exception of private ones (whose names do not start with a letter) and a few unrepresentable legacy attribute types. In addition, the dict contains entries for the rule instance\'s name and kind (for example, \'cc_binary\').
The values of the result represent attribute values as follows:
\':foo\' for targets in the same package or \'//pkg:name\' for targets in a different package.select values are returned with their contents transformed as described above.If possible, avoid using this function. It makes BUILD files brittle and order-dependent. Also, beware that it differs subtly from the two other conversions of rule attribute values from internal form to Starlark: one used by computed defaults, the other used by ctx.attr.foo."
+ doc: "
If using Bazel, please load the rule from \nhttps://github.com/bazelbuild/rules_proto.\n\n
Specifies how a LANG_proto_library rule (e.g., java_proto_library) should invoke the\nproto-compiler.\nSome LANG_proto_library rules allow specifying which toolchain to use using command-line flags;\nconsult their documentation.\n\n
Normally you should not write those kind of rules unless you want to\ntune your Java compiler.\n\n
There\'s no compiler. The proto-compiler is taken from the proto_library rule we attach to. It is\npassed as a command-line flag to Blaze.\nSeveral features require a proto-compiler to be invoked on the proto_library rule itself.\nIt\'s beneficial to enforce the compiler that LANG_proto_library uses is the same as the one\nproto_library does.\n\n
A simple example would be:\n
\nproto_lang_toolchain(\n name = \"javalite_toolchain\",\n command_line = \"--javalite_out=shared,immutable:$(OUT)\",\n plugin = \":javalite_plugin\",\n runtime = \":protobuf_lite\",\n)\n"
api_context: BUILD
}
global {
- name: "existing_rules"
+ name: "proto_library"
callable {
- return_type: "unknown"
+ param {
+ name: "**kwattrs"
+ is_star_star_arg: true
+ }
}
- doc: "Returns an immutable dict-like object describing the rules so far instantiated in this thread\'s package. Each entry of the dict-like object maps the name of the rule instance to the result that would be returned by existing_rule(name).Here, an immutable dict-like object means a deeply immutable object x supporting dict-like iteration, len(x), name in x, x[name], x.get(name), x.items(), x.keys(), and x.values().
If the --noincompatible_existing_rules_immutable_view flag is set, instead returns a new mutable dict with the same content.
Note: If possible, avoid using this function. It makes BUILD files brittle and order-dependent. Furthermore, if the --noincompatible_existing_rules_immutable_view flag is set, this function may be very expensive, especially if called within a loop."
+ doc: "
If using Bazel, please load the rule from \nhttps://github.com/bazelbuild/rules_proto.\n\n
Use proto_library to define libraries of protocol buffers which\nmay be used from multiple languages. A proto_library may be listed\nin the deps clause of supported rules, such as\njava_proto_library.\n\n
When compiled on the command-line, a proto_library creates a file\nnamed foo-descriptor-set.proto.bin, which is the descriptor set for\nthe messages the rule srcs. The file is a serialized\nFileDescriptorSet, which is described in\n\nhttps://developers.google.com/protocol-buffers/docs/techniques#self-description.\n\n
It only contains information about the .proto files directly\nmentioned by a proto_library rule; the collection of transitive\ndescriptor sets is available through the\n[ProtoInfo].transitive_descriptor_sets Starlark provider.\nSee documentation in proto_info.bzl.\n\n
Recommended code organization:\n
proto_library rule per .proto file.\nfoo.proto will be in a rule named foo_proto,\n which is located in the same package.\n[language]_proto_library that wraps a proto_library\n named foo_proto should be called foo_[language]_proto,\n and be located in the same package.\nNone"
- doc: "A visibility declaration can to be specified. The files will be visible to the targets specified. If no visibility is specified, the files will be visible to every package."
- default_value: "None"
+ name: "data"
+ doc: "The list of files need by this library at runtime. See comments about\nthe [`data` attribute typically defined by rules](https://bazel.build/reference/be/common-definitions#typical-attributes).\n\nThere is no `py_embed_data` like there is `cc_embed_data` and `go_embed_data`.\nThis is because Python has a concept of runtime resources."
+ default_value: "[]"
+ }
+ param {
+ name: "args"
+ doc: "\n List of strings; subject to\n $(location) and\n \"Make variable\" substitution, and\n Bourne shell tokenization;\n nonconfigurable;\n default is []\n
\nCommand line arguments that Bazel will pass to the target when it is executed\neither by the run command or as a test. These arguments are\npassed before the ones that are specified on the bazel run or\nbazel test command line.\n
\nNOTE: The arguments are not passed when you run the target\noutside of Bazel (for example, by manually executing the binary in\nbazel-bin/).\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "deprecation" + doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "env" + doc: "Dictionary of strings; values are subject to\n$(location) and\n\"Make variable\" substitution; default is {}
Specifies additional environment variables to set when the target is\n executed by bazel run.\n
\n This attribute only applies to native rules, like cc_binary, py_binary,\n and sh_binary. It does not apply to Starlark-defined executable rules.\n
\nNOTE: The environment variables are not set when you run the target\noutside of Bazel (for example, by manually executing the binary in\nbazel-bin/).\n
List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
None"
- doc: "Licenses to be specified."
+ doc: "\nList of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "main" + doc: "Optional; the name of the source file that is the main entry point of the\napplication. This file must also be listed in `srcs`. If left unspecified,\n`name`, with `.py` appended, is used instead. If `name` does not match any\nfilename in `srcs`, `main` must be specified." default_value: "None" } - return_type: "NoneType" + param { + name: "output_licenses" + doc: "List of strings; default is []
\nThe licenses of the output files that this binary generates.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n\n" + } + param { + name: "precompile" + doc: "Whether py source files **for this target** should be precompiled.\n\nValues:\n\n* `inherit`: Allow the downstream binary decide if precompiled files are used.\n* `enabled`: Compile Python source files at build time.\n* `disabled`: Don\'t compile Python source files at build time.\n\n:::{seealso}\n\n* The {flag}`--precompile` flag, which can override this attribute in some cases\n and will affect all targets when building.\n* The {obj}`pyc_collection` attribute for transitively enabling precompiling on\n a per-target basis.\n* The [Precompiling](precompiling) docs for a guide about using precompiling.\n:::" + default_value: "\"inherit\"" + } + param { + name: "precompile_invalidation_mode" + doc: "How precompiled files should be verified to be up-to-date with their associated\nsource files. Possible values are:\n* `auto`: The effective value will be automatically determined by other build\n settings.\n* `checked_hash`: Use the pyc file if the hash of the source file matches the hash\n recorded in the pyc file. This is most useful when working with code that\n you may modify.\n* `unchecked_hash`: Always use the pyc file; don\'t check the pyc\'s hash against\n the source file. This is most useful when the code won\'t be modified.\n\nFor more information on pyc invalidation modes, see\nhttps://docs.python.org/3/library/py_compile.html#py_compile.PycInvalidationMode" + default_value: "\"auto\"" + } + param { + name: "precompile_optimize_level" + doc: "The optimization level for precompiled files.\n\nFor more information about optimization levels, see the `compile()` function\'s\n`optimize` arg docs at https://docs.python.org/3/library/functions.html#compile\n\nNOTE: The value `-1` means \"current interpreter\", which will be the interpreter\nused _at build time when pycs are generated_, not the interpreter used at\nruntime when the code actually runs." + default_value: "0" + } + param { + name: "precompile_source_retention" + doc: "Determines, when a source file is compiled, if the source file is kept\nin the resulting output or not. Valid values are:\n\n* `inherit`: Inherit the value from the {flag}`--precompile_source_retention` flag.\n* `keep_source`: Include the original Python source.\n* `omit_source`: Don\'t include the original py source." + default_value: "\"inherit\"" + } + param { + name: "pyc_collection" + doc: "Determines whether pyc files from dependencies should be manually included.\n\nValid values are:\n* `inherit`: Inherit the value from {flag}`--precompile`.\n* `include_pyc`: Add implicitly generated pyc files from dependencies. i.e.\n pyc files for targets that specify {attr}`precompile=\"inherit\"`.\n* `disabled`: Don\'t add implicitly generated pyc files. Note that\n pyc files may still come from dependencies that enable precompiling at the\n target level." + default_value: "\"inherit\"" + } + param { + name: "python_version" + doc: "Defunct, unused, does nothing." + default_value: "\"PY3\"" + } + param { + name: "restricted_to" + doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "toolchains" + doc: "List of labels;\n nonconfigurable; default is []
\n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n
@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific cc_toolchain or java_toolchain a\n target will use.\n
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" } - return_type: "sequence" - } - doc: "Glob returns a new, mutable, sorted list of every file in the current package that:include.exclude (default []).exclude_directories argument is enabled (set to 1), files of type directory will be omitted from the results (default 1)."
- api_context: BUILD
-}
-global {
- name: "module_name"
- callable {
- return_type: "string"
- }
- doc: "The name of the Bazel module associated with the repo this package is in. If this package is from a repo defined in WORKSPACE instead of MODULE.bazel, this is empty. For repos generated by module extensions, this is the name of the module hosting the extension. It\'s the same as the module.name field seen in module_ctx.modules."
- api_context: BUILD
-}
-global {
- name: "module_version"
- callable {
- return_type: "string"
- }
- doc: "The version of the Bazel module associated with the repo this package is in. If this package is from a repo defined in WORKSPACE instead of MODULE.bazel, this is empty. For repos generated by module extensions, this is the version of the module hosting the extension. It\'s the same as the module.version field seen in module_ctx.modules."
- api_context: BUILD
-}
-global {
- name: "package_group"
- callable {
param {
- name: "name"
- doc: "The unique name for this rule."
- is_mandatory: true
+ name: "deprecation"
+ doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" } param { - name: "packages" - type: "sequence of strings" - doc: "A complete enumeration of packages in this group." - default_value: "[]" + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" } param { - name: "includes" - type: "sequence of strings" - doc: "Other package groups that are included in this one." + name: "exec_compatible_with" + doc: "List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
visibility attributes."
- api_context: BUILD
-}
-global {
- name: "package_name"
- callable {
- return_type: "string"
- }
- doc: "The name of the package being evaluated. For example, in the BUILD file some/package/BUILD, its value will be some/package. If the BUILD file calls a function defined in a .bzl file, package_name() will match the caller BUILD file package. This function is equivalent to the deprecated variable PACKAGE_NAME."
- api_context: BUILD
-}
-global {
- name: "package_relative_label"
- callable {
param {
- name: "input"
- type: "string; or Label"
- doc: "The input label string or Label object. If a Label object is passed, it\'s returned as is."
- is_mandatory: true
+ name: "licenses"
+ doc: "\nList of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "precompile" + doc: "Whether py source files **for this target** should be precompiled.\n\nValues:\n\n* `inherit`: Allow the downstream binary decide if precompiled files are used.\n* `enabled`: Compile Python source files at build time.\n* `disabled`: Don\'t compile Python source files at build time.\n\n:::{seealso}\n\n* The {flag}`--precompile` flag, which can override this attribute in some cases\n and will affect all targets when building.\n* The {obj}`pyc_collection` attribute for transitively enabling precompiling on\n a per-target basis.\n* The [Precompiling](precompiling) docs for a guide about using precompiling.\n:::" + default_value: "\"inherit\"" + } + param { + name: "precompile_invalidation_mode" + doc: "How precompiled files should be verified to be up-to-date with their associated\nsource files. Possible values are:\n* `auto`: The effective value will be automatically determined by other build\n settings.\n* `checked_hash`: Use the pyc file if the hash of the source file matches the hash\n recorded in the pyc file. This is most useful when working with code that\n you may modify.\n* `unchecked_hash`: Always use the pyc file; don\'t check the pyc\'s hash against\n the source file. This is most useful when the code won\'t be modified.\n\nFor more information on pyc invalidation modes, see\nhttps://docs.python.org/3/library/py_compile.html#py_compile.PycInvalidationMode" + default_value: "\"auto\"" + } + param { + name: "precompile_optimize_level" + doc: "The optimization level for precompiled files.\n\nFor more information about optimization levels, see the `compile()` function\'s\n`optimize` arg docs at https://docs.python.org/3/library/functions.html#compile\n\nNOTE: The value `-1` means \"current interpreter\", which will be the interpreter\nused _at build time when pycs are generated_, not the interpreter used at\nruntime when the code actually runs." + default_value: "0" + } + param { + name: "precompile_source_retention" + doc: "Determines, when a source file is compiled, if the source file is kept\nin the resulting output or not. Valid values are:\n\n* `inherit`: Inherit the value from the {flag}`--precompile_source_retention` flag.\n* `keep_source`: Include the original Python source.\n* `omit_source`: Don\'t include the original py source." + default_value: "\"inherit\"" + } + param { + name: "restricted_to" + doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "toolchains" + doc: "List of labels;\n nonconfigurable; default is []
\n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n
@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific cc_toolchain or java_toolchain a\n target will use.\n
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
BUILD file for which the current macro is executing). If the input is already a Label, it is returned unchanged.This function may only be called while evaluating a BUILD file and the macros it directly or indirectly calls; it may not be called in (for instance) a rule implementation function.
The result of this function is the same Label value as would be produced by passing the given string to a label-valued attribute of a target declared in the BUILD file.
Usage note: The difference between this function and Label() is that List of labels;\n nonconfigurable; default is \nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n \nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n String; nonconfigurable; default is \nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n \nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a \nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n \nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n \nOnce people have stopped using it, the target can be removed.\n List of strings; nonconfigurable;\n default is \n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n List of labels;\n nonconfigurable; default is \nA list of\n Dictionary of strings; default is A dictionary of strings that will be added to the If a key is present in both the platform and target-level properties, the value will be taken from the target. List of feature strings; default is A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself. This List of labels;\n nonconfigurable; default is \nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n \nThis is part of Bazel\'s constraint system. See\n \n List of strings; nonconfigurable;\n default is \n Tags can be used on any rule. Tags on test and\n \n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n \n Bazel modifies test running behavior if it finds the following keywords in the\n \nList of labels; default is \nA list of\n \nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n \nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n \n\n \nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\n \n\n \nSee the\nPlatforms\npage for more information about incompatible target skipping.\n Boolean; nonconfigurable; default is \nIf \nEquivalently, a rule that is not \nTests ( \nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n \nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n List of labels;\n nonconfigurable; default is \n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific List of labels;\n nonconfigurable;\n default varies\n \n The \n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n Examples: List of strings; subject to\n$(location) and\n\"Make variable\" substitution, and\nBourne shell tokenization; default is Command line arguments that Bazel passes to the target when it is\nexecuted with \nThese arguments are passed before any List of labels;\n nonconfigurable; default is \nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n \nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n String; nonconfigurable; default is \nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n \nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a \nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n \nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n \nOnce people have stopped using it, the target can be removed.\n List of strings; nonconfigurable;\n default is \n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n \n Dictionary of strings; values are subject to\n $(location) and\n \"Make variable\" substitution; default is \n Specifies additional environment variables to set when the test is executed by\n \n This attribute only applies to native rules, like List of strings; default is Specifies additional environment variables to inherit from the\n external environment when the test is executed by \n This attribute only applies to native rules, like List of labels;\n nonconfigurable; default is \nA list of\n Dictionary of strings; default is A dictionary of strings that will be added to the If a key is present in both the platform and target-level properties, the value will be taken from the target. List of feature strings; default is A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself. This Boolean; nonconfigurable;\n default is \nMarks test as flaky.\n \nIf set, executes the test up to three times, marking it as failed only if it\nfails each time. By default, this attribute is set to False and the test is\nexecuted only once. Note, that use of this attribute is generally discouraged -\ntests should pass reliably when their assertions are upheld.\n List of strings; nonconfigurable;\n default is \n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n Boolean; nonconfigurable;\n default is Forces the test to be run locally, without sandboxing. Setting this to True is equivalent to providing \"local\" as a tag\n( Using List of labels;\n nonconfigurable; default is \nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n \nThis is part of Bazel\'s constraint system. See\n Non-negative integer less than or equal to 50; default is Specifies the number of parallel shards\nto use to run the test. If set, this value will override any heuristics used to determine the number of\nparallel shards with which to run the test. Note that for some test\nrules, this parameter may be required to enable sharding\nin the first place. Also see If test sharding is enabled, the environment variable Sharding requires the test runner to support the test sharding protocol.\nIf it does not, then it will most likely run every test in every shard, which\nis not what you want. See\nTest Sharding\nin the Test Encyclopedia for details on sharding. String Specifies a test target\'s \"heaviness\": how much time/resources it needs to run. Unit tests are considered \"small\", integration tests \"medium\", and end-to-end tests \"large\" or\n\"enormous\". Bazel uses the size to determine a default timeout, which can be overridden using the\n Test sizes correspond to the following default timeouts and assumed peak local resource\nusages: \n The environment variable\n \n List of strings; nonconfigurable;\n default is \n Tags can be used on any rule. Tags on test and\n \n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n \n Bazel modifies test running behavior if it finds the following keywords in the\n \nList of labels; default is \nA list of\n \nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n \nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n \n\n \nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\n \n\n \nSee the\nPlatforms\npage for more information about incompatible target skipping.\n Boolean; nonconfigurable; default is \nIf \nEquivalently, a rule that is not \nTests ( \nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n \nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n String \nHow long the test is expected to run before returning.\n \nWhile a test\'s size attribute controls resource estimation, a test\'s\ntimeout may be set independently. If not explicitly specified, the\ntimeout is based on the test\'s size. The test\ntimeout can be overridden with the \nFor times other than the above, the test timeout can be overridden with the\n \n The environment variable\n List of labels;\n nonconfigurable; default is \n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific List of labels;\n nonconfigurable;\n default varies\n \n The \n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n All elements (direct and indirect) of a depset must be of the same type, as obtained by the expression Because a hash-based set is used to eliminate duplicates during iteration, all elements of a depset should be hashable. However, this invariant is not currently checked consistently in all constructors. Use the --incompatible_always_check_depset_elements flag to enable consistent checking; this will be the default behavior in future releases; see Issue 10313.\n In addition, elements must currently be immutable, though this restriction will be relaxed in future.\n The order of the created depset should be compatible with the order of its The canonical name of the repository containing the package currently being evaluated, with a single at-sign ( \n This attribute should be used to list other Example usage: Defining a rule attribute: Accessing in rule implementation: Package specifications follow the same format as for The \"@\" syntax is not allowed; all specifications are interpreted relative to the current module\'s repository. If Note that the flags \n This attribute should be used to list shell script source files that belong to\n this library. Scripts can load other scripts using the shell\'s Sets the load visibility of the .bzl module currently being initialized. The load visibility of a module governs whether or not other BUILD and .bzl files may load it. (This is distinct from the target visibility of the underlying .bzl source file, which governs whether the file may appear as a dependency of other targets.) Load visibility works at the level of packages: To load a module the file doing the loading must live in a package that has been granted visibility to the module. A module can always be loaded within its own package, regardless of its visibility. If the flag List of labels; default is \nFiles needed by this rule at runtime. May list file or rule targets. Generally\nallows any target.\n \nThe default outputs and runfiles of targets in the \nNew rules should define a \n List of strings; subject to\n $(location) and\n \"Make variable\" substitution, and\n Bourne shell tokenization;\n nonconfigurable;\n default is \nCommand line arguments that Bazel will pass to the target when it is executed\neither by the \nNOTE: The arguments are not passed when you run the target\noutside of Bazel (for example, by manually executing the binary in\n Implicit attributes starting with Explicit attributes must have type List of labels;\n nonconfigurable; default is \nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n \nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n An unnested list of providers will automatically be converted to a list containing one list of providers. That is, To make some rule (e.g. String; nonconfigurable; default is \nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n \nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a \nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n \nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n \nOnce people have stopped using it, the target can be removed.\n An unnested list of providers will automatically be converted to a list containing one list of providers. That is, To make another aspect (e.g. Dictionary of strings; values are subject to\n$(location) and\n\"Make variable\" substitution; default is Specifies additional environment variables to set when the target is\n executed by \n This attribute only applies to native rules, like \nNOTE: The environment variables are not set when you run the target\noutside of Bazel (for example, by manually executing the binary in\n It is an error if the implementation function omits any of the types of providers listed here from its return value. However, the implementation function may return additional providers not listed here. Each element of the list is an List of labels;\n nonconfigurable; default is \nA list of\n Dictionary of strings; default is A dictionary of strings that will be added to the If a key is present in both the platform and target-level properties, the value will be taken from the target. List of feature strings; default is A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself. This List of strings; default is \nThe licenses of the output files that this binary generates.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n For example, suppose an aspect propagates transitively through attribute `deps` and it is applied to target `alpha`. Suppose `alpha` has `deps = [\':beta_output\']`, where `beta_output` is a declared output of a target `beta`. Suppose `beta` has a target `charlie` as one of its `deps`. If `apply_to_generating_rules=True` for the aspect, then the aspect will propagate through `alpha`, `beta`, and `charlie`. If False, then the aspect will propagate only to `alpha`. False by default. List of labels;\n nonconfigurable; default is \nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n \nThis is part of Bazel\'s constraint system. See\n \n List of strings; nonconfigurable;\n default is \n Tags can be used on any rule. Tags on test and\n \n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n \n Bazel modifies test running behavior if it finds the following keywords in the\n \nList of labels; default is \nA list of\n \nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n \nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n \n\n \nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\n \n\n \nSee the\nPlatforms\npage for more information about incompatible target skipping.\n Boolean; nonconfigurable; default is \nIf \nEquivalently, a rule that is not \nTests ( \nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n \nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n List of labels;\n nonconfigurable; default is \n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific List of labels;\n nonconfigurable;\n default varies\n \n The \n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n \n The For a simple shell script with no dependencies and some data files:\n For macros, a related function, \n This attribute should be used to list other \n This attribute should be used to list shell script source files that belong to\n this library. Scripts can load other scripts using the shell\'s A precise description follows; see Rules (Custom initialization of providers) for an intuitive discussion and use cases. Let But in the case where NB: the above steps imply that an error occurs if In this way, the When List of labels; default is \nFiles needed by this rule at runtime. May list file or rule targets. Generally\nallows any target.\n \nThe default outputs and runfiles of targets in the \nNew rules should define a See Rules (Providers) for a comprehensive guide on how to use providers. Returns a If List of labels;\n nonconfigurable; default is \nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n \nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n String; nonconfigurable; default is \nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n \nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a \nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n \nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n \nOnce people have stopped using it, the target can be removed.\n List of labels;\n nonconfigurable; default is \nA list of\n Dictionary of strings; default is A dictionary of strings that will be added to the If a key is present in both the platform and target-level properties, the value will be taken from the target. A schema for defining predeclared outputs. Unlike The value of this argument is either a dictionary or a callback function that produces a dictionary. The callback works similar to computed dependency attributes: The function\'s parameter names are matched against the rule\'s attributes, so for example if you pass Each entry in the dictionary creates a predeclared output where the key is an identifier and the value is a string template that determines the output\'s label. In the rule\'s implementation function, the identifier becomes the field name used to access the output\'s In practice, the most common substitution placeholder is List of feature strings; default is A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself. This List of labels;\n nonconfigurable; default is \nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n \nThis is part of Bazel\'s constraint system. See\n \n List of strings; nonconfigurable;\n default is \n Tags can be used on any rule. Tags on test and\n \n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n \n Bazel modifies test running behavior if it finds the following keywords in the\n \nList of labels; default is \nA list of\n \nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n \nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n \n\n \nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\n \n\n \nSee the\nPlatforms\npage for more information about incompatible target skipping.\n Boolean; nonconfigurable; default is \nIf \nEquivalently, a rule that is not \nTests ( \nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n \nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n List of labels;\n nonconfigurable; default is \n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific List of labels;\n nonconfigurable;\n default varies\n \n The \n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n \n The main use for this rule is to aggregate together a logical\n \"library\" consisting of related scripts—programs in an\n interpreted language that does not require compilation or linking,\n such as the Bourne shell—and any data those programs need at\n run-time. Such \"libraries\" can then be used from\n the \n You can use the \n In interpreted programming languages, there\'s not always a clear\n distinction between \"code\" and \"data\": after all, the program is\n just \"data\" from the interpreter\'s point of view. For this reason\n this rule has three attributes which are all essentially equivalent:\n It is an error if the implementation function omits any of the types of providers listed here from its return value. However, the implementation function may return additional providers not listed here. Each element of the list is an \n This attribute should be used to list other \n This attribute should be used to list shell script source files that belong to\n this library. Scripts can load other scripts using the shell\'s Note: Analysis test rules are primarily defined using infrastructure provided in core Starlark libraries. See Testing for guidance. If a rule is defined as an analysis test rule, it becomes allowed to use configuration transitions defined using analysis_test_transition on its attributes, but opts into some restrictions: List of labels; default is \nFiles needed by this rule at runtime. May list file or rule targets. Generally\nallows any target.\n \nThe default outputs and runfiles of targets in the \nNew rules should define a List of strings; subject to\n$(location) and\n\"Make variable\" substitution, and\nBourne shell tokenization; default is Command line arguments that Bazel passes to the target when it is\nexecuted with \nThese arguments are passed before any List of labels;\n nonconfigurable; default is \nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n \nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n String; nonconfigurable; default is \nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n \nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a \nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n \nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n \nOnce people have stopped using it, the target can be removed.\n The function is called at load time for each instance of the rule. It\'s called with values of public attributes defined by the rule (not with generic attributes, for example It has to return a dictionary from the attribute names to the desired values. The attributes that are not returned are unaffected. Returning Initializers are evaluated before the default values specified in an attribute definition. Consequently, if a parameter in the initializer\'s signature contains a default values, it overwrites the default from the attribute definition (except if returning Similarly, if a parameter in the initializer\'s signature doesn\'t have a default, the parameter will become mandatory. It\'s a good practice to omit default/mandatory settings on an attribute definition in such cases. It\'s a good practice to use In case of extended rules, all initializers are called proceeding from child to ancestors. Each initializer is passed only the public attributes it knows about."
- default_value: "None"
+ name: "env"
+ doc: " \n Dictionary of strings; values are subject to\n $(location) and\n \"Make variable\" substitution; default is \n Specifies additional environment variables to set when the test is executed by\n \n This attribute only applies to native rules, like List of strings; default is Specifies additional environment variables to inherit from the\n external environment when the test is executed by \n This attribute only applies to native rules, like List of labels;\n nonconfigurable; default is \nA list of\n Dictionary of strings; default is A dictionary of strings that will be added to the If a key is present in both the platform and target-level properties, the value will be taken from the target. Rules must be assigned to global variables in a .bzl file; the name of the global variable is the rule\'s name. Test rules are required to have a name ending in List of feature strings; default is A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself. This Boolean; nonconfigurable;\n default is \nMarks test as flaky.\n \nIf set, executes the test up to three times, marking it as failed only if it\nfails each time. By default, this attribute is set to False and the test is\nexecuted only once. Note, that use of this attribute is generally discouraged -\ntests should pass reliably when their assertions are upheld.\n Boolean; nonconfigurable;\n default is Forces the test to be run locally, without sandboxing. Setting this to True is equivalent to providing \"local\" as a tag\n( See the Rules page for more on defining and using attributes."
- api_context: BZL
-}
-global {
- name: "struct"
- callable {
param {
- name: "**kwargs"
- is_star_star_arg: true
+ name: "restricted_to"
+ doc: " List of labels;\n nonconfigurable; default is \nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n \nThis is part of Bazel\'s constraint system. See\n Non-negative integer less than or equal to 50; default is Specifies the number of parallel shards\nto use to run the test. If set, this value will override any heuristics used to determine the number of\nparallel shards with which to run the test. Note that for some test\nrules, this parameter may be required to enable sharding\nin the first place. Also see If test sharding is enabled, the environment variable Sharding requires the test runner to support the test sharding protocol.\nIf it does not, then it will most likely run every test in every shard, which\nis not what you want. See\nTest Sharding\nin the Test Encyclopedia for details on sharding. String Specifies a test target\'s \"heaviness\": how much time/resources it needs to run. Unit tests are considered \"small\", integration tests \"medium\", and end-to-end tests \"large\" or\n\"enormous\". Bazel uses the size to determine a default timeout, which can be overridden using the\n Test sizes correspond to the following default timeouts and assumed peak local resource\nusages: \n The environment variable\n \n List of strings; nonconfigurable;\n default is \n Tags can be used on any rule. Tags on test and\n \n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n \n Bazel modifies test running behavior if it finds the following keywords in the\n \nList of labels; default is \nA list of\n \nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n \nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n \n\n \nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\n \n\n \nSee the\nPlatforms\npage for more information about incompatible target skipping.\n Boolean; nonconfigurable; default is \nIf \nEquivalently, a rule that is not \nTests ( \nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n \nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n String \nHow long the test is expected to run before returning.\n \nWhile a test\'s size attribute controls resource estimation, a test\'s\ntimeout may be set independently. If not explicitly specified, the\ntimeout is based on the test\'s size. The test\ntimeout can be overridden with the \nFor times other than the above, the test timeout can be overridden with the\n \n The environment variable\n The List of labels;\n nonconfigurable; default is \n The set of targets whose Make variables this target is\n allowed to access. These targets are either instances of rules that provide\n \n Note that this is distinct from the concept of\n toolchain resolution\n that is used by rule implementations for platform-dependent configuration. You cannot use this\n attribute to determine which specific ex: the following rule is marked as a build setting by setting the List of labels;\n nonconfigurable;\n default varies\n \n The \n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n Creates a configuration transition to be applied on an analysis-test rule\'s dependencies. This transition may only be applied on attributes of rules with This function is primarily designed to facilitate the Analysis Test Framework core library. See its documentation (or its implementation) for best practices."
- api_context: BZL
+ doc: " \n The For a simple shell script with no dependencies and some data files:\n Note that the wrapped Starlark files must be files in the source tree; Bazel cannot\n Note that this must be a file in the source tree; Bazel cannot Example:Label() uses the context of the package of the .bzl file that called it, not the package of the BUILD file. Use Label() when you need to refer to a fixed target that is hardcoded into the macro, such as a compiler. Use package_relative_label() when you need to normalize a label string supplied by the BUILD file to a Label object. (There is no way to convert a string to a Label in the context of a package other than the BUILD file or the calling .bzl file. For that reason, outer macros should always prefer to pass Label objects to inner macros rather than label strings.)"
- api_context: BUILD
-}
-global {
- name: "repository_name"
- callable {
- return_type: "string"
}
- doc: "The name of the repository the rule or build extension is called from. For example, in packages that are called into existence by the WORKSPACE stanza local_repository(name=\'local\', path=...) it will be set to @local. In packages in the main repository, it will be set to @. This function is equivalent to the deprecated variable REPOSITORY_NAME."
+ doc: "A library of Python code that can be depended upon.\n\nDefault outputs:\n* The input Python sources\n* The precompiled artifacts from the sources.\n\nNOTE: Precompilation affects which of the default outputs are included in the\nresulting runfiles. See the precompile-related attributes and flags for\nmore information.\n\n:::{versionchanged} 0.37.0\nSource files are no longer added to the runfiles directly.\n:::"
api_context: BUILD
}
global {
- name: "subpackages"
+ name: "py_runtime"
callable {
param {
- name: "include"
- type: "sequence of strings"
- doc: "The list of glob patterns to include in subpackages scan."
- is_mandatory: true
+ name: "abi_flags"
+ doc: "The runtime\'s ABI flags, i.e. `sys.abiflags`.\n\nIf not set, then it will be set based on flags."
+ default_value: "\"[]abs(-2.3) == 2.3
"
-}
-global {
- name: "all"
- callable {
param {
- name: "elements"
- doc: "A string or a collection of elements."
- is_mandatory: true
+ name: "deprecation"
+ doc: "Nonedeprecation attribute is\ndepended upon by a target in another package.\nall([\"hello\", 3, True]) == True\nall([-1, 0, 1]) == False
"
-}
-global {
- name: "any"
- callable {
param {
- name: "elements"
- doc: "A string or a collection of elements."
- is_mandatory: true
+ name: "distribs"
+ doc: "[]any([-1, 0, 1]) == True\nany([False, 0, \"\"]) == False
"
-}
-global {
- name: "bool"
- callable {
param {
- name: "x"
- doc: "The variable to convert."
- default_value: "False"
+ name: "exec_compatible_with"
+ doc: "[]\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n False if the object is None, False, an empty string (\"\"), the number 0, or an empty collection (e.g. (), []). Otherwise, it returns True."
-}
-global {
- name: "dict"
- callable {
param {
- name: "pairs"
- doc: "A dict, or an iterable whose elements are each of length 2 (key, value)."
+ name: "exec_properties"
+ doc: "{}exec_properties of a platform selected for this target. See exec_properties of the platform rule.[]features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\nenumerate([24, 21, 84]) == [(0, 24), (1, 21), (2, 84)]
\n"
-}
-global {
- name: "fail"
- callable {
param {
- name: "msg"
- doc: "Deprecated: use positional arguments instead. This argument acts like an implicit leading positional argument."
- default_value: "None"
+ name: "pyc_tag"
+ doc: "Optional string; the tag portion of a pyc filename, e.g. the `cpython-39` infix\nof `foo.cpython-39.pyc`. See PEP 3147. If not specified, it will be computed\nfrom `implementation_name` and `interpreter_version_info`. If no pyc_tag is\navailable, then only source-less pyc generation will function correctly."
+ default_value: "\"\""
}
param {
- name: "attr"
- type: "string; or None"
- doc: "Deprecated. Causes an optional prefix containing this string to be added to the error message."
- default_value: "None"
+ name: "python_version"
+ doc: "Whether this runtime is for Python major version 2 or 3. Valid values are `\"PY2\"`\nand `\"PY3\"`.\n\nThe default value is controlled by the `--incompatible_py3_is_default` flag.\nHowever, in the future this attribute will be mandatory and have no default\nvalue."
+ default_value: "\"PY3\""
}
param {
- name: "*args"
- doc: "A list of values, formatted with debugPrint (which is equivalent to str by default) and joined with spaces, that appear in the error message."
- is_mandatory: true
- is_star_arg: true
+ name: "restricted_to"
+ doc: "[]compatible_with\nfor details.\n
Any other value causes an error. With no argument, x is already a float, float returns it unchanged. x is a bool, float returns 1.0 for True and 0.0 for False. x is an int, float returns the nearest finite floating-point value to x, or an error if the magnitude is too large. x is a string, it must be a valid floating-point literal, or be equal (ignoring case) to NaN, Inf, or Infinity, optionally preceded by a + or - sign. float() returns 0.0."
-}
-global {
- name: "getattr"
- callable {
param {
- name: "x"
- doc: "The struct whose attribute is accessed."
- is_mandatory: true
+ name: "stub_shebang"
+ doc: "\"Shebang\" expression prepended to the bootstrapping Python stub script\nused when executing {rule}`py_binary` targets.\n\nSee https://github.com/bazelbuild/bazel/issues/8685 for\nmotivation.\n\nDoes not apply to Windows."
+ default_value: "\"#!/usr/bin/env python3\""
}
param {
- name: "name"
- doc: "The name of the struct attribute."
- is_mandatory: true
+ name: "tags"
+ doc: "[]\ntest_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\ntags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n\n
\n\nno-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n tags attribute of the test rule:\n\n
\n\nSee\nTag Conventions\n in the Test Encyclopedia for more conventions on tags attached to test targets.\n"
}
param {
- name: "default"
- doc: "The default value to return in case the struct doesn\'t have an attribute of the given name."
- default_value: "unbound"
+ name: "target_compatible_with"
+ doc: "exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n []\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\ntarget_compatible_with for a\ncc_toolchain is not useful.\ndefault (if specified) or raises an error. getattr(x, \"foobar\") is equivalent to x.foobar.getattr(ctx.attr, \"myattr\")\ngetattr(ctx.attr, \"myattr\", \"mydefault\")
"
-}
-global {
- name: "hasattr"
- callable {
param {
- name: "x"
- doc: "The object to check."
- is_mandatory: true
+ name: "testonly"
+ doc: "False\n except for test and test suite targetsTrue, only testonly targets (such as tests) can depend on this target.\ntestonly is not allowed to\ndepend on any rule that is testonly.\n*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n[]TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n\n
\n\n@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n cc_toolchain or java_toolchain a\n target will use.\nx has an attribute or method of the given name, otherwise False. Example:hasattr(ctx.attr, \"myattr\")
"
-}
-global {
- name: "hash"
- callable {
param {
- name: "value"
- doc: "String value to hash."
- is_mandatory: true
+ name: "visibility"
+ doc: "visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\ndefault_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\nString.hashCode(), namely: s[0] * (31^(n-1)) + s[1] * (31^(n-2)) + ... + s[n-1]
Hashing of values besides strings is not currently supported."
+ doc: "Represents a Python runtime used to execute Python code.\n\nA `py_runtime` target can represent either a *platform runtime* or an *in-build\nruntime*. A platform runtime accesses a system-installed interpreter at a known\npath, whereas an in-build runtime points to an executable target that acts as\nthe interpreter. In both cases, an \"interpreter\" means any executable binary or\nwrapper script that is capable of running a Python script passed on the command\nline, following the same conventions as the standard CPython interpreter.\n\nA platform runtime is by its nature non-hermetic. It imposes a requirement on\nthe target platform to have an interpreter located at a specific path. An\nin-build runtime may or may not be hermetic, depending on whether it points to\na checked-in interpreter or a wrapper script that accesses the system\ninterpreter.\n\nExample\n\n```\nload(\"@rules_python//python:py_runtime.bzl\", \"py_runtime\")\n\npy_runtime(\n name = \"python-2.7.12\",\n files = glob([\"python-2.7.12/**\"]),\n interpreter = \"python-2.7.12/bin/python\",\n)\n\npy_runtime(\n name = \"python-3.6.0\",\n interpreter_path = \"/opt/pyenv/versions/3.6.0/bin/python\",\n)\n```"
+ api_context: BUILD
}
global {
- name: "int"
+ name: "py_test"
callable {
param {
- name: "x"
- doc: "The string to convert."
+ name: "deps"
+ doc: "List of additional libraries to be linked in to the target.\nSee comments about\nthe [`deps` attribute typically defined by\nrules](https://bazel.build/reference/be/common-definitions#typical-attributes).\nThese are typically `py_library` rules.\n\nTargets that only provide data files used at runtime belong in the `data`\nattribute."
+ default_value: "[]"
+ }
+ param {
+ name: "srcs"
+ doc: "The list of Python source files that are processed to create the target. This\nincludes all your checked-in code and may include generated source files. The\n`.py` files belong in `srcs` and library targets belong in `deps`. Other binary\nfiles that may be needed at run time belong in `data`."
is_mandatory: true
}
param {
- name: "base"
- doc: "The base used to interpret a string value; defaults to 10. Must be between 2 and 36 (inclusive), or 0 to detect the base as if x were an integer literal. This parameter must not be supplied if the value is not a string."
- default_value: "unbound"
+ name: "data"
+ doc: "The list of files need by this library at runtime. See comments about\nthe [`data` attribute typically defined by rules](https://bazel.build/reference/be/common-definitions#typical-attributes).\n\nThere is no `py_embed_data` like there is `cc_embed_data` and `go_embed_data`.\nThis is because Python has a concept of runtime resources."
+ default_value: "[]"
}
- return_type: "int"
- }
- doc: "Returns x as an int value.
This function fails if x is already an int, int returns it unchanged.x is a bool, int returns 1 for True and 0 for False.x is a string, it must have the format <sign><prefix><digits>. <sign> is either \"+\", \"-\", or empty (interpreted as positive). <digits> are a sequence of digits from 0 up to base - 1, where the letters a-z (or equivalently, A-Z) are used as digits for 10-35. In the case where base is 2/8/16, <prefix> is optional and may be 0b/0o/0x (or equivalently, 0B/0O/0X) respectively; if the base is any other value besides these bases or the special value 0, the prefix must be empty. In the case where base is 0, the string is interpreted as an integer literal, in the sense that one of the bases 2/8/10/16 is chosen depending on which prefix if any is used. If base is 0, no prefix is used, and there is more than one digit, the leading digit cannot be 0; this is to avoid confusion between octal and decimal. The magnitude of the number represented by the string must be within the allowed range for the int type.x is a float, int returns the integer value of the float, rounding towards zero. It is an error if x is non-finite (NaN or infinity).x is any other type, or if the value is a string not satisfying the above format. Unlike Python\'s int function, this function does not allow zero arguments, and does not allow extraneous whitespace for string arguments.int(\"123\") == 123\nint(\"-123\") == -123\nint(\"+123\") == 123\nint(\"FF\", 16) == 255\nint(\"0xFF\", 16) == 255\nint(\"10\", 0) == 10\nint(\"-0x10\", 0) == -16\nint(\"-0x10\", 0) == -16\nint(\"123.456\") == 123\n
"
-}
-global {
- name: "len"
- callable {
param {
- name: "x"
- doc: "The value whose length to report."
- is_mandatory: true
+ name: "args"
+ doc: "[]bazel test.\n\n--test_arg values\nspecified on the bazel test command line.\n[]Nonedeprecation attribute is\ndepended upon by a target in another package.\n[]{}\nbazel test.\ncc_test,\n py_test, and sh_test. It does not apply to\n Starlark-defined test rules. For your own Starlark rules, you can add an \"env\"\n attribute and use it to populate a\n\n TestEnvironment\n \n Provider.\n[]bazel test.\ncc_test, py_test,\n and sh_test. It does not apply to Starlark-defined test rules.\n[]\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n {}exec_properties of a platform selected for this target. See exec_properties of the platform rule.[]features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\nFalselist([1, 2]) == [1, 2]\nlist((2, 3, 2)) == [2, 3, 2]\nlist({5: \"a\", 2: \"b\", 4: \"c\"}) == [5, 2, 4]"
-}
-global {
- name: "max"
- callable {
param {
- name: "*args"
- doc: "The elements to be checked."
- is_mandatory: true
- is_star_arg: true
+ name: "legacy_create_init"
+ doc: "Whether to implicitly create empty `__init__.py` files in the runfiles tree.\nThese are created in every directory containing Python source code or shared\nlibraries, and every parent directory of those directories, excluding the repo\nroot directory. The default, `-1` (auto), means true unless\n`--incompatible_default_to_explicit_init_py` is used. If false, the user is\nresponsible for creating (possibly empty) `__init__.py` files and adding them to\nthe `srcs` of Python targets as required."
+ default_value: "-1"
}
- return_type: "unknown"
- }
- doc: "Returns the largest one of all given arguments. If only one argument is provided, it must be a non-empty iterable.It is an error if elements are not comparable (for example int with string), or if no arguments are given. max(2, 5, 4) == 5\nmax([5, 6, 3]) == 6
"
-}
-global {
- name: "min"
- callable {
param {
- name: "*args"
- doc: "The elements to be checked."
- is_mandatory: true
- is_star_arg: true
+ name: "licenses"
+ doc: "\n[\"none\"]min(2, 5, 4) == 2\nmin([5, 6, 3]) == 3
"
-}
-global {
- name: "print"
- callable {
param {
- name: "sep"
- doc: "The separator string between the objects, default is space (\" \")."
- default_value: "\" \""
+ name: "local"
+ doc: "Falsetags=[\"local\"]).args as debug output. It will be prefixed with the string \"DEBUG\" and the location (file and line number) of this call. The exact way in which the arguments are converted to strings is unspecified and may change at any time. In particular, it may be different from (and more detailed than) the formatting done by str() and repr().print in production code is discouraged due to the spam it creates for users. For deprecations, prefer a hard error using fail() whenever possible."
-}
-global {
- name: "range"
- callable {
param {
- name: "start_or_stop"
- doc: "Value of the start element if stop is provided, otherwise value of stop and the actual start is 0"
- is_mandatory: true
+ name: "precompile_optimize_level"
+ doc: "The optimization level for precompiled files.\n\nFor more information about optimization levels, see the `compile()` function\'s\n`optimize` arg docs at https://docs.python.org/3/library/functions.html#compile\n\nNOTE: The value `-1` means \"current interpreter\", which will be the interpreter\nused _at build time when pycs are generated_, not the interpreter used at\nruntime when the code actually runs."
+ default_value: "0"
}
param {
- name: "stop_or_none"
- type: "int; or None"
- doc: "optional index of the first item not to be included in the resulting list; generation of the list stops before stop is reached."
- default_value: "None"
+ name: "precompile_source_retention"
+ doc: "Determines, when a source file is compiled, if the source file is kept\nin the resulting output or not. Valid values are:\n\n* `inherit`: Inherit the value from the {flag}`--precompile_source_retention` flag.\n* `keep_source`: Include the original Python source.\n* `omit_source`: Don\'t include the original py source."
+ default_value: "\"inherit\""
}
param {
- name: "step"
- doc: "The increment (default is 1). It may be negative."
- default_value: "1"
+ name: "pyc_collection"
+ doc: "Determines whether pyc files from dependencies should be manually included.\n\nValid values are:\n* `inherit`: Inherit the value from {flag}`--precompile`.\n* `include_pyc`: Add implicitly generated pyc files from dependencies. i.e.\n pyc files for targets that specify {attr}`precompile=\"inherit\"`.\n* `disabled`: Don\'t add implicitly generated pyc files. Note that\n pyc files may still come from dependencies that enable precompiling at the\n target level."
+ default_value: "\"inherit\""
}
- return_type: "sequence"
- }
- doc: "Creates a list where items go from start to stop, using a step increment. If a single argument is provided, items will range from 0 to that element.range(4) == [0, 1, 2, 3]\nrange(3, 9, 2) == [3, 5, 7]\nrange(3, 0, -1) == [3, 2, 1]
"
-}
-global {
- name: "repr"
- callable {
param {
- name: "x"
- doc: "The object to convert."
- is_mandatory: true
+ name: "python_version"
+ doc: "Defunct, unused, does nothing."
+ default_value: "\"PY3\""
}
- return_type: "string"
- }
- doc: "Converts any object to a string representation. This is useful for debugging.repr(\"ab\") == \'\"ab\"\'
"
-}
-global {
- name: "reversed"
- callable {
param {
- name: "sequence"
- doc: "The iterable sequence (e.g. list) to be reversed."
- is_mandatory: true
+ name: "restricted_to"
+ doc: "[]compatible_with\nfor details.\nreversed([3, 5, 4]) == [4, 5, 3]
"
-}
-global {
- name: "sorted"
- callable {
param {
- name: "iterable"
- doc: "The iterable sequence to sort."
- is_mandatory: true
+ name: "shard_count"
+ doc: "-1--test_sharding_strategy.\nTEST_TOTAL_SHARDS\n will be set to this value when spawning the test.\"enormous\", \"large\", \"medium\", or\n \"small\"; nonconfigurable;\n default is \"medium\"timeout attribute. The timeout is for all tests in the BUILD target, not for each\nindividual test. When the test is run locally, the size is additionally used for\nscheduling purposes: Bazel tries to respect --local_{ram,cpu}_resources and not\noverwhelm the local machine by running lots of heavy tests at the same time.\n
\n\n\n \n Size \n RAM (in MB) \n CPU (in CPU cores) \n Default timeout \n \n \n small \n 20 \n 1 \n short (1 minute) \n \n \n medium \n 100 \n 1 \n moderate (5 minutes) \n \n \n large \n 300 \n 1 \n long (15 minutes) \n \n \nenormous \n 800 \n 1 \n eternal (60 minutes) \n TEST_SIZE will be set to\n the value of this attribute when spawning the test.\nsorted([3, 5, 4]) == [3, 4, 5]
"
-}
-global {
- name: "str"
- callable {
param {
- name: "x"
- doc: "The object to convert."
- is_mandatory: true
+ name: "stamp"
+ doc: "Whether to encode build information into the binary. Possible values:\n\n* `stamp = 1`: Always stamp the build information into the binary, even in\n `--nostamp` builds. **This setting should be avoided**, since it potentially kills\n remote caching for the binary and any downstream actions that depend on it.\n* `stamp = 0`: Always replace build information by constant values. This gives\n good build result caching.\n* `stamp = -1`: Embedding of build information is controlled by the\n `--[no]stamp` flag.\n\nStamped binaries are not rebuilt unless their dependencies change.\n\nWARNING: Stamping can harm build performance by reducing cache hits and should\nbe avoided if possible."
+ default_value: "0"
}
- return_type: "string"
- }
- doc: "Converts any object to string. This is useful for debugging.str(\"ab\") == \"ab\"\nstr(8) == \"8\"
"
-}
-global {
- name: "tuple"
- callable {
param {
- name: "x"
- doc: "The object to convert."
- default_value: "()"
+ name: "tags"
+ doc: "[]\ntest_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\ntags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n\n
\n\nno-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n tags attribute of the test rule:\n\n
\n\nSee\nTag Conventions\n in the Test Encyclopedia for more conventions on tags attached to test targets.\n"
}
- return_type: "tuple"
- }
- doc: "Returns a tuple with the same elements as the given iterable value.exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n tuple([1, 2]) == (1, 2)\ntuple((2, 3, 2)) == (2, 3, 2)\ntuple({5: \"a\", 2: \"b\", 4: \"c\"}) == (5, 2, 4)"
-}
-global {
- name: "type"
- callable {
param {
- name: "x"
- doc: "The object to check type of."
- is_mandatory: true
+ name: "target_compatible_with"
+ doc: "[]\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\ntarget_compatible_with for a\ncc_toolchain is not useful.\ntype(2) == \"int\"\ntype([1]) == \"list\"\ntype(struct(a = 2)) == \"struct\"
This function might change in the future. To write Python-compatible code and be future-proof, use it only to compare return values: if type(x) == type([]): # if x is a list
"
-}
-global {
- name: "zip"
- callable {
param {
- name: "*args"
- doc: "lists to zip."
- is_mandatory: true
- is_star_arg: true
+ name: "testonly"
+ doc: "False\n except for test and test suite targetsTrue, only testonly targets (such as tests) can depend on this target.\ntestonly is not allowed to\ndepend on any rule that is testonly.\n*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\nlist of tuples, where the i-th tuple contains the i-th element from each of the argument sequences or iterables. The list has the size of the shortest input. With a single iterable argument, it returns a list of 1-tuples. With no arguments, it returns an empty list. Examples:zip() # == []\nzip([1, 2]) # == [(1,), (2,)]\nzip([1, 2], [3, 4]) # == [(1, 3), (2, 4)]\nzip([1, 2], [3, 4, 5]) # == [(1, 3), (2, 4)]
"
-}
-global {
- name: "native"
- type: "native"
- doc: "A built-in module to support native rules and other package helper functions. All native rules appear as functions in this module, e.g. native.cc_library. Note that the native module is only available in the loading phase (i.e. for macros, not for rule implementations). Attributes will ignore None values, and treat them as if the attribute was unset.
The following functions are also available:"
- api_context: BZL
-}
-global {
- name: "depset"
- callable {
param {
- name: "direct"
- type: "sequence; or None"
- doc: "A list of direct elements of a depset. "
- default_value: "None"
+ name: "timeout"
+ doc: "\"short\", \"moderate\", \"long\", or\n \"eternal\"; nonconfigurable; default is derived\n from the test\'s size attribute--test_timeout flag, e.g. for\nrunning under certain conditions which are known to be slow. Test timeout values\ncorrespond to the following time periods:\n\n
\n\n\n \n Timeout Value \n Time Period \n \n \n short \n 1 minute \n \n \n moderate \n 5 minutes \n \n \n long \n 15 minutes \n \n \neternal \n 60 minutes \n --test_timeout bazel flag, e.g. for manually running under\nconditions which are known to be slow. The --test_timeout values\nare in seconds. For example --test_timeout=120 will set the test\ntimeout to two minutes.\nTEST_TIMEOUT will be set\n to the test timeout (in seconds) when spawning the test.\n[]TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n\n
\n\n@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n cc_toolchain or java_toolchain a\n target will use.\nNone"
- doc: "A list of depsets whose elements will become indirect elements of the depset."
- default_value: "None"
+ name: "visibility"
+ doc: "visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\ndefault_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\ndirect parameter is a list of direct elements of the depset, and transitive parameter is a list of depsets whose elements become indirect elements of the created depset. The order in which elements are returned when the depset is converted to a list is specified by the order parameter. See the Depsets overview for more information.\ntype(x).\ntransitive depsets. \"default\" order is compatible with any other order, all other orders are only compatible with themselves."
- api_context: BZL
+ doc: "Creates an executable Python program.\n\nThis is the public macro wrapping the underlying rule. Args are forwarded\non as-is unless otherwise specified. See\n{rule}`py_test` for detailed attribute documentation.\n\nThis macro affects the following args:\n* `python_version`: cannot be `PY2`\n* `srcs_version`: cannot be `PY2` or `PY2ONLY`\n* `tags`: May have special marker values added, if not already present.\n\nArgs:\n **attrs: Rule attributes forwarded onto {rule}`py_test`."
+ api_context: BUILD
}
global {
- name: "json"
- type: "json"
- doc: "Module json is a Starlark module of JSON-related functions."
- api_context: BZL
+ name: "repo_name"
+ callable {
+ }
+ doc: "The canonical name of the repository containing the package currently being evaluated, with no leading at-signs."
+ api_context: BUILD
}
global {
- name: "proto"
- type: "proto"
- doc: "A module for protocol message processing."
- api_context: BZL
+ name: "repository_name"
+ callable {
+ }
+ doc: "Deprecated. Prefer to use repo_name instead, which doesn\'t contain the spurious leading at-sign, but behaves identically otherwise.@) prefixed. For example, in packages that are called into existence by the WORKSPACE stanza local_repository(name=\'local\', path=...) it will be set to @local. In packages in the main repository, it will be set to @."
+ api_context: BUILD
}
global {
name: "select"
@@ -7526,1412 +8209,1290 @@ global {
doc: "Optional custom error to report if no condition matches."
default_value: "\'\'"
}
- return_type: "unknown"
}
- doc: "select() is the helper function that makes a rule attribute configurable. See build encyclopedia for details."
- api_context: BZL
+ doc: "select() is the helper function that makes a rule attribute configurable. See build encyclopedia for details."
+ api_context: BUILD
}
global {
- name: "configuration_field"
+ name: "sh_binary"
callable {
param {
- name: "fragment"
- doc: "The name of a configuration fragment which contains the late-bound value."
+ name: "name"
is_mandatory: true
}
param {
- name: "name"
- doc: "The name of the value to obtain from the configuration fragment."
- is_mandatory: true
+ name: "deps"
+ doc: "The list of \"library\" targets to be aggregated into this target.\nSee general comments about deps\nat Typical attributes defined by\nmost build rules.\nsh_library rules that provide\n interpreted program source code depended on by the code in srcs. The files\n provided by these rules will be present among the runfiles of this target.\n\'_foo\': attr.label(default=configuration_field(fragment=\'java\', name=\'toolchain\'))
def _rule_impl(ctx):\n foo_info = ctx.attr._foo\n ...
"
- api_context: BZL
-}
-global {
- name: "visibility"
- callable {
param {
- name: "value"
- doc: "A list of package specification strings, or a single package specification string.package_group, except that negative package specifications are not permitted. That is, a specification may have the forms:\"//foo\": the package //foo\"//foo/...\": the package //foo and all of its subpackages.\"public\" or \"private\": all packages or no packages, respectivelyvalue is a list of strings, the set of packages granted visibility to this module is the union of the packages represented by each specification. (An empty list has the same effect as private.) If value is a single string, it is treated as if it were the singleton list [value].--incompatible_package_group_has_public_syntax and --incompatible_fix_package_group_reporoot_syntax have no effect on this argument. The \"public\" and \"private\" values are always available, and \"//...\" is always interpreted as \"all packages in the current repository\"."
- is_mandatory: true
+ name: "srcs"
+ doc: "The list of input files.\nsource\n or . command.\nvisibility() may only be called once per .bzl file, and only at the top level, not inside a function. The preferred style is to put this call immediately below the load() statements and any brief logic needed to determine the argument.--check_bzl_visibility is set to false, load visibility violations will emit warnings but not fail the build."
- api_context: BZL
-}
-global {
- name: "aspect"
- callable {
param {
- name: "implementation"
- doc: "A Starlark function that implements this aspect, with exactly two parameters: Target (the target to which the aspect is applied) and ctx (the rule context which the target is created from). Attributes of the target are available via the ctx.rule field. This function is evaluated during the analysis phase for each application of an aspect to a target."
- is_mandatory: true
+ name: "data"
+ doc: "\n[]data attribute\nshould appear in the *.runfiles area of any executable which is\noutput by or has a runtime dependency on this target. This may include data\nfiles or binaries used when this target\'s\nsrcs are executed. See the\ndata dependencies\nsection for more information about how to depend on and use data files.\ndata attribute if they process\ninputs which might use other inputs at runtime. Rules\' implementation functions\nmust also populate the target\'s\nrunfiles from the outputs and runfiles of any data attribute,\nas well as runfiles from any dependency attribute which provides either\nsource code or runtime dependencies.\ndeps and exports. The list can also contain a single string \"*\" to propagate along all dependencies of a target."
- default_value: "[]"
+ name: "args"
+ doc: "[]\nrun command or as a test. These arguments are\npassed before the ones that are specified on the bazel run or\nbazel test command line.\nbazel-bin/).\nctx parameter. _ must have default values, and have type label or label_list. string, and must use the values restriction. Explicit attributes restrict the aspect to only be used with rules that have attributes of the same name, type, and valid values according to the restriction."
- default_value: "{}"
+ name: "compatible_with"
+ doc: "[][[FooInfo], [BarInfo], [BazInfo, QuxInfo]] is a valid value while [FooInfo, BarInfo, [BazInfo, QuxInfo]] is not valid.[FooInfo, BarInfo] will automatically be converted to [[FooInfo, BarInfo]].some_rule) targets visible to an aspect, some_rule must advertise all providers from at least one of the required providers lists. For example, if the required_providers of an aspect are [[FooInfo], [BarInfo], [BazInfo, QuxInfo]], this aspect can see some_rule targets if and only if some_rule provides FooInfo, or BarInfo, or both BazInfo and QuxInfo."
- default_value: "[]"
+ name: "deprecation"
+ doc: "Nonedeprecation attribute is\ndepended upon by a target in another package.\n[[FooInfo], [BarInfo], [BazInfo, QuxInfo]] is a valid value while [FooInfo, BarInfo, [BazInfo, QuxInfo]] is not valid.[FooInfo, BarInfo] will automatically be converted to [[FooInfo, BarInfo]]. other_aspect) visible to this aspect, other_aspect must provide all providers from at least one of the lists. In the example of [[FooInfo], [BarInfo], [BazInfo, QuxInfo]], this aspect can see other_aspect if and only if other_aspect provides FooInfo, or BarInfo, or both BazInfo and QuxInfo."
- default_value: "[]"
+ name: "env"
+ doc: "{}bazel run.\ncc_binary, py_binary,\n and sh_binary. It does not apply to Starlark-defined executable rules.\nbazel-bin/).\n*Info object returned by provider(), except that a legacy provider is represented by its string name instead.When a target of the rule is used as a dependency for a target that declares a required provider, it is not necessary to specify that provider here. It is enough that the implementation function returns it. However, it is considered best practice to specify it, even though this is not required. The required_providers field of an aspect does, however, require that providers are specified here."
+ name: "env_inherit"
default_value: "[]"
}
param {
- name: "requires"
- type: "sequence of Aspects"
- doc: "List of aspects required to be propagated before this aspect."
- default_value: "[]"
+ name: "exec_compatible_with"
+ doc: "[]\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n {}exec_properties of a platform selected for this target. See exec_properties of the platform rule.ctx.toolchain."
- default_value: "[]"
+ name: "features"
+ doc: "[]features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n[]None"
- doc: "A description of the aspect that can be extracted by documentation generating tools."
- default_value: "None"
+ name: "package_metadata"
+ default_value: "[]"
}
param {
- name: "apply_to_generating_rules"
- doc: "If true, the aspect will, when applied to an output file, instead apply to the output file\'s generating rule. []compatible_with\nfor details.\n[]\ntest_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\ntags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n\n
\n\nno-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n tags attribute of the test rule:\n\n
\n\nSee\nTag Conventions\n in the Test Encyclopedia for more conventions on tags attached to test targets.\n"
}
param {
- name: "exec_groups"
- type: "dict; or exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n None"
- doc: "Dict of execution group name (string) to exec_groups. If set, allows aspects to run actions on multiple execution platforms within a single instance. See execution groups documentation for more info."
- default_value: "None"
+ name: "target_compatible_with"
+ doc: "[]\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\ntarget_compatible_with for a\ncc_toolchain is not useful.\nFalse\n except for test and test suite targetsTrue, only testonly targets (such as tests) can depend on this target.\ntestonly is not allowed to\ndepend on any rule that is testonly.\n*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n[]TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n\n
\n\n@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n cc_toolchain or java_toolchain a\n target will use.\nvisibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\ndefault_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\nsh_binary rule is used to declare executable shell scripts.\n (sh_binary is a misnomer: its outputs aren\'t necessarily binaries.) This rule ensures\n that all dependencies are built, and appear in the runfiles area at execution time.\n We recommend that you name your sh_binary() rules after the name of the script minus\n the extension (e.g. .sh); the rule name and the file name must be distinct.\n sh_binary respects shebangs, so any available interpreter may be used (eg.\n #!/bin/zsh)\nExample
\n\nsh_binary(\n name = \"foo\",\n srcs = [\"foo.sh\"],\n data = glob([\"datafiles/*.txt\"]),\n)\n
"
+ api_context: BUILD
}
global {
- name: "Label"
+ name: "sh_library"
callable {
param {
- name: "input"
+ name: "name"
is_mandatory: true
}
- }
- doc: "Converts a label string into a Label object, in the context of the package where the calling .bzl source file lives. If the given value is already a Label, it is returned unchanged.native.package_relative_label(), converts the input into a Label in the context of the package currently being constructed. Use that function to mimic the string-to-label conversion that is automatically done by label-valued rule attributes."
- api_context: BZL
-}
-global {
- name: "provider"
- callable {
param {
- name: "doc"
- type: "string; or None"
- doc: "A description of the provider that can be extracted by documentation generating tools."
- default_value: "None"
+ name: "deps"
+ doc: "The list of \"library\" targets to be aggregated into this target.\nSee general comments about deps\nat Typical attributes defined by\nmost build rules.\nsh_library rules that provide\n interpreted program source code depended on by the code in srcs. The files\n provided by these rules will be present among the runfiles of this target.\nNone"
- doc: "If specified, restricts the set of allowed fields.
Possible values are:
All fields are optional."
- default_value: "None"
+ name: "srcs"
+ doc: "The list of input files.\n
provider(fields = [\'a\', \'b\'])
provider(\n fields = { \'a\' : \'Documentation for a\', \'b\' : \'Documentation for b\' })source\n or . command.\nNone"
- doc: "An optional callback for preprocessing and validating the provider\'s field values during instantiation. If init is specified, provider() returns a tuple of 2 elements: the normal provider symbol and a raw constructor.P be the provider symbol created by calling provider(). Conceptually, an instance of P is generated by calling a default constructor function c(*args, **kwargs), which does the following:
In the case where an args is non-empty, an error occurs.fields parameter was specified when provider() was called, and if kwargs contains any key that was not listed in fields, an error occurs.c returns a new instance that has, for each k: v entry in kwargs, a field named k with value v.init callback is not given, a call to the symbol P itself acts as a call to the default constructor function c; in other words, P(*args, **kwargs) returns c(*args, **kwargs). For example,MyInfo = provider()\nm = MyInfo(foo = 1)
will straightforwardly make it so that m is a MyInfo instance with m.foo == 1.init is specified, the call P(*args, **kwargs) will perform the following steps instead:init(*args, **kwargs), that is, with the exact same positional and keyword arguments as were passed to P.init is expected to be a dictionary, d, whose keys are field name strings. If it is not, an error occurs.P is generated as if by calling the default constructor with d\'s entries as keyword arguments, as in c(**d).*args or **kwargs does not match init\'s signature, or the evaluation of init\'s body fails (perhaps intentionally via a call to fail()), or if the return value of init is not a dictionary with the expected schema.init callback generalizes normal provider construction by allowing positional arguments and arbitrary logic for preprocessing and validation. It does not enable circumventing the list of allowed fields.init is specified, the return value of provider() becomes a tuple (P, r), where r is the raw constructor. In fact, the behavior of r is exactly that of the default constructor function c discussed above. Typically, r is bound to a variable whose name is prefixed with an underscore, so that only the current .bzl file has direct access to it:MyInfo, _new_myinfo = provider(init = ...)
"
- default_value: "None"
+ name: "data"
+ doc: "\n[]data attribute\nshould appear in the *.runfiles area of any executable which is\noutput by or has a runtime dependency on this target. This may include data\nfiles or binaries used when this target\'s\nsrcs are executed. See the\ndata dependencies\nsection for more information about how to depend on and use data files.\ndata attribute if they process\ninputs which might use other inputs at runtime. Rules\' implementation functions\nmust also populate the target\'s\nrunfiles from the outputs and runfiles of any data attribute,\nas well as runfiles from any dependency attribute which provides either\nsource code or runtime dependencies.\nMyInfo = provider()\n...\ndef _my_library_impl(ctx):\n ...\n my_info = MyInfo(x = 2, y = 3)\n # my_info.x == 2\n # my_info.y == 3\n ...
Provider callable value if init is not specified.init is specified, returns a tuple of 2 elements: a Provider callable value and a raw constructor callable value. See Rules (Custom initialization of custom providers) and the discussion of the init parameter below for details."
- api_context: BZL
-}
-global {
- name: "rule"
- callable {
param {
- name: "implementation"
- doc: "the Starlark function implementing this rule, must have exactly one parameter: ctx. The function is called during the analysis phase for each instance of the rule. It can access the attributes provided by the user. It must create actions to generate all the declared outputs."
- is_mandatory: true
+ name: "compatible_with"
+ doc: "[]Nonedeprecation attribute is\ndepended upon by a target in another package.\n[]\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n blaze test command. All test rules are automatically considered executable; it is unnecessary (and discouraged) to explicitly set executable = True for a test rule. The value defaults to False. See the Rules page for more information."
- default_value: "unbound"
+ name: "exec_properties"
+ doc: "{}exec_properties of a platform selected for this target. See exec_properties of the platform rule._ are private, and can be used to add an implicit dependency on a label. The attribute name is implicitly added and must not be specified. Attributes visibility, deprecation, tags, testonly, and features are implicitly added and cannot be overridden. Most rules need only a handful of attributes. To limit memory usage, the rule function imposes a cap on the size of attrs."
- default_value: "{}"
+ name: "expect_failure"
}
param {
- name: "outputs"
- type: "dict; or None; or function"
- doc: "Deprecated. This parameter is deprecated and will be removed soon. Please do not depend on it. It is disabled with ---incompatible_no_rule_outputs_param. Use this flag to verify your code is compatible with its imminent removal.
This parameter has been deprecated. Migrate rules to use OutputGroupInfo or attr.output instead. output and output_list attributes, the user does not specify the labels for these files. See the Rules page for more on predeclared outputs.outputs = _my_func with the definition def _my_func(srcs, deps): ..., the function has access to the attributes srcs and deps. Whether the dictionary is specified directly or via a function, it is interpreted as follows.File in ctx.outputs. The output\'s label has the same package as the rule, and the part after the package is produced by substituting each placeholder of the form \"%{ATTR}\" with a string formed from the value of the attribute ATTR:\"//pkg:a/b.c\" becomes \"a/b\".\"a/b.c\").attr.label_list) used in placeholders are required to have exactly one element. Their conversion is the same as their non-list version (attr.label).%{dirname} and %{basename} expand to those parts of the rule\'s label, excluding its package. For example, in \"//pkg:a/b.c\", the dirname is a and the basename is b.c.\"%{name}\". For example, for a target named \"foo\", the outputs dict {\"bin\": \"%{name}.exe\"} predeclares an output named foo.exe that is accessible in the implementation function as ctx.outputs.bin."
- default_value: "None"
+ name: "features"
+ doc: "[]features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\nblaze run command. It defaults to False. See the Rules page for more information."
- default_value: "unbound"
+ name: "package_metadata"
+ default_value: "[]"
}
param {
- name: "output_to_genfiles"
- doc: "If true, the files will be generated in the genfiles directory instead of the bin directory. Unless you need it for compatibility with existing rules (e.g. when generating header files for C++), do not set this flag."
- default_value: "False"
+ name: "restricted_to"
+ doc: "[]compatible_with\nfor details.\n[]\ntest_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\ntags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n\n
\n\nno-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n tags attribute of the test rule:\n\n
\n\nSee\nTag Conventions\n in the Test Encyclopedia for more conventions on tags attached to test targets.\n"
}
param {
- name: "host_fragments"
- type: "sequence of strings"
- doc: "List of names of configuration fragments that the rule requires in host configuration."
- default_value: "[]"
+ name: "target_compatible_with"
+ doc: "exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n []\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
If true, this rule will expose its actions for inspection by rules that depend on it via an Actions provider. The provider is also available to the rule itself by calling ctx.created_actions().
This should only be used for testing the analysis-time behavior of Starlark rules. This flag may be removed in the future."
- default_value: "False"
+ name: "testonly"
+ doc: "False\n except for test and test suite targetsTrue, only testonly targets (such as tests) can depend on this target.\ntestonly is not allowed to\ndepend on any rule that is testonly.\n*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\nctx.toolchain."
+ doc: "[]TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n\n
\n\n@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n cc_toolchain or java_toolchain a\n target will use.\nvisibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\ndefault_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\ndata attribute of one or\n more sh_binary rules.\nfilegroup rule to aggregate data\n files.\nsrcs, deps and data.\n The current implementation does not distinguish between the elements of these lists.\n All three attributes accept rules, source files and generated files.\n It is however good practice to use the attributes for their usual purpose (as with other rules).\nExamples
\n\n\nsh_library(\n name = \"foo\",\n data = [\n \":foo_service_script\", # an sh_binary with srcs\n \":deploy_foo\", # another sh_binary with srcs\n ],\n)\n
"
+ api_context: BUILD
+}
+global {
+ name: "sh_test"
+ callable {
param {
- name: "doc"
- type: "string; or None"
- doc: "A description of the rule that can be extracted by documentation generating tools."
- default_value: "None"
+ name: "name"
+ is_mandatory: true
}
param {
- name: "provides"
- doc: "A list of providers that the implementation function must return.*Info object returned by provider(), except that a legacy provider is represented by its string name instead.When a target of the rule is used as a dependency for a target that declares a required provider, it is not necessary to specify that provider here. It is enough that the implementation function returns it. However, it is considered best practice to specify it, even though this is not required. The required_providers field of an aspect does, however, require that providers are specified here."
+ name: "deps"
+ doc: "The list of \"library\" targets to be aggregated into this target.\nSee general comments about deps\nat Typical attributes defined by\nmost build rules.\nsh_library rules that provide\n interpreted program source code depended on by the code in srcs. The files\n provided by these rules will be present among the runfiles of this target.\nsource\n or . command.\n
"
- default_value: "False"
+ name: "data"
+ doc: "\ntest=True were set). This supersedes the value of test[]data attribute\nshould appear in the *.runfiles area of any executable which is\noutput by or has a runtime dependency on this target. This may include data\nfiles or binaries used when this target\'s\nsrcs are executed. See the\ndata dependencies\nsection for more information about how to depend on and use data files.\ndata attribute if they process\ninputs which might use other inputs at runtime. Rules\' implementation functions\nmust also populate the target\'s\nrunfiles from the outputs and runfiles of any data attribute,\nas well as runfiles from any dependency attribute which provides either\nsource code or runtime dependencies.\nNone"
- doc: "If set, describes what kind of build setting this rule is. See the config module. If this is set, a mandatory attribute named \"build_setting_default\" is automatically added to this rule, with a type corresponding to the value passed in here."
- default_value: "None"
+ name: "args"
+ doc: "[]bazel test.\n\n--test_arg values\nspecified on the bazel test command line.\n[]None"
- doc: "Dict of execution group name (string) to exec_groups. If set, allows rules to run actions on multiple execution platforms within a single target. See execution groups documentation for more info."
- default_value: "None"
+ name: "deprecation"
+ doc: "Nonedeprecation attribute is\ndepended upon by a target in another package.\nname or tags). None as value results in using the default value specified in the attribute definition. None). **kwargs for attributes that are not handled.{}\nbazel test.\ncc_test,\n py_test, and sh_test. It does not apply to\n Starlark-defined test rules. For your own Starlark rules, you can add an \"env\"\n attribute and use it to populate a\n\n TestEnvironment\n \n Provider.\nexecutable and test from the parent. Values of fragments, toolchains, exec_compatible_with, and exec_groups are merged. Legacy or deprecated parameters may not be set. Incoming configuration transition cfg of parent is applied after thisrule\'s incoming configuration."
- default_value: "None"
+ name: "env_inherit"
+ doc: "[]bazel test.\ncc_test, py_test,\n and sh_test. It does not apply to Starlark-defined test rules.\nNone"
- doc: "Experimental: A label of an allowlist defining which rules can extending this rule. It can be set also to True/False to always allow/disallow extending. Bazel defaults to always allowing extensions."
- default_value: "None"
+ name: "exec_compatible_with"
+ doc: "[]\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n {}exec_properties of a platform selected for this target. See exec_properties of the platform rule._test, while all other rules must not have this suffix. (This restriction applies only to rules, not to their targets.)"
- api_context: BZL
-}
-global {
- name: "subrule"
- callable {
param {
- name: "implementation"
- type: "function"
- doc: "The Starlark function implementing this subrule"
- is_mandatory: true
+ name: "expect_failure"
}
param {
- name: "attrs"
- type: "dict"
- doc: "A dictionary to declare all the (private) attributes of the subrule.
"
- default_value: "{}"
+ name: "features"
+ doc: "FilesToRunProvider for label attributes with executable=TrueFile for label attributes with allow_single_file=TrueTarget for all other label attributes[Target] for all label-list attributes[]features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\nctx.toolchains."
- default_value: "[]"
+ name: "flaky"
+ doc: "FalseFalsetags=[\"local\"]).attrs dictionary argument of rule() and aspect().[]compatible_with\nfor details.\ns = struct(x = 2, y = 3)\nreturn s.x + getattr(s, \"y\") # returns 5
"
- api_context: BZL
-}
-global {
- name: "OutputGroupInfo"
- callable {
param {
- name: "**kwargs"
- is_star_star_arg: true
+ name: "shard_count"
+ doc: "-1--test_sharding_strategy.\nTEST_TOTAL_SHARDS\n will be set to this value when spawning the test.OutputGroupInfo(group1 = <files>, group2 = <files>...)
See Requesting output files for more information."
- api_context: BZL
-}
-global {
- name: "Actions"
- type: "Actions"
- doc: "Deprecated and subject to imminent removal. Please do not use."
- api_context: BZL
-}
-global {
- name: "DefaultInfo"
- callable {
param {
- name: "files"
- default_value: "None"
+ name: "size"
+ doc: "\"enormous\", \"large\", \"medium\", or\n \"small\"; nonconfigurable;\n default is \"medium\"timeout attribute. The timeout is for all tests in the BUILD target, not for each\nindividual test. When the test is run locally, the size is additionally used for\nscheduling purposes: Bazel tries to respect --local_{ram,cpu}_resources and not\noverwhelm the local machine by running lots of heavy tests at the same time.\n
\n\n\n \n Size \n RAM (in MB) \n CPU (in CPU cores) \n Default timeout \n \n \n small \n 20 \n 1 \n short (1 minute) \n \n \n medium \n 100 \n 1 \n moderate (5 minutes) \n \n \n large \n 300 \n 1 \n long (15 minutes) \n \n \nenormous \n 800 \n 1 \n eternal (60 minutes) \n TEST_SIZE will be set to\n the value of this attribute when spawning the test.\n[]\ntest_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\ntags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n\n
\n\nno-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n tags attribute of the test rule:\n\n
\n\nSee\nTag Conventions\n in the Test Encyclopedia for more conventions on tags attached to test targets.\n"
}
param {
- name: "data_runfiles"
- default_value: "None"
+ name: "target_compatible_with"
+ doc: "exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n []\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\ntarget_compatible_with for a\ncc_toolchain is not useful.\nFalse\n except for test and test suite targetsTrue, only testonly targets (such as tests) can depend on this target.\ntestonly is not allowed to\ndepend on any rule that is testonly.\n*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n\"short\", \"moderate\", \"long\", or\n \"eternal\"; nonconfigurable; default is derived\n from the test\'s size attribute--test_timeout flag, e.g. for\nrunning under certain conditions which are known to be slow. Test timeout values\ncorrespond to the following time periods:\n\n
\n\n\n \n Timeout Value \n Time Period \n \n \n short \n 1 minute \n \n \n moderate \n 5 minutes \n \n \n long \n 15 minutes \n \n \neternal \n 60 minutes \n --test_timeout bazel flag, e.g. for manually running under\nconditions which are known to be slow. The --test_timeout values\nare in seconds. For example --test_timeout=120 will set the test\ntimeout to two minutes.\nTEST_TIMEOUT will be set\n to the test timeout (in seconds) when spawning the test.\nDefaultInfo constructor."
- api_context: BZL
-}
-global {
- name: "RunEnvironmentInfo"
- callable {
param {
- name: "environment"
- default_value: "{}"
+ name: "toolchains"
+ doc: "[]TemplateVariableInfo or special targets for toolchain types built into Bazel. These\n include:\n\n\n
\n\n@bazel_tools//tools/cpp:toolchain_type\n @rules_java//toolchains:current_java_runtime\n cc_toolchain or java_toolchain a\n target will use.\n
This value has a dual purpose:
Create a new DataInfo = provider()\nd = DataInfo(x = 2, y = 3)\nprint(d.x + d.y) # prints 5
Note: Some providers, defined internally, do not allow instance creation DataInfo = provider()\ndef _rule_impl(ctx)\n ... ctx.attr.dep[DataInfo]
Provider using the provider function."
- api_context: BZL
-}
-global {
- name: "config_common"
- type: "config_common"
- doc: "Functions for Starlark to interact with Blaze\'s configurability APIs."
- api_context: BZL
-}
-global {
- name: "config"
- type: "config"
- doc: "This is a top-level module for creating configuration transitions and build setting descriptors which describe what kind of build setting (if any) a rule is. build_setting parameter of the rule() function. Specifically it is a build setting of type int and is a flag which means this build setting is callable on the command line. my_rule = rule(\n implementation = _impl,\n build_setting = config.int(flag = True),\n ...\n )
"
- api_context: BZL
-}
-global {
- name: "analysis_test_transition"
- callable {
param {
- name: "settings"
- doc: "A dictionary containing information about configuration settings which should be set by this configuration transition. Keys are build setting labels and values are their new post-transition values. All other settings are unchanged. Use this to declare specific configuration settings that an analysis test requires to be set in order to pass."
- is_mandatory: true
+ name: "visibility"
+ doc: "visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\ndefault_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\nanalysis_test = True. Such rules are restricted in capabilities (for example, the size of their dependency tree is limited), so transitions created using this function are limited in potential scope as compared to transitions created using transition(). sh_binary rule is used to declare executable shell scripts.\n (sh_binary is a misnomer: its outputs aren\'t necessarily binaries.) This rule ensures\n that all dependencies are built, and appear in the runfiles area at execution time.\n We recommend that you name your sh_binary() rules after the name of the script minus\n the extension (e.g. .sh); the rule name and the file name must be distinct.\n sh_binary respects shebangs, so any available interpreter may be used (eg.\n #!/bin/zsh)\nExample
\n\nsh_binary(\n name = \"foo\",\n srcs = [\"foo.sh\"],\n data = glob([\"datafiles/*.txt\"]),\n)\n
"
+ api_context: BUILD
}
global {
- name: "transition"
+ name: "starlark_doc_extract"
callable {
param {
- name: "implementation"
+ name: "name"
is_mandatory: true
}
param {
- name: "inputs"
- is_mandatory: true
+ name: "deps"
+ doc: " A list of targets wrapping the Starlark files which are load()-ed by\n src. These targets should under normal usage be\n bzl_library\n targets, but the starlark_doc_extract rule does not enforce that, and accepts\n any target which provides Starlark files in its DefaultInfo.\n\n load() generated files.\n"
+ default_value: "[]"
}
param {
- name: "outputs"
+ name: "src"
+ doc: " A Starlark file from which to extract documentation.\n\n load()\n generated files.\n"
is_mandatory: true
}
- }
- doc: "A transition that reads a set of input build settings and writes a set of output build settings.\ndef _transition_impl(settings, attr):\n # This transition just reads the current CPU value as a demonstration.\n # A real transition could incorporate this into its followup logic.\n current_cpu = settings[\"//command_line_option:cpu\"]\n return {\"//command_line_option:compilation_mode\": \"dbg\"}\n\nbuild_in_debug_mode = transition(\n implementation = _transition_impl,\n inputs = [\"//command_line_option:cpu\"],\n outputs = [\"//command_line_option:compilation_mode\"],\n)
For more details see here.
" - api_context: BZL -} -global { - name: "platform_common" - type: "platform_common" - doc: "Functions for Starlark to interact with the platform APIs." - api_context: BZL -} -global { - name: "ProtoInfo" - type: "ProtoInfo" - doc: "A constructor for simple value objects, known as provider instances.DataInfo = provider()\nd = DataInfo(x = 2, y = 3)\nprint(d.x + d.y) # prints 5Note: Some providers, defined internally, do not allow instance creation
DataInfo = provider()\ndef _rule_impl(ctx)\n ... ctx.attr.dep[DataInfo]
Provider using the provider function."
- api_context: BZL
-}
-global {
- name: "proto_common"
- type: "proto_common"
- doc: "Utilities for protocol buffers. Please consider using load(\"@rules_proto//proto:defs.bzl\", \"proto_common\") to load this symbol from rules_proto.
Please consider using load(\"@rules_proto//proto:defs.bzl\", \"proto_common\") to load this symbol from rules_proto.
DataInfo = provider()\nd = DataInfo(x = 2, y = 3)\nprint(d.x + d.y) # prints 5Note: Some providers, defined internally, do not allow instance creation
DataInfo = provider()\ndef _rule_impl(ctx)\n ... ctx.attr.dep[DataInfo]
Provider using the provider function."
- api_context: BZL
-}
-global {
- name: "cc_common"
- type: "cc_common"
- doc: "The type of the Starlark None value."
- api_context: BZL
-}
-global {
- name: "CcInfo"
- callable {
param {
- name: "compilation_context"
- default_value: "None"
+ name: "data"
+ doc: "\nList of labels; default is []
\nFiles needed by this rule at runtime. May list file or rule targets. Generally\nallows any target.\n
\n\n\nThe default outputs and runfiles of targets in the data attribute\nshould appear in the *.runfiles area of any executable which is\noutput by or has a runtime dependency on this target. This may include data\nfiles or binaries used when this target\'s\nsrcs are executed. See the\ndata dependencies\nsection for more information about how to depend on and use data files.\n
\nNew rules should define a data attribute if they process\ninputs which might use other inputs at runtime. Rules\' implementation functions\nmust also populate the target\'s\nrunfiles from the outputs and runfiles of any data attribute,\nas well as runfiles from any dependency attribute which provides either\nsource code or runtime dependencies.\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" + } + param { + name: "deprecation" + doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "exec_compatible_with" + doc: "List of labels;\n nonconfigurable; default is []\n
\nA list of\nconstraint_values\nthat must be present in the execution platform for this target. This is in\naddition to any constraints already set by the rule type. Constraints are used\nto restrict the list of available execution platforms. For more details, see\nthe description of\n toolchain resolution.\n
Dictionary of strings; default is {}
A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.
If a key is present in both the platform and target-level properties, the value will be taken from the target.
\n" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
List of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" + } + param { + name: "package_metadata" + default_value: "[]" + } + param { + name: "render_main_repo_name" + doc: " If true, render labels in the main repository in emitted documentation with a repo component\n (in other words,//foo:bar.bzl will be emitted as\n @main_repo_name//foo:bar.bzl).\n The name to use for the main repository is obtained from module(name = ...)\n in the main repository\'s MODULE.bazel file (if Bzlmod is enabled), or from\n workspace(name = ...) in the main repository\'s WORKSPACE file.\n
This attribute should be set to False when generating documentation for\n Starlark files which are intended to be used only within the same repository, and to\n True when generating documentation for Starlark files which are intended to be\n used from other repositories.\n"
+ default_value: "false"
}
param {
- name: "linking_context"
- default_value: "None"
+ name: "restricted_to"
+ doc: "
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
starlark_doc_extract emits documentation for an entity if and only if\n
\"_\");\n and\n symbol_names list is empty (which is the default\n case), or\n symbol_names list.\n CcInfo constructor."
- api_context: BZL
-}
-global {
- name: "DebugPackageInfo"
- callable {
param {
- name: "target_label"
- is_mandatory: true
+ name: "tags"
+ doc: "\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" } param { - name: "unstripped_file" - is_mandatory: true + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" } param { - name: "dwp_file" - default_value: "None" + name: "transitive_configs" + default_value: "[]" + } + param { + name: "visibility" + doc: "List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
DebugPackageInfo constructor."
- api_context: BZL
-}
-global {
- name: "CcToolchainConfigInfo"
- type: "CcToolchainConfigInfo"
- api_context: BZL
-}
-global {
- name: "java_common"
- type: "java_common"
- doc: "The type of the Starlark None value."
- api_context: BZL
-}
-global {
- name: "JavaInfo"
- type: "JavaInfo"
- doc: "The type of the Starlark None value."
- api_context: BZL
-}
-global {
- name: "JavaPluginInfo"
- type: "JavaPluginInfo"
- doc: "The type of the Starlark None value."
- api_context: BZL
+ doc: "\nstarlark_doc_extract() extracts documentation for rules, functions (including\nmacros), aspects, and providers defined or re-exported in a given .bzl or\n.scl file. The output of this rule is a ModuleInfo binary proto as defined\nin\nstardoc_output.proto\nin the Bazel source tree.\n\n
name.binaryproto (the default output): A\n ModuleInfo binary proto.name.textproto (only built if explicitly requested): the text\n proto version of name.binaryproto.Warning: the output format of this rule is not guaranteed to be stable. It is intended mainly for\ninternal use by Stardoc.\n\n"
+ api_context: BUILD
}
global {
- name: "ProguardSpecProvider"
+ name: "subpackages"
callable {
param {
- name: "specs"
+ name: "include"
+ doc: "The list of glob patterns to include in subpackages scan."
is_mandatory: true
}
- return_type: "ProguardSpecProvider"
- }
- doc: "The ProguardSpecProvider constructor."
- api_context: BZL
-}
-global {
- name: "android_common"
- type: "android_common"
- doc: "Do not use this module. It is intended for migration purposes only. If you depend on it, you will be broken when it is removed.Common utilities and functionality related to Android rules."
- api_context: BZL
-}
-global {
- name: "ApkInfo"
- callable {
param {
- name: "**kwargs"
- is_star_star_arg: true
+ name: "exclude"
+ doc: "The list of glob patterns to exclude from subpackages scan."
+ default_value: "[]"
}
- }
- api_context: BZL
-}
-global {
- name: "AndroidInstrumentationInfo"
- callable {
param {
- name: "target"
- is_mandatory: true
+ name: "allow_empty"
+ doc: "Whether we fail if the call returns an empty list. By default empty list indicates potential error in BUILD file where the call to subpackages() is superflous. Setting to true allows this function to succeed in that case."
+ default_value: "False"
}
}
- doc: "The AndroidInstrumentationInfo constructor."
- api_context: BZL
+ doc: "Returns a new mutable list of every direct subpackage of the current package, regardless of file-system directory depth. List returned is sorted and contains the names of subpackages relative to the current package. It is advised to prefer using the methods in bazel_skylib.subpackages module rather than calling this function directly."
+ api_context: BUILD
}
global {
- name: "AndroidDeviceBrokerInfo"
+ name: "test_suite"
callable {
param {
- name: "type"
+ name: "name"
is_mandatory: true
}
- }
- doc: "The AndroidDeviceBrokerInfo constructor."
- api_context: BZL
-}
-global {
- name: "AndroidResourcesInfo"
- callable {
param {
- name: "label"
- is_mandatory: true
+ name: "compatible_with"
+ doc: "
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" } param { - name: "manifest" - is_mandatory: true + name: "deprecation" + doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" } param { - name: "r_txt" - is_mandatory: true + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" } param { - name: "transitive_android_resources" - is_mandatory: true + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
List of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" } param { - name: "transitive_resources" - is_mandatory: true + name: "package_metadata" + default_value: "[]" } param { - name: "transitive_manifests" - is_mandatory: true + name: "restricted_to" + doc: "List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
\n Tags which begin with a \"-\" character are considered negative tags. The\n preceding \"-\" character is not considered part of the tag, so a suite tag\n of \"-small\" matches a test\'s \"small\" size. All other tags are considered\n positive tags.\n
\n\n Optionally, to make positive tags more explicit, tags may also begin with the\n \"+\" character, which will not be evaluated as part of the text of the tag. It\n merely makes the positive and negative distinction easier to read.\n
\n\n Only test rules that match all of the positive tags and none of the negative\n tags will be included in the test suite. Note that this does not mean that error checking\n for dependencies on tests that are filtered out is skipped; the dependencies on skipped\n tests still need to be legal (e.g. not blocked by visibility constraints).\n
\n\n The manual tag keyword is treated differently than the above by the\n \"test_suite expansion\" performed by the bazel test command on invocations\n involving wildcard\n target patterns.\n There, test_suite targets tagged \"manual\" are filtered out (and thus not\n expanded). This behavior is consistent with how bazel build and\n bazel test handle wildcard target patterns in general. Note that this is\n explicitly different from how bazel query \'tests(E)\' behaves, as suites are\n always expanded by the tests query function, regardless of the\n manual tag.\n
\n Note that a test\'s size is considered a tag for the purpose of filtering.\n
\n If you need a test_suite that contains tests with mutually exclusive tags\n (e.g. all small and medium tests), you\'ll have to create three test_suite\n rules: one for all small tests, one for all medium tests, and one that includes the\n previous two.\n
\nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" } param { - name: "transitive_compiled_symbols" - is_mandatory: true + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" } param { - name: "transitive_static_lib" - default_value: "unbound" + name: "tests" + doc: " A list of test suites and test targets of any language.\n\n Any *_test is accepted here, independent of the language. No\n *_binary targets are accepted however, even if they happen to run a test.\n Filtering by the specified tags is only done for tests listed directly in\n this attribute. If this attribute contains test_suites, the tests inside\n those will not be filtered by this test_suite (they are considered to be\n filtered already).\n
\n If the tests attribute is unspecified or empty, the rule will default to\n including all test rules in the current BUILD file that are not tagged as\n manual. These rules are still subject to tag filtering.\n
List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
AndroidResourcesInfo constructor."
- api_context: BZL
+ doc: "\n\nA test_suite defines a set of tests that are considered \"useful\" to humans. This\nallows projects to define sets of tests, such as \"tests you must run before checkin\", \"our\nproject\'s stress tests\" or \"all small tests.\" The bazel test command respects this sort\nof organization: For an invocation like bazel test //some/test:suite, Bazel first\nenumerates all test targets transitively included by the //some/test:suite target (we\ncall this \"test_suite expansion\"), then Bazel builds and tests those targets.\n
A test suite to run all of the small tests in the current package.
\n\ntest_suite(\n name = \"small_tests\",\n tags = [\"small\"],\n)\n\n\n
A test suite that runs a specified set of tests:
\n\n\ntest_suite(\n name = \"smoke_tests\",\n tests = [\n \"system_unittest\",\n \"public_api_unittest\",\n ],\n)\n\n\n
A test suite to run all tests in the current package which are not flaky.
\n\ntest_suite(\n name = \"non_flaky_test\",\n tags = [\"-flaky\"],\n)\n\n\n" + api_context: BUILD } global { - name: "AndroidNativeLibsInfo" + name: "toolchain" callable { param { - name: "native_libs" + name: "name" is_mandatory: true } - } - doc: "The
AndroidNativeLibsInfo constructor."
- api_context: BZL
-}
-global {
- name: "AndroidApplicationResourceInfo"
- callable {
param {
- name: "resource_apk"
- is_mandatory: true
+ name: "deprecation"
+ doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" } param { - name: "resource_java_src_jar" - is_mandatory: true + name: "distribs" + doc: "List of strings; nonconfigurable;\n default is []
\n A list of distribution-method strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" } param { - name: "resource_java_class_jar" - is_mandatory: true + name: "exec_compatible_with" + doc: " A list ofconstraint_values that must be satisfied by an execution platform in\n order for this toolchain to be selected for a target building on that platform.\n"
+ default_value: "[]"
}
param {
- name: "manifest"
- is_mandatory: true
+ name: "features"
+ doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
List of strings; nonconfigurable;\n default is [\"none\"]
\n A list of license-type strings to be used for this particular target.\n\nThis is part of a deprecated licensing API that Bazel no longer uses. Don\'t\nuse this.\n
\n" } param { - name: "main_dex_proguard_config" - is_mandatory: true + name: "package_metadata" + default_value: "[]" } param { - name: "r_txt" - default_value: "None" + name: "tags" + doc: "\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n constraint_values that must be satisfied by the target platform in\n order for this toolchain to be selected for a target building for that platform.\n"
+ default_value: "[]"
}
param {
- name: "databinding_info"
- default_value: "None"
+ name: "target_settings"
+ doc: " A list of config_settings that must be satisfied by the target configuration\n in order for this toolchain to be selected during toolchain resolution.\n"
+ default_value: "[]"
}
param {
- name: "build_stamp_jar"
- default_value: "None"
+ name: "testonly"
+ doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" } param { - name: "should_compile_java_srcs" - default_value: "True" + name: "toolchain" + doc: " The target representing the actual tool or tool suite that is made available when this\n toolchain is selected.\n" + is_mandatory: true + } + param { + name: "toolchain_type" + doc: " The label of atoolchain_type target that represents the role that this\n toolchain serves.\n"
+ is_mandatory: true
+ }
+ param {
+ name: "transitive_configs"
+ default_value: "[]"
+ }
+ param {
+ name: "visibility"
+ doc: "List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
AndroidApplicationResourceInfo constructor."
- api_context: BZL
+ doc: "\nThis rule declares a specific toolchain\'s type and constraints so that it can be selected\nduring toolchain resolution. See the\nToolchains page for more\ndetails.\n\n" + api_context: BUILD } global { - name: "AndroidBinaryNativeLibsInfo" + name: "toolchain_type" callable { param { - name: "native_libs" + name: "name" is_mandatory: true } param { - name: "native_libs_name" - default_value: "None" + name: "compatible_with" + doc: "
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, in addition to\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system, which lets users declare which\ntargets can and cannot depend on each other. For example, externally deployable\nbinaries shouldn\'t depend on libraries with company-secret code. See\n\nConstraintSemantics for details.\n
\n" } param { - name: "transitive_native_libs" - default_value: "None" + name: "deprecation" + doc: "String; nonconfigurable; default is None
\nAn explanatory warning message associated with this target.\nTypically this is used to notify users that a target has become obsolete,\nor has become superseded by another rule, is private to a package, or is\nperhaps considered harmful for some reason. It is a good idea to include\nsome reference (like a webpage, a bug number or example migration CLs) so\nthat one can easily find out what changes are required to avoid the message.\nIf there is a new target that can be used as a drop in replacement, it is a\ngood idea to just migrate all users of the old target.\n
\n\n\nThis attribute has no effect on the way things are built, but it\nmay affect a build tool\'s diagnostic output. The build tool issues a\nwarning when a rule with a deprecation attribute is\ndepended upon by a target in another package.\n
\nIntra-package dependencies are exempt from this warning, so that,\nfor example, building the tests of a deprecated rule does not\nencounter a warning.\n
\n\n\nIf a deprecated target depends on another deprecated target, no warning\nmessage is issued.\n
\n\n\nOnce people have stopped using it, the target can be removed.\n
\n" + } + param { + name: "features" + doc: "List of feature strings; default is []
A feature is string tag that can be enabled or disabled on a target. The\n meaning of a feature depends on the rule itself.
\n\nThis features attribute is combined with the \npackage level features attribute. For example, if\nthe features [\"a\", \"b\"] are enabled on the package level, and a target\'s\nfeatures attribute contains [\"-a\", \"c\"], the features enabled for the\nrule will be \"b\" and \"c\".\n \n See example.\n
List of labels;\n nonconfigurable; default is []
\nThe list of environments this target can be built for, instead of\ndefault-supported environments.\n
\n\n\nThis is part of Bazel\'s constraint system. See\ncompatible_with\nfor details.\n
\n List of strings; nonconfigurable;\n default is []\n
\n Tags can be used on any rule. Tags on test and\n test_suite rules are useful for categorizing the tests.\n Tags on non-test targets are used to control sandboxed execution of\n genrules and\n\nStarlark\n actions, and for parsing by humans and/or external tools.\n
\n Bazel modifies the behavior of its sandboxing code if it finds the following\n keywords in the tags attribute of any test or genrule\n target, or the keys of execution_requirements for any Starlark\n action.\n
no-sandbox keyword results in the action or test never being\n sandboxed; it can still be cached or run remotely - use no-cache\n or no-remote to prevent either or both of those.\n no-cache keyword results in the action or test never being\n cached (locally or remotely). Note: for the purposes of this tag, the disk cache\n is considered a local cache, whereas the HTTP and gRPC caches are considered\n remote. Other caches, such as Skyframe or the persistent action cache, are not\n affected.\n no-remote-cache keyword results in the action or test never being\n cached remotely (but it may be cached locally; it may also be executed remotely).\n Note: for the purposes of this tag, the disk cache is considered a local cache,\n whereas the HTTP and gRPC caches are considered remote. Other caches, such as\n Skyframe or the persistent action cache, are not affected.\n If a combination of local disk cache and remote cache are used (combined cache),\n it\'s treated as a remote cache and disabled entirely unless --incompatible_remote_results_ignore_disk\n is set in which case the local components will be used.\n no-remote-exec keyword results in the action or test never being\n executed remotely (but it may be cached remotely).\n no-remote keyword prevents the action or test from being executed remotely or\n cached remotely. This is equivalent to using both\n no-remote-cache and no-remote-exec.\n no-remote-cache-upload keyword disables upload part of remote caching of a spawn.\n it does not disable remote execution.\n local keyword precludes the action or test from being remotely cached,\n remotely executed, or run inside the sandbox.\n For genrules and tests, marking the rule with the local = True\n attribute has the same effect.\n requires-network keyword allows access to the external\n network from inside the sandbox. This tag only has an effect if sandboxing\n is enabled.\n block-network keyword blocks access to the external\n network from inside the sandbox. In this case, only communication\n with localhost is allowed. This tag only has an effect if sandboxing is\n enabled.\n requires-fakeroot runs the test or action as uid and gid 0 (i.e., the root\n user). This is only supported on Linux. This tag takes precedence over the\n --sandbox_fake_username command-line option.\n \n Tags on tests are generally used to annotate a test\'s role in your\n debug and release process. Typically, tags are most useful for C++ and Python\n tests, which lack any runtime annotation ability. The use of tags and size\n elements gives flexibility in assembling suites of tests based around codebase\n check-in policy.\n
\n\n\n Bazel modifies test running behavior if it finds the following keywords in the\n tags attribute of the test rule:\n
exclusive will force the test to be run in the\n "exclusive" mode, ensuring that no other tests are running at the\n same time. Such tests will be executed in serial fashion after all build\n activity and non-exclusive tests have been completed. Remote execution is\n disabled for such tests because Bazel doesn\'t have control over what\'s\n running on a remote machine.\n exclusive-if-local will force the test to be run in the\n "exclusive" mode if it is executed locally, but will run the test in parallel if it\'s\n executed remotely.\n manual keyword will exclude the target from expansion of target pattern wildcards\n (..., :*, :all, etc.) and test_suite rules\n which do not list the test explicitly when computing the set of top-level targets to build/run\n for the build, test, and coverage commands. It does not\n affect target wildcard or test suite expansion in other contexts, including the\n query command. Note that manual does not imply that a target should\n not be built/run automatically by continuous build/test systems. For example, it may be\n desirable to exclude a target from bazel test ... because it requires specific\n Bazel flags, but still have it included in properly-configured presubmit or continuous test\n runs.\n\n external keyword will force test to be unconditionally\n executed (regardless of --cache_test_results\n value).\n \nList of labels; default is []\n
\nA list of\nconstraint_values\nthat must be present in the target platform for this target to be considered\ncompatible. This is in addition to any constraints already set by the\nrule type. If the target platform does not satisfy all listed constraints then\nthe target is considered incompatible. Incompatible targets are\nskipped for building and testing when the target pattern is expanded\n(e.g. //..., :all). When explicitly specified on the\ncommand line, incompatible targets cause Bazel to print an error and cause a\nbuild or test failure.\n
\nTargets that transitively depend on incompatible targets are themselves\nconsidered incompatible. They are also skipped for building and testing.\n
\n\n\nAn empty list (which is the default) signifies that the target is compatible\nwith all platforms.\n
\n\n
\nAll rules other than Workspace Rules support this\nattribute.\nFor some rules this attribute has no effect. For example, specifying\ntarget_compatible_with for a\ncc_toolchain is not useful.\n
\n\n
\nSee the\nPlatforms\npage for more information about incompatible target skipping.\n
\n" + } + param { + name: "testonly" + doc: "Boolean; nonconfigurable; default is False\n except for test and test suite targets
\nIf True, only testonly targets (such as tests) can depend on this target.\n
\nEquivalently, a rule that is not testonly is not allowed to\ndepend on any rule that is testonly.\n
\nTests (*_test rules)\nand test suites (test_suite rules)\nare testonly by default.\n
\nThis attribute is intended to mean that the target should not be\ncontained in binaries that are released to production.\n
\n\n\nBecause testonly is enforced at build time, not run time, and propagates\nvirally through the dependency tree, it should be applied judiciously. For\nexample, stubs and fakes that\nare useful for unit tests may also be useful for integration tests\ninvolving the same binaries that will be released to production, and\ntherefore should probably not be marked testonly. Conversely, rules that\nare dangerous to even link in, perhaps because they unconditionally\noverride normal behavior, should definitely be marked testonly.\n
\n" + } + param { + name: "transitive_configs" + default_value: "[]" + } + param { + name: "visibility" + doc: "List of labels;\n nonconfigurable;\n default varies\n
\n\n\n The visibility attribute controls whether the target can be\n depended on by targets in other locations. See the documentation for\n visibility.\n
\n For targets declared directly in a BUILD file or in legacy macros called from\n a BUILD file, the default value is the package\'s\n default_visibility\n if specified, or else [\"//visibility:private\"]. For targets\n declared in one or more symbolic macros, the default value is always just\n [\"//visibility:private\"] (which makes it useable only within the\n package containing the macro\'s code).\n
AndroidBinaryNativeLibsInfo constructor."
- api_context: BZL
+ doc: "\n\n This rule defines a new type of toolchain -- a simple target that represents a class of tools that\n serve the same role for different platforms.\n
\n\n\n See the Toolchains page for more details.\n
\n\n\n This defines a toolchain type for a custom rule.\n
\n\ntoolchain_type(\n name = \"bar_toolchain_type\",\n)\n\n\n
\n This can be used in a bzl file.\n
\n\nbar_binary = rule(\n implementation = _bar_binary_impl,\n attrs = {\n \"srcs\": attr.label_list(allow_files = True),\n ...\n # No `_compiler` attribute anymore.\n },\n toolchains = [\"//bar_tools:toolchain_type\"]\n)\n\n"
+ api_context: BUILD
}
global {
- name: "AndroidSdkInfo"
+ name: "xcode_config"
callable {
param {
- name: "build_tools_version"
- is_mandatory: true
- }
- param {
- name: "framework_aidl"
+ name: "name"
is_mandatory: true
}
param {
- name: "aidl_lib"
- is_mandatory: true
+ name: "compatible_with"
+ default_value: "[]"
}
param {
- name: "android_jar"
+ name: "default"
+ doc: "The default official version of Xcode to use.\nThe version specified by the provided `xcode_version` target is to be used if\nno `xcode_version` build flag is specified. This is required if any\n`versions` are set. This may not be set if `remote_versions` or\n`local_versions` is set."
is_mandatory: true
}
param {
- name: "sourceProperties"
- is_mandatory: true
+ name: "deprecation"
}
param {
- name: "shrinked_android_jar"
- is_mandatory: true
+ name: "exec_compatible_with"
+ default_value: "[]"
}
param {
- name: "main_dex_classes"
- is_mandatory: true
+ name: "exec_properties"
+ default_value: "{}"
}
param {
- name: "adb"
- is_mandatory: true
+ name: "expect_failure"
}
param {
- name: "dx"
- is_mandatory: true
+ name: "features"
+ default_value: "[]"
}
param {
- name: "main_dex_list_creator"
+ name: "local_versions"
+ doc: "The `xcode_version` targets that are available locally.\nThese are used along with `local_versions` to select a mutually available\nversion. This may not be set if `versions` is set."
is_mandatory: true
}
param {
- name: "aidl"
- is_mandatory: true
+ name: "package_metadata"
+ default_value: "[]"
}
param {
- name: "aapt"
+ name: "remote_versions"
+ doc: "The `xcode_version` targets that are available remotely.\nThese are used along with `remote_versions` to select a mutually available\nversion. This may not be set if `versions` is set."
is_mandatory: true
}
param {
- name: "aapt2"
- is_mandatory: true
+ name: "restricted_to"
+ default_value: "[]"
}
param {
- name: "apk_builder"
- is_mandatory: true
+ name: "tags"
+ default_value: "[]"
}
param {
- name: "apk_signer"
- is_mandatory: true
+ name: "target_compatible_with"
+ default_value: "[]"
}
param {
- name: "proguard"
- is_mandatory: true
+ name: "testonly"
+ default_value: "false"
}
param {
- name: "zipalign"
- is_mandatory: true
+ name: "toolchains"
+ default_value: "[]"
}
param {
- name: "system"
- default_value: "None"
+ name: "transitive_configs"
+ default_value: "[]"
}
param {
- name: "legacy_main_dex_list_generator"
- default_value: "None"
+ name: "versions"
+ doc: "Accepted `xcode_version` targets that may be used.\nIf the value of the `xcode_version` build flag matches one of the aliases\nor version number of any of the given `xcode_version` targets, the matching\ntarget will be used. This may not be set if `remote_versions` or\n`local_versions` is set."
+ default_value: "[]"
}
param {
- name: "dexdump"
- default_value: "None"
+ name: "visibility"
+ default_value: "[]"
}
}
- doc: "The AndroidSdkInfo constructor."
- api_context: BZL
+ doc: "A single target of this rule can be referenced by the `--xcode_version_config`\nbuild flag to translate the `--xcode_version` flag into an accepted official\nXcode version. This allows selection of an official Xcode version from a number\nof registered aliases."
+ api_context: BUILD
}
global {
- name: "AndroidManifestInfo"
+ name: "xcode_config_alias"
callable {
param {
- name: "manifest"
+ name: "name"
is_mandatory: true
}
param {
- name: "package"
- is_mandatory: true
+ name: "compatible_with"
+ default_value: "[]"
}
param {
- name: "exports_manifest"
- default_value: "False"
+ name: "deprecation"
}
- }
- doc: "The AndroidManifestInfo constructor."
- api_context: BZL
-}
-global {
- name: "AndroidAssetsInfo"
- callable {
param {
- name: "label"
- is_mandatory: true
+ name: "exec_compatible_with"
+ default_value: "[]"
}
param {
- name: "validation_result"
- is_mandatory: true
+ name: "exec_properties"
+ default_value: "{}"
}
param {
- name: "direct_parsed_assets"
- is_mandatory: true
+ name: "expect_failure"
}
param {
- name: "transitive_parsed_assets"
- is_mandatory: true
+ name: "features"
+ default_value: "[]"
}
param {
- name: "transitive_assets"
- is_mandatory: true
+ name: "package_metadata"
+ default_value: "[]"
}
param {
- name: "transitive_symbols"
- is_mandatory: true
+ name: "restricted_to"
+ default_value: "[]"
}
param {
- name: "transitive_compiled_symbols"
- is_mandatory: true
+ name: "tags"
+ default_value: "[]"
}
- }
- doc: "The AndroidAssetsInfo constructor."
- api_context: BZL
-}
-global {
- name: "AndroidLibraryAarInfo"
- callable {
param {
- name: "aar"
- is_mandatory: true
+ name: "target_compatible_with"
+ default_value: "[]"
}
param {
- name: "manifest"
- is_mandatory: true
+ name: "testonly"
+ default_value: "false"
}
param {
- name: "aars_from_deps"
- is_mandatory: true
+ name: "toolchains"
+ default_value: "[]"
}
param {
- name: "defines_local_resources"
- is_mandatory: true
+ name: "transitive_configs"
+ default_value: "[]"
+ }
+ param {
+ name: "visibility"
+ default_value: "[]"
}
}
- doc: "The AndroidLibraryAarInfoApi constructor."
- api_context: BZL
+ api_context: BUILD
}
global {
- name: "AndroidProguardInfo"
+ name: "xcode_version"
callable {
param {
- name: "local_proguard_specs"
+ name: "name"
is_mandatory: true
}
- }
- doc: "The AndroidProguardInfo constructor."
- api_context: BZL
-}
-global {
- name: "AndroidIdlInfo"
- callable {
param {
- name: "transitive_idl_import_roots"
- is_mandatory: true
+ name: "aliases"
+ doc: "Accepted aliases for this version of Xcode. If the value of the xcode_version build flag matches any of the given alias strings, this Xcode version will be used."
+ default_value: "[]"
+ }
+ param {
+ name: "compatible_with"
+ default_value: "[]"
+ }
+ param {
+ name: "default_ios_sdk_version"
+ doc: "The iOS SDK version that is used by default when this version of Xcode is being used. The `--ios_sdk_version` build flag will override the value specified here."
}
param {
- name: "transitive_idl_imports"
- is_mandatory: true
+ name: "default_macos_sdk_version"
+ doc: "The macOS SDK version that is used by default when this version of Xcode is being used. The `--macos_sdk_version` build flag will override the value specified here."
}
param {
- name: "transitive_idl_jars"
- is_mandatory: true
+ name: "default_tvos_sdk_version"
+ doc: "The tvOS SDK version that is used by default when this version of Xcode is being used. The `--tvos_sdk_version` build flag will override the value specified here."
}
param {
- name: "transitive_idl_preprocessed"
- is_mandatory: true
+ name: "default_visionos_sdk_version"
+ doc: "The visionOS SDK version that is used by default when this version of Xcode is being used."
}
- }
- doc: "The AndroidIdlInfo constructor."
- api_context: BZL
-}
-global {
- name: "AndroidIdeInfo"
- callable {
param {
- name: "java_package"
- is_mandatory: true
+ name: "default_watchos_sdk_version"
+ doc: "The watchOS SDK version that is used by default when this version of Xcode is being used. The `--watchos_sdk_version` build flag will override the value specified here."
}
param {
- name: "manifest"
- is_mandatory: true
+ name: "deprecation"
}
param {
- name: "generated_manifest"
- is_mandatory: true
+ name: "exec_compatible_with"
+ default_value: "[]"
}
param {
- name: "idl_import_root"
- is_mandatory: true
+ name: "exec_properties"
+ default_value: "{}"
}
param {
- name: "idl_srcs"
- is_mandatory: true
+ name: "expect_failure"
}
param {
- name: "idl_generated_java_files"
- is_mandatory: true
+ name: "features"
+ default_value: "[]"
}
param {
- name: "idl_source_jar"
- is_mandatory: true
+ name: "package_metadata"
+ default_value: "[]"
}
param {
- name: "idl_class_jar"
- is_mandatory: true
+ name: "restricted_to"
+ default_value: "[]"
}
param {
- name: "defines_android_resources"
- is_mandatory: true
+ name: "tags"
+ default_value: "[]"
}
param {
- name: "resource_jar"
- is_mandatory: true
+ name: "target_compatible_with"
+ default_value: "[]"
}
param {
- name: "resource_apk"
- is_mandatory: true
+ name: "testonly"
+ default_value: "false"
}
param {
- name: "signed_apk"
- is_mandatory: true
+ name: "toolchains"
+ default_value: "[]"
}
param {
- name: "aar"
- is_mandatory: true
+ name: "transitive_configs"
+ default_value: "[]"
}
param {
- name: "apks_under_test"
+ name: "version"
+ doc: "The official version number of a version of Xcode."
is_mandatory: true
}
param {
- name: "native_libs"
- is_mandatory: true
+ name: "visibility"
+ default_value: "[]"
}
}
- doc: "The AndroidIdeInfo constructor."
- api_context: BZL
+ api_context: BUILD
}
global {
- name: "AndroidPreDexJarInfo"
+ name: "archive_override"
callable {
param {
- name: "pre_dex_jar"
+ name: "module_name"
+ doc: "The name of the Bazel module dependency to apply this override to."
is_mandatory: true
}
- }
- doc: "The AndroidPreDexJarInfo constructor."
- api_context: BZL
-}
-global {
- name: "AndroidCcLinkParamsInfo"
- callable {
param {
- name: "store"
- is_mandatory: true
+ name: "**kwargs"
+ doc: "All other arguments are forwarded to the underlying http_archive repo\nrule. Note that the name attribute shouldn\'t be specified; use\nmodule_name instead."
+ is_star_star_arg: true
}
}
- doc: "The AndroidCcLinkParamsInfo constructor."
- api_context: BZL
+ doc: "Specifies that this dependency should come from an archive file (zip, gzip, etc) at a\ncertain location, instead of from a registry. Effectively, this dependency will be\nbacked by an http_archive rule.\n\nThis directive only takes effect in the root module; in other words, if a module is\nused as a dependency by others, its own overrides are ignored."
+ api_context: MODULE
}
global {
- name: "DataBindingV2Info"
+ name: "bazel_dep"
callable {
param {
- name: "setter_store_file"
- default_value: "None"
+ name: "name"
+ doc: "The name of the module to be added as a direct dependency."
+ is_mandatory: true
}
param {
- name: "class_info_file"
- default_value: "None"
+ name: "version"
+ doc: "The version of the module to be added as a direct dependency."
+ default_value: "\'\'"
}
param {
- name: "br_file"
- default_value: "None"
+ name: "max_compatibility_level"
+ doc: "The maximum compatibility_level supported for the module to be added as a direct dependency. The version of the module implies the minimum compatibility_level supported, as well as the maximum if this attribute is not specified."
+ default_value: "-1"
}
param {
- name: "label"
- default_value: "None"
+ name: "repo_name"
+ doc: "The name of the external repo representing this dependency. This is by default the name of the module."
+ default_value: "\'\'"
}
param {
- name: "java_package"
- default_value: "None"
+ name: "dev_dependency"
+ doc: "If true, this dependency will be ignored if the current module is not the root module or `--ignore_dev_dependency` is enabled."
+ default_value: "False"
}
+ }
+ doc: "Declares a direct dependency on another Bazel module."
+ api_context: MODULE
+}
+global {
+ name: "git_override"
+ callable {
param {
- name: "databinding_v2_providers_in_deps"
- default_value: "[]"
+ name: "module_name"
+ doc: "The name of the Bazel module dependency to apply this override to."
+ is_mandatory: true
}
param {
- name: "databinding_v2_providers_in_exports"
- default_value: "[]"
+ name: "**kwargs"
+ doc: "All other arguments are forwarded to the underlying git_repository\nrepo rule. Note that the name attribute shouldn\'t be specified; use\nmodule_name instead."
+ is_star_star_arg: true
}
}
- doc: "The DataBindingV2Info constructor."
- api_context: BZL
+ doc: "Specifies that this dependency should come from a certain commit in a Git repository,\ninstead of from a registry. Effectively, this dependency will be backed by a\ngit_repository rule.\n\n
This directive only takes effect in the root module; in other words, if a module is\nused as a dependency by others, its own overrides are ignored."
+ api_context: MODULE
}
global {
- name: "AndroidLibraryResourceClassJarProvider"
+ name: "include"
callable {
param {
- name: "jars"
+ name: "label"
+ doc: "The label pointing to the file to include. The label must point to a file in the main repo; in other words, it must start with double slashes ( Only the root module may use Only files in the main repo may be included. Use This directive only takes effect in the root module; in other words, if a module is\nused as a dependency by others, its own overrides are ignored."
+ api_context: MODULE
}
global {
- name: "AndroidBinaryData"
+ name: "module"
callable {
param {
- name: "resource_apk"
- is_mandatory: true
+ name: "name"
+ doc: "The name of the module. Can be omitted only if this module is the root module (as in, if it\'s not going to be depended on by another module). A valid module name must: 1) only contain lowercase letters (a-z), digits (0-9), dots (.), hyphens (-), and underscores (_); 2) begin with a lowercase letter; 3) end with a lowercase letter or digit."
+ default_value: "\'\'"
}
param {
- name: "resource_proguard_config"
- is_mandatory: true
+ name: "version"
+ doc: "The version of the module. Can be omitted only if this module is the root module (as in, if it\'s not going to be depended on by another module). The version must be in a relaxed SemVer format; see the documentation for more details."
+ default_value: "\'\'"
}
param {
- name: "resources_info"
- is_mandatory: true
+ name: "compatibility_level"
+ doc: "The compatibility level of the module; this should be changed every time a major incompatible change is introduced. This is essentially the \"major version\" of the module in terms of SemVer, except that it\'s not embedded in the version string itself, but exists as a separate field. Modules with different compatibility levels participate in version resolution as if they\'re modules with different names, but the final dependency graph cannot contain multiple modules with the same name but different compatibility levels (unless It should be called at most once, and if called, it must be the very first directive in the MODULE.bazel file. It can be omitted only if this module is the root module (as in, if it\'s not going to be depended on by another module)."
+ api_context: MODULE
+}
+global {
+ name: "multiple_version_override"
+ callable {
param {
- name: "assets_info"
+ name: "module_name"
+ doc: "The name of the Bazel module dependency to apply this override to."
is_mandatory: true
}
param {
- name: "manifest_info"
+ name: "versions"
+ doc: "Explicitly specifies the versions allowed to coexist. These versions must already be present in the dependency graph pre-selection. Dependencies on this module will be \"upgraded\" to the nearest higher allowed version at the same compatibility level, whereas dependencies that have a higher version than any allowed versions at the same compatibility level will cause an error."
is_mandatory: true
}
+ param {
+ name: "registry"
+ doc: "Overrides the registry for this module; instead of finding this module from the default list of registries, the given registry should be used."
+ default_value: "\'\'"
+ }
}
- doc: "The Use If a patch makes changes to the MODULE.bazel file, these changes will only be effective if the patch file is provided by the root module."
+ default_value: "[]"
}
param {
- name: "java_resource_jar"
- default_value: "None"
+ name: "patch_cmds"
+ doc: "Sequence of Bash commands to be applied on Linux/Macos after patches are applied. Changes to the MODULE.bazel file will not be effective."
+ default_value: "[]"
}
param {
- name: "shuffled_java_resource_jar"
- default_value: "None"
+ name: "patch_strip"
+ doc: "Same as the --strip argument of Unix patch."
+ default_value: "0"
}
}
- doc: "The This parameter is currently experimental and only available with the flag This function takes a list of strings and a directory is ignored if any of the given strings matches its repository-relative path according to the semantics of the This target must exist, but can be any type of rule (including bind). If this attribute is omitted, rules referring to this target in Warning: use of Warning: Gives a target an alias in the The To give a target an alias, Now targets can depend on Bind can also be used to make targets in external repositories available to your workspace.\n For example, if there is a remote repository named Then, in a BUILD file in your workspace, the bound target can be used as follows: Within Then Allows targets from a local directory to be bound. This means that the current repository can\n use targets defined in this other directory. See the bind\n section for more details. Suppose the current repository is a chat client, rooted at the directory ~/chat-app. It\n would like to use an SSL library which is defined in a different repository: ~/ssl. The\n SSL library has a target The user can add a dependency on this target by adding the following lines to\n ~/chat-app/WORKSPACE: Targets would specify Allows a local directory to be turned into a Bazel repository. This means that the current\n repository can define and use targets from anywhere on the filesystem. This rule creates a Bazel repository by creating a WORKSPACE file and subdirectory containing\nsymlinks to the BUILD file and path given. The build file should create targets relative to the\n Suppose the current repository is a chat client, rooted at the directory ~/chat-app. It\n would like to use an SSL library which is defined in a different directory: ~/ssl. The user can add a dependency by creating a BUILD file for the SSL library\n(~/chat-app/BUILD.my-ssl) containing:\n\n Then they can add the following lines to ~/chat-app/WORKSPACE: This will create a You can also use And creating the following BUILD.piano file: This function can only be used in a Sets the name for this workspace. Workspace names should be a Java-package-style description of the project, using underscores as separators, e.g., github.com/bazelbuild/bazel should use com_github_bazelbuild_bazel. This name is used for the directory that the repository\'s runfiles are stored in. For example, if there is a runfile Remote repository rule names must be valid workspace names. For example, you could have //). The name of the file must end with .MODULE.bazel and must not start with .."
is_mandatory: true
}
}
- doc: "The AndroidLibraryResourceClassJarProvider constructor."
- api_context: BZL
+ doc: "Includes the contents of another MODULE.bazel-like file. Effectively, include() behaves as if the included file is textually placed at the location of the include() call, except that variable bindings (such as those used for use_extension) are only ever visible in the file they occur in, not in any included or including files.include(); it is an error if a bazel_dep\'s MODULE file uses include().include() allows you to segment the root module file into multiple parts, to avoid having an enormous MODULE.bazel file or to better manage access control for individual semantic segments."
+ api_context: MODULE
}
global {
- name: "AndroidFeatureFlagSet"
+ name: "inject_repo"
callable {
param {
- name: "flags"
+ name: "extension_proxy"
+ doc: "A module extension proxy object returned by a use_extension call."
is_mandatory: true
}
+ param {
+ name: "*args"
+ doc: "The repos visible to the current module that should be injected into the\nextension under the same name."
+ is_star_arg: true
+ }
+ param {
+ name: "**kwargs"
+ doc: "The new repos to inject into the extension, where the values are the names of\nrepos in the scope of the current module and the keys are the name they will be\nvisible under in the extension."
+ is_star_star_arg: true
+ }
}
- doc: "The AndroidFeatureFlagSetProvider constructor."
- api_context: BZL
+ doc: "Injects one or more new repos into the given module extension.\nThis is ignored if the current module is not the root module or\n--ignore_dev_dependency is enabled.\n\noverride_repo instead to override an\nexisting repo."
+ api_context: MODULE
}
global {
- name: "ProguardMappingInfo"
+ name: "local_path_override"
callable {
param {
- name: "proguard_mapping"
+ name: "module_name"
+ doc: "The name of the Bazel module dependency to apply this override to."
+ is_mandatory: true
+ }
+ param {
+ name: "path"
+ doc: "The path to the directory where this module is."
is_mandatory: true
}
}
- doc: "The ProguardMappingInfo constructor."
- api_context: BZL
+ doc: "Specifies that this dependency should come from a certain directory on local disk,\ninstead of from a registry. Effectively, this dependency will be backed by a\nlocal_repository rule.\n\nmultiple_version_override is in effect). See the documentation for more details."
+ default_value: "0"
+ }
+ param {
+ name: "repo_name"
+ doc: "The name of the repository representing this module, as seen by the module itself. By default, the name of the repo is the name of the module. This can be specified to ease migration for projects that have been using a repo name for itself that differs from its module name."
+ default_value: "\'\'"
+ }
+ param {
+ name: "bazel_compatibility"
+ doc: "A list of bazel versions that allows users to declare which Bazel versions are compatible with this module. It does NOT affect dependency resolution, but bzlmod will use this information to check if your current Bazel version is compatible. The format of this value is a string of some constraint values separated by comma. Three constraints are supported: <=X.X.X: The Bazel version must be equal or older than X.X.X. Used when there is a known incompatible change in a newer version. >=X.X.X: The Bazel version must be equal or newer than X.X.X.Used when you depend on some features that are only available since X.X.X. -X.X.X: The Bazel version X.X.X is not compatible. Used when there is a bug in X.X.X that breaks you, but fixed in later versions."
+ default_value: "[]"
}
+ }
+ doc: "Declares certain properties of the Bazel module represented by the current Bazel repo. These properties are either essential metadata of the module (such as the name and version), or affect behavior of the current module and its dependents. AndroidBinaryDataInfoApi constructor."
- api_context: BZL
+ doc: "Specifies that a dependency should still come from a registry, but multiple versions of it should be allowed to coexist. See the documentation for more details. This directive only takes effect in the root module; in other words, if a module is used as a dependency by others, its own overrides are ignored."
+ api_context: MODULE
}
global {
- name: "BaselineProfileProvider"
+ name: "override_repo"
callable {
param {
- name: "files"
+ name: "extension_proxy"
+ doc: "A module extension proxy object returned by a use_extension call."
is_mandatory: true
}
param {
- name: "art_profile_zip"
- default_value: "None"
+ name: "*args"
+ doc: "The repos in the extension that should be overridden with the repos of the same\nname in the current module."
+ is_star_arg: true
+ }
+ param {
+ name: "**kwargs"
+ doc: "The overrides to apply to the repos generated by the extension, where the values\nare the names of repos in the scope of the current module and the keys are the\nnames of the repos they will override in the extension."
+ is_star_star_arg: true
}
- return_type: "BaselineProfileProvider"
}
- doc: "The BaselineProfileProvider constructor."
- api_context: BZL
+ doc: "Overrides one or more repos defined by the given module extension with the given repos\nvisible to the current module. This is ignored if the current module is not the root\nmodule or `--ignore_dev_dependency` is enabled.\n\ninject_repo instead to add a new repo.\n"
+ api_context: MODULE
}
global {
- name: "AndroidNeverLinkLibrariesProvider"
+ name: "register_execution_platforms"
callable {
param {
- name: "transitive_neverlink_libraries"
- is_mandatory: true
+ name: "dev_dependency"
+ doc: "If true, the execution platforms will not be registered if the current module is not the root module or `--ignore_dev_dependency` is enabled."
+ default_value: "False"
+ }
+ param {
+ name: "*platform_labels"
+ doc: "The target patterns to register."
+ is_star_arg: true
}
- return_type: "AndroidNeverLinkLibrariesProvider"
}
- doc: "The AndroidNeverLinkLibrariesProvider constructor."
- api_context: BZL
+ doc: "Specifies already-defined execution platforms to be registered when this module is selected. Should be absolute target patterns (ie. beginning with either @ or //). See toolchain resolution for more information. Patterns that expand to multiple targets, such as :all, will be registered in lexicographical order by name."
+ api_context: MODULE
}
global {
- name: "AndroidOptimizedJarInfo"
+ name: "register_toolchains"
callable {
param {
- name: "optimized_jar"
- is_mandatory: true
+ name: "dev_dependency"
+ doc: "If true, the toolchains will not be registered if the current module is not the root module or `--ignore_dev_dependency` is enabled."
+ default_value: "False"
+ }
+ param {
+ name: "*toolchain_labels"
+ doc: "The target patterns to register."
+ is_star_arg: true
}
}
- doc: "The AndroidOptimizedJarInfo constructor."
- api_context: BZL
+ doc: "Specifies already-defined toolchains to be registered when this module is selected. Should be absolute target patterns (ie. beginning with either @ or //). See toolchain resolution for more information. Patterns that expand to multiple targets, such as :all, will be registered in lexicographical order by target name (not the name of the toolchain implementation)."
+ api_context: MODULE
}
global {
- name: "AndroidDexInfo"
+ name: "single_version_override"
callable {
param {
- name: "deploy_jar"
+ name: "module_name"
+ doc: "The name of the Bazel module dependency to apply this override to."
is_mandatory: true
}
param {
- name: "final_classes_dex_zip"
- is_mandatory: true
+ name: "version"
+ doc: "Overrides the declared version of this module in the dependency graph. In other words, this module will be \"pinned\" to this override version. This attribute can be omitted if all one wants to override is the registry or the patches. "
+ default_value: "\'\'"
}
param {
- name: "filtered_deploy_jar"
- default_value: "None"
+ name: "registry"
+ doc: "Overrides the registry for this module; instead of finding this module from the default list of registries, the given registry should be used."
+ default_value: "\'\'"
}
param {
- name: "final_proguard_output_map"
- default_value: "None"
+ name: "patches"
+ doc: "A list of labels pointing to patch files to apply for this module. The patch files must exist in the source tree of the top level project. They are applied in the list order.AndroidDexInfo constructor."
- api_context: BZL
+ doc: "Specifies that a dependency should still come from a registry, but its version should be pinned, or its registry overridden, or a list of patches applied. This directive only takes effect in the root module; in other words, if a module is used as a dependency by others, its own overrides are ignored."
+ api_context: MODULE
}
global {
- name: "AndroidOptimizationInfo"
+ name: "use_extension"
callable {
param {
- name: "optimized_jar"
- default_value: "None"
+ name: "extension_bzl_file"
+ doc: "A label to the Starlark file defining the module extension."
+ is_mandatory: true
}
param {
- name: "mapping"
- default_value: "None"
+ name: "extension_name"
+ doc: "The name of the module extension to use. A symbol with this name must be exported by the Starlark file."
+ is_mandatory: true
}
param {
- name: "seeds"
- default_value: "None"
+ name: "dev_dependency"
+ doc: "If true, this usage of the module extension will be ignored if the current module is not the root module or `--ignore_dev_dependency` is enabled."
+ default_value: "False"
}
param {
- name: "library_jar"
- default_value: "None"
+ name: "isolate"
+ doc: "If true, this usage of the module extension will be isolated from all other usages, both in this and other modules. Tags created for this usage do not affect other usages and the repositories generated by the extension for this usage will be distinct from all other repositories generated by the extension.--experimental_isolated_extension_usages."
+ default_value: "False"
}
+ }
+ doc: "Returns a proxy object representing a module extension; its methods can be invoked to create module extension tags."
+ api_context: MODULE
+}
+global {
+ name: "use_repo"
+ callable {
param {
- name: "config"
- default_value: "None"
+ name: "extension_proxy"
+ doc: "A module extension proxy object returned by a use_extension call."
+ is_mandatory: true
}
param {
- name: "usage"
- default_value: "None"
+ name: "*args"
+ doc: "The names of the repos to import."
+ is_star_arg: true
}
param {
- name: "proto_mapping"
- default_value: "None"
+ name: "**kwargs"
+ doc: "Specifies certain repos to import into the scope of the current module with different names. The keys should be the name to use in the current scope, whereas the values should be the original names exported by the module extension."
+ is_star_star_arg: true
}
+ }
+ doc: "Imports one or more repos generated by the given module extension into the scope of the current module."
+ api_context: MODULE
+}
+global {
+ name: "use_repo_rule"
+ callable {
param {
- name: "rewritten_startup_profile"
- default_value: "None"
+ name: "repo_rule_bzl_file"
+ doc: "A label to the Starlark file defining the repo rule."
+ is_mandatory: true
}
param {
- name: "rewriten_merged_baseline_profile"
- default_value: "None"
+ name: "repo_rule_name"
+ doc: "The name of the repo rule to use. A symbol with this name must be exported by the Starlark file."
+ is_mandatory: true
}
+ }
+ doc: "Returns a proxy value that can be directly invoked in the MODULE.bazel file as a repository rule, one or more times. Repos created in such a way are only visible to the current module, under the name declared using the name attribute on the proxy. The implicit Boolean dev_dependency attribute can also be used on the proxy to denote that a certain repo is only to be created when the current module is the root module."
+ api_context: MODULE
+}
+global {
+ name: "ignore_directories"
+ callable {
param {
- name: "optimized_resource_apk"
- default_value: "None"
+ name: "dirs"
+ is_mandatory: true
}
+ }
+ doc: "The list of directories to ignore in this repository. glob() function. This function can be used to ignore directories that are implementation details of source control systems, output files of other build systems, etc."
+ api_context: REPO
+}
+global {
+ name: "repo"
+ callable {
param {
- name: "shrunk_resource_apk"
- default_value: "None"
+ name: "**kwargs"
+ doc: "The repo() function accepts exactly the same arguments as the package() function in BUILD files."
+ is_star_star_arg: true
}
+ }
+ doc: "Declares metadata that applies to every rule in the repository. It must be called at most once per REPO.bazel file. If called, it must be the first call in the REPO.bazel file."
+ api_context: REPO
+}
+global {
+ name: "ignore"
+ callable {
param {
- name: "shrunk_resource_zip"
- default_value: "None"
+ name: "*args"
+ doc: "The canonical repo names of the repos to ignore."
+ is_star_arg: true
}
+ }
+ doc: "Ignore this repo from vendoring. Bazel will never vendor it or use the corresponding directory (if exists) while building in vendor mode."
+ api_context: VENDOR
+}
+global {
+ name: "pin"
+ callable {
param {
- name: "resource_shrinker_log"
- default_value: "None"
+ name: "*args"
+ doc: "The canonical repo names of the repos to pin."
+ is_star_arg: true
}
+ }
+ doc: "Pin the contents of this repo under the vendor directory. Bazel will not update this repo while vendoring, and will use the vendored source as if there is a --override_repository flag when building in vendor mode"
+ api_context: VENDOR
+}
+global {
+ name: "bind"
+ callable {
param {
- name: "resource_optimization_config"
- default_value: "None"
+ name: "name"
+ doc: "The label under \'//external\' to serve as the alias name"
+ is_mandatory: true
}
param {
- name: "resource_path_shortening_map"
+ name: "actual"
+ doc: " The target to be aliased.\n\n //external\n will simply not see this dependency edge. Note that this is different from omitting the\n bind rule completely: it is an error if an //external dependency\n does not have an associated bind rule.\n AndroidOptimizationInfoApi constructor."
- api_context: BZL
-}
-global {
- name: "PyInfo"
- type: "PyInfo"
- doc: "A constructor for simple value objects, known as provider instances.
This value has a dual purpose:
Create a new DataInfo = provider()\nd = DataInfo(x = 2, y = 3)\nprint(d.x + d.y) # prints 5
Note: Some providers, defined internally, do not allow instance creation DataInfo = provider()\ndef _rule_impl(ctx)\n ... ctx.attr.dep[DataInfo]
Provider using the provider function."
- api_context: BZL
-}
-global {
- name: "PyRuntimeInfo"
- type: "PyRuntimeInfo"
- doc: "A constructor for simple value objects, known as provider instances.
This value has a dual purpose:
Create a new DataInfo = provider()\nd = DataInfo(x = 2, y = 3)\nprint(d.x + d.y) # prints 5
Note: Some providers, defined internally, do not allow instance creation DataInfo = provider()\ndef _rule_impl(ctx)\n ... ctx.attr.dep[DataInfo]
Provider using the provider function."
- api_context: BZL
-}
-global {
- name: "PyWrapCcInfo"
- type: "PyWrapCcInfo"
- doc: "A constructor for simple value objects, known as provider instances.
This value has a dual purpose:
Create a new DataInfo = provider()\nd = DataInfo(x = 2, y = 3)\nprint(d.x + d.y) # prints 5
Note: Some providers, defined internally, do not allow instance creation DataInfo = provider()\ndef _rule_impl(ctx)\n ... ctx.attr.dep[DataInfo]
Provider using the provider function."
- api_context: BZL
-}
-global {
- name: "PyCcLinkParamsProvider"
- type: "PyCcLinkParamsProvider"
- doc: "A constructor for simple value objects, known as provider instances.
This value has a dual purpose:
Create a new DataInfo = provider()\nd = DataInfo(x = 2, y = 3)\nprint(d.x + d.y) # prints 5
Note: Some providers, defined internally, do not allow instance creation DataInfo = provider()\ndef _rule_impl(ctx)\n ... ctx.attr.dep[DataInfo]
Provider using the provider function."
- api_context: BZL
-}
-global {
- name: "apple_common"
- type: "apple_common"
- doc: "Functions for Starlark to access internals of the apple rule implementations."
- api_context: BZL
+ doc: "\nbind() is not recommended. See \"Consider removing bind\" for a long\ndiscussion of its issues and alternatives. In particular, consider the use of\nrepo_mapping\nrepository attributes.select() cannot be used in bind(). See the Configurable Attributes FAQ for\ndetails.//external package.//external package is not a \"normal\" package: there is no external/ directory,\n so it can be thought of as a \"virtual package\" that contains all bound targets.Examples
\n\nbind it in the WORKSPACE file. For example,\n suppose there is a java_library target called\n //third_party/javacc-v2. This can be aliased by adding the following to the\n WORKSPACE file:\nbind(\n name = \"javacc-latest\",\n actual = \"//third_party/javacc-v2\",\n)\n
\n\n//external:javacc-latest instead of\n //third_party/javacc-v2. If javacc-v3 is released, the bind rule can be\n updated and all of the BUILD files depending on //external:javacc-latest will now\n depend on javacc-v3 without needing to be edited.@my-ssl imported in the\n WORKSPACE file and it has a cc_library target //src:openssl-lib, you can\n create an alias for this target using bind:\nbind(\n name = \"openssl\",\n actual = \"@my-ssl//src:openssl-lib\",\n)\n
\n\n\ncc_library(\n name = \"sign-in\",\n srcs = [\"sign_in.cc\"],\n hdrs = [\"sign_in.h\"],\n deps = [\"//external:openssl\"],\n)\n
\n\nsign_in.cc and sign_in.h, the header files exposed by\n //external:openssl can be referred to using their path relative to their repository\n root. For example, if the rule definition for @my-ssl//src:openssl-lib looks like\n this:\ncc_library(\n name = \"openssl-lib\",\n srcs = [\"openssl.cc\"],\n hdrs = [\"openssl.h\"],\n)\n
\n\nsign_in.cc\'s includes might look like this:\n#include \"sign_in.h\"\n#include \"src/openssl.h\"\n
\n\n"
+ api_context: WORKSPACE
}
global {
- name: "testing"
- type: "testing"
- doc: "Helper methods for Starlark to access testing infrastructure."
- api_context: BZL
+ name: "local_config_platform"
+ type: "CLASS: com.google.devtools.build.lib.packages.RuleClass"
+ api_context: WORKSPACE
}
global {
- name: "coverage_common"
- type: "coverage_common"
- doc: "Helper functions to access coverage-related infrastructure."
- api_context: BZL
+ name: "local_repository"
+ type: "CLASS: com.google.devtools.build.lib.packages.RuleClass"
+ callable {
+ }
+ doc: "\nExamples
\n\n//src:openssl-lib.\nlocal_repository(\n name = \"my-ssl\",\n path = \"/home/user/ssl\",\n)\n
\n\n@my-ssl//src:openssl-lib as a dependency to depend on this\nlibrary.
This value has a dual purpose:
Create a new DataInfo = provider()\nd = DataInfo(x = 2, y = 3)\nprint(d.x + d.y) # prints 5
Note: Some providers, defined internally, do not allow instance creation DataInfo = provider()\ndef _rule_impl(ctx)\n ... ctx.attr.dep[DataInfo]
Provider using the provider function."
- api_context: BZL
+ name: "new_local_repository"
+ type: "CLASS: com.google.devtools.build.lib.packages.RuleClass"
+ callable {
+ }
+ doc: "\npath. For directories that already contain a WORKSPACE file and a BUILD file, the\nlocal_repository rule can be used.\n\nExamples
\n\n\njava_library(\n name = \"openssl\",\n srcs = glob([\'*.java\'])\n visibility = [\"//visibility:public\"],\n)\n
\n\n\nnew_local_repository(\n name = \"my-ssl\",\n path = \"/home/user/ssl\",\n build_file = \"BUILD.my-ssl\",\n)\n
\n\n@my-ssl repository that symlinks to /home/user/ssl.\nTargets can depend on this library by adding @my-ssl//:openssl to a target\'s\ndependencies.new_local_repository to include single files, not just\ndirectories. For example, suppose you had a jar file at /home/username/Downloads/piano.jar. You\ncould add just that file to your build by adding the following to your WORKSPACE file:\n\n\nnew_local_repository(\n name = \"piano\",\n path = \"/home/username/Downloads/piano.jar\",\n build_file = \"BUILD.piano\",\n)\n
\n\n\njava_import(\n name = \"play-music\",\n jars = [\"piano.jar\"],\n visibility = [\"//visibility:public\"],\n)\n
\n\nThen targets can depend on @piano//:play-music to use piano.jar.\n\n"
+ api_context: WORKSPACE
}
global {
- name: "AnalysisFailureInfo"
- type: "AnalysisFailureInfo"
- api_context: BZL
+ name: "register_execution_platforms"
+ callable {
+ param {
+ name: "*platform_labels"
+ doc: "The target patterns to register."
+ is_star_arg: true
+ }
+ }
+ doc: "Specifies already-defined execution platforms to be registered. Should be absolute target patterns (ie. beginning with either @ or //). See toolchain resolution for more information. Patterns that expand to multiple targets, such as :all, will be registered in lexicographical order by name."
+ api_context: WORKSPACE
}
global {
- name: "AnalysisTestResultInfo"
+ name: "register_toolchains"
callable {
param {
- name: "success"
- is_mandatory: true
+ name: "*toolchain_labels"
+ doc: "The target patterns to register."
+ is_star_arg: true
}
+ }
+ doc: "Specifies already-defined toolchains to be registered. Should be absolute target patterns (ie. beginning with either @ or //). See toolchain resolution for more information. Patterns that expand to multiple targets, such as :all, will be registered in lexicographical order by target name (not the name of the toolchain implementation)."
+ api_context: WORKSPACE
+}
+global {
+ name: "workspace"
+ callable {
param {
- name: "message"
+ name: "name"
+ doc: "the name of the workspace. Names must start with a letter and can only contain letters, numbers, underscores, dashes, and dots."
is_mandatory: true
}
- return_type: "AnalysisTestResultInfo"
}
- doc: "The AnalysisTestResultInfo constructor."
- api_context: BZL
+ doc: "WORKSPACE file and must be declared before all other functions in the WORKSPACE file. Each WORKSPACE file should have a workspace function.foo/bar in the local repository and the WORKSPACE file contains workspace(name = \'baz\'), then the runfile will be available under mytarget.runfiles/baz/foo/bar. If no workspace name is specified, then the runfile will be symlinked to bar.runfiles/foo/bar.maven_jar(name = \'foo\'), but not maven_jar(name = \'foo%bar\'), as Bazel would attempt to write a WORKSPACE file for the maven_jar containing workspace(name = \'foo%bar\').