Bazel Docs: Replace 7.7.1 docs with 7.7.3 docs Create documentation for the Bazel 7.7.3 release by moving the 7.7.1 docs and updating all versioned links to `/versions/7.7.3`. PiperOrigin-RevId: 1026679402 Change-Id: If6dc84ffc061313debd1ce74462b4ebf9792e1ba
diff --git a/docs/versions/7.7.1/migrate/index.mdx b/docs/versions/7.7.1/migrate/index.mdx deleted file mode 100644 index a4c2eb5..0000000 --- a/docs/versions/7.7.1/migrate/index.mdx +++ /dev/null
@@ -1,9 +0,0 @@ ---- -title: 'Migrating to Bazel' ---- - -This page links to migration guides for Bazel. - -* [Maven](/versions/7.7.1/migrate/maven) -* [Xcode](/versions/7.7.1/migrate/xcode) -* [CocoaPods](/versions/7.7.1/migrate/cocoapods)
diff --git a/docs/versions/7.7.1/reference/be/be-nav.mdx b/docs/versions/7.7.1/reference/be/be-nav.mdx deleted file mode 100644 index 0defe6e..0000000 --- a/docs/versions/7.7.1/reference/be/be-nav.mdx +++ /dev/null
@@ -1,32 +0,0 @@ -\*\*Build Encyclopedia\*\* - -* [Overview](/versions/7.7.1/reference/be/overview) -* [Concepts](#be-menu) - + [Common Definitions](/versions/7.7.1/reference/be/common-definitions) - + ["Make" variables](/versions/7.7.1/reference/be/make-variables) -* [Rules](#be-rules) - + [Functions](/versions/7.7.1/reference/be/functions) - + [Android](/versions/7.7.1/reference/be/android) - + [C / C++](/versions/7.7.1/reference/be/c-cpp) - + [Java](/versions/7.7.1/reference/be/java) - + [Objective-C](/versions/7.7.1/reference/be/objective-c) - + [Protocol Buffer](/versions/7.7.1/reference/be/protocol-buffer) - + [Python](/versions/7.7.1/reference/be/python) - + [Shell](/versions/7.7.1/reference/be/shell) - + [Extra Actions](/versions/7.7.1/reference/be/extra-actions) - + [General](/versions/7.7.1/reference/be/general) - + [Platforms and Toolchains](/versions/7.7.1/reference/be/platforms-and-toolchains) - + [Workspace](/versions/7.7.1/reference/be/workspace) - + [AppEngine](https://github.com/bazelbuild/rules_appengine) - + [Apple (Swift, iOS, macOS, tvOS, visionOS, watchOS)](https://github.com/bazelbuild/rules_apple) - + [C#](https://github.com/bazelbuild/rules_dotnet) - + [D](https://github.com/bazelbuild/rules_d) - + [Docker](https://github.com/bazelbuild/rules_docker) - + [Groovy](https://github.com/bazelbuild/rules_groovy) - + [Go](https://github.com/bazelbuild/rules_go) - + [JavaScript (Closure)](https://github.com/bazelbuild/rules_closure) - + [Jsonnet](https://github.com/bazelbuild/rules_jsonnet) - + [Packaging](/versions/7.7.1/reference/be/pkg) - + [Rust](https://github.com/bazelbuild/rules_rust) - + [Sass](https://github.com/bazelbuild/rules_sass) - + [Scala](https://github.com/bazelbuild/rules_scala) \ No newline at end of file
diff --git a/docs/versions/7.7.1/reference/be/overview.mdx b/docs/versions/7.7.1/reference/be/overview.mdx deleted file mode 100644 index 7b31ca5..0000000 --- a/docs/versions/7.7.1/reference/be/overview.mdx +++ /dev/null
@@ -1,55 +0,0 @@ ---- -title: 'Bazel BUILD Encyclopedia of Functions' ---- - -## Concepts and terminology - -* [Common definitions](/versions/7.7.1/reference/be/common-definitions) - + [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization) - + [Label expansion](/versions/7.7.1/reference/be/common-definitions#label-expansion) - + [Typical attributes for most rules](/versions/7.7.1/reference/be/common-definitions#typical-attributes) - + [Common attributes for all rules](/versions/7.7.1/reference/be/common-definitions#common-attributes) - + [Common attributes for tests](/versions/7.7.1/reference/be/common-definitions#common-attributes-tests) - + [Common attributes for binaries](/versions/7.7.1/reference/be/common-definitions#common-attributes-binaries) - + [Configurable attributes](/versions/7.7.1/reference/be/common-definitions#configurable-attributes) - + [Implicit output targets](/versions/7.7.1/reference/be/common-definitions#implicit-outputs) -* ["Make" variables](/versions/7.7.1/reference/be/make-variables) - + [Use](/versions/7.7.1/reference/be/make-variables#use) - -## Functions - -* [package](/versions/7.7.1/reference/be/functions#package) -* [package\_group](/versions/7.7.1/reference/be/functions#package_group) -* [exports\_files](/versions/7.7.1/reference/be/functions#exports_files) -* [glob](/versions/7.7.1/reference/be/functions#glob) -* [select](/versions/7.7.1/reference/be/functions#select) -* [workspace](/versions/7.7.1/rules/lib/globals/workspace#workspace) - -## Rules - -Native rules ship with the Bazel binary and do not require a `load` statement. -Native rules are available globally in BUILD files. In .bzl files, you can find them in -the `native` module. -For non-native Starlark rules that ship separately from Bazel, see the list of -[recommended rules](/versions/7.7.1/rules/rules#recommended-rules). - -### Language-specific native rules - -| Language | Binary rules | Library rules | Test rules | Other rules | -| --- | --- | --- | --- | --- | -| Android | [android\_binary](/versions/7.7.1/reference/be/android#android_binary) | [aar\_import](/versions/7.7.1/reference/be/android#aar_import) [android\_library](/versions/7.7.1/reference/be/android#android_library) | [android\_instrumentation\_test](/versions/7.7.1/reference/be/android#android_instrumentation_test) [android\_local\_test](/versions/7.7.1/reference/be/android#android_local_test) | [android\_device](/versions/7.7.1/reference/be/android#android_device) [android\_ndk\_repository](/versions/7.7.1/reference/be/android#android_ndk_repository) [android\_sdk\_repository](/versions/7.7.1/reference/be/android#android_sdk_repository) | -| C / C++ | [cc\_binary](/versions/7.7.1/reference/be/c-cpp#cc_binary) | [cc\_import](/versions/7.7.1/reference/be/c-cpp#cc_import) [cc\_library](/versions/7.7.1/reference/be/c-cpp#cc_library) [cc\_proto\_library](/versions/7.7.1/reference/be/c-cpp#cc_proto_library) [cc\_shared\_library](/versions/7.7.1/reference/be/c-cpp#cc_shared_library) [cc\_static\_library](/versions/7.7.1/reference/be/c-cpp#cc_static_library) [fdo\_prefetch\_hints](/versions/7.7.1/reference/be/c-cpp#fdo_prefetch_hints) [fdo\_profile](/versions/7.7.1/reference/be/c-cpp#fdo_profile) [memprof\_profile](/versions/7.7.1/reference/be/c-cpp#memprof_profile) [propeller\_optimize](/versions/7.7.1/reference/be/c-cpp#propeller_optimize) | [cc\_test](/versions/7.7.1/reference/be/c-cpp#cc_test) | [cc\_toolchain](/versions/7.7.1/reference/be/c-cpp#cc_toolchain) [cc\_toolchain\_suite](/versions/7.7.1/reference/be/c-cpp#cc_toolchain_suite) | -| Java | [java\_binary](/versions/7.7.1/reference/be/java#java_binary) | [java\_import](/versions/7.7.1/reference/be/java#java_import) [java\_library](/versions/7.7.1/reference/be/java#java_library) [java\_lite\_proto\_library](/versions/7.7.1/reference/be/java#java_lite_proto_library) [java\_proto\_library](/versions/7.7.1/reference/be/java#java_proto_library) | [java\_test](/versions/7.7.1/reference/be/java#java_test) | [java\_package\_configuration](/versions/7.7.1/reference/be/java#java_package_configuration) [java\_plugin](/versions/7.7.1/reference/be/java#java_plugin) [java\_runtime](/versions/7.7.1/reference/be/java#java_runtime) [java\_toolchain](/versions/7.7.1/reference/be/java#java_toolchain) | -| Objective-C | | [j2objc\_library](/versions/7.7.1/reference/be/objective-c#j2objc_library) [objc\_import](/versions/7.7.1/reference/be/objective-c#objc_import) [objc\_library](/versions/7.7.1/reference/be/objective-c#objc_library) | | [available\_xcodes](/versions/7.7.1/reference/be/objective-c#available_xcodes) [xcode\_config](/versions/7.7.1/reference/be/objective-c#xcode_config) [xcode\_version](/versions/7.7.1/reference/be/objective-c#xcode_version) | -| Protocol Buffer | | [proto\_lang\_toolchain](/versions/7.7.1/reference/be/protocol-buffer#proto_lang_toolchain) [proto\_library](/versions/7.7.1/reference/be/protocol-buffer#proto_library) | | | -| Python | [py\_binary](/versions/7.7.1/reference/be/python#py_binary) | [py\_library](/versions/7.7.1/reference/be/python#py_library) | [py\_test](/versions/7.7.1/reference/be/python#py_test) | [py\_runtime](/versions/7.7.1/reference/be/python#py_runtime) | -| Shell | [sh\_binary](/versions/7.7.1/reference/be/shell#sh_binary) | [sh\_library](/versions/7.7.1/reference/be/shell#sh_library) | [sh\_test](/versions/7.7.1/reference/be/shell#sh_test) | | - -### Language-agnostic native rules - -| Family | Rules | -| --- | --- | -| Extra Actions | * [action\_listener](/versions/7.7.1/reference/be/extra-actions#action_listener)* [extra\_action](/versions/7.7.1/reference/be/extra-actions#extra_action) | -| General | * [alias](/versions/7.7.1/reference/be/general#alias)* [config\_setting](/versions/7.7.1/reference/be/general#config_setting)* [filegroup](/versions/7.7.1/reference/be/general#filegroup)* [genquery](/versions/7.7.1/reference/be/general#genquery)* [genrule](/versions/7.7.1/reference/be/general#genrule)* [starlark\_doc\_extract](/versions/7.7.1/reference/be/general#starlark_doc_extract)* [test\_suite](/versions/7.7.1/reference/be/general#test_suite) | -| Platforms and Toolchains | * [constraint\_setting](/versions/7.7.1/reference/be/platforms-and-toolchains#constraint_setting)* [constraint\_value](/versions/7.7.1/reference/be/platforms-and-toolchains#constraint_value)* [platform](/versions/7.7.1/reference/be/platforms-and-toolchains#platform)* [toolchain](/versions/7.7.1/reference/be/platforms-and-toolchains#toolchain)* [toolchain\_type](/versions/7.7.1/reference/be/platforms-and-toolchains#toolchain_type) | -| Workspace | * [bind](/versions/7.7.1/reference/be/workspace#bind)* [local\_repository](/versions/7.7.1/reference/be/workspace#local_repository)* [new\_local\_repository](/versions/7.7.1/reference/be/workspace#new_local_repository) | \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/index.mdx b/docs/versions/7.7.1/rules/index.mdx deleted file mode 100644 index 8d61fcf..0000000 --- a/docs/versions/7.7.1/rules/index.mdx +++ /dev/null
@@ -1,83 +0,0 @@ ---- -title: 'Rules' ---- - -The Bazel ecosystem has a growing and evolving set of rules to support popular -languages and packages. Much of Bazel's strength comes from the ability to -[define new rules](/versions/7.7.1/extending/concepts) that can be used by others. - -This page describes the recommended, native, and non-native Bazel rules. - -## Recommended rules {#recommended-rules} - -Here is a selection of recommended rules: - -* [Android](/versions/7.7.1/docs/bazel-and-android) -* [C / C++](/versions/7.7.1/docs/bazel-and-cpp) -* [Docker/OCI](https://github.com/bazel-contrib/rules_oci) -* [Go](https://github.com/bazelbuild/rules_go) -* [Haskell](https://github.com/tweag/rules_haskell) -* [Java](/versions/7.7.1/docs/bazel-and-java) -* [JavaScript / NodeJS](https://github.com/bazelbuild/rules_nodejs) -* [Kubernetes](https://github.com/bazelbuild/rules_k8s) -* [Maven dependency management](https://github.com/bazelbuild/rules_jvm_external) -* [Objective-C](/versions/7.7.1/docs/bazel-and-apple) -* [Package building](https://github.com/bazelbuild/rules_pkg) -* [Protocol Buffers](https://github.com/bazelbuild/rules_proto#protobuf-rules-for-bazel) -* [Python](https://github.com/bazelbuild/rules_python) -* [Scala](https://github.com/bazelbuild/rules_scala) -* [Shell](/versions/7.7.1/reference/be/shell) -* [Webtesting](https://github.com/bazelbuild/rules_webtesting) (Webdriver) - -The repository [Skylib](https://github.com/bazelbuild/bazel-skylib) contains -additional functions that can be useful when writing new rules and new -macros. - -The rules above were reviewed and follow our -[requirements for recommended rules](/versions/7.7.1/community/recommended-rules). -Contact the respective rule set's maintainers regarding issues and feature -requests. - -To find more Bazel rules, use a search engine, take a look on -[awesomebazel.com](https://awesomebazel.com/), or search on -[GitHub](https://github.com/search?o=desc&q=bazel+rules&s=stars&type=Repositories). - -## Native rules that do not apply to a specific programming language - -Native rules are shipped with the Bazel binary, they are always available in -BUILD files without a `load` statement. - -* Extra actions - - [`extra_action`](/versions/7.7.1/reference/be/extra-actions#extra_action) - - [`action_listener`](/versions/7.7.1/reference/be/extra-actions#action_listener) -* General - - [`filegroup`](/versions/7.7.1/reference/be/general#filegroup) - - [`genquery`](/versions/7.7.1/reference/be/general#genquery) - - [`test_suite`](/versions/7.7.1/reference/be/general#test_suite) - - [`alias`](/versions/7.7.1/reference/be/general#alias) - - [`config_setting`](/versions/7.7.1/reference/be/general#config_setting) - - [`genrule`](/versions/7.7.1/reference/be/general#genrule) -* Platform - - [`constraint_setting`](/versions/7.7.1/reference/be/platforms-and-toolchains#constraint_setting) - - [`constraint_value`](/versions/7.7.1/reference/be/platforms-and-toolchains#constraint_value) - - [`platform`](/versions/7.7.1/reference/be/platforms-and-toolchains#platform) - - [`toolchain`](/versions/7.7.1/reference/be/platforms-and-toolchains#toolchain) - - [`toolchain_type`](/versions/7.7.1/reference/be/platforms-and-toolchains#toolchain_type) -* Workspace - - [`bind`](/versions/7.7.1/reference/be/workspace#bind) - - [`local_repository`](/versions/7.7.1/reference/be/workspace#local_repository) - - [`new_local_repository`](/versions/7.7.1/reference/be/workspace#new_local_repository) - - [`xcode_config`](/versions/7.7.1/reference/be/objective-c#xcode_config) - - [`xcode_version`](/versions/7.7.1/reference/be/objective-c#xcode_version) - -## Embedded non-native rules {#embedded-rules} - -Bazel also embeds additional rules written in [Starlark](/versions/7.7.1/rules/language). Those can be loaded from -the `@bazel_tools` built-in external repository. - -* Repository rules - - [`git_repository`](/versions/7.7.1/rules/lib/repo/git#git_repository) - - [`http_archive`](/versions/7.7.1/rules/lib/repo/http#http_archive) - - [`http_file`](/versions/7.7.1/rules/lib/repo/http#http_archive) - - [`http_jar`](/versions/7.7.1/rules/lib/repo/http#http_jar) - - [Utility functions on patching](/versions/7.7.1/rules/lib/repo/utils)
diff --git a/docs/versions/7.7.1/rules/lib/builtins.mdx b/docs/versions/7.7.1/rules/lib/builtins.mdx deleted file mode 100644 index 5f861fa..0000000 --- a/docs/versions/7.7.1/rules/lib/builtins.mdx +++ /dev/null
@@ -1,62 +0,0 @@ ---- -title: 'Built-in Types' ---- - -This section lists types of Starlark objects. With some exceptions, these type names are not valid Starlark symbols; instances of them may be acquired through different means. - -* [Action](/versions/7.7.1/rules/lib/builtins/Action) -* [actions](/versions/7.7.1/rules/lib/builtins/actions) -* [apple\_platform](/versions/7.7.1/rules/lib/builtins/apple_platform) -* [apple\_platform\_type](/versions/7.7.1/rules/lib/builtins/apple_platform_type) -* [apple\_toolchain](/versions/7.7.1/rules/lib/builtins/apple_toolchain) -* [Args](/versions/7.7.1/rules/lib/builtins/Args) -* [Aspect](/versions/7.7.1/rules/lib/builtins/Aspect) -* [Attribute](/versions/7.7.1/rules/lib/builtins/Attribute) -* [bazel\_module](/versions/7.7.1/rules/lib/builtins/bazel_module) -* [bazel\_module\_tags](/versions/7.7.1/rules/lib/builtins/bazel_module_tags) -* [BuildSetting](/versions/7.7.1/rules/lib/builtins/BuildSetting) -* [CcCompilationOutputs](/versions/7.7.1/rules/lib/builtins/CcCompilationOutputs) -* [CcLinkingOutputs](/versions/7.7.1/rules/lib/builtins/CcLinkingOutputs) -* [CompilationContext](/versions/7.7.1/rules/lib/builtins/CompilationContext) -* [configuration](/versions/7.7.1/rules/lib/builtins/configuration) -* [ctx](/versions/7.7.1/rules/lib/builtins/ctx) -* [depset](/versions/7.7.1/rules/lib/builtins/depset) -* [DirectoryExpander](/versions/7.7.1/rules/lib/builtins/DirectoryExpander) -* [DottedVersion](/versions/7.7.1/rules/lib/builtins/DottedVersion) -* [exec\_result](/versions/7.7.1/rules/lib/builtins/exec_result) -* [ExecGroupCollection](/versions/7.7.1/rules/lib/builtins/ExecGroupCollection) -* [ExecGroupContext](/versions/7.7.1/rules/lib/builtins/ExecGroupContext) -* [ExecTransitionFactory](/versions/7.7.1/rules/lib/builtins/ExecTransitionFactory) -* [extension\_metadata](/versions/7.7.1/rules/lib/builtins/extension_metadata) -* [FeatureConfiguration](/versions/7.7.1/rules/lib/builtins/FeatureConfiguration) -* [File](/versions/7.7.1/rules/lib/builtins/File) -* [fragments](/versions/7.7.1/rules/lib/builtins/fragments) -* [java\_annotation\_processing](/versions/7.7.1/rules/lib/builtins/java_annotation_processing) -* [Label](/versions/7.7.1/rules/lib/builtins/Label) -* [LateBoundDefault](/versions/7.7.1/rules/lib/builtins/LateBoundDefault) -* [LibraryToLink](/versions/7.7.1/rules/lib/builtins/LibraryToLink) -* [License](/versions/7.7.1/rules/lib/builtins/License) -* [LinkerInput](/versions/7.7.1/rules/lib/builtins/LinkerInput) -* [LinkingContext](/versions/7.7.1/rules/lib/builtins/LinkingContext) -* [mapped\_root](/versions/7.7.1/rules/lib/builtins/mapped_root) -* [module\_ctx](/versions/7.7.1/rules/lib/builtins/module_ctx) -* [native\_rule\_transition](/versions/7.7.1/rules/lib/builtins/native_rule_transition) -* [path](/versions/7.7.1/rules/lib/builtins/path) -* [Provider](/versions/7.7.1/rules/lib/builtins/Provider) -* [repository\_ctx](/versions/7.7.1/rules/lib/builtins/repository_ctx) -* [repository\_os](/versions/7.7.1/rules/lib/builtins/repository_os) -* [repository\_rule](/versions/7.7.1/rules/lib/builtins/repository_rule) -* [root](/versions/7.7.1/rules/lib/builtins/root) -* [rule](/versions/7.7.1/rules/lib/builtins/rule) -* [rule\_attributes](/versions/7.7.1/rules/lib/builtins/rule_attributes) -* [runfiles](/versions/7.7.1/rules/lib/builtins/runfiles) -* [struct](/versions/7.7.1/rules/lib/builtins/struct) -* [Subrule](/versions/7.7.1/rules/lib/builtins/Subrule) -* [subrule\_ctx](/versions/7.7.1/rules/lib/builtins/subrule_ctx) -* [SymlinkEntry](/versions/7.7.1/rules/lib/builtins/SymlinkEntry) -* [tag\_class](/versions/7.7.1/rules/lib/builtins/tag_class) -* [Target](/versions/7.7.1/rules/lib/builtins/Target) -* [TemplateDict](/versions/7.7.1/rules/lib/builtins/TemplateDict) -* [toolchain\_type](/versions/7.7.1/rules/lib/builtins/toolchain_type) -* [ToolchainContext](/versions/7.7.1/rules/lib/builtins/ToolchainContext) -* [transition](/versions/7.7.1/rules/lib/builtins/transition) \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/builtins/Attribute.mdx b/docs/versions/7.7.1/rules/lib/builtins/Attribute.mdx deleted file mode 100644 index c44de64..0000000 --- a/docs/versions/7.7.1/rules/lib/builtins/Attribute.mdx +++ /dev/null
@@ -1,5 +0,0 @@ ---- -title: 'Attribute' ---- - -Representation of a definition of an attribute. Use the [attr](/versions/7.7.1/rules/lib/toplevel/attr) module to create an Attribute. They are only for use with a [rule](/versions/7.7.1/rules/lib/globals/bzl#rule) or an [aspect](/versions/7.7.1/rules/lib/globals/bzl#aspect). \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/core.mdx b/docs/versions/7.7.1/rules/lib/core.mdx deleted file mode 100644 index 7b7ac2b..0000000 --- a/docs/versions/7.7.1/rules/lib/core.mdx +++ /dev/null
@@ -1,17 +0,0 @@ ---- -title: 'Core Starlark data types' ---- - -This section lists the data types of the [Starlark core language](https://github.com/bazelbuild/starlark/blob/master/spec.md#built-in-constants-and-functions). With some exceptions, these type names are not valid Starlark symbols; instances of them may be acquired through different means. - -* [bool](/versions/7.7.1/rules/lib/core/bool) -* [builtin\_function\_or\_method](/versions/7.7.1/rules/lib/core/builtin_function_or_method) -* [dict](/versions/7.7.1/rules/lib/core/dict) -* [float](/versions/7.7.1/rules/lib/core/float) -* [function](/versions/7.7.1/rules/lib/core/function) -* [int](/versions/7.7.1/rules/lib/core/int) -* [json](/versions/7.7.1/rules/lib/core/json) -* [list](/versions/7.7.1/rules/lib/core/list) -* [range](/versions/7.7.1/rules/lib/core/range) -* [string](/versions/7.7.1/rules/lib/core/string) -* [tuple](/versions/7.7.1/rules/lib/core/tuple) \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/fragments.mdx b/docs/versions/7.7.1/rules/lib/fragments.mdx deleted file mode 100644 index da46b61..0000000 --- a/docs/versions/7.7.1/rules/lib/fragments.mdx +++ /dev/null
@@ -1,20 +0,0 @@ ---- -title: 'Configuration Fragments' ---- - -Configuration fragments give rules access to language-specific parts of [configuration](/versions/7.7.1/rules/lib/builtins/configuration). - -Rule implementations can get them using `ctx.fragments.[fragment name]` - -* [apple](/versions/7.7.1/rules/lib/fragments/apple) -* [bazel\_android](/versions/7.7.1/rules/lib/fragments/bazel_android) -* [bazel\_py](/versions/7.7.1/rules/lib/fragments/bazel_py) -* [coverage](/versions/7.7.1/rules/lib/fragments/coverage) -* [cpp](/versions/7.7.1/rules/lib/fragments/cpp) -* [j2objc](/versions/7.7.1/rules/lib/fragments/j2objc) -* [java](/versions/7.7.1/rules/lib/fragments/java) -* [objc](/versions/7.7.1/rules/lib/fragments/objc) -* [platform](/versions/7.7.1/rules/lib/fragments/platform) -* [proto](/versions/7.7.1/rules/lib/fragments/proto) -* [py](/versions/7.7.1/rules/lib/fragments/py) -* [swift](/versions/7.7.1/rules/lib/fragments/swift) \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/globals.mdx b/docs/versions/7.7.1/rules/lib/globals.mdx deleted file mode 100644 index 0e84fba..0000000 --- a/docs/versions/7.7.1/rules/lib/globals.mdx +++ /dev/null
@@ -1,12 +0,0 @@ ---- -title: 'Global functions' ---- - -This section lists the global functions available in Starlark. The list of available functions differs depending on the file type (whether a BUILD file, or a .bzl file, etc). - -* [.bzl files](/versions/7.7.1/rules/lib/globals/bzl) -* [All Bazel files](/versions/7.7.1/rules/lib/globals/all) -* [BUILD files](/versions/7.7.1/rules/lib/globals/build) -* [MODULE.bazel files](/versions/7.7.1/rules/lib/globals/module) -* [VENDOR.bazel files](/versions/7.7.1/rules/lib/globals/vendor) -* [WORKSPACE files](/versions/7.7.1/rules/lib/globals/workspace) \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/overview.mdx b/docs/versions/7.7.1/rules/lib/overview.mdx deleted file mode 100644 index 4a859c9..0000000 --- a/docs/versions/7.7.1/rules/lib/overview.mdx +++ /dev/null
@@ -1,157 +0,0 @@ ---- -title: 'One-Page Overview' ---- - -## [Global functions](/versions/7.7.1/rules/lib/globals) - -* [.bzl files](/versions/7.7.1/rules/lib/globals/bzl) -* [All Bazel files](/versions/7.7.1/rules/lib/globals/all) -* [BUILD files](/versions/7.7.1/rules/lib/globals/build) -* [MODULE.bazel files](/versions/7.7.1/rules/lib/globals/module) -* [VENDOR.bazel files](/versions/7.7.1/rules/lib/globals/vendor) -* [WORKSPACE files](/versions/7.7.1/rules/lib/globals/workspace) - -## [Configuration Fragments](/versions/7.7.1/rules/lib/fragments) - -* [apple](/versions/7.7.1/rules/lib/fragments/apple) -* [bazel\_android](/versions/7.7.1/rules/lib/fragments/bazel_android) -* [bazel\_py](/versions/7.7.1/rules/lib/fragments/bazel_py) -* [coverage](/versions/7.7.1/rules/lib/fragments/coverage) -* [cpp](/versions/7.7.1/rules/lib/fragments/cpp) -* [j2objc](/versions/7.7.1/rules/lib/fragments/j2objc) -* [java](/versions/7.7.1/rules/lib/fragments/java) -* [objc](/versions/7.7.1/rules/lib/fragments/objc) -* [platform](/versions/7.7.1/rules/lib/fragments/platform) -* [proto](/versions/7.7.1/rules/lib/fragments/proto) -* [py](/versions/7.7.1/rules/lib/fragments/py) -* [swift](/versions/7.7.1/rules/lib/fragments/swift) - -## [Providers](/versions/7.7.1/rules/lib/providers) - -* [AnalysisTestResultInfo](/versions/7.7.1/rules/lib/providers/AnalysisTestResultInfo) -* [AndroidNeverLinkLibrariesProvider](/versions/7.7.1/rules/lib/providers/AndroidNeverLinkLibrariesProvider) -* [AppleDebugOutputs](/versions/7.7.1/rules/lib/providers/AppleDebugOutputs) -* [AppleDynamicFramework](/versions/7.7.1/rules/lib/providers/AppleDynamicFramework) -* [AppleExecutableBinary](/versions/7.7.1/rules/lib/providers/AppleExecutableBinary) -* [BaselineProfileProvider](/versions/7.7.1/rules/lib/providers/BaselineProfileProvider) -* [CcInfo](/versions/7.7.1/rules/lib/providers/CcInfo) -* [CcToolchainConfigInfo](/versions/7.7.1/rules/lib/providers/CcToolchainConfigInfo) -* [CcToolchainInfo](/versions/7.7.1/rules/lib/providers/CcToolchainInfo) -* [ConstraintCollection](/versions/7.7.1/rules/lib/providers/ConstraintCollection) -* [ConstraintSettingInfo](/versions/7.7.1/rules/lib/providers/ConstraintSettingInfo) -* [ConstraintValueInfo](/versions/7.7.1/rules/lib/providers/ConstraintValueInfo) -* [DebugPackageInfo](/versions/7.7.1/rules/lib/providers/DebugPackageInfo) -* [DefaultInfo](/versions/7.7.1/rules/lib/providers/DefaultInfo) -* [ExecutionInfo](/versions/7.7.1/rules/lib/providers/ExecutionInfo) -* [FeatureFlagInfo](/versions/7.7.1/rules/lib/providers/FeatureFlagInfo) -* [file\_provider](/versions/7.7.1/rules/lib/providers/file_provider) -* [FilesToRunProvider](/versions/7.7.1/rules/lib/providers/FilesToRunProvider) -* [GeneratedExtensionRegistryProvider](/versions/7.7.1/rules/lib/providers/GeneratedExtensionRegistryProvider) -* [IncompatiblePlatformProvider](/versions/7.7.1/rules/lib/providers/IncompatiblePlatformProvider) -* [InstrumentedFilesInfo](/versions/7.7.1/rules/lib/providers/InstrumentedFilesInfo) -* [java\_compilation\_info](/versions/7.7.1/rules/lib/providers/java_compilation_info) -* [java\_output\_jars](/versions/7.7.1/rules/lib/providers/java_output_jars) -* [JavaRuntimeInfo](/versions/7.7.1/rules/lib/providers/JavaRuntimeInfo) -* [JavaToolchainInfo](/versions/7.7.1/rules/lib/providers/JavaToolchainInfo) -* [ObjcProvider](/versions/7.7.1/rules/lib/providers/ObjcProvider) -* [OutputGroupInfo](/versions/7.7.1/rules/lib/providers/OutputGroupInfo) -* [PackageSpecificationInfo](/versions/7.7.1/rules/lib/providers/PackageSpecificationInfo) -* [PlatformInfo](/versions/7.7.1/rules/lib/providers/PlatformInfo) -* [ProguardSpecProvider](/versions/7.7.1/rules/lib/providers/ProguardSpecProvider) -* [ProtoRegistryProvider](/versions/7.7.1/rules/lib/providers/ProtoRegistryProvider) -* [PyInfo](/versions/7.7.1/rules/lib/providers/PyInfo) -* [PyRuntimeInfo](/versions/7.7.1/rules/lib/providers/PyRuntimeInfo) -* [RunEnvironmentInfo](/versions/7.7.1/rules/lib/providers/RunEnvironmentInfo) -* [TemplateVariableInfo](/versions/7.7.1/rules/lib/providers/TemplateVariableInfo) -* [ToolchainInfo](/versions/7.7.1/rules/lib/providers/ToolchainInfo) -* [ToolchainTypeInfo](/versions/7.7.1/rules/lib/providers/ToolchainTypeInfo) -* [XcodeProperties](/versions/7.7.1/rules/lib/providers/XcodeProperties) -* [XcodeVersionConfig](/versions/7.7.1/rules/lib/providers/XcodeVersionConfig) - -## [Built-in Types](/versions/7.7.1/rules/lib/builtins) - -* [Action](/versions/7.7.1/rules/lib/builtins/Action) -* [actions](/versions/7.7.1/rules/lib/builtins/actions) -* [apple\_platform](/versions/7.7.1/rules/lib/builtins/apple_platform) -* [apple\_platform\_type](/versions/7.7.1/rules/lib/builtins/apple_platform_type) -* [apple\_toolchain](/versions/7.7.1/rules/lib/builtins/apple_toolchain) -* [Args](/versions/7.7.1/rules/lib/builtins/Args) -* [Aspect](/versions/7.7.1/rules/lib/builtins/Aspect) -* [Attribute](/versions/7.7.1/rules/lib/builtins/Attribute) -* [bazel\_module](/versions/7.7.1/rules/lib/builtins/bazel_module) -* [bazel\_module\_tags](/versions/7.7.1/rules/lib/builtins/bazel_module_tags) -* [BuildSetting](/versions/7.7.1/rules/lib/builtins/BuildSetting) -* [CcCompilationOutputs](/versions/7.7.1/rules/lib/builtins/CcCompilationOutputs) -* [CcLinkingOutputs](/versions/7.7.1/rules/lib/builtins/CcLinkingOutputs) -* [CompilationContext](/versions/7.7.1/rules/lib/builtins/CompilationContext) -* [configuration](/versions/7.7.1/rules/lib/builtins/configuration) -* [ctx](/versions/7.7.1/rules/lib/builtins/ctx) -* [depset](/versions/7.7.1/rules/lib/builtins/depset) -* [DirectoryExpander](/versions/7.7.1/rules/lib/builtins/DirectoryExpander) -* [DottedVersion](/versions/7.7.1/rules/lib/builtins/DottedVersion) -* [exec\_result](/versions/7.7.1/rules/lib/builtins/exec_result) -* [ExecGroupCollection](/versions/7.7.1/rules/lib/builtins/ExecGroupCollection) -* [ExecGroupContext](/versions/7.7.1/rules/lib/builtins/ExecGroupContext) -* [ExecTransitionFactory](/versions/7.7.1/rules/lib/builtins/ExecTransitionFactory) -* [extension\_metadata](/versions/7.7.1/rules/lib/builtins/extension_metadata) -* [FeatureConfiguration](/versions/7.7.1/rules/lib/builtins/FeatureConfiguration) -* [File](/versions/7.7.1/rules/lib/builtins/File) -* [fragments](/versions/7.7.1/rules/lib/builtins/fragments) -* [java\_annotation\_processing](/versions/7.7.1/rules/lib/builtins/java_annotation_processing) -* [Label](/versions/7.7.1/rules/lib/builtins/Label) -* [LateBoundDefault](/versions/7.7.1/rules/lib/builtins/LateBoundDefault) -* [LibraryToLink](/versions/7.7.1/rules/lib/builtins/LibraryToLink) -* [License](/versions/7.7.1/rules/lib/builtins/License) -* [LinkerInput](/versions/7.7.1/rules/lib/builtins/LinkerInput) -* [LinkingContext](/versions/7.7.1/rules/lib/builtins/LinkingContext) -* [mapped\_root](/versions/7.7.1/rules/lib/builtins/mapped_root) -* [module\_ctx](/versions/7.7.1/rules/lib/builtins/module_ctx) -* [native\_rule\_transition](/versions/7.7.1/rules/lib/builtins/native_rule_transition) -* [path](/versions/7.7.1/rules/lib/builtins/path) -* [Provider](/versions/7.7.1/rules/lib/builtins/Provider) -* [repository\_ctx](/versions/7.7.1/rules/lib/builtins/repository_ctx) -* [repository\_os](/versions/7.7.1/rules/lib/builtins/repository_os) -* [repository\_rule](/versions/7.7.1/rules/lib/builtins/repository_rule) -* [root](/versions/7.7.1/rules/lib/builtins/root) -* [rule](/versions/7.7.1/rules/lib/builtins/rule) -* [rule\_attributes](/versions/7.7.1/rules/lib/builtins/rule_attributes) -* [runfiles](/versions/7.7.1/rules/lib/builtins/runfiles) -* [struct](/versions/7.7.1/rules/lib/builtins/struct) -* [Subrule](/versions/7.7.1/rules/lib/builtins/Subrule) -* [subrule\_ctx](/versions/7.7.1/rules/lib/builtins/subrule_ctx) -* [SymlinkEntry](/versions/7.7.1/rules/lib/builtins/SymlinkEntry) -* [tag\_class](/versions/7.7.1/rules/lib/builtins/tag_class) -* [Target](/versions/7.7.1/rules/lib/builtins/Target) -* [TemplateDict](/versions/7.7.1/rules/lib/builtins/TemplateDict) -* [toolchain\_type](/versions/7.7.1/rules/lib/builtins/toolchain_type) -* [ToolchainContext](/versions/7.7.1/rules/lib/builtins/ToolchainContext) -* [transition](/versions/7.7.1/rules/lib/builtins/transition) - -## [Top-level Modules](/versions/7.7.1/rules/lib/toplevel) - -* [apple\_common](/versions/7.7.1/rules/lib/toplevel/apple_common) -* [attr](/versions/7.7.1/rules/lib/toplevel/attr) -* [cc\_common](/versions/7.7.1/rules/lib/toplevel/cc_common) -* [config](/versions/7.7.1/rules/lib/toplevel/config) -* [config\_common](/versions/7.7.1/rules/lib/toplevel/config_common) -* [coverage\_common](/versions/7.7.1/rules/lib/toplevel/coverage_common) -* [java\_common](/versions/7.7.1/rules/lib/toplevel/java_common) -* [native](/versions/7.7.1/rules/lib/toplevel/native) -* [platform\_common](/versions/7.7.1/rules/lib/toplevel/platform_common) -* [proto](/versions/7.7.1/rules/lib/toplevel/proto) -* [proto\_common](/versions/7.7.1/rules/lib/toplevel/proto_common) -* [testing](/versions/7.7.1/rules/lib/toplevel/testing) - -## [Core Starlark data types](/versions/7.7.1/rules/lib/core) - -* [bool](/versions/7.7.1/rules/lib/core/bool) -* [builtin\_function\_or\_method](/versions/7.7.1/rules/lib/core/builtin_function_or_method) -* [dict](/versions/7.7.1/rules/lib/core/dict) -* [float](/versions/7.7.1/rules/lib/core/float) -* [function](/versions/7.7.1/rules/lib/core/function) -* [int](/versions/7.7.1/rules/lib/core/int) -* [json](/versions/7.7.1/rules/lib/core/json) -* [list](/versions/7.7.1/rules/lib/core/list) -* [range](/versions/7.7.1/rules/lib/core/range) -* [string](/versions/7.7.1/rules/lib/core/string) -* [tuple](/versions/7.7.1/rules/lib/core/tuple) \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/providers.mdx b/docs/versions/7.7.1/rules/lib/providers.mdx deleted file mode 100644 index 1775004..0000000 --- a/docs/versions/7.7.1/rules/lib/providers.mdx +++ /dev/null
@@ -1,45 +0,0 @@ ---- -title: 'Providers' ---- - -This section lists providers available on built-in rules. See the [Rules page](https://bazel.build/versions/7.7.1/extending/rules#providers) for more on providers. These symbols are available only in .bzl files. - -* [AnalysisTestResultInfo](/versions/7.7.1/rules/lib/providers/AnalysisTestResultInfo) -* [AndroidNeverLinkLibrariesProvider](/versions/7.7.1/rules/lib/providers/AndroidNeverLinkLibrariesProvider) -* [AppleDebugOutputs](/versions/7.7.1/rules/lib/providers/AppleDebugOutputs) -* [AppleDynamicFramework](/versions/7.7.1/rules/lib/providers/AppleDynamicFramework) -* [AppleExecutableBinary](/versions/7.7.1/rules/lib/providers/AppleExecutableBinary) -* [BaselineProfileProvider](/versions/7.7.1/rules/lib/providers/BaselineProfileProvider) -* [CcInfo](/versions/7.7.1/rules/lib/providers/CcInfo) -* [CcToolchainConfigInfo](/versions/7.7.1/rules/lib/providers/CcToolchainConfigInfo) -* [CcToolchainInfo](/versions/7.7.1/rules/lib/providers/CcToolchainInfo) -* [ConstraintCollection](/versions/7.7.1/rules/lib/providers/ConstraintCollection) -* [ConstraintSettingInfo](/versions/7.7.1/rules/lib/providers/ConstraintSettingInfo) -* [ConstraintValueInfo](/versions/7.7.1/rules/lib/providers/ConstraintValueInfo) -* [DebugPackageInfo](/versions/7.7.1/rules/lib/providers/DebugPackageInfo) -* [DefaultInfo](/versions/7.7.1/rules/lib/providers/DefaultInfo) -* [ExecutionInfo](/versions/7.7.1/rules/lib/providers/ExecutionInfo) -* [FeatureFlagInfo](/versions/7.7.1/rules/lib/providers/FeatureFlagInfo) -* [file\_provider](/versions/7.7.1/rules/lib/providers/file_provider) -* [FilesToRunProvider](/versions/7.7.1/rules/lib/providers/FilesToRunProvider) -* [GeneratedExtensionRegistryProvider](/versions/7.7.1/rules/lib/providers/GeneratedExtensionRegistryProvider) -* [IncompatiblePlatformProvider](/versions/7.7.1/rules/lib/providers/IncompatiblePlatformProvider) -* [InstrumentedFilesInfo](/versions/7.7.1/rules/lib/providers/InstrumentedFilesInfo) -* [java\_compilation\_info](/versions/7.7.1/rules/lib/providers/java_compilation_info) -* [java\_output\_jars](/versions/7.7.1/rules/lib/providers/java_output_jars) -* [JavaRuntimeInfo](/versions/7.7.1/rules/lib/providers/JavaRuntimeInfo) -* [JavaToolchainInfo](/versions/7.7.1/rules/lib/providers/JavaToolchainInfo) -* [ObjcProvider](/versions/7.7.1/rules/lib/providers/ObjcProvider) -* [OutputGroupInfo](/versions/7.7.1/rules/lib/providers/OutputGroupInfo) -* [PackageSpecificationInfo](/versions/7.7.1/rules/lib/providers/PackageSpecificationInfo) -* [PlatformInfo](/versions/7.7.1/rules/lib/providers/PlatformInfo) -* [ProguardSpecProvider](/versions/7.7.1/rules/lib/providers/ProguardSpecProvider) -* [ProtoRegistryProvider](/versions/7.7.1/rules/lib/providers/ProtoRegistryProvider) -* [PyInfo](/versions/7.7.1/rules/lib/providers/PyInfo) -* [PyRuntimeInfo](/versions/7.7.1/rules/lib/providers/PyRuntimeInfo) -* [RunEnvironmentInfo](/versions/7.7.1/rules/lib/providers/RunEnvironmentInfo) -* [TemplateVariableInfo](/versions/7.7.1/rules/lib/providers/TemplateVariableInfo) -* [ToolchainInfo](/versions/7.7.1/rules/lib/providers/ToolchainInfo) -* [ToolchainTypeInfo](/versions/7.7.1/rules/lib/providers/ToolchainTypeInfo) -* [XcodeProperties](/versions/7.7.1/rules/lib/providers/XcodeProperties) -* [XcodeVersionConfig](/versions/7.7.1/rules/lib/providers/XcodeVersionConfig) \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/repo/index.mdx b/docs/versions/7.7.1/rules/lib/repo/index.mdx deleted file mode 100644 index 52aa6e5..0000000 --- a/docs/versions/7.7.1/rules/lib/repo/index.mdx +++ /dev/null
@@ -1,11 +0,0 @@ ---- -title: 'Repository Rules' ---- - -* [Rules related to git](/versions/7.7.1/rules/lib/repo/git) -* [Rules related to http](/versions/7.7.1/rules/lib/repo/http) -* [Rules related to local directories](/versions/7.7.1/rules/lib/repo/local) - -# Generic functions for repository rule authors - -* [Utility functions on patching](/versions/7.7.1/rules/lib/repo/utils)
diff --git a/docs/versions/7.7.1/rules/lib/toplevel.mdx b/docs/versions/7.7.1/rules/lib/toplevel.mdx deleted file mode 100644 index df4f956..0000000 --- a/docs/versions/7.7.1/rules/lib/toplevel.mdx +++ /dev/null
@@ -1,18 +0,0 @@ ---- -title: 'Top-level Modules' ---- - -This section lists top-level modules. These symbols are available only in .bzl files. - -* [apple\_common](/versions/7.7.1/rules/lib/toplevel/apple_common) -* [attr](/versions/7.7.1/rules/lib/toplevel/attr) -* [cc\_common](/versions/7.7.1/rules/lib/toplevel/cc_common) -* [config](/versions/7.7.1/rules/lib/toplevel/config) -* [config\_common](/versions/7.7.1/rules/lib/toplevel/config_common) -* [coverage\_common](/versions/7.7.1/rules/lib/toplevel/coverage_common) -* [java\_common](/versions/7.7.1/rules/lib/toplevel/java_common) -* [native](/versions/7.7.1/rules/lib/toplevel/native) -* [platform\_common](/versions/7.7.1/rules/lib/toplevel/platform_common) -* [proto](/versions/7.7.1/rules/lib/toplevel/proto) -* [proto\_common](/versions/7.7.1/rules/lib/toplevel/proto_common) -* [testing](/versions/7.7.1/rules/lib/toplevel/testing) \ No newline at end of file
diff --git a/docs/versions/7.7.1/about/faq.mdx b/docs/versions/7.7.3/about/faq.mdx similarity index 95% rename from docs/versions/7.7.1/about/faq.mdx rename to docs/versions/7.7.3/about/faq.mdx index 9d2a861..0cc3182 100644 --- a/docs/versions/7.7.1/about/faq.mdx +++ b/docs/versions/7.7.3/about/faq.mdx
@@ -2,7 +2,7 @@ title: 'FAQ' --- -If you have questions or need support, see [Getting Help](/versions/7.7.1/help). +If you have questions or need support, see [Getting Help](/versions/7.7.3/help). ## What is Bazel? @@ -12,7 +12,7 @@ Bazel was designed to fit the way software is developed at Google. It has the following features: -* Multi-language support: Bazel supports [many languages](/versions/7.7.1/reference/be/overview), and can be extended to support arbitrary programming languages. +* Multi-language support: Bazel supports [many languages](/versions/7.7.3/reference/be/overview), and can be extended to support arbitrary programming languages. * High-level build language: Projects are described in the `BUILD` language, a concise text format that describes a project as sets of small interconnected libraries, binaries and tests. In contrast, with tools like Make, you have to describe individual files and compiler invocations. * Multi-platform support: The same tool and the same `BUILD` files can be used to build software for different architectures, and even different platforms. At Google, we use Bazel to build everything from server applications running on systems in our data centers to client apps running on mobile phones. * Reproducibility: In `BUILD` files, each library, test and binary must specify its direct dependencies completely. Bazel uses this dependency information to know what must be rebuilt when you make changes to a source file, and which tasks can run in parallel. This means that all builds are incremental and will always produce the same result. @@ -40,7 +40,7 @@ ## Does Bazel require a build cluster? -Bazel runs build operations locally by default. However, Bazel can also connect to a build cluster for even faster builds and tests. See our documentation on [remote execution and caching](/versions/7.7.1/remote/rbe) and [remote caching](/versions/7.7.1/remote/caching) for further details. +Bazel runs build operations locally by default. However, Bazel can also connect to a build cluster for even faster builds and tests. See our documentation on [remote execution and caching](/versions/7.7.3/remote/rbe) and [remote caching](/versions/7.7.3/remote/caching) for further details. ## How does the Google development process work? @@ -97,7 +97,7 @@ The core features (C++, Java, and shell rules) have extensive use inside Google, so they are thoroughly tested and have very little churn. Similarly, we test new versions of Bazel across hundreds of thousands of targets every day to find regressions, and we release new versions multiple times every month. -In short, except for features marked as experimental, Bazel should Just Work. Changes to non-experimental rules will be backward compatible. A more detailed list of feature support statuses can be found in our [support document](/versions/7.7.1/contribute/support). +In short, except for features marked as experimental, Bazel should Just Work. Changes to non-experimental rules will be backward compatible. A more detailed list of feature support statuses can be found in our [support document](/versions/7.7.3/contribute/support). ## How stable is Bazel as a binary? @@ -105,7 +105,7 @@ ## How can I start using Bazel? -See [Getting Started](/versions/7.7.1/start/). +See [Getting Started](/versions/7.7.3/start/). ## Doesn’t Docker solve the reproducibility problems? @@ -136,7 +136,7 @@ ## Do you have binary releases? -Yes, you can find the latest [release binaries](https://github.com/bazelbuild/bazel/releases/latest) and review our [release policy](/versions/7.7.1/release/) +Yes, you can find the latest [release binaries](https://github.com/bazelbuild/bazel/releases/latest) and review our [release policy](/versions/7.7.3/release/) ## I use Eclipse/IntelliJ/XCode. How does Bazel interoperate with IDEs? @@ -152,21 +152,21 @@ Bazel returns a non-zero exit code if the build or test invocation fails, and this should be enough for basic CI integration. Since Bazel does not need clean builds for correctness, the CI system should not be configured to clean before starting a build/test run. -Further details on exit codes are in the [User Manual](/versions/7.7.1/docs/user-manual). +Further details on exit codes are in the [User Manual](/versions/7.7.3/docs/user-manual). ## What future features can we expect in Bazel? -See our [Roadmaps](/versions/7.7.1/about/roadmap). +See our [Roadmaps](/versions/7.7.3/about/roadmap). ## Can I use Bazel for my INSERT LANGUAGE HERE project? -Bazel is extensible. Anyone can add support for new languages. Many languages are supported: see the [build encyclopedia](/versions/7.7.1/reference/be/overview) for a list of recommendations and [awesomebazel.com](https://awesomebazel.com/) for a more comprehensive list. +Bazel is extensible. Anyone can add support for new languages. Many languages are supported: see the [build encyclopedia](/versions/7.7.3/reference/be/overview) for a list of recommendations and [awesomebazel.com](https://awesomebazel.com/) for a more comprehensive list. -If you would like to develop extensions or learn how they work, see the documentation for [extending Bazel](/versions/7.7.1/extending/concepts). +If you would like to develop extensions or learn how they work, see the documentation for [extending Bazel](/versions/7.7.3/extending/concepts). ## Can I contribute to the Bazel code base? -See our [contribution guidelines](/versions/7.7.1/contribute/). +See our [contribution guidelines](/versions/7.7.3/contribute/). ## Why isn’t all development done in the open?
diff --git a/docs/versions/7.7.1/about/intro.mdx b/docs/versions/7.7.3/about/intro.mdx similarity index 78% rename from docs/versions/7.7.1/about/intro.mdx rename to docs/versions/7.7.3/about/intro.mdx index 51b16eb..38d9f16 100644 --- a/docs/versions/7.7.1/about/intro.mdx +++ b/docs/versions/7.7.3/about/intro.mdx
@@ -32,7 +32,7 @@ source files. It works with multiple repositories and user bases in the tens of thousands. -* **Bazel is extensible.** Many [languages](/versions/7.7.1/rules) are +* **Bazel is extensible.** Many [languages](/versions/7.7.3/rules) are supported, and you can extend Bazel to support any other language or framework. @@ -40,9 +40,9 @@ To build or test a project with Bazel, you typically do the following: -1. **Set up Bazel.** Download and [install Bazel](/versions/7.7.1/install). +1. **Set up Bazel.** Download and [install Bazel](/versions/7.7.3/install). -2. **Set up a project [workspace](/versions/7.7.1/concepts/build-ref#workspaces)**, which is a +2. **Set up a project [workspace](/versions/7.7.3/concepts/build-ref#workspaces)**, which is a directory where Bazel looks for build inputs and `BUILD` files, and where it stores build outputs. @@ -50,7 +50,7 @@ build it. You write your `BUILD` file by declaring build targets using - [Starlark](/versions/7.7.1/rules/language), a domain-specific language. (See example + [Starlark](/versions/7.7.3/rules/language), a domain-specific language. (See example [here](https://github.com/bazelbuild/bazel/blob/master/examples/cpp/BUILD).) A build target specifies a set of input artifacts that Bazel will build plus @@ -62,11 +62,11 @@ covering the most common artifact types in the supported languages on supported platforms. -4. **Run Bazel** from the [command line](/versions/7.7.1/reference/command-line-reference). Bazel +4. **Run Bazel** from the [command line](/versions/7.7.3/reference/command-line-reference). Bazel places your outputs within the workspace. In addition to building, you can also use Bazel to run -[tests](/versions/7.7.1/reference/test-encyclopedia) and [query](/versions/7.7.1/query/guide) the build +[tests](/versions/7.7.3/reference/test-encyclopedia) and [query](/versions/7.7.3/query/guide) the build to trace dependencies in your code. ## Bazel build process {#bazel-build-process} @@ -76,8 +76,8 @@ 1. **Loads** the `BUILD` files relevant to the target. 2. **Analyzes** the inputs and their - [dependencies](/versions/7.7.1/concepts/dependencies), applies the specified build - rules, and produces an [action](/versions/7.7.1/extending/concepts#evaluation-model) + [dependencies](/versions/7.7.3/concepts/dependencies), applies the specified build + rules, and produces an [action](/versions/7.7.3/extending/concepts#evaluation-model) graph. 3. **Executes** the build actions on the inputs until the final build outputs @@ -86,24 +86,24 @@ Since all previous build work is cached, Bazel can identify and reuse cached artifacts and only rebuild or retest what's changed. To further enforce correctness, you can set up Bazel to run builds and tests -[hermetically](/versions/7.7.1/basics/hermeticity) through sandboxing, minimizing skew -and maximizing [reproducibility](/versions/7.7.1/run/build#correct-incremental-rebuilds). +[hermetically](/versions/7.7.3/basics/hermeticity) through sandboxing, minimizing skew +and maximizing [reproducibility](/versions/7.7.3/run/build#correct-incremental-rebuilds). ### Action graph {#action-graph} The action graph represents the build artifacts, the relationships between them, and the build actions that Bazel will perform. Thanks to this graph, Bazel can -[track](/versions/7.7.1/run/build#build-consistency) changes to +[track](/versions/7.7.3/run/build#build-consistency) changes to file content as well as changes to actions, such as build or test commands, and know what build work has previously been done. The graph also enables you to -easily [trace dependencies](/versions/7.7.1/query/guide) in your code. +easily [trace dependencies](/versions/7.7.3/query/guide) in your code. ## Getting started tutorials {#getting-started-tutorials} -To get started with Bazel, see [Getting Started](/versions/7.7.1/start/) or jump +To get started with Bazel, see [Getting Started](/versions/7.7.3/start/) or jump directly to the Bazel tutorials: -* [Tutorial: Build a C++ Project](/versions/7.7.1/start/cpp) -* [Tutorial: Build a Java Project](/versions/7.7.1/start/java) -* [Tutorial: Build an Android Application](/versions/7.7.1/start/android-app) -* [Tutorial: Build an iOS Application](/versions/7.7.1/start/ios-app) +* [Tutorial: Build a C++ Project](/versions/7.7.3/start/cpp) +* [Tutorial: Build a Java Project](/versions/7.7.3/start/java) +* [Tutorial: Build an Android Application](/versions/7.7.3/start/android-app) +* [Tutorial: Build an iOS Application](/versions/7.7.3/start/ios-app)
diff --git a/docs/versions/7.7.1/about/roadmap.mdx b/docs/versions/7.7.3/about/roadmap.mdx similarity index 96% rename from docs/versions/7.7.1/about/roadmap.mdx rename to docs/versions/7.7.3/about/roadmap.mdx index 73dad45..ab5ce58 100644 --- a/docs/versions/7.7.1/about/roadmap.mdx +++ b/docs/versions/7.7.3/about/roadmap.mdx
@@ -9,7 +9,7 @@ With these changes, we’re looking to keep our open-source community informed and included. This roadmap describes current initiatives and predictions for the future of Bazel development, giving you visibility into current priorities and ongoing projects. ## Bazel 7.0 Release -We plan to bring Bazel 7.0 [long term support (LTS)](https://bazel.build/versions/7.7.1/release/versioning) to you in late 2023. With Bazel 7.0 we aim to deliver many of the in progress items and continue to work through feature improvements that our users have been asking for. +We plan to bring Bazel 7.0 [long term support (LTS)](https://bazel.build/versions/7.7.3/release/versioning) to you in late 2023. With Bazel 7.0 we aim to deliver many of the in progress items and continue to work through feature improvements that our users have been asking for. ### Better cross-platform cache sharing Enables [cached artifacts](https://docs.google.com/document/d/1o0mrl2DanfV_6kB_Kf_jUdge13CQ8CvCiqeni2o-rvA/edit#heading=h.mvuo768l4ja2) to be shared across different build local (Mac) and remote (Linux) build platforms primarily for Java/Kotlin and Android development, resulting in better performance and efficient cache usage. @@ -21,7 +21,7 @@ Bazel 7.0 provides support for asynchronous execution, speeding up remote execution via increased parallelism with flag --jobs. ### Bzlmod: external dependency management system -[Bzlmod](https://bazel.build/versions/7.7.1/docs/bzlmod) automatically resolves transitive dependencies, allowing projects to scale while staying fast and resource-efficient. Bazel 7.0 contains a number of enhancements to [Bazel's external dependency management](https://docs.google.com/document/d/1moQfNcEIttsk6vYanNKIy3ZuK53hQUFq1b1r0rmsYVg/edit#heading=h.lgyp7ubwxmjc) functionality, including: +[Bzlmod](https://bazel.build/versions/7.7.3/docs/bzlmod) automatically resolves transitive dependencies, allowing projects to scale while staying fast and resource-efficient. Bazel 7.0 contains a number of enhancements to [Bazel's external dependency management](https://docs.google.com/document/d/1moQfNcEIttsk6vYanNKIy3ZuK53hQUFq1b1r0rmsYVg/edit#heading=h.lgyp7ubwxmjc) functionality, including: - Bzlmod turned on by default for external dependency management in Bazel - Lock file support — enables hermetic build with Bzlmod @@ -47,9 +47,9 @@ ### Android app build with Bazel - Migrate Android native rules to Starlark: For Bazel 7.0 the Android rules migrate to Starlark to decouple development from Bazel itself and to better enable community contributions. Additionally, we have made these rules independent of the core Bazel binary, allowing us to release more frequently. -- [Migration of Android rules to Starlark](https://bazel.build/versions/7.7.1/reference/be/android) +- [Migration of Android rules to Starlark](https://bazel.build/versions/7.7.3/reference/be/android) - R8 support: Allows Android app developers to use R8 updated optimizations. -- Mobile Install: Allows Android app developers to develop, test, deploy any Android app changes quickly through an updated version of [Mobile Install](https://bazel.build/versions/7.7.1/docs/mobile-install). +- Mobile Install: Allows Android app developers to develop, test, deploy any Android app changes quickly through an updated version of [Mobile Install](https://bazel.build/versions/7.7.3/docs/mobile-install). ### Software Bill of Materials data generation (SBOMs) & OSS license compliance tools With Bazel, developers can generate data to help produce [SBOMs](https://security.googleblog.com/2022/06/sbom-in-action-finding-vulnerabilities.html). This data outputs in text or JSON format, and can be easily formatted to meet [SPDX](https://spdx.dev/specifications/) or [CycloneDX](https://cyclonedx.org/specification/overview/) specifications. Additionally, the process provides rules to declare the licenses Bazel modules are made available under, and tools to build processes around those declarations. See the in-progress [rules_license implementation](https://github.com/bazelbuild/rules_license) on GitHub.
diff --git a/docs/versions/7.7.1/about/vision.mdx b/docs/versions/7.7.3/about/vision.mdx similarity index 98% rename from docs/versions/7.7.1/about/vision.mdx rename to docs/versions/7.7.3/about/vision.mdx index 61f7326..9a6e349 100644 --- a/docs/versions/7.7.1/about/vision.mdx +++ b/docs/versions/7.7.3/about/vision.mdx
@@ -82,7 +82,7 @@ ["Bazel sandwich"](https://github.com/bazelbuild/bazel-website/blob/master/designs/_posts/2016-08-04-extensibility-for-native-rules.md) principles. 1. The rules need to be **remote-execution ready**. In practice, this means - **configurable using the [toolchains](/versions/7.7.1/extending/toolchains) mechanism**. + **configurable using the [toolchains](/versions/7.7.3/extending/toolchains) mechanism**. 1. The rules (and Bazel) need to interface with a **widely-used IDE** for the language, if there is one. 1. The rules need to have **thorough, usable documentation,** with introductory
diff --git a/docs/versions/7.7.1/advanced/performance/build-performance-breakdown.mdx b/docs/versions/7.7.3/advanced/performance/build-performance-breakdown.mdx similarity index 86% rename from docs/versions/7.7.1/advanced/performance/build-performance-breakdown.mdx rename to docs/versions/7.7.3/advanced/performance/build-performance-breakdown.mdx index 5b8c17f..0413c3b 100644 --- a/docs/versions/7.7.1/advanced/performance/build-performance-breakdown.mdx +++ b/docs/versions/7.7.3/advanced/performance/build-performance-breakdown.mdx
@@ -6,7 +6,7 @@ some of which can have an impact on build performance. This page attempts to map some of these Bazel concepts to their implications on build performance. While not extensive, we have included some examples of how to detect build performance -issues through [extracting metrics](/versions/7.7.1/configure/build-performance-metrics) +issues through [extracting metrics](/versions/7.7.3/configure/build-performance-metrics) and what you can do to fix them. With this, we hope you can apply these concepts when investigating build performance regressions. @@ -53,7 +53,7 @@ each additional BUILD file in the loading phase. - This is often due to the addition of dependencies and having to load their transitive closure. - - Use [query](/versions/7.7.1/query/quickstart) / [cquery](/versions/7.7.1/query/cquery) to find + - Use [query](/versions/7.7.3/query/quickstart) / [cquery](/versions/7.7.3/query/cquery) to find where new dependencies might have been added. 2. `TargetMetrics.targets_configured`: representing the number of targets and @@ -61,24 +61,24 @@ constructing and traversing the configured target graph. - This is often due to the addition of dependencies and having to construct the graph of their transitive closure. - - Use [cquery](/versions/7.7.1/query/cquery) to find where new + - Use [cquery](/versions/7.7.3/query/cquery) to find where new dependencies might have been added. 3. `ActionSummary.actions_created`: represents the actions created in the build, and a regression represents more work in constructing the action graph. Note that this also includes unused actions that might not have been executed. - - Use [aquery](/versions/7.7.1/query/aquery) for debugging regressions; + - Use [aquery](/versions/7.7.3/query/aquery) for debugging regressions; we suggest starting with - [`--output=summary`](/versions/7.7.1/reference/command-line-reference#flag--output) + [`--output=summary`](/versions/7.7.3/reference/command-line-reference#flag--output) before further drilling down with - [`--skyframe_state`](/versions/7.7.1/reference/command-line-reference#flag--skyframe_state). + [`--skyframe_state`](/versions/7.7.3/reference/command-line-reference#flag--skyframe_state). 4. `ActionSummary.actions_executed`: the number of actions executed, a regression directly represents more work in executing these actions. - - The [BEP](/versions/7.7.1/remote/bep) writes out the action statistics + - The [BEP](/versions/7.7.3/remote/bep) writes out the action statistics `ActionData` that shows the most executed action types. By default, it collects the top 20 action types, but you can pass in the - [`--experimental_record_metrics_for_all_mnemonics`](/versions/7.7.1/reference/command-line-reference#flag--experimental_record_metrics_for_all_mnemonics) + [`--experimental_record_metrics_for_all_mnemonics`](/versions/7.7.3/reference/command-line-reference#flag--experimental_record_metrics_for_all_mnemonics) to collect this data for all action types that were executed. - This should help you to figure out what kind of actions were executed (additionally). @@ -112,7 +112,7 @@ - **Wall time** is the real world time elapsed. - If _only_ wall time regresses, we suggest collecting a - [JSON trace profile](/versions/7.7.1/advanced/performance/json-trace-profile) and looking + [JSON trace profile](/versions/7.7.3/advanced/performance/json-trace-profile) and looking for differences. Otherwise, it would likely be more efficient to investigate other regressed metrics as they could have affected the wall time. @@ -132,25 +132,25 @@ Using the [`--experimental_collect_load_average_in_profiler`](https://github.com/bazelbuild/bazel/blob/6.0.0/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java#L306-L312) flag introduced in Bazel 6.0, the -[JSON trace profiler](/versions/7.7.1/advanced/performance/json-trace-profile) collects the +[JSON trace profiler](/versions/7.7.3/advanced/performance/json-trace-profile) collects the system load average during the invocation. - + **Figure 1.** Profile that includes system load average. A high load during a Bazel invocation can be an indication that Bazel schedules too many local actions in parallel for your machine. You might want to look into adjusting -[`--local_cpu_resources`](/versions/7.7.1/reference/command-line-reference#flag--local_cpu_resources) -and [`--local_ram_resources`](/versions/7.7.1/reference/command-line-reference#flag--local_ram_resources), +[`--local_cpu_resources`](/versions/7.7.3/reference/command-line-reference#flag--local_cpu_resources) +and [`--local_ram_resources`](/versions/7.7.3/reference/command-line-reference#flag--local_ram_resources), especially in container environments (at least until [#16512](https://github.com/bazelbuild/bazel/pull/16512) is merged). #### Monitoring Bazel memory usage There are two main sources to get Bazel’s memory usage, Bazel `info` and the -[BEP](/versions/7.7.1/remote/bep). +[BEP](/versions/7.7.3/remote/bep). - `bazel info used-heap-size-after-gc`: The amount of used memory in bytes after a call to `System.gc()`. @@ -158,13 +158,13 @@ provides benchmarks for this metric as well. - Additionally, there are `peak-heap-size`, `max-heap-size`, `used-heap-size` and `committed-heap-size` (see - [documentation](/versions/7.7.1/docs/user-manual#configuration-independent-data)), but are + [documentation](/versions/7.7.3/docs/user-manual#configuration-independent-data)), but are less relevant. -- [BEP](/versions/7.7.1/remote/bep)’s +- [BEP](/versions/7.7.3/remote/bep)’s `MemoryMetrics.peak_post_gc_heap_size`: Size of the peak JVM heap size in bytes post GC (requires setting - [`--memory_profile`](/versions/7.7.1/reference/command-line-reference#flag--memory_profile) + [`--memory_profile`](/versions/7.7.3/reference/command-line-reference#flag--memory_profile) that attempts to force a full GC). A regression in memory usage is usually a result of a regression in @@ -173,28 +173,28 @@ implementation. To analyze Bazel’s memory footprint on a more granular level, we recommend using -the [built-in memory profiler](/versions/7.7.1/rules/performance#memory-profiling) +the [built-in memory profiler](/versions/7.7.3/rules/performance#memory-profiling) for rules. #### Memory profiling of persistent workers -While [persistent workers](/versions/7.7.1/remote/persistent) can help to speed up builds +While [persistent workers](/versions/7.7.3/remote/persistent) can help to speed up builds significantly (especially for interpreted languages) their memory footprint can be problematic. Bazel collects metrics on its workers, in particular, the `WorkerMetrics.WorkerStats.worker_memory_in_kb` field tells how much memory workers use (by mnemonic). -The [JSON trace profiler](/versions/7.7.1/advanced/performance/json-trace-profile) also +The [JSON trace profiler](/versions/7.7.3/advanced/performance/json-trace-profile) also collects persistent worker memory usage during the invocation by passing in the [`--experimental_collect_system_network_usage`](https://github.com/bazelbuild/bazel/blob/6.0.0/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java#L314-L320) flag (new in Bazel 6.0). - + **Figure 2.** Profile that includes workers memory usage. Lowering the value of -[`--worker_max_instances`](/versions/7.7.1/reference/command-line-reference#flag--worker_max_instances) +[`--worker_max_instances`](/versions/7.7.3/reference/command-line-reference#flag--worker_max_instances) (default 4) might help to reduce the amount of memory used by persistent workers. We are actively working on making Bazel’s resource manager and scheduler smarter so that such fine tuning @@ -208,24 +208,24 @@ If you are using remote execution for your builds, you might want to consider monitoring the network traffic during the invocation using the -`NetworkMetrics.SystemNetworkStats` proto from the [BEP](/versions/7.7.1/remote/bep) +`NetworkMetrics.SystemNetworkStats` proto from the [BEP](/versions/7.7.3/remote/bep) (requires passing `--experimental_collect_system_network_usage`). -Furthermore, [JSON trace profiles](/versions/7.7.1/advanced/performance/json-trace-profile) +Furthermore, [JSON trace profiles](/versions/7.7.3/advanced/performance/json-trace-profile) allow you to view system-wide network usage throughout the course of the build by passing the `--experimental_collect_system_network_usage` flag (new in Bazel 6.0). - + **Figure 3.** Profile that includes system-wide network usage. A high but rather flat network usage when using remote execution might indicate that network is the bottleneck in your build; if you are not using it already, consider turning on Build without the Bytes by passing -[`--remote_download_minimal`](/versions/7.7.1/reference/command-line-reference#flag--remote_download_minimal). +[`--remote_download_minimal`](/versions/7.7.3/reference/command-line-reference#flag--remote_download_minimal). This will speed up your builds by avoiding the download of unnecessary intermediate artifacts. Another option is to configure a local -[disk cache](/versions/7.7.1/reference/command-line-reference#flag--disk_cache) to save on +[disk cache](/versions/7.7.3/reference/command-line-reference#flag--disk_cache) to save on download bandwidth.
diff --git a/docs/versions/7.7.1/advanced/performance/build-performance-metrics.mdx b/docs/versions/7.7.3/advanced/performance/build-performance-metrics.mdx similarity index 88% rename from docs/versions/7.7.1/advanced/performance/build-performance-metrics.mdx rename to docs/versions/7.7.3/advanced/performance/build-performance-metrics.mdx index d72b203..c5a7869 100644 --- a/docs/versions/7.7.1/advanced/performance/build-performance-metrics.mdx +++ b/docs/versions/7.7.3/advanced/performance/build-performance-metrics.mdx
@@ -16,7 +16,7 @@ An important step to improving the performance of builds is to understand where resources are spent. This page lists different metrics you can collect. -[Breaking down build performance](/versions/7.7.1/configure/build-performance-breakdown) showcases +[Breaking down build performance](/versions/7.7.3/configure/build-performance-breakdown) showcases how you can use these metrics to detect and fix build performance issues. There are a few main ways to extract metrics from your Bazel builds, namely: @@ -25,33 +25,33 @@ Bazel outputs a variety of protocol buffers [`build_event_stream.proto`](https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto) -through the [Build Event Protocol (BEP)](/versions/7.7.1/remote/bep), which +through the [Build Event Protocol (BEP)](/versions/7.7.3/remote/bep), which can be aggregated by a backend specified by you. Depending on your use cases, you might decide to aggregate the metrics in various ways, but here we will go over some concepts and proto fields that would be useful in general to consider. ## Bazel’s query / cquery / aquery commands {#bazel-commands-query-cquery-aquery} -Bazel provides 3 different query modes ([query](/versions/7.7.1/query/quickstart), -[cquery](/versions/7.7.1/query/cquery) and [aquery](/versions/7.7.1/query/aquery)) that allow users +Bazel provides 3 different query modes ([query](/versions/7.7.3/query/quickstart), +[cquery](/versions/7.7.3/query/cquery) and [aquery](/versions/7.7.3/query/aquery)) that allow users to query the target graph, configured target graph and action graph respectively. The query language provides a -[suite of functions](/versions/7.7.1/query/language#functions) usable across the different +[suite of functions](/versions/7.7.3/query/language#functions) usable across the different query modes, that allows you to customize your queries according to your needs. ## JSON Trace Profiles {#json-trace-profiles} For every build-like Bazel invocation, Bazel writes a trace profile in JSON -format. The [JSON trace profile](/versions/7.7.1/advanced/performance/json-trace-profile) can +format. The [JSON trace profile](/versions/7.7.3/advanced/performance/json-trace-profile) can be very useful to quickly understand what Bazel spent time on during the invocation. ## Execution Log {#execution-log} -The [execution log](/versions/7.7.1/remote/cache-remote) can help you to troubleshoot and fix +The [execution log](/versions/7.7.3/remote/cache-remote) can help you to troubleshoot and fix missing remote cache hits due to machine and environment differences or non-deterministic actions. If you pass the flag -[`--experimental_execution_log_spawn_metrics`](/versions/7.7.1/reference/command-line-reference#flag--experimental_execution_log_spawn_metrics) +[`--experimental_execution_log_spawn_metrics`](/versions/7.7.3/reference/command-line-reference#flag--experimental_execution_log_spawn_metrics) (available from Bazel 5.2) it will also contain detailed spawn metrics, both for locally and remotely executed actions. You can use these metrics for example to make comparisons between local and remote machine performance or to find out
diff --git a/docs/versions/7.7.1/advanced/performance/iteration-speed.mdx b/docs/versions/7.7.3/advanced/performance/iteration-speed.mdx similarity index 91% rename from docs/versions/7.7.1/advanced/performance/iteration-speed.mdx rename to docs/versions/7.7.3/advanced/performance/iteration-speed.mdx index a14ff73..14b4bfe 100644 --- a/docs/versions/7.7.1/advanced/performance/iteration-speed.mdx +++ b/docs/versions/7.7.3/advanced/performance/iteration-speed.mdx
@@ -12,8 +12,8 @@ * The `bazel` command line interface (CLI) is the user-facing front-end tool and receives commands from the user. -* The CLI tool starts a [*Bazel server*](https://bazel.build/versions/7.7.1/run/client-server) - for each distinct [output base](https://bazel.build/versions/7.7.1/remote/output-directories). +* The CLI tool starts a [*Bazel server*](https://bazel.build/versions/7.7.3/run/client-server) + for each distinct [output base](https://bazel.build/versions/7.7.3/remote/output-directories). The Bazel server is generally persistent, but will shut down after some idle time so as to not waste resources. @@ -52,14 +52,14 @@ is also *invalidated* very easily: for example, many `bazel` command line flags cause the cache to be discarded. This is because many flags affect the build graph (e.g. because of -[configurable attributes](https://bazel.build/versions/7.7.1/configure/attributes)). Some flag +[configurable attributes](https://bazel.build/versions/7.7.3/configure/attributes)). Some flag changes can also cause the Bazel server to be restarted (e.g. changing -[startup options](https://bazel.build/versions/7.7.1/docs/user-manual#startup-options)). +[startup options](https://bazel.build/versions/7.7.3/docs/user-manual#startup-options)). A good execution cache is also valuable for build performance. An execution cache can be kept locally -[on disk](https://bazel.build/versions/7.7.1/remote/caching#disk-cache), or -[remotely](https://bazel.build/versions/7.7.1/remote/caching). The cache can be shared among +[on disk](https://bazel.build/versions/7.7.3/remote/caching#disk-cache), or +[remotely](https://bazel.build/versions/7.7.3/remote/caching). The cache can be shared among Bazel servers, and indeed among developers. ## Avoid discarding the analysis cache {#avoid-discarding-cache} @@ -73,7 +73,7 @@ try to use a fixed set of flags for the duration of a particular workflow. * Losing the Bazel server loses the analysis cache. The Bazel server has a - [configurable](https://bazel.build/versions/7.7.1/docs/user-manual#max-idle-secs) idle + [configurable](https://bazel.build/versions/7.7.3/docs/user-manual#max-idle-secs) idle time, after which it shuts down. You can configure this time via your bazelrc file to suit your needs. The server also restarted when startup flags change, so, again, avoid changing those flags if possible.
diff --git a/docs/versions/7.7.1/advanced/performance/json-trace-profile.mdx b/docs/versions/7.7.3/advanced/performance/json-trace-profile.mdx similarity index 94% rename from docs/versions/7.7.1/advanced/performance/json-trace-profile.mdx rename to docs/versions/7.7.3/advanced/performance/json-trace-profile.mdx index f84a426..ace8abf 100644 --- a/docs/versions/7.7.1/advanced/performance/json-trace-profile.mdx +++ b/docs/versions/7.7.3/advanced/performance/json-trace-profile.mdx
@@ -7,11 +7,11 @@ By default, for all build-like commands and query Bazel writes such a profile to `command.profile.gz`. You can configure whether a profile is written with the -[`--generate_json_trace_profile`](/versions/7.7.1/reference/command-line-reference#flag--generate_json_trace_profile) +[`--generate_json_trace_profile`](/versions/7.7.3/reference/command-line-reference#flag--generate_json_trace_profile) flag, and the location it is written to with the -[`--profile`](/versions/7.7.1/docs/user-manual#profile) flag. Locations ending with `.gz` are +[`--profile`](/versions/7.7.3/docs/user-manual#profile) flag. Locations ending with `.gz` are compressed with GZIP. Use the flag -[`--experimental_announce_profile_path`](/versions/7.7.1/reference/command-line-reference#flag--experimental_announce_profile_path) +[`--experimental_announce_profile_path`](/versions/7.7.3/reference/command-line-reference#flag--experimental_announce_profile_path) to print the path to this file to the log. ## Tools @@ -27,7 +27,7 @@ Example profile: - + **Figure 1.** Example profile. @@ -46,7 +46,7 @@ ### `bazel analyze-profile` -The Bazel subcommand [`analyze-profile`](/versions/7.7.1/docs/user-manual#analyze-profile) +The Bazel subcommand [`analyze-profile`](/versions/7.7.3/docs/user-manual#analyze-profile) consumes a profile format and prints cumulative statistics for different task types for each build phase and an analysis of the critical path. @@ -123,7 +123,7 @@ * `action count`: Displays how many concurrent actions were in flight. Click on it to see the actual value. Should go up to the value of - [`--jobs`](/versions/7.7.1/reference/command-line-reference#flag--jobs) in clean + [`--jobs`](/versions/7.7.3/reference/command-line-reference#flag--jobs) in clean builds. * `CPU usage (Bazel)`: For each second of the build, displays the amount of CPU that was used by Bazel (a value of 1 equals one core being 100% busy). @@ -187,7 +187,7 @@ microseconds. The category (`cat`) is one of enum values of `ProfilerTask`. Note that some events are merged together if they are very short and close to each other; pass -[`--noslim_json_profile`](/versions/7.7.1/reference/command-line-reference#flag--slim_profile) +[`--noslim_json_profile`](/versions/7.7.3/reference/command-line-reference#flag--slim_profile) if you would like to prevent event merging. See also the
diff --git a/docs/versions/7.7.1/advanced/performance/memory.mdx b/docs/versions/7.7.3/advanced/performance/memory.mdx similarity index 85% rename from docs/versions/7.7.1/advanced/performance/memory.mdx rename to docs/versions/7.7.3/advanced/performance/memory.mdx index 9338a56..472846b 100644 --- a/docs/versions/7.7.1/advanced/performance/memory.mdx +++ b/docs/versions/7.7.3/advanced/performance/memory.mdx
@@ -8,16 +8,16 @@ In certain situations, you may want Bazel to use minimal memory. You can set the maximum heap via the startup flag -[`--host_jvm_args`](/versions/7.7.1/docs/user-manual#host-jvm-args), +[`--host_jvm_args`](/versions/7.7.3/docs/user-manual#host-jvm-args), like `--host_jvm_args=-Xmx2g`. However, if your builds are big enough, Bazel may throw an `OutOfMemoryError` (OOM) when it doesn't have enough memory. You can make Bazel use less memory, at the cost of slower incremental builds, by passing the following command flags: -[`--discard_analysis_cache`](/versions/7.7.1/docs/user-manual#discard-analysis-cache), -[`--nokeep_state_after_build`](/versions/7.7.1/reference/command-line-reference#flag--keep_state_after_build), +[`--discard_analysis_cache`](/versions/7.7.3/docs/user-manual#discard-analysis-cache), +[`--nokeep_state_after_build`](/versions/7.7.3/reference/command-line-reference#flag--keep_state_after_build), and -[`--notrack_incremental_state`](/versions/7.7.1/reference/command-line-reference#flag--track_incremental_state). +[`--notrack_incremental_state`](/versions/7.7.3/reference/command-line-reference#flag--track_incremental_state). These flags will minimize the memory that Bazel uses in a build, at the cost of making future builds slower than a standard incremental build would be. @@ -40,6 +40,6 @@ Bazel comes with a built-in memory profiler that can help you check your rule’s memory use. Read more about this process on the -[Memory Profiling section](/versions/7.7.1/rules/performance#memory-profiling) of our +[Memory Profiling section](/versions/7.7.3/rules/performance#memory-profiling) of our documentation on how to improve the performance of custom rules.
diff --git a/docs/versions/7.7.1/basics/artifact-based-builds.mdx b/docs/versions/7.7.3/basics/artifact-based-builds.mdx similarity index 98% rename from docs/versions/7.7.1/basics/artifact-based-builds.mdx rename to docs/versions/7.7.3/basics/artifact-based-builds.mdx index faac1e5..11a05f7 100644 --- a/docs/versions/7.7.1/basics/artifact-based-builds.mdx +++ b/docs/versions/7.7.3/basics/artifact-based-builds.mdx
@@ -169,7 +169,7 @@ changes, every artifact that depends on it is rebuilt. Bazel solves the second part of the problem, platform independence, by setting -[build configurations](/versions/7.7.1/run/build#build-config-cross-compilation). Rather than +[build configurations](/versions/7.7.3/run/build#build-config-cross-compilation). Rather than targets depending directly on their tools, they depend on types of configurations: * **Host configuration**: building tools that run during the build @@ -182,7 +182,7 @@ systems is their flexibility in supporting any kind of build process, and it would be better not to give that up in an artifact-based build system. Fortunately, Bazel allows its supported target types to be extended by -[adding custom rules](/versions/7.7.1/extending/rules). +[adding custom rules](/versions/7.7.3/extending/rules). To define a rule in Bazel, the rule author declares the inputs that the rule requires (in the form of attributes passed in the `BUILD` file) and the fixed @@ -209,7 +209,7 @@ Actions sound like they might run into the same problems as tasks in other systems—isn’t it still possible to write actions that both write to the same file and end up conflicting with one another? Actually, Bazel makes these -conflicts impossible by using _[sandboxing](/versions/7.7.1/docs/sandboxing)_. On supported +conflicts impossible by using _[sandboxing](/versions/7.7.3/docs/sandboxing)_. On supported systems, every action is isolated from every other action via a filesystem sandbox. Effectively, each action can see only a restricted view of the filesystem that includes the inputs it has declared and any outputs it has
diff --git a/docs/versions/7.7.1/basics/build-systems.mdx b/docs/versions/7.7.3/basics/build-systems.mdx similarity index 100% rename from docs/versions/7.7.1/basics/build-systems.mdx rename to docs/versions/7.7.3/basics/build-systems.mdx
diff --git a/docs/versions/7.7.1/basics/dependencies.mdx b/docs/versions/7.7.3/basics/dependencies.mdx similarity index 99% rename from docs/versions/7.7.1/basics/dependencies.mdx rename to docs/versions/7.7.3/basics/dependencies.mdx index de159b2..5ba6b6d 100644 --- a/docs/versions/7.7.1/basics/dependencies.mdx +++ b/docs/versions/7.7.3/basics/dependencies.mdx
@@ -106,7 +106,7 @@ depends on a common library target C. Should target A be able to use classes defined in target C? -[](/versions/7.7.1/images/transitive-dependencies.png) +[](/versions/7.7.3/images/transitive-dependencies.png) **Figure 1**. Transitive dependencies
diff --git a/docs/versions/7.7.1/basics/distributed-builds.mdx b/docs/versions/7.7.3/basics/distributed-builds.mdx similarity index 95% rename from docs/versions/7.7.1/basics/distributed-builds.mdx rename to docs/versions/7.7.3/basics/distributed-builds.mdx index d8b7cd4..4e9e852 100644 --- a/docs/versions/7.7.1/basics/distributed-builds.mdx +++ b/docs/versions/7.7.3/basics/distributed-builds.mdx
@@ -19,7 +19,7 @@ The simplest type of distributed build is one that only leverages _remote caching_, which is shown in Figure 1. -[](/versions/7.7.1/images/distributed-build-remote-cache.png) +[](/versions/7.7.3/images/distributed-build-remote-cache.png) **Figure 1**. A distributed build showing remote caching @@ -61,7 +61,7 @@ remote execution, in which the actual work of doing the build can be spread across any number of workers. Figure 2 depicts a remote execution system. -[](/versions/7.7.1/images/remote-execution-system.png) +[](/versions/7.7.3/images/remote-execution-system.png) **Figure 2**. A remote execution system @@ -101,7 +101,7 @@ Since 2008, Google has been using a distributed build system that employs both remote caching and remote execution, which is illustrated in Figure 3. -[](/versions/7.7.1/images/high-level-build-system.png) +[](/versions/7.7.3/images/high-level-build-system.png) **Figure 3**. Google’s distributed build system
diff --git a/docs/versions/7.7.1/basics/hermeticity.mdx b/docs/versions/7.7.3/basics/hermeticity.mdx similarity index 95% rename from docs/versions/7.7.1/basics/hermeticity.mdx rename to docs/versions/7.7.3/basics/hermeticity.mdx index bb7333e..658cec1 100644 --- a/docs/versions/7.7.1/basics/hermeticity.mdx +++ b/docs/versions/7.7.3/basics/hermeticity.mdx
@@ -69,18 +69,18 @@ step twice or on different systems, compare a hash of the file contents and get results that differ, the build is not reproducible. * Run steps to - [debug local cache hits](/versions/7.7.1/remote/cache-remote#troubleshooting-cache-hits) + [debug local cache hits](/versions/7.7.3/remote/cache-remote#troubleshooting-cache-hits) from a variety of potential client machines to ensure that you catch any cases of client environment leaking into the actions. * Execute a build within a docker container that contains nothing but the checked-out source tree and explicit list of host tools. Build breakages and error messages will catch implicit system dependencies. * Discover and fix hermeticity problems using - [remote execution rules](/versions/7.7.1/remote/rules#overview). -* Enable strict [sandboxing](/versions/7.7.1/docs/sandboxing) + [remote execution rules](/versions/7.7.3/remote/rules#overview). +* Enable strict [sandboxing](/versions/7.7.3/docs/sandboxing) at the per-action level, since actions in a build can be stateful and affect the build or the output. -* [Workspace rules](/versions/7.7.1/remote/workspace) +* [Workspace rules](/versions/7.7.3/remote/workspace) allow developers to add dependencies to external workspaces, but they are rich enough to allow arbitrary processing to happen in the process. You can get a log of some potentially non-hermetic actions in Bazel workspace rules by
diff --git a/docs/versions/7.7.1/basics/index.mdx b/docs/versions/7.7.3/basics/index.mdx similarity index 87% rename from docs/versions/7.7.1/basics/index.mdx rename to docs/versions/7.7.3/basics/index.mdx index be145a3..b7db944 100644 --- a/docs/versions/7.7.1/basics/index.mdx +++ b/docs/versions/7.7.3/basics/index.mdx
@@ -26,30 +26,30 @@ Thank you to the original author, Erik Kuefler, for allowing its reuse and modification here! -* **[Why a Build System?](/versions/7.7.1/basics/build-systems)** +* **[Why a Build System?](/versions/7.7.3/basics/build-systems)** If you haven't used a build system before, start here. This page covers why you should use a build system, and why compilers and build scripts aren't the best choice once your organization starts to scale beyond a few developers. -* **[Task-Based Build Systems](/versions/7.7.1/basics/task-based-builds)** +* **[Task-Based Build Systems](/versions/7.7.3/basics/task-based-builds)** This page discusses task-based build systems (such as Make, Maven, and Gradle) and some of their challenges. -* **[Artifact-Based Build Systems](/versions/7.7.1/basics/artifact-based-builds)** +* **[Artifact-Based Build Systems](/versions/7.7.3/basics/artifact-based-builds)** This page discusses artifact-based build systems in response to the pain points of task-based build systems. -* **[Distributed Builds](/versions/7.7.1/basics/distributed-builds)** +* **[Distributed Builds](/versions/7.7.3/basics/distributed-builds)** This page covers distributed builds, or builds that are executed outside of your local machine. This requires more robust infrastructure to share resources and build results (and is where the true wizardry happens!) -* **[Dependency Management](/versions/7.7.1/basics/dependencies)** +* **[Dependency Management](/versions/7.7.3/basics/dependencies)** This page covers some complications of dependencies at a large scale and strategies to counteract those complications.
diff --git a/docs/versions/7.7.1/basics/task-based-builds.mdx b/docs/versions/7.7.3/basics/task-based-builds.mdx similarity index 98% rename from docs/versions/7.7.1/basics/task-based-builds.mdx rename to docs/versions/7.7.3/basics/task-based-builds.mdx index 730ef6b..1645869 100644 --- a/docs/versions/7.7.1/basics/task-based-builds.mdx +++ b/docs/versions/7.7.3/basics/task-based-builds.mdx
@@ -65,7 +65,7 @@ depends on via the depends attribute. These dependencies form an acyclic graph, as seen in Figure 1. -[](/versions/7.7.1/images/task-dependencies.png) +[](/versions/7.7.3/images/task-dependencies.png) Figure 1. An acyclic graph showing dependencies
diff --git a/docs/versions/7.7.1/build/share-variables.mdx b/docs/versions/7.7.3/build/share-variables.mdx similarity index 100% rename from docs/versions/7.7.1/build/share-variables.mdx rename to docs/versions/7.7.3/build/share-variables.mdx
diff --git a/docs/versions/7.7.1/build/style-guide.mdx b/docs/versions/7.7.3/build/style-guide.mdx similarity index 100% rename from docs/versions/7.7.1/build/style-guide.mdx rename to docs/versions/7.7.3/build/style-guide.mdx
diff --git a/docs/versions/7.7.1/community/images/Bitrise.png b/docs/versions/7.7.3/community/images/Bitrise.png similarity index 100% rename from docs/versions/7.7.1/community/images/Bitrise.png rename to docs/versions/7.7.3/community/images/Bitrise.png Binary files differ
diff --git a/docs/versions/7.7.1/community/images/Gradle.png b/docs/versions/7.7.3/community/images/Gradle.png similarity index 100% rename from docs/versions/7.7.1/community/images/Gradle.png rename to docs/versions/7.7.3/community/images/Gradle.png Binary files differ
diff --git a/docs/versions/7.7.1/community/images/Linkedin-Logo.png b/docs/versions/7.7.3/community/images/Linkedin-Logo.png similarity index 100% rename from docs/versions/7.7.1/community/images/Linkedin-Logo.png rename to docs/versions/7.7.3/community/images/Linkedin-Logo.png Binary files differ
diff --git a/docs/versions/7.7.1/community/images/Lucid_Software-logo.svg b/docs/versions/7.7.3/community/images/Lucid_Software-logo.svg similarity index 100% rename from docs/versions/7.7.1/community/images/Lucid_Software-logo.svg rename to docs/versions/7.7.3/community/images/Lucid_Software-logo.svg
diff --git a/docs/versions/7.7.1/community/images/acqio_logo.svg b/docs/versions/7.7.3/community/images/acqio_logo.svg similarity index 100% rename from docs/versions/7.7.1/community/images/acqio_logo.svg rename to docs/versions/7.7.3/community/images/acqio_logo.svg
diff --git a/docs/versions/7.7.1/community/images/aspect-logo-2.png b/docs/versions/7.7.3/community/images/aspect-logo-2.png similarity index 100% rename from docs/versions/7.7.1/community/images/aspect-logo-2.png rename to docs/versions/7.7.3/community/images/aspect-logo-2.png Binary files differ
diff --git a/docs/versions/7.7.1/community/images/bitrise-logo.png b/docs/versions/7.7.3/community/images/bitrise-logo.png similarity index 100% rename from docs/versions/7.7.1/community/images/bitrise-logo.png rename to docs/versions/7.7.3/community/images/bitrise-logo.png Binary files differ
diff --git a/docs/versions/7.7.1/community/images/buildbuddy-logo.svg b/docs/versions/7.7.3/community/images/buildbuddy-logo.svg similarity index 100% rename from docs/versions/7.7.1/community/images/buildbuddy-logo.svg rename to docs/versions/7.7.3/community/images/buildbuddy-logo.svg
diff --git a/docs/versions/7.7.1/community/images/buildkite.svg b/docs/versions/7.7.3/community/images/buildkite.svg similarity index 100% rename from docs/versions/7.7.1/community/images/buildkite.svg rename to docs/versions/7.7.3/community/images/buildkite.svg
diff --git a/docs/versions/7.7.1/community/images/codethink-logo.svg b/docs/versions/7.7.3/community/images/codethink-logo.svg similarity index 100% rename from docs/versions/7.7.1/community/images/codethink-logo.svg rename to docs/versions/7.7.3/community/images/codethink-logo.svg
diff --git a/docs/versions/7.7.1/community/images/develocity.png b/docs/versions/7.7.3/community/images/develocity.png similarity index 100% rename from docs/versions/7.7.1/community/images/develocity.png rename to docs/versions/7.7.3/community/images/develocity.png Binary files differ
diff --git a/docs/versions/7.7.1/community/images/dropbox.png b/docs/versions/7.7.3/community/images/dropbox.png similarity index 100% rename from docs/versions/7.7.1/community/images/dropbox.png rename to docs/versions/7.7.3/community/images/dropbox.png Binary files differ
diff --git a/docs/versions/7.7.1/community/images/engflow-logo.svg b/docs/versions/7.7.3/community/images/engflow-logo.svg similarity index 100% rename from docs/versions/7.7.1/community/images/engflow-logo.svg rename to docs/versions/7.7.3/community/images/engflow-logo.svg
diff --git a/docs/versions/7.7.1/community/images/epam-logo.png b/docs/versions/7.7.3/community/images/epam-logo.png similarity index 100% rename from docs/versions/7.7.1/community/images/epam-logo.png rename to docs/versions/7.7.3/community/images/epam-logo.png Binary files differ
diff --git a/docs/versions/7.7.1/community/images/flare-logo.png b/docs/versions/7.7.3/community/images/flare-logo.png similarity index 100% rename from docs/versions/7.7.1/community/images/flare-logo.png rename to docs/versions/7.7.3/community/images/flare-logo.png Binary files differ
diff --git a/docs/versions/7.7.1/community/images/hermetiq-logo.png b/docs/versions/7.7.3/community/images/hermetiq-logo.png similarity index 100% rename from docs/versions/7.7.1/community/images/hermetiq-logo.png rename to docs/versions/7.7.3/community/images/hermetiq-logo.png Binary files differ
diff --git a/docs/versions/7.7.1/community/images/jetbrains.svg b/docs/versions/7.7.3/community/images/jetbrains.svg similarity index 100% rename from docs/versions/7.7.1/community/images/jetbrains.svg rename to docs/versions/7.7.3/community/images/jetbrains.svg
diff --git a/docs/versions/7.7.1/community/images/liulishuo.png b/docs/versions/7.7.3/community/images/liulishuo.png similarity index 100% rename from docs/versions/7.7.1/community/images/liulishuo.png rename to docs/versions/7.7.3/community/images/liulishuo.png Binary files differ
diff --git a/docs/versions/7.7.1/community/images/nativelink.svg b/docs/versions/7.7.3/community/images/nativelink.svg similarity index 100% rename from docs/versions/7.7.1/community/images/nativelink.svg rename to docs/versions/7.7.3/community/images/nativelink.svg
diff --git a/docs/versions/7.7.1/community/images/oasis-logo.png b/docs/versions/7.7.3/community/images/oasis-logo.png similarity index 100% rename from docs/versions/7.7.1/community/images/oasis-logo.png rename to docs/versions/7.7.3/community/images/oasis-logo.png Binary files differ
diff --git a/docs/versions/7.7.1/community/images/sumglobal-logo.png b/docs/versions/7.7.3/community/images/sumglobal-logo.png similarity index 100% rename from docs/versions/7.7.1/community/images/sumglobal-logo.png rename to docs/versions/7.7.3/community/images/sumglobal-logo.png Binary files differ
diff --git a/docs/versions/7.7.1/community/images/trunk-logo-dark.svg b/docs/versions/7.7.3/community/images/trunk-logo-dark.svg similarity index 100% rename from docs/versions/7.7.1/community/images/trunk-logo-dark.svg rename to docs/versions/7.7.3/community/images/trunk-logo-dark.svg
diff --git a/docs/versions/7.7.1/community/images/tweag-logo.png b/docs/versions/7.7.3/community/images/tweag-logo.png similarity index 100% rename from docs/versions/7.7.1/community/images/tweag-logo.png rename to docs/versions/7.7.3/community/images/tweag-logo.png Binary files differ
diff --git a/docs/versions/7.7.1/community/images/typedb.png b/docs/versions/7.7.3/community/images/typedb.png similarity index 100% rename from docs/versions/7.7.1/community/images/typedb.png rename to docs/versions/7.7.3/community/images/typedb.png Binary files differ
diff --git a/docs/versions/7.7.1/community/images/virtuslab.svg b/docs/versions/7.7.3/community/images/virtuslab.svg similarity index 100% rename from docs/versions/7.7.1/community/images/virtuslab.svg rename to docs/versions/7.7.3/community/images/virtuslab.svg
diff --git a/docs/versions/7.7.1/community/recommended-rules.mdx b/docs/versions/7.7.3/community/recommended-rules.mdx similarity index 92% rename from docs/versions/7.7.1/community/recommended-rules.mdx rename to docs/versions/7.7.3/community/recommended-rules.mdx index a483a23..269a0ed 100644 --- a/docs/versions/7.7.1/community/recommended-rules.mdx +++ b/docs/versions/7.7.3/community/recommended-rules.mdx
@@ -3,7 +3,7 @@ --- In the documentation, we provide a list of -[recommended rules](/versions/7.7.1/rules). +[recommended rules](/versions/7.7.3/rules). This is a set of high quality rules, which will provide a good experience to our users. We make a distinction between the supported rules, and the hundreds of @@ -15,7 +15,7 @@ to be part of the _recommended rules_ by filing a [GitHub issue](https://github.com/bazelbuild/bazel/). -After a review by the [Bazel core team](/versions/7.7.1/contribute/policy), it +After a review by the [Bazel core team](/versions/7.7.3/contribute/policy), it will be recommended on the Bazel website. ## Requirements for the rule maintainers {#requirements-rule-maintainers} @@ -25,7 +25,7 @@ * The ruleset is well maintained. There must be at least two active maintainers. * The ruleset is well documented, with examples, and easy to use. * The ruleset follows the best practices and is performant (see - [the performance guide](/versions/7.7.1/rules/performance)). + [the performance guide](/versions/7.7.3/rules/performance)). * The ruleset has sufficient test coverage. * The ruleset is tested on [BuildKite](https://github.com/bazelbuild/continuous-integration/blob/master/buildkite/README.md)
diff --git a/docs/versions/7.7.1/community/remote-execution-services.mdx b/docs/versions/7.7.3/community/remote-execution-services.mdx similarity index 100% rename from docs/versions/7.7.1/community/remote-execution-services.mdx rename to docs/versions/7.7.3/community/remote-execution-services.mdx
diff --git a/docs/versions/7.7.1/community/roadmaps-configurability.mdx b/docs/versions/7.7.3/community/roadmaps-configurability.mdx similarity index 90% rename from docs/versions/7.7.1/community/roadmaps-configurability.mdx rename to docs/versions/7.7.3/community/roadmaps-configurability.mdx index b23bfd9..37635a2 100644 --- a/docs/versions/7.7.1/community/roadmaps-configurability.mdx +++ b/docs/versions/7.7.3/community/roadmaps-configurability.mdx
@@ -26,9 +26,9 @@ * Builds scale well, particularly w.r.t graph size and action caching. We also support -[`cquery`](https://bazel.build/versions/7.7.1/query/cquery), [`Starlark configuration`](https://bazel.build/versions/7.7.1/extending/config), +[`cquery`](https://bazel.build/versions/7.7.3/query/cquery), [`Starlark configuration`](https://bazel.build/versions/7.7.3/extending/config), and -[`select()`](https://bazel.build/versions/7.7.1/docs/configurable-attributes). +[`select()`](https://bazel.build/versions/7.7.3/docs/configurable-attributes). ## Roadmap @@ -40,7 +40,7 @@ ### Platforms <div class="padbottom"></div> -<span class="etabox">Q3 2021</span>**Android rules use the new [platforms API](https://bazel.build/versions/7.7.1/concepts/platforms)** +<span class="etabox">Q3 2021</span>**Android rules use the new [platforms API](https://bazel.build/versions/7.7.3/concepts/platforms)** <span class="inprogressstatus">IN PROGRESS</span> ([#11749](https://github.com/bazelbuild/bazel/issues/11749)) * This is our main priority for the beginning of 2021. @@ -50,7 +50,7 @@ <span class="inprogressstatus">IN PROGRESS</span> ([#11748](https://github.com/bazelbuild/bazel/issues/11748)) <div class="padbottom"></div> -<span class="etabox">paused</span>**C++ rules use the new [platformsfall API](https://bazel.build/versions/7.7.1/concepts/platforms)** +<span class="etabox">paused</span>**C++ rules use the new [platformsfall API](https://bazel.build/versions/7.7.3/concepts/platforms)** <span class="inprogressstatus">IN PROGRESS</span> ([#6516](https://github.com/bazelbuild/bazel/issues/6516)) * This is blocked on Android platforms. We can turn this on with a simple flag flip.
diff --git a/docs/versions/7.7.1/community/roadmaps-starlark.mdx b/docs/versions/7.7.3/community/roadmaps-starlark.mdx similarity index 100% rename from docs/versions/7.7.1/community/roadmaps-starlark.mdx rename to docs/versions/7.7.3/community/roadmaps-starlark.mdx
diff --git a/docs/versions/7.7.1/community/sig.mdx b/docs/versions/7.7.3/community/sig.mdx similarity index 98% rename from docs/versions/7.7.1/community/sig.mdx rename to docs/versions/7.7.3/community/sig.mdx index 9131492..a1ac369 100644 --- a/docs/versions/7.7.1/community/sig.mdx +++ b/docs/versions/7.7.3/community/sig.mdx
@@ -3,7 +3,7 @@ --- Bazel hosts Special Interest Groups (SIGs) to focus collaboration on particular -areas and to support communication and coordination between [Bazel owners, maintainers, and contributors](/versions/7.7.1/contribute/policy). This policy +areas and to support communication and coordination between [Bazel owners, maintainers, and contributors](/versions/7.7.3/contribute/policy). This policy applies to [`bazelbuild`](http://github.com/bazelbuild). SIGs do their work in public. The ideal scope for a SIG covers a well-defined
diff --git a/docs/versions/7.7.1/community/update.mdx b/docs/versions/7.7.3/community/update.mdx similarity index 100% rename from docs/versions/7.7.1/community/update.mdx rename to docs/versions/7.7.3/community/update.mdx
diff --git a/docs/versions/7.7.1/community/users.mdx b/docs/versions/7.7.3/community/users.mdx similarity index 98% rename from docs/versions/7.7.1/community/users.mdx rename to docs/versions/7.7.3/community/users.mdx index d9e2805..ce46232 100644 --- a/docs/versions/7.7.1/community/users.mdx +++ b/docs/versions/7.7.3/community/users.mdx
@@ -13,7 +13,7 @@ ### [acqio](https://acqio.com.br) -<img src="/versions/7.7.1/community/images/acqio_logo.svg" width="150" align="right" /> +<img src="/versions/7.7.3/community/images/acqio_logo.svg" width="150" align="right" /> Acqio is a Fintech that provides payment products and services for small and medium merchants. Acqio has a handful of monorepos and uses Bazel along with @@ -110,7 +110,7 @@ baking and deploying all their 3D Assets. ### [Dropbox](https://www.dropbox.com/) -<img src="/versions/7.7.1/community/images/dropbox.png" width="150" align="right" /> +<img src="/versions/7.7.3/community/images/dropbox.png" width="150" align="right" /> At Dropbox, Bazel is a key component to our distributed build and test environment. We use Bazel to combine TypeScript/Python/Go/C/Rust into reliable production releases. @@ -168,7 +168,7 @@ builds every day. ### [GRAKN.AI](https://grakn.ai) -<img src="/versions/7.7.1/community/images/grakn.jpeg" alt="GRAKN AI Logo" width="150" align="right" /> +<img src="/versions/7.7.3/community/images/grakn.jpeg" alt="GRAKN AI Logo" width="150" align="right" /> Grakn is a database technology that serves as the knowledge-base foundation to intelligent systems. Grakn allows intelligent systems to interpret complex @@ -237,19 +237,19 @@ ### [LingoChamp](https://www.liulishuo.com/en) -<img src="/versions/7.7.1/community/images/liulishuo.png" width="100" align="right" /> +<img src="/versions/7.7.3/community/images/liulishuo.png" width="100" align="right" /> LingoChamp provides professional solutions to English learners. We use Bazel for our go, java and python projects. ### [LinkedIn](https://linkedin.com/) -<img src="/versions/7.7.1/community/images/Linkedin-Logo.png" width="100" align="right" /> +<img src="/versions/7.7.3/community/images/Linkedin-Logo.png" width="100" align="right" /> LinkedIn, a subsidiary of Microsoft, is the world’s largest professional social network. LinkedIn uses Bazel for building its iOS Apps. ### [Lucid Software](https://lucid.co/) -<img src="/versions/7.7.1/community/images/Lucid_Software-logo.svg" width="150" align="right" /> +<img src="/versions/7.7.3/community/images/Lucid_Software-logo.svg" width="150" align="right" /> Lucid Software is a leader in visual collaboration, helping teams see and build the future from idea to reality. With its products—[Lucidchart](https://www.lucidchart.com/),
diff --git a/docs/versions/7.7.1/concepts/build-files.mdx b/docs/versions/7.7.3/concepts/build-files.mdx similarity index 95% rename from docs/versions/7.7.1/concepts/build-files.mdx rename to docs/versions/7.7.3/concepts/build-files.mdx index 819f237..d13cea6 100644 --- a/docs/versions/7.7.1/concepts/build-files.mdx +++ b/docs/versions/7.7.3/concepts/build-files.mdx
@@ -40,7 +40,7 @@ Crucially, programs in Starlark can't perform arbitrary I/O. This invariant makes the interpretation of `BUILD` files hermetic — dependent only on a known set of inputs, which is essential for ensuring that builds are reproducible. -For more details, see [Hermeticity](/versions/7.7.1/basics/hermeticity). +For more details, see [Hermeticity](/versions/7.7.3/basics/hermeticity). `BUILD` files should be written using only ASCII characters, although technically they are interpreted using the Latin-1 character set. @@ -67,7 +67,7 @@ (no variable) and `load` statements must appear at top-level — they cannot be in a function body. -The first argument of `load` is a [label](/versions/7.7.1/concepts/labels) identifying a +The first argument of `load` is a [label](/versions/7.7.3/concepts/labels) identifying a `.bzl` file. If it's a relative label, it is resolved with respect to the package (not directory) containing the current `bzl` file. Relative labels in `load` statements should use a leading `:`. @@ -90,7 +90,7 @@ In a `.bzl` file, symbols starting with `_` are not exported and cannot be loaded from another file. -You can use [load visibility](/versions/7.7.1/concepts/visibility#load-visibility) to restrict +You can use [load visibility](/versions/7.7.3/concepts/visibility#load-visibility) to restrict who may load a `.bzl` file. ## Types of build rules {#types-of-build-rules} @@ -101,7 +101,7 @@ libraries, and tests, respectively. Other languages use the same naming scheme, with a different prefix, such as `java_*` for Java. Some of these functions are documented in the -[Build Encyclopedia](/versions/7.7.1/reference/be/overview), but it is possible +[Build Encyclopedia](/versions/7.7.3/reference/be/overview), but it is possible for anyone to create new rules. * `*_binary` rules build executable programs in a given language. After a
diff --git a/docs/versions/7.7.1/concepts/build-ref.mdx b/docs/versions/7.7.3/concepts/build-ref.mdx similarity index 96% rename from docs/versions/7.7.1/concepts/build-ref.mdx rename to docs/versions/7.7.3/concepts/build-ref.mdx index bca6d2a..6a2289b 100644 --- a/docs/versions/7.7.1/concepts/build-ref.mdx +++ b/docs/versions/7.7.3/concepts/build-ref.mdx
@@ -17,7 +17,7 @@ in legacy contexts, `WORKSPACE` or `WORKSPACE.bazel`. The repo in which the current Bazel command is being run is called the _main -repo_. Other, (external) repos are defined by _repo rules_; see [external dependencies overview](/versions/7.7.1/external/overview) for more information. +repo_. Other, (external) repos are defined by _repo rules_; see [external dependencies overview](/versions/7.7.3/external/overview) for more information. ## Workspace {#workspace} @@ -36,7 +36,7 @@ used to produce output artifacts. A package is defined as a directory containing a -[`BUILD` file](/versions/7.7.1/concepts/build-files) named either `BUILD` or `BUILD.bazel`. A +[`BUILD` file](/versions/7.7.3/concepts/build-files) named either `BUILD` or `BUILD.bazel`. A package includes all files in its directory, plus all subdirectories beneath it, except those which themselves contain a `BUILD` file. From this definition, no file or directory may be a part of two different packages. @@ -94,4 +94,4 @@ package groups they include. The only allowed ways to refer to them are from the `visibility` attribute of rules or from the `default_visibility` attribute of the `package` function; they do not generate or consume files. For more -information, refer to the [`package_group` documentation](/versions/7.7.1/reference/be/functions#package_group). +information, refer to the [`package_group` documentation](/versions/7.7.3/reference/be/functions#package_group).
diff --git a/docs/versions/7.7.1/concepts/dependencies.mdx b/docs/versions/7.7.3/concepts/dependencies.mdx similarity index 94% rename from docs/versions/7.7.1/concepts/dependencies.mdx rename to docs/versions/7.7.3/concepts/dependencies.mdx index 3358c7c..9c1649e 100644 --- a/docs/versions/7.7.1/concepts/dependencies.mdx +++ b/docs/versions/7.7.3/concepts/dependencies.mdx
@@ -94,14 +94,14 @@ <tr> <td> <figure> - <img src="/versions/7.7.1/docs/images/a_b_c.svg" + <img src="/versions/7.7.3/docs/images/a_b_c.svg" alt="Declared dependency graph with arrows connecting a, b, and c" /> <figcaption><b>Declared</b> dependency graph</figcaption> </figure> </td> <td> <figure> - <img src="/versions/7.7.1/docs/images/a_b_c.svg" + <img src="/versions/7.7.3/docs/images/a_b_c.svg" alt="Actual dependency graph that matches the declared dependency graph with arrows connecting a, b, and c" /> <figcaption><b>Actual</b> dependency graph</figcaption> @@ -135,14 +135,14 @@ <tr> <td> <figure> - <img src="/versions/7.7.1/docs/images/a_b_c.svg" + <img src="/versions/7.7.3/docs/images/a_b_c.svg" alt="Declared dependency graph with arrows connecting a, b, and c" /> <figcaption><b>Declared</b> dependency graph</figcaption> </figure> </td> <td> <figure> - <img src="/versions/7.7.1/docs/images/a_b_c_ac.svg" + <img src="/versions/7.7.3/docs/images/a_b_c_ac.svg" alt="Actual dependency graph with arrows connecting a, b, and c. An arrow now connects A to C as well. This does not match the declared dependency graph" /> @@ -189,7 +189,7 @@ <tr> <td> <figure> - <img src="/versions/7.7.1/docs/images/ab_c.svg" + <img src="/versions/7.7.3/docs/images/ab_c.svg" alt="Declared dependency graph with arrows connecting a and b. b no longer connects to c, which breaks a's connection to c" /> <figcaption><b>Declared</b> dependency graph</figcaption> @@ -197,7 +197,7 @@ </td> <td> <figure> - <img src="/versions/7.7.1/docs/images/a_b_a_c.svg" + <img src="/versions/7.7.3/docs/images/a_b_a_c.svg" alt="Actual dependency graph that shows a connecting to b and c, but b no longer connects to c" /> <figcaption><b>Actual</b> dependency graph</figcaption> @@ -217,11 +217,11 @@ Most build rules have three attributes for specifying different kinds of generic dependencies: `srcs`, `deps` and `data`. These are explained below. For more details, see -[Attributes common to all rules](/versions/7.7.1/reference/be/common-definitions). +[Attributes common to all rules](/versions/7.7.3/reference/be/common-definitions). Many rules also have additional attributes for rule-specific kinds of dependencies, for example, `compiler` or `resources`. These are detailed in the -[Build Encyclopedia](/versions/7.7.1/reference/be/). +[Build Encyclopedia](/versions/7.7.3/reference/be/). ### `srcs` dependencies {#srcs-dependencies} @@ -292,16 +292,16 @@ edits to individual files as those changes don't affect the enclosing directory. Rather than specifying directories as inputs to the build system, you should enumerate the set of files contained within them, either explicitly or using the -[`glob()`](/versions/7.7.1/reference/be/functions#glob) function. (Use `**` to force the +[`glob()`](/versions/7.7.3/reference/be/functions#glob) function. (Use `**` to force the `glob()` to be recursive.) <p><span class="compare-better">Recommended</span> — <code>data = glob(["testdata/**"])</code></p> Unfortunately, there are some scenarios where directory labels must be used. For example, if the `testdata` directory contains files whose names don't -conform to the [label syntax](/versions/7.7.1/concepts/labels#labels-lexical-specification), +conform to the [label syntax](/versions/7.7.3/concepts/labels#labels-lexical-specification), then explicit enumeration of files, or use of the -[`glob()`](/versions/7.7.1/reference/be/functions#glob) function produces an invalid labels +[`glob()`](/versions/7.7.3/reference/be/functions#glob) function produces an invalid labels error. You must use directory labels in this case, but beware of the associated risk of incorrect rebuilds described above.
diff --git a/docs/versions/7.7.1/concepts/labels.mdx b/docs/versions/7.7.3/concepts/labels.mdx similarity index 94% rename from docs/versions/7.7.1/concepts/labels.mdx rename to docs/versions/7.7.3/concepts/labels.mdx index afdca9b..23fb9f5 100644 --- a/docs/versions/7.7.1/concepts/labels.mdx +++ b/docs/versions/7.7.3/concepts/labels.mdx
@@ -10,13 +10,13 @@ ``` The first part of the label is the repository name, `@@myrepo`. The double-`@` -syntax signifies that this is a [*canonical* repo name](/versions/7.7.1/external/overview#canonical-repo-name), which is unique within +syntax signifies that this is a [*canonical* repo name](/versions/7.7.3/external/overview#canonical-repo-name), which is unique within the workspace. Labels with canonical repo names unambiguously identify a target no matter which context they appear in. Often the canonical repo name is an arcane string that looks like `@@rules_java~7.1.0~toolchains~local_jdk`. What is much more commonly seen is -labels with an [*apparent* repo name](/versions/7.7.1/external/overview#apparent-repo-name), +labels with an [*apparent* repo name](/versions/7.7.3/external/overview#apparent-repo-name), which looks like: ``` @@ -112,14 +112,14 @@ used from external repositories. For information about the different ways you can refer to targets, see -[target patterns](/versions/7.7.1/run/build#specifying-build-targets). +[target patterns](/versions/7.7.3/run/build#specifying-build-targets). ### Lexical specification of a label {#labels-lexical-specification} Label syntax discourages use of metacharacters that have special meaning to the shell. This helps to avoid inadvertent quoting problems, and makes it easier to construct tools and scripts that manipulate labels, such as the -[Bazel Query Language](/versions/7.7.1/query/language). +[Bazel Query Language](/versions/7.7.3/query/language). The precise details of allowed target names are below. @@ -180,7 +180,7 @@ steps to build the outputs. Rules can be of one of many different kinds (sometimes called the _rule class_), which produce compiled executables and libraries, test executables and other supported -outputs as described in the [Build Encyclopedia](/versions/7.7.1/reference/be/overview). +outputs as described in the [Build Encyclopedia](/versions/7.7.3/reference/be/overview). `BUILD` files declare _targets_ by invoking _rules_. @@ -204,7 +204,7 @@ Every rule has a set of _attributes_; the applicable attributes for a given rule, and the significance and semantics of each attribute are a function of -the rule's kind; see the [Build Encyclopedia](/versions/7.7.1/reference/be/overview) for a +the rule's kind; see the [Build Encyclopedia](/versions/7.7.3/reference/be/overview) for a list of rules and their corresponding attributes. Each attribute has a name and a type. Some of the common types an attribute can have are integer, label, list of labels, string, list of strings, output label, list of output labels. Not @@ -218,7 +218,7 @@ In some cases, the name of the rule kind is somewhat arbitrary, and more interesting are the names of the files generated by the rule, and this is true of genrules. For more information, see -[General Rules: genrule](/versions/7.7.1/reference/be/general#genrule). +[General Rules: genrule](/versions/7.7.3/reference/be/general#genrule). In other cases, the name is significant: for `*_binary` and `*_test` rules, for example, the rule name determines the name of the executable produced by @@ -226,4 +226,4 @@ This directed acyclic graph over targets is called the _target graph_ or _build dependency graph_, and is the domain over which the -[Bazel Query tool](/versions/7.7.1/query/guide) operates. +[Bazel Query tool](/versions/7.7.3/query/guide) operates.
diff --git a/docs/versions/7.7.1/concepts/platforms.mdx b/docs/versions/7.7.3/concepts/platforms.mdx similarity index 98% rename from docs/versions/7.7.1/concepts/platforms.mdx rename to docs/versions/7.7.3/concepts/platforms.mdx index b9f348c..b9bf7d1 100644 --- a/docs/versions/7.7.1/concepts/platforms.mdx +++ b/docs/versions/7.7.3/concepts/platforms.mdx
@@ -50,7 +50,7 @@ This replaces legacy flags `--java_toolchain`, `--host_java_toolchain`, `--javabase`, and `--host_javabase`. -See [Java and Bazel](/versions/7.7.1/docs/bazel-and-java) for details. +See [Java and Bazel](/versions/7.7.3/docs/bazel-and-java) for details. ### Android {#android} @@ -169,8 +169,8 @@ 1. The toolchains you want to use must exist. If using stock toolchains, the language owners should include instructions for how to register them. If - writing your own custom toolchains, you need to [register](https://bazel.build/versions/7.7.1/extending/toolchains#registering-building-toolchains) them in your - `MODULE.bazel` file or with [`--extra_toolchains`](https://bazel.build/versions/7.7.1/reference/command-line-reference#flag--extra_toolchains). + writing your own custom toolchains, you need to [register](https://bazel.build/versions/7.7.3/extending/toolchains#registering-building-toolchains) them in your + `MODULE.bazel` file or with [`--extra_toolchains`](https://bazel.build/versions/7.7.3/reference/command-line-reference#flag--extra_toolchains). 1. `select()`s and [configuration transitions][Starlark transitions] must resolve properly. See [select()](#select) and [Transitions](#transitions). @@ -258,7 +258,7 @@ [Common platform properties](#common-platform-properties) 1. Define standard toolchains and make them accessible to users through your - rule's registration instructions ([details](https://bazel.build/versions/7.7.1/extending/toolchains#registering-building-toolchains)) + rule's registration instructions ([details](https://bazel.build/versions/7.7.3/extending/toolchains#registering-building-toolchains)) 1. Ensure [`select()`s](#select) and [configuration transitions](#transitions) support platforms. This is the
diff --git a/docs/versions/7.7.1/concepts/visibility.mdx b/docs/versions/7.7.3/concepts/visibility.mdx similarity index 94% rename from docs/versions/7.7.1/concepts/visibility.mdx rename to docs/versions/7.7.3/concepts/visibility.mdx index 0baeb11..99b3edf 100644 --- a/docs/versions/7.7.1/concepts/visibility.mdx +++ b/docs/versions/7.7.3/concepts/visibility.mdx
@@ -19,18 +19,18 @@ `A` grants visibility to `B`'s package. Thus, packages are the unit of granularity for deciding whether or not to allow access. If `B` depends on `A` but `A` is not visible to `B`, then any attempt to build `B` fails during -[analysis](/versions/7.7.1/reference/glossary#analysis-phase). +[analysis](/versions/7.7.3/reference/glossary#analysis-phase). Note that granting visibility to a package does not by itself grant visibility to its subpackages. For more details on package and subpackages, see -[Concepts and terminology](/versions/7.7.1/concepts/build-ref). +[Concepts and terminology](/versions/7.7.3/concepts/build-ref). For prototyping, you can disable target visibility enforcement by setting the flag `--check_visibility=false`. This should not be done for production usage in submitted code. The primary way to control visibility is with the -[`visibility`](/versions/7.7.1/reference/be/common-definitions#common.visibility) attribute on +[`visibility`](/versions/7.7.3/reference/be/common-definitions#common.visibility) attribute on rule targets. This section describes the format of this attribute, and how to determine a target's visibility. @@ -54,10 +54,10 @@ direct and indirect subpackages. * `"//some_pkg:my_package_group"`: Grants access to all of the packages that - are part of the given [`package_group`](/versions/7.7.1/reference/be/functions#package_group). + are part of the given [`package_group`](/versions/7.7.3/reference/be/functions#package_group). * Package groups use a - [different syntax](/versions/7.7.1/reference/be/functions#package_group.packages) for + [different syntax](/versions/7.7.3/reference/be/functions#package_group.packages) for specifying packages. Within a package group, the forms `"//foo/bar:__pkg__"` and `"//foo/bar:__subpackages__"` are respectively replaced by `"//foo/bar"` and `"//foo/bar/..."`. Likewise, @@ -85,8 +85,8 @@ 1. The value of its `visibility` attribute, if set; or else 2. The value of the -[`default_visibility`](/versions/7.7.1/reference/be/functions#package.default_visibility) -argument of the [`package`](/versions/7.7.1/reference/be/functions#package) statement in the +[`default_visibility`](/versions/7.7.3/reference/be/functions#package.default_visibility) +argument of the [`package`](/versions/7.7.3/reference/be/functions#package) statement in the target's `BUILD` file, if such a declaration exists; or else 3. `//visibility:private`. @@ -157,7 +157,7 @@ ### Source file target visibility {#source-file-target-visibility} You can explicitly set the visibility of a source file target by calling -[`exports_files`](/versions/7.7.1/reference/be/functions#exports_files). When no `visibility` +[`exports_files`](/versions/7.7.3/reference/be/functions#exports_files). When no `visibility` argument is passed to `exports_files`, it makes the visibility public. `exports_files` may not be used to override the visibility of a generated file. @@ -199,8 +199,8 @@ ### Config setting visibility {#config-setting-visibility} Historically, Bazel has not enforced visibility for -[`config_setting`](/versions/7.7.1/reference/be/general#config_setting) targets that are -referenced in the keys of a [`select()`](/versions/7.7.1/reference/be/functions#select). There +[`config_setting`](/versions/7.7.3/reference/be/general#config_setting) targets that are +referenced in the keys of a [`select()`](/versions/7.7.3/reference/be/functions#select). There are two flags to remove this legacy behavior: * [`--incompatible_enforce_config_setting_visibility`](https://github.com/bazelbuild/bazel/issues/12932) @@ -225,7 +225,7 @@ ### Visibility of implicit dependencies {#visibility-implicit-dependencies} -Some rules have [implicit dependencies](/versions/7.7.1/extending/rules#private_attributes_and_implicit_dependencies) — +Some rules have [implicit dependencies](/versions/7.7.3/extending/rules#private_attributes_and_implicit_dependencies) — dependencies that are not spelled out in a `BUILD` file but are inherent to every instance of that rule. For example, a `cc_library` rule might create an implicit dependency from each of its rule targets to an executable target @@ -263,7 +263,7 @@ Note that a `.bzl` file may or may not have a corresponding source file target. If it does, there is no guarantee that the load visibility and the target visibility coincide. That is, the same `BUILD` file might be able to load the -`.bzl` file but not list it in the `srcs` of a [`filegroup`](/versions/7.7.1/reference/be/general#filegroup), +`.bzl` file but not list it in the `srcs` of a [`filegroup`](/versions/7.7.3/reference/be/general#filegroup), or vice versa. This can sometimes cause problems for rules that wish to consume `.bzl` files as source code, such as for documentation generation or testing. @@ -276,9 +276,9 @@ ### Declaring load visibility {#declaring-load-visibility} To set the load visibility of a `.bzl` file, call the -[`visibility()`](/versions/7.7.1/rules/lib/globals/bzl#visibility) function from within the file. +[`visibility()`](/versions/7.7.3/rules/lib/globals/bzl#visibility) function from within the file. The argument to `visibility()` is a list of package specifications, just like -the [`packages`](/versions/7.7.1/reference/be/functions#package_group.packages) attribute of +the [`packages`](/versions/7.7.3/reference/be/functions#package_group.packages) attribute of `package_group`. However, `visibility()` does not accept negative package specifications. @@ -371,7 +371,7 @@ Sometimes a `.bzl` file might need to be visible to an allowlist that is composed of multiple smaller allowlists. This is analogous to how a `package_group` can incorporate other `package_group`s via its -[`includes`](/versions/7.7.1/reference/be/functions#package_group.includes) attribute. +[`includes`](/versions/7.7.3/reference/be/functions#package_group.includes) attribute. Suppose you are deprecating a widely used macro. You want it to be visible only to existing users and to the packages owned by your own team. You might write:
diff --git a/docs/versions/7.7.1/configure/attributes.mdx b/docs/versions/7.7.3/configure/attributes.mdx similarity index 94% rename from docs/versions/7.7.1/configure/attributes.mdx rename to docs/versions/7.7.3/configure/attributes.mdx index 8af6445..5591b8d 100644 --- a/docs/versions/7.7.1/configure/attributes.mdx +++ b/docs/versions/7.7.3/configure/attributes.mdx
@@ -2,7 +2,7 @@ title: 'Configurable Build Attributes' --- -**_Configurable attributes_**, commonly known as [`select()`](/versions/7.7.1/reference/be/functions#select), is a Bazel feature that lets users toggle the values +**_Configurable attributes_**, commonly known as [`select()`](/versions/7.7.3/reference/be/functions#select), is a Bazel feature that lets users toggle the values of build rule attributes at the command line. This can be used, for example, for a multiplatform library that automatically @@ -65,7 +65,7 @@ </table> `select()` serves as a placeholder for a value that will be chosen based on -*configuration conditions*, which are labels referencing [`config_setting`](/versions/7.7.1/reference/be/general#config_setting) +*configuration conditions*, which are labels referencing [`config_setting`](/versions/7.7.3/reference/be/general#config_setting) targets. By using `select()` in a configurable attribute, the attribute effectively adopts different values when different conditions hold. @@ -82,7 +82,7 @@ `resources`, `cmd`, and most other attributes. Only a small number of attributes are *non-configurable*, and these are clearly annotated. For example, `config_setting`'s own -[`values`](/versions/7.7.1/reference/be/general#config_setting.values) attribute is non-configurable. +[`values`](/versions/7.7.3/reference/be/general#config_setting.values) attribute is non-configurable. ## `select()` and dependencies {#select-and-dependencies} @@ -90,7 +90,7 @@ under a target. For example, `genrule`'s `tools` changes `--cpu` to the CPU of the machine running Bazel (which, thanks to cross-compilation, may be different than the CPU the target is built for). This is known as a -[configuration transition](/versions/7.7.1/reference/glossary#transition). +[configuration transition](/versions/7.7.3/reference/glossary#transition). Given @@ -143,8 +143,8 @@ ## Configuration conditions {#configuration-conditions} Each key in a configurable attribute is a label reference to a -[`config_setting`](/versions/7.7.1/reference/be/general#config_setting) or -[`constraint_value`](/versions/7.7.1/reference/be/platforms-and-toolchains#constraint_value). +[`config_setting`](/versions/7.7.3/reference/be/general#config_setting) or +[`constraint_value`](/versions/7.7.3/reference/be/platforms-and-toolchains#constraint_value). `config_setting` is just a collection of expected command line flag settings. By encapsulating these in a target, it's @@ -156,8 +156,8 @@ Flags like `--cpu` are built into Bazel: the build tool natively understands them for all builds in all projects. These are specified with -[`config_setting`](/versions/7.7.1/reference/be/general#config_setting)'s -[`values`](/versions/7.7.1/reference/be/general#config_setting.values) attribute: +[`config_setting`](/versions/7.7.3/reference/be/general#config_setting)'s +[`values`](/versions/7.7.3/reference/be/general#config_setting.values) attribute: ```python config_setting( @@ -181,7 +181,7 @@ * `values = { "force_pic": "0" }` matches `bazel build --noforce_pic` `config_setting` only supports flags that affect target behavior. For example, -[`--show_progress`](/versions/7.7.1/docs/user-manual#show-progress) isn't allowed because +[`--show_progress`](/versions/7.7.3/docs/user-manual#show-progress) isn't allowed because it only affects how Bazel reports progress to the user. Targets can't use that flag to construct their results. The exact set of supported flags isn't documented. In practice, most flags that "make sense" work. @@ -192,8 +192,8 @@ [Starlark build settings][BuildSettings]. Unlike built-in flags, these are defined as build targets, so Bazel references them with target labels. -These are triggered with [`config_setting`](/versions/7.7.1/reference/be/general#config_setting)'s -[`flag_values`](/versions/7.7.1/reference/be/general#config_setting.flag_values) +These are triggered with [`config_setting`](/versions/7.7.3/reference/be/general#config_setting)'s +[`flag_values`](/versions/7.7.3/reference/be/general#config_setting.flag_values) attribute: ```python @@ -210,12 +210,12 @@ Behavior is the same as for [built-in flags](#built-in-flags). See [here](https://github.com/bazelbuild/examples/tree/HEAD/configurations/select_on_build_setting) for a working example. -[`--define`](/versions/7.7.1/reference/command-line-reference#flag--define) +[`--define`](/versions/7.7.3/reference/command-line-reference#flag--define) is an alternative legacy syntax for custom flags (for example `--define foo=bar`). This can be expressed either in the -[values](/versions/7.7.1/reference/be/general#config_setting.values) attribute +[values](/versions/7.7.3/reference/be/general#config_setting.values) attribute (`values = {"define": "foo=bar"}`) or the -[define_values](/versions/7.7.1/reference/be/general#config_setting.define_values) attribute +[define_values](/versions/7.7.3/reference/be/general#config_setting.define_values) attribute (`define_values = {"foo": "bar"}`). `--define` is only supported for backwards compatibility. Prefer Starlark build settings whenever possible. @@ -263,7 +263,7 @@ While the ability to specify multiple flags on the command line provides flexibility, it can also be burdensome to individually set each one every time you want to build a target. - [Platforms](/versions/7.7.1/extending/platforms) + [Platforms](/versions/7.7.3/extending/platforms) let you consolidate these into simple bundles. ```python @@ -358,7 +358,7 @@ check against single values. Platforms are still under development. See the -[documentation](/versions/7.7.1/concepts/platforms) for details. +[documentation](/versions/7.7.3/concepts/platforms) for details. ## Combining `select()`s {#combining-selects} @@ -560,7 +560,7 @@ //tools/cc_target_os:android ``` -This can be customized with the [`no_match_error`](/versions/7.7.1/reference/be/functions#select) +This can be customized with the [`no_match_error`](/versions/7.7.3/reference/be/functions#select) attribute: ```python @@ -622,7 +622,7 @@ This is for two reasons. First, macros that need to know which path a `select` will choose *cannot work* -because macros are evaluated in Bazel's [loading phase](/versions/7.7.1/run/build#loading), +because macros are evaluated in Bazel's [loading phase](/versions/7.7.3/run/build#loading), which occurs before flag values are known. This is a core Bazel design restriction that's unlikely to change any time soon. @@ -632,14 +632,14 @@ ## Bazel query and cquery {#query-and-cquery} -Bazel [`query`](/versions/7.7.1/query/guide) operates over Bazel's -[loading phase](/versions/7.7.1/reference/glossary#loading-phase). +Bazel [`query`](/versions/7.7.3/query/guide) operates over Bazel's +[loading phase](/versions/7.7.3/reference/glossary#loading-phase). This means it doesn't know what command line flags a target uses since those flags aren't evaluated until later in the build (in the -[analysis phase](/versions/7.7.1/reference/glossary#analysis-phase)). +[analysis phase](/versions/7.7.3/reference/glossary#analysis-phase)). So it can't determine which `select()` branches are chosen. -Bazel [`cquery`](/versions/7.7.1/query/cquery) operates after Bazel's analysis phase, so it has +Bazel [`cquery`](/versions/7.7.3/query/cquery) operates after Bazel's analysis phase, so it has all this information and can accurately resolve `select()`s. Consider: @@ -700,7 +700,7 @@ The key issue this question usually means is that select() doesn't work in *macros*. These are different than *rules*. See the -documentation on [rules](/versions/7.7.1/extending/rules) and [macros](/versions/7.7.1/extending/macros) +documentation on [rules](/versions/7.7.3/extending/rules) and [macros](/versions/7.7.3/extending/macros) to understand the difference. Here's an end-to-end example: @@ -911,14 +911,14 @@ First of all, do not use `bind()`. It is deprecated in favor of `alias()`. -The technical answer is that [`bind()`](/versions/7.7.1/reference/be/workspace#bind) is a repo +The technical answer is that [`bind()`](/versions/7.7.3/reference/be/workspace#bind) is a repo rule, not a BUILD rule. Repo rules do not have a specific configuration, and aren't evaluated in the same way as BUILD rules. Therefore, a `select()` in a `bind()` can't actually evaluate to any specific branch. -Instead, you should use [`alias()`](/versions/7.7.1/reference/be/general#alias), with a `select()` in +Instead, you should use [`alias()`](/versions/7.7.3/reference/be/general#alias), with a `select()` in the `actual` attribute, to perform this type of run-time determination. This works correctly, since `alias()` is a BUILD rule, and is evaluated with a specific configuration. @@ -956,7 +956,7 @@ ### Why doesn't my select() choose what I expect? {#faq-select-choose-condition} If `//myapp:foo` has a `select()` that doesn't choose the condition you expect, -use [cquery](/versions/7.7.1/query/cquery) and `bazel config` to debug: +use [cquery](/versions/7.7.3/query/cquery) and `bazel config` to debug: If `//myapp:foo` is the top-level target you're building, run: @@ -997,7 +997,7 @@ Then compare this output against the settings expected by each `config_setting`. `//myapp:foo` may exist in different configurations in the same build. See the -[cquery docs](/versions/7.7.1/query/cquery) for guidance on using `somepath` to get the right +[cquery docs](/versions/7.7.3/query/cquery) for guidance on using `somepath` to get the right one. Caution: To prevent restarting the Bazel server, invoke `bazel config` with the
diff --git a/docs/versions/7.7.1/configure/best-practices.mdx b/docs/versions/7.7.3/configure/best-practices.mdx similarity index 98% rename from docs/versions/7.7.1/configure/best-practices.mdx rename to docs/versions/7.7.3/configure/best-practices.mdx index fb1c83a..4449573 100644 --- a/docs/versions/7.7.1/configure/best-practices.mdx +++ b/docs/versions/7.7.3/configure/best-practices.mdx
@@ -65,7 +65,7 @@ ## Using the `.bazelrc` file {#bazelrc-file} For project-specific options, use the configuration file your -`workspace/.bazelrc` (see [bazelrc format](/versions/7.7.1/run/bazelrc)). +`workspace/.bazelrc` (see [bazelrc format](/versions/7.7.3/run/bazelrc)). If you want to support per-user options for your project that you **do not** want to check into source control, include the line:
diff --git a/docs/versions/7.7.1/configure/coverage.mdx b/docs/versions/7.7.3/configure/coverage.mdx similarity index 96% rename from docs/versions/7.7.1/configure/coverage.mdx rename to docs/versions/7.7.3/configure/coverage.mdx index 8f5fe0c..2295401 100644 --- a/docs/versions/7.7.1/configure/coverage.mdx +++ b/docs/versions/7.7.3/configure/coverage.mdx
@@ -36,10 +36,10 @@ "Instrumentation" in this case refers to the coverage tools that are used for a specific target. Bazel allows turning this on for a specific subset of files using the -[`--instrumentation_filter`](/versions/7.7.1/reference/command-line-reference#flag--instrumentation_filter) +[`--instrumentation_filter`](/versions/7.7.3/reference/command-line-reference#flag--instrumentation_filter) flag, which specifies a filter for targets that are tested with the instrumentation enabled. To enable instrumentation for tests, the -[`--instrument_test_targets`](/versions/7.7.1/reference/command-line-reference#flag--instrument_test_targets) +[`--instrument_test_targets`](/versions/7.7.3/reference/command-line-reference#flag--instrument_test_targets) flag is required. By default, bazel tries to match the target package(s), and prints the @@ -49,7 +49,7 @@ To produce a coverage report, use [`bazel coverage --combined_report=lcov -[target]`](/versions/7.7.1/reference/command-line-reference#coverage). This runs the +[target]`](/versions/7.7.3/reference/command-line-reference#coverage). This runs the tests for the target, generating coverage reports in the lcov format for each file.
diff --git a/docs/versions/7.7.1/configure/integrate-cpp.mdx b/docs/versions/7.7.3/configure/integrate-cpp.mdx similarity index 83% rename from docs/versions/7.7.1/configure/integrate-cpp.mdx rename to docs/versions/7.7.3/configure/integrate-cpp.mdx index f20b55f..1841336 100644 --- a/docs/versions/7.7.1/configure/integrate-cpp.mdx +++ b/docs/versions/7.7.3/configure/integrate-cpp.mdx
@@ -8,20 +8,20 @@ Because of [ongoing migration of C++ rules](https://github.com/bazelbuild/bazel/issues/6516) -to [platforms](/versions/7.7.1/extending/platforms) and -[toolchains](/versions/7.7.1/extending/toolchains), you +to [platforms](/versions/7.7.3/extending/platforms) and +[toolchains](/versions/7.7.3/extending/toolchains), you should use the helper function available at [@bazel_tools//tools/cpp:toolchain_utils.bzl](https://source.bazel.build/bazel/+/main:tools/cpp/toolchain_utils.bzl;l=23), which works both when toolchains are disabled and enabled. To depend on a C++ toolchain in your rule, add a -[`Label`](/versions/7.7.1/rules/lib/toplevel/attr#label) +[`Label`](/versions/7.7.3/rules/lib/toplevel/attr#label) attribute named `_cc_toolchain` and point it to `@bazel_tools//tools/cpp:current_cc_toolchain` (an instance of `cc_toolchain_alias` rule, that points to the currently selected C++ toolchain). Then, in the rule implementation, use [`find_cpp_toolchain(ctx)`](https://source.bazel.build/bazel/+/main:tools/cpp/toolchain_utils.bzl;l=23) to get the -[`CcToolchainInfo`](/versions/7.7.1/rules/lib/providers/CcToolchainInfo). +[`CcToolchainInfo`](/versions/7.7.3/rules/lib/providers/CcToolchainInfo). A complete working example can be found [in the rules_cc examples](https://github.com/bazelbuild/rules_cc/blob/main/examples/write_cc_toolchain_cpu/write_cc_toolchain_cpu.bzl). @@ -33,19 +33,19 @@ consistently with the C++ toolchain - for example, passing C++ command line flags to a tool that invokes the C++ compiler behind the scenes. -C++ rules use a special way of constructing command lines based on [feature configuration](/versions/7.7.1/docs/cc-toolchain-config-reference). To construct a command line, +C++ rules use a special way of constructing command lines based on [feature configuration](/versions/7.7.3/docs/cc-toolchain-config-reference). To construct a command line, you need the following: * `features` and `action_configs` - these come from the `CcToolchainConfigInfo` and encapsulated in `CcToolchainInfo` -* `FeatureConfiguration` - returned by [cc_common.configure_features](/versions/7.7.1/rules/lib/toplevel/cc_common#configure_features) +* `FeatureConfiguration` - returned by [cc_common.configure_features](/versions/7.7.3/rules/lib/toplevel/cc_common#configure_features) * cc toolchain config variables - returned by - [cc_common.create_compile_variables](/versions/7.7.1/rules/lib/toplevel/cc_common#create_compile_variables) + [cc_common.create_compile_variables](/versions/7.7.3/rules/lib/toplevel/cc_common#create_compile_variables) or - [cc_common.create_link_variables](/versions/7.7.1/rules/lib/toplevel/cc_common#create_link_variables). + [cc_common.create_link_variables](/versions/7.7.3/rules/lib/toplevel/cc_common#create_link_variables). There still are tool-specific getters, such as -[compiler_executable](/versions/7.7.1/rules/lib/providers/CcToolchainInfo#compiler_executable). +[compiler_executable](/versions/7.7.3/rules/lib/providers/CcToolchainInfo#compiler_executable). Prefer `get_tool_for_action` over these, as tool-specific getters will eventually be removed. @@ -55,10 +55,10 @@ ## Implementing Starlark rules that depend on C++ rules and/or that C++ rules can depend on {#implement-starlark-rules} Most C++ rules provide -[`CcInfo`](/versions/7.7.1/rules/lib/providers/CcInfo), -a provider containing [`CompilationContext`](/versions/7.7.1/rules/lib/builtins/CompilationContext) +[`CcInfo`](/versions/7.7.3/rules/lib/providers/CcInfo), +a provider containing [`CompilationContext`](/versions/7.7.3/rules/lib/builtins/CompilationContext) and -[`LinkingContext`](/versions/7.7.1/rules/lib/builtins/LinkingContext). +[`LinkingContext`](/versions/7.7.3/rules/lib/builtins/LinkingContext). Through these it is possible to access information such as all transitive headers or libraries to link. From `CcInfo` and from the `CcToolchainInfo` custom Starlark rules should be able to get all the information they need.
diff --git a/docs/versions/7.7.1/configure/windows.mdx b/docs/versions/7.7.3/configure/windows.mdx similarity index 96% rename from docs/versions/7.7.1/configure/windows.mdx rename to docs/versions/7.7.3/configure/windows.mdx index fa7328a..0badc2e 100644 --- a/docs/versions/7.7.1/configure/windows.mdx +++ b/docs/versions/7.7.3/configure/windows.mdx
@@ -3,7 +3,7 @@ --- This page covers Best Practices for using Bazel on Windows. For installation -instructions, see [Install Bazel on Windows](/versions/7.7.1/install/windows). +instructions, see [Install Bazel on Windows](/versions/7.7.3/install/windows). ## Known issues {#known-issues} @@ -15,7 +15,7 @@ ### Avoid long path issues {#long-path-issues} Some tools have the [Maximum Path Length Limitation](https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation) on Windows, including the MSVC compiler. -To avoid hitting this issue, you can specify a short output directory for Bazel by the [\-\-output_user_root](/versions/7.7.1/reference/command-line-reference#flag--output_user_root) flag. +To avoid hitting this issue, you can specify a short output directory for Bazel by the [\-\-output_user_root](/versions/7.7.3/reference/command-line-reference#flag--output_user_root) flag. For example, add the following line to your bazelrc file: @@ -39,8 +39,8 @@ (on Windows 10 version 1703 or newer), or by running Bazel as an administrator. This enables the following features: -* [\-\-windows_enable_symlinks](/versions/7.7.1/reference/command-line-reference#flag--windows_enable_symlinks) -* [\-\-enable_runfiles](/versions/7.7.1/reference/command-line-reference#flag--enable_runfiles) +* [\-\-windows_enable_symlinks](/versions/7.7.3/reference/command-line-reference#flag--windows_enable_symlinks) +* [\-\-enable_runfiles](/versions/7.7.3/reference/command-line-reference#flag--enable_runfiles) To make it easier, add the following lines to your bazelrc file: @@ -133,7 +133,7 @@ To build C++ targets with MSVC, you need: -* [The Visual C++ compiler](/versions/7.7.1/install/windows#install-vc). +* [The Visual C++ compiler](/versions/7.7.3/install/windows#install-vc). * (Optional) The `BAZEL_VC` and `BAZEL_VC_FULL_VERSION` environment variable. @@ -282,7 +282,7 @@ To build Java targets, you need: -* [The Java SE Development Kit](/versions/7.7.1/install/windows#install-jdk) +* [The Java SE Development Kit](/versions/7.7.3/install/windows#install-jdk) On Windows, Bazel builds two output files for `java_binary` rules: @@ -302,7 +302,7 @@ To build Python targets, you need: -* The [Python interpreter](/versions/7.7.1/install/windows#install-python) +* The [Python interpreter](/versions/7.7.3/install/windows#install-python) On Windows, Bazel builds two output files for `py_binary` rules:
diff --git a/docs/versions/7.7.1/contribute/breaking-changes.mdx b/docs/versions/7.7.3/contribute/breaking-changes.mdx similarity index 96% rename from docs/versions/7.7.1/contribute/breaking-changes.mdx rename to docs/versions/7.7.3/contribute/breaking-changes.mdx index 372a0d1..25a829f 100644 --- a/docs/versions/7.7.1/contribute/breaking-changes.mdx +++ b/docs/versions/7.7.3/contribute/breaking-changes.mdx
@@ -6,11 +6,11 @@ change our designs and fix the things that do not quite work. However, we need to make sure that community and Bazel ecosystem can follow along. To that end, Bazel project has adopted a -[backward compatibility policy](/versions/7.7.1/release/backward-compatibility). +[backward compatibility policy](/versions/7.7.3/release/backward-compatibility). This document describes the process for Bazel contributors to make a breaking change in Bazel to adhere to this policy. -1. Follow the [design document policy](/versions/7.7.1/contribute/design-documents). +1. Follow the [design document policy](/versions/7.7.3/contribute/design-documents). 1. [File a GitHub issue.](#github-issue) @@ -67,7 +67,7 @@ ``` In the commit description, add a brief summary of the flag. -Also add [`RELNOTES:`](/versions/7.7.1/contribute/release-notes) in the following form: +Also add [`RELNOTES:`](/versions/7.7.3/contribute/release-notes) in the following form: `RELNOTES: --incompatible_name_of_flag has been added. See #xyz for details` The commit should also update the relevant documentation, so that there is no
diff --git a/docs/versions/7.7.1/contribute/codebase.mdx b/docs/versions/7.7.3/contribute/codebase.mdx similarity index 98% rename from docs/versions/7.7.1/contribute/codebase.mdx rename to docs/versions/7.7.3/contribute/codebase.mdx index 200dde4..f2bfea3 100644 --- a/docs/versions/7.7.1/contribute/codebase.mdx +++ b/docs/versions/7.7.3/contribute/codebase.mdx
@@ -91,7 +91,7 @@ ## Directory layout {#directory-layout} Bazel creates a somewhat complicated set of directories during a build. A full -description is available in [Output directory layout](/versions/7.7.1/remote/output-directories). +description is available in [Output directory layout](/versions/7.7.3/remote/output-directories). The "main repo" is the source tree Bazel is run in. It usually corresponds to something you checked out from source control. The root of this directory is @@ -196,7 +196,7 @@ 3. From `ConfiguredRuleClassProvider` (these are command line options related to individual programming languages) 4. Starlark rules can also define their own options (see - [here](/versions/7.7.1/extending/config)) + [here](/versions/7.7.3/extending/config)) Each option (excluding Starlark-defined options) is a member variable of a `FragmentOptions` subclass that has the `@Option` annotation, which specifies @@ -227,7 +227,7 @@ A repository is marked by a repo boundary file (`MODULE.bazel`, `REPO.bazel`, or in legacy contexts, `WORKSPACE` or `WORKSPACE.bazel`) in its root directory. The main repo is the source tree where you're invoking Bazel from. External repos -are defined in various ways; see [external dependencies overview](/versions/7.7.1/external/overview) for more information. +are defined in various ways; see [external dependencies overview](/versions/7.7.3/external/overview) for more information. Code of external repositories is symlinked or downloaded under `$OUTPUT_BASE/external`. @@ -360,7 +360,7 @@ Skyframe lives in the `com.google.devtools.build.skyframe` package. The similarly-named package `com.google.devtools.build.lib.skyframe` contains the implementation of Bazel on top of Skyframe. More information about Skyframe is -available [here](/versions/7.7.1/reference/skyframe). +available [here](/versions/7.7.3/reference/skyframe). To evaluate a given `SkyKey` into a `SkyValue`, Skyframe will invoke the `SkyFunction` corresponding to the type of the key. During the function's @@ -424,9 +424,9 @@ The dialects available for `BUILD` and `.bzl` files are slightly different because they express different things. A list of differences is available -[here](/versions/7.7.1/rules/language#differences-between-build-and-bzl-files). +[here](/versions/7.7.3/rules/language#differences-between-build-and-bzl-files). -More information about Starlark is available [here](/versions/7.7.1/rules/language). +More information about Starlark is available [here](/versions/7.7.3/rules/language). ## The loading/analysis phase {#loading-phase} @@ -530,7 +530,7 @@ _split transition._ Configuration transitions can also be implemented in Starlark (documentation -[here](/versions/7.7.1/extending/config)) +[here](/versions/7.7.3/extending/config)) ### Transitive info providers {#transitive-info-providers} @@ -629,7 +629,7 @@ Aspects are a way to "propagate computation down the dependency graph". They are described for users of Bazel -[here](/versions/7.7.1/extending/aspects). A good +[here](/versions/7.7.3/extending/aspects). A good motivating example is protocol buffers: a `proto_library` rule should not know about any particular language, but building the implementation of a protocol buffer message (the "basic unit" of protocol buffers) in any programming @@ -680,7 +680,7 @@ multiple architectures where build actions run and multiple architectures for which code is built. These architectures are referred to as _platforms_ in Bazel parlance (full documentation -[here](/versions/7.7.1/extending/platforms)) +[here](/versions/7.7.3/extending/platforms)) A platform is described by a key-value mapping from _constraint settings_ (such as the concept of "CPU architecture") to _constraint values_ (such as a particular CPU @@ -693,7 +693,7 @@ specific OS and be able to target some other OSes. Bazel must determine the C++ compiler that is used based on the set execution and target platform (documentation for toolchains -[here](/versions/7.7.1/extending/toolchains)). +[here](/versions/7.7.3/extending/toolchains)). In order to do this, toolchains are annotated with the set of execution and target platform constraints they support. In order to do this, the definition of @@ -829,7 +829,7 @@ Bazel supports this by the mechanism called _visibility_: you can declare that a particular target can only be depended on using the -[visibility](/versions/7.7.1/reference/be/common-definitions#common-attributes) attribute. This +[visibility](/versions/7.7.3/reference/be/common-definitions#common-attributes) attribute. This attribute is a little special because, although it holds a list of labels, these labels may encode a pattern over package names rather than a pointer to any particular target. (Yes, this is a design flaw.) @@ -1253,7 +1253,7 @@ Tests are run according to an elaborate protocol that uses environment variables to tell tests what's expected from them. A detailed description of what Bazel expects from tests and what tests can expect from Bazel is available -[here](/versions/7.7.1/reference/test-encyclopedia). At the +[here](/versions/7.7.3/reference/test-encyclopedia). At the simplest, an exit code of 0 means success, anything else means failure. In addition to the cache status file, each test process emits a number of other @@ -1366,7 +1366,7 @@ ## The query engine {#query-engine} Bazel has a -[little language](/versions/7.7.1/query/guide) +[little language](/versions/7.7.3/query/guide) used to ask it various things about various graphs. The following query kinds are provided: @@ -1424,7 +1424,7 @@ * A test was run (`TestAttempt`, `TestSummary`) Some of these events are represented outside of Bazel in the -[Build Event Protocol](/versions/7.7.1/remote/bep) +[Build Event Protocol](/versions/7.7.3/remote/bep) (they are `BuildEvent`s). This allows not only `BlazeModule`s, but also things outside the Bazel process to observe the build. They are accessible either as a file that contains protocol messages or Bazel can connect to a server (called @@ -1437,7 +1437,7 @@ Note: The information in this section is out of date, as code in this area has undergone extensive change in the past couple of years. Please refer to -[external dependencies overview](/versions/7.7.1/external/overview) for more up-to-date +[external dependencies overview](/versions/7.7.3/external/overview) for more up-to-date information. Whereas Bazel was originally designed to be used in a monorepo (a single source
diff --git a/docs/versions/7.7.1/contribute/design-documents.mdx b/docs/versions/7.7.3/contribute/design-documents.mdx similarity index 98% rename from docs/versions/7.7.1/contribute/design-documents.mdx rename to docs/versions/7.7.3/contribute/design-documents.mdx index c0732f2..e9713a0 100644 --- a/docs/versions/7.7.1/contribute/design-documents.mdx +++ b/docs/versions/7.7.3/contribute/design-documents.mdx
@@ -25,7 +25,7 @@ When you write a design document, you can coordinate with other Bazel developers and seek guidance from Bazel's core team. For example, when a proposal adds, removes, or modifies any function or object available in BUILD, WORKSPACE, or -bzl files, add the [Starlark team](/versions/7.7.1/contribute/maintainers-guide) as reviewers. +bzl files, add the [Starlark team](/versions/7.7.3/contribute/maintainers-guide) as reviewers. Design documents are reviewed before submission because: * Bazel is a very complex system; seemingly innocuous local changes can have @@ -137,7 +137,7 @@ * Objective and capable of providing constructive feedback * Available for the entire review period to lead the process -Consider checking the contacts for various [team labels](/versions/7.7.1/contribute/maintainers-guide#team-labels). +Consider checking the contacts for various [team labels](/versions/7.7.3/contribute/maintainers-guide#team-labels). ## Markdown vs Google Docs {#markdown-versus-gdocs}
diff --git a/docs/versions/7.7.1/contribute/docs-style-guide.mdx b/docs/versions/7.7.3/contribute/docs-style-guide.mdx similarity index 99% rename from docs/versions/7.7.1/contribute/docs-style-guide.mdx rename to docs/versions/7.7.3/contribute/docs-style-guide.mdx index 65b5fda..e56d9e5 100644 --- a/docs/versions/7.7.1/contribute/docs-style-guide.mdx +++ b/docs/versions/7.7.3/contribute/docs-style-guide.mdx
@@ -52,7 +52,7 @@ - Keep it consistent. Don't introduce new names for existing concepts. Where applicable, use the term defined in the - [Glossary](/versions/7.7.1/reference/glossary). + [Glossary](/versions/7.7.3/reference/glossary). - For example, if you're writing about issuing commands on a terminal, don't use both terminal and command line on the page.
diff --git a/docs/versions/7.7.1/contribute/docs.mdx b/docs/versions/7.7.3/contribute/docs.mdx similarity index 100% rename from docs/versions/7.7.1/contribute/docs.mdx rename to docs/versions/7.7.3/contribute/docs.mdx
diff --git a/docs/versions/7.7.1/contribute/images/structured-concurrency-3d.svg b/docs/versions/7.7.3/contribute/images/structured-concurrency-3d.svg similarity index 100% rename from docs/versions/7.7.1/contribute/images/structured-concurrency-3d.svg rename to docs/versions/7.7.3/contribute/images/structured-concurrency-3d.svg
diff --git a/docs/versions/7.7.1/contribute/images/structured-concurrency.svg b/docs/versions/7.7.3/contribute/images/structured-concurrency.svg similarity index 100% rename from docs/versions/7.7.1/contribute/images/structured-concurrency.svg rename to docs/versions/7.7.3/contribute/images/structured-concurrency.svg
diff --git a/docs/versions/7.7.1/contribute/images/suspend-resume.svg b/docs/versions/7.7.3/contribute/images/suspend-resume.svg similarity index 100% rename from docs/versions/7.7.1/contribute/images/suspend-resume.svg rename to docs/versions/7.7.3/contribute/images/suspend-resume.svg
diff --git a/docs/versions/7.7.1/contribute/images/unstructured-concurrency.svg b/docs/versions/7.7.3/contribute/images/unstructured-concurrency.svg similarity index 100% rename from docs/versions/7.7.1/contribute/images/unstructured-concurrency.svg rename to docs/versions/7.7.3/contribute/images/unstructured-concurrency.svg
diff --git a/docs/versions/7.7.1/contribute/index.mdx b/docs/versions/7.7.3/contribute/index.mdx similarity index 87% rename from docs/versions/7.7.1/contribute/index.mdx rename to docs/versions/7.7.3/contribute/index.mdx index c7d01b4..04dc08e 100644 --- a/docs/versions/7.7.1/contribute/index.mdx +++ b/docs/versions/7.7.3/contribute/index.mdx
@@ -10,7 +10,7 @@ You can help by [reporting issues](http://github.com/bazelbuild/bazel/issues) when: - - Bazel crashes or you encounter a bug that can [only be resolved using `bazel clean`](/versions/7.7.1/run/build#correct-incremental-rebuilds). + - Bazel crashes or you encounter a bug that can [only be resolved using `bazel clean`](/versions/7.7.3/run/build#correct-incremental-rebuilds). - The documentation is incomplete or unclear. You can also report issues from the page you are viewing by using the "Create issue" link at the top right corner of the page. @@ -46,25 +46,25 @@ portability, and the impact on memory usage and performance. To learn about how to submit a change, see the -[patch acceptance process](/versions/7.7.1/contribute/patch-acceptance). +[patch acceptance process](/versions/7.7.3/contribute/patch-acceptance). ## Bazel's code description {#code-description} -Bazel has a large codebase with code in multiple locations. See the [codebase guide](/versions/7.7.1/contribute/codebase) for more details. +Bazel has a large codebase with code in multiple locations. See the [codebase guide](/versions/7.7.3/contribute/codebase) for more details. Bazel is organized as follows: * Client code is in `src/main/cpp` and provides the command-line interface. * Protocol buffers are in `src/main/protobuf`. * Server code is in `src/main/java` and `src/test/java`. - * Core code which is mostly composed of [SkyFrame](/versions/7.7.1/reference/skyframe) + * Core code which is mostly composed of [SkyFrame](/versions/7.7.3/reference/skyframe) and some utilities. * Built-in rules are in `com.google.devtools.build.lib.rules` and in `com.google.devtools.build.lib.bazel.rules`. You might want to read about - the [Challenges of Writing Rules](/versions/7.7.1/rules/challenges) first. + the [Challenges of Writing Rules](/versions/7.7.3/rules/challenges) first. * Java native interfaces are in `src/main/native`. * Various tooling for language support are described in the list in the - [compiling Bazel](/versions/7.7.1/install/compile-source) section. + [compiling Bazel](/versions/7.7.3/install/compile-source) section. ### Searching Bazel's source code {#search-code} @@ -72,4 +72,4 @@ [Bazel Code Search](https://source.bazel.build/). You can navigate Bazel's repositories, branches, and files. You can also view history, diffs, and blame information. To learn more, see the -[Bazel Code Search User Guide](/versions/7.7.1/contribute/search). +[Bazel Code Search User Guide](/versions/7.7.3/contribute/search).
diff --git a/docs/versions/7.7.1/contribute/maintainers-guide.mdx b/docs/versions/7.7.3/contribute/maintainers-guide.mdx similarity index 98% rename from docs/versions/7.7.1/contribute/maintainers-guide.mdx rename to docs/versions/7.7.3/contribute/maintainers-guide.mdx index 516cf0b1..ddc1d42 100644 --- a/docs/versions/7.7.1/contribute/maintainers-guide.mdx +++ b/docs/versions/7.7.3/contribute/maintainers-guide.mdx
@@ -4,7 +4,7 @@ This is a guide for the maintainers of the Bazel open source project. -If you are looking to contribute to Bazel, please read [Contributing to Bazel](/versions/7.7.1/contribute) instead. +If you are looking to contribute to Bazel, please read [Contributing to Bazel](/versions/7.7.3/contribute) instead. The objectives of this page are to: @@ -13,7 +13,7 @@ 1. Set expectations between the community contributors and the project maintainers. -Bazel's [core group of contributors](/versions/7.7.1/contribute/policy) has dedicated +Bazel's [core group of contributors](/versions/7.7.3/contribute/policy) has dedicated subteams to manage aspects of the open source project. These are: * **Release Process**: Manage Bazel's release process.
diff --git a/docs/versions/7.7.1/contribute/naming.mdx b/docs/versions/7.7.3/contribute/naming.mdx similarity index 97% rename from docs/versions/7.7.1/contribute/naming.mdx rename to docs/versions/7.7.3/contribute/naming.mdx index 03652c5..b02dad7 100644 --- a/docs/versions/7.7.1/contribute/naming.mdx +++ b/docs/versions/7.7.3/contribute/naming.mdx
@@ -11,7 +11,7 @@ ## Naming Starlark rules {#name-starlark-rules} -See [Deploying new Starlark rules](/versions/7.7.1/rules/deploying) +See [Deploying new Starlark rules](/versions/7.7.3/rules/deploying) in the docs. ## Naming other Bazel related tools {#name-related-tools}
diff --git a/docs/versions/7.7.1/contribute/patch-acceptance.mdx b/docs/versions/7.7.3/contribute/patch-acceptance.mdx similarity index 91% rename from docs/versions/7.7.1/contribute/patch-acceptance.mdx rename to docs/versions/7.7.3/contribute/patch-acceptance.mdx index 667f163..ef71431 100644 --- a/docs/versions/7.7.1/contribute/patch-acceptance.mdx +++ b/docs/versions/7.7.3/contribute/patch-acceptance.mdx
@@ -5,17 +5,17 @@ This page outlines how contributors can propose and make changes to the Bazel code base. -1. Read the [Bazel Contribution policy](/versions/7.7.1/contribute/policy). +1. Read the [Bazel Contribution policy](/versions/7.7.3/contribute/policy). 1. Create a [GitHub issue](https://github.com/bazelbuild/bazel/) to discuss your plan and design. Pull requests that change or add behavior need a corresponding issue for tracking. 1. If you're proposing significant changes, write a - [design document](/versions/7.7.1/contribute/design-documents). + [design document](/versions/7.7.3/contribute/design-documents). 1. Ensure you've signed a [Contributor License Agreement](https://cla.developers.google.com). 1. Prepare a git commit that implements the feature. Don't forget to add tests and update the documentation. If your change has user-visible effects, please - [add release notes](/versions/7.7.1/contribute/release-notes). If it is an incompatible change, - read the [guide for rolling out breaking changes](/versions/7.7.1/contribute/breaking-changes). + [add release notes](/versions/7.7.3/contribute/release-notes). If it is an incompatible change, + read the [guide for rolling out breaking changes](/versions/7.7.3/contribute/breaking-changes). 1. Create a pull request on [GitHub](https://github.com/bazelbuild/bazel/pulls). If you're new to GitHub, read [about pull requests](https://help.github.com/articles/about-pull-requests/). Note that
diff --git a/docs/versions/7.7.1/contribute/policy.mdx b/docs/versions/7.7.3/contribute/policy.mdx similarity index 96% rename from docs/versions/7.7.1/contribute/policy.mdx rename to docs/versions/7.7.3/contribute/policy.mdx index 4e7e352..ff1dc6e 100644 --- a/docs/versions/7.7.1/contribute/policy.mdx +++ b/docs/versions/7.7.3/contribute/policy.mdx
@@ -60,7 +60,7 @@ * Discussed and approved by the Maintainers of the relevant area of code. Discussions and approvals happen on GitHub Issues and in GitHub PRs. Larger contributions require a - [design review](/versions/7.7.1/contribute/design-documents). + [design review](/versions/7.7.3/contribute/design-documents). * Added to Bazel's Continuous Integration system if not already present. * Supportable and aligned with Bazel product direction * **Code review**. All changes in all `bazelbuild` repositories require @@ -74,4 +74,4 @@ documentation updates. For more details on contributing to Bazel, see our -[contribution guidelines](/versions/7.7.1/contribute/). +[contribution guidelines](/versions/7.7.3/contribute/).
diff --git a/docs/versions/7.7.1/contribute/release-notes.mdx b/docs/versions/7.7.3/contribute/release-notes.mdx similarity index 98% rename from docs/versions/7.7.1/contribute/release-notes.mdx rename to docs/versions/7.7.3/contribute/release-notes.mdx index a1d8b6d..c572c78 100644 --- a/docs/versions/7.7.1/contribute/release-notes.mdx +++ b/docs/versions/7.7.3/contribute/release-notes.mdx
@@ -16,7 +16,7 @@ * If the change adds / removes / changes Bazel in a user-visible way, then it may be advantageous to mention it. -If the change is significant, follow the [design document policy](/versions/7.7.1/contribute/design-documents) first. +If the change is significant, follow the [design document policy](/versions/7.7.3/contribute/design-documents) first. ## Guidelines {#guidelines}
diff --git a/docs/versions/7.7.1/contribute/search.mdx b/docs/versions/7.7.3/contribute/search.mdx similarity index 100% rename from docs/versions/7.7.1/contribute/search.mdx rename to docs/versions/7.7.3/contribute/search.mdx
diff --git a/docs/versions/7.7.1/contribute/statemachine-guide.mdx b/docs/versions/7.7.3/contribute/statemachine-guide.mdx similarity index 99% rename from docs/versions/7.7.1/contribute/statemachine-guide.mdx rename to docs/versions/7.7.3/contribute/statemachine-guide.mdx index 7b32589..f79017b 100644 --- a/docs/versions/7.7.1/contribute/statemachine-guide.mdx +++ b/docs/versions/7.7.3/contribute/statemachine-guide.mdx
@@ -101,7 +101,7 @@ references are the most common way to specify the next state in a `StateMachine`. - + Intuitively, breaking a computation down into `StateMachine` steps, instead of a monolithic function, provides the hooks needed to *suspend* and *resume* a @@ -265,13 +265,13 @@ possible to create hierarchical[^5] concurrency as shown in the following example. - + It's hard to tell from the *UML* that the concurrency structure forms a tree. There's an [alternate view](#concurrency-tree-diagram) that better shows the tree structure. - + Structured concurrency is much easier to reason about. @@ -1202,7 +1202,7 @@ The following is an alternative view of the diagram in [Structured concurrency](#structured-concurrency) that better depicts the tree structure. The blocks form a small tree. - + [^1]: In contrast to Skyframe's convention of restarting from the beginning when values are not available.
diff --git a/docs/versions/7.7.1/contribute/windows-chocolatey-maintenance.mdx b/docs/versions/7.7.3/contribute/windows-chocolatey-maintenance.mdx similarity index 100% rename from docs/versions/7.7.1/contribute/windows-chocolatey-maintenance.mdx rename to docs/versions/7.7.3/contribute/windows-chocolatey-maintenance.mdx
diff --git a/docs/versions/7.7.1/contribute/windows-scoop-maintenance.mdx b/docs/versions/7.7.3/contribute/windows-scoop-maintenance.mdx similarity index 100% rename from docs/versions/7.7.1/contribute/windows-scoop-maintenance.mdx rename to docs/versions/7.7.3/contribute/windows-scoop-maintenance.mdx
diff --git a/docs/versions/7.7.1/docs/android-build-performance.mdx b/docs/versions/7.7.3/docs/android-build-performance.mdx similarity index 93% rename from docs/versions/7.7.1/docs/android-build-performance.mdx rename to docs/versions/7.7.3/docs/android-build-performance.mdx index 95f3e3c..4c33988ba 100644 --- a/docs/versions/7.7.1/docs/android-build-performance.mdx +++ b/docs/versions/7.7.3/docs/android-build-performance.mdx
@@ -4,12 +4,12 @@ This page contains information on optimizing build performance for Android apps specifically. For general build performance optimization with Bazel, see -[Optimizing Performance](/versions/7.7.1/rules/performance). +[Optimizing Performance](/versions/7.7.3/rules/performance). ## Recommended flags {#recommended-flags} The flags are in the -[`bazelrc` configuration syntax](/versions/7.7.1/run/bazelrc#bazelrc-syntax-semantics), so +[`bazelrc` configuration syntax](/versions/7.7.3/run/bazelrc#bazelrc-syntax-semantics), so they can be pasted directly into a `bazelrc` file and invoked with `--config=<configuration_name>` on the command line. @@ -17,7 +17,7 @@ Bazel writes a JSON trace profile by default to a file called `command.profile.gz` in Bazel's output base. -See the [JSON Profile documentation](/versions/7.7.1/rules/performance#performance-profiling) for +See the [JSON Profile documentation](/versions/7.7.3/rules/performance#performance-profiling) for how to read and interact with the profile. **Persistent workers for Android build actions**.
diff --git a/docs/versions/7.7.1/docs/android-instrumentation-test.mdx b/docs/versions/7.7.3/docs/android-instrumentation-test.mdx similarity index 98% rename from docs/versions/7.7.1/docs/android-instrumentation-test.mdx rename to docs/versions/7.7.3/docs/android-instrumentation-test.mdx index 5527253..193b93b 100644 --- a/docs/versions/7.7.1/docs/android-instrumentation-test.mdx +++ b/docs/versions/7.7.3/docs/android-instrumentation-test.mdx
@@ -2,13 +2,13 @@ title: 'Android Instrumentation Tests' --- -_If you're new to Bazel, start with the [Building Android with Bazel](/versions/7.7.1/start/android-app) tutorial._ +_If you're new to Bazel, start with the [Building Android with Bazel](/versions/7.7.3/start/android-app) tutorial._ - + **Figure 1.** Running parallel Android instrumentation tests. -[`android_instrumentation_test`](/versions/7.7.1/reference/be/android#android_instrumentation_test) +[`android_instrumentation_test`](/versions/7.7.3/reference/be/android#android_instrumentation_test) allows developers to test their apps on Android emulators and devices. It utilizes real Android framework APIs and the Android Test Library. @@ -105,7 +105,7 @@ Here is a typical target dependency graph of an `android_instrumentation_test`: - + **Figure 2.** Target dependency graph of an `android_instrumentation_test`.
diff --git a/docs/versions/7.7.1/docs/android-ndk.mdx b/docs/versions/7.7.3/docs/android-ndk.mdx similarity index 96% rename from docs/versions/7.7.1/docs/android-ndk.mdx rename to docs/versions/7.7.3/docs/android-ndk.mdx index 713e4fa..7cdc2da 100644 --- a/docs/versions/7.7.1/docs/android-ndk.mdx +++ b/docs/versions/7.7.3/docs/android-ndk.mdx
@@ -2,7 +2,7 @@ title: 'Using the Android Native Development Kit with Bazel' --- -_If you're new to Bazel, please start with the [Building Android with Bazel](/versions/7.7.1/start/android-app) tutorial._ +_If you're new to Bazel, please start with the [Building Android with Bazel](/versions/7.7.3/start/android-app) tutorial._ ## Overview {#overview} @@ -30,7 +30,7 @@ ) ``` -For more information about the `android_ndk_repository` rule, see the [Build Encyclopedia entry](/versions/7.7.1/reference/be/android#android_ndk_repository). +For more information about the `android_ndk_repository` rule, see the [Build Encyclopedia entry](/versions/7.7.3/reference/be/android#android_ndk_repository). If you're using a recent version of the Android NDK (r22 and beyond), use the Starlark implementation of `android_ndk_repository`. @@ -70,7 +70,7 @@ This `BUILD` file results in the following target graph: - + **Figure 1.** Build graph of Android project with cc_library dependencies. @@ -226,7 +226,7 @@ ``` Read more about passing compiler and linker flags with `--cxxopt`, `--copt`, and -`--linkopt` in the [User Manual](/versions/7.7.1/docs/user-manual#cxxopt). +`--linkopt` in the [User Manual](/versions/7.7.3/docs/user-manual#cxxopt). Compiler and linker flags can also be specified as attributes in `cc_library` using `copts` and `linkopts`. For example: @@ -243,8 +243,8 @@ ## Integration with platforms and toolchains Bazel's configuration model is moving towards -[platforms](/versions/7.7.1/extending/platforms) and -[toolchains](/versions/7.7.1/extending/toolchains). If your +[platforms](/versions/7.7.3/extending/platforms) and +[toolchains](/versions/7.7.3/extending/toolchains). If your build uses the `--platforms` flag to select for the architecture or operating system to build for, you will need to pass the `--extra_toolchains` flag to Bazel in order to use the NDK. @@ -318,7 +318,7 @@ any special flags, except for `--fat_apk_cpu` and `--android_crosstool_top` for ABI and STL configuration. -Behind the scenes, this automatic configuration uses Android [configuration transitions](/versions/7.7.1/extending/rules#configurations). +Behind the scenes, this automatic configuration uses Android [configuration transitions](/versions/7.7.3/extending/rules#configurations). A compatible rule, like `android_binary`, automatically changes the configuration of its dependencies to an Android configuration, so only @@ -383,7 +383,7 @@ Note: All of the targets on the command line must be compatible with building for Android when specifying these flags, which may make it difficult to -use [Bazel wild-cards](/versions/7.7.1/run/build#specifying-build-targets) like +use [Bazel wild-cards](/versions/7.7.3/run/build#specifying-build-targets) like `/...` and `:all`. These flags can be put into a `bazelrc` config (one for each ABI), in
diff --git a/docs/versions/7.7.1/docs/bazel-and-android.mdx b/docs/versions/7.7.3/docs/bazel-and-android.mdx similarity index 80% rename from docs/versions/7.7.1/docs/bazel-and-android.mdx rename to docs/versions/7.7.3/docs/bazel-and-android.mdx index 252312f..4a03bf5 100644 --- a/docs/versions/7.7.1/docs/bazel-and-android.mdx +++ b/docs/versions/7.7.3/docs/bazel-and-android.mdx
@@ -10,7 +10,7 @@ The following resources will help you work with Bazel on Android projects: -* [Tutorial: Building an Android app](/versions/7.7.1/start/android-app). This +* [Tutorial: Building an Android app](/versions/7.7.3/start/android-app). This tutorial is a good place to start learning about Bazel commands and concepts, and how to build Android apps with Bazel. * [Codelab: Building Android Apps with Bazel](https://developer.android.com/codelabs/bazel-android-intro#0). @@ -22,19 +22,19 @@ the SDK/NDK, and creating emulator images. There are also Bazel plugins for Android Studio and IntelliJ. -* [Android rules](/versions/7.7.1/reference/be/android). The Build Encyclopedia describes the rules +* [Android rules](/versions/7.7.3/reference/be/android). The Build Encyclopedia describes the rules for building and testing Android apps with Bazel. -* [Integration with Android Studio](/versions/7.7.1/install/ide). Bazel is compatible with +* [Integration with Android Studio](/versions/7.7.3/install/ide). Bazel is compatible with Android Studio using the [Android Studio with Bazel](https://ij.bazel.build/) plugin. -* [`mobile-install` for Android](/versions/7.7.1/docs/mobile-install). Bazel's `mobile-install` +* [`mobile-install` for Android](/versions/7.7.3/docs/mobile-install). Bazel's `mobile-install` feature provides automated build-and-deploy functionality for building and testing Android apps directly on Android devices and emulators. -* [Android instrumentation testing](/versions/7.7.1/docs/android-instrumentation-test) on +* [Android instrumentation testing](/versions/7.7.3/docs/android-instrumentation-test) on emulators and devices. -* [Android NDK integration](/versions/7.7.1/docs/android-ndk). Bazel supports compiling to +* [Android NDK integration](/versions/7.7.3/docs/android-ndk). Bazel supports compiling to native code through direct NDK integration and the C++ rules. -* [Android build performance](/versions/7.7.1/docs/android-build-performance). This page +* [Android build performance](/versions/7.7.3/docs/android-build-performance). This page provides information on optimizing build performance for Android apps. ## Further reading {#further-reading}
diff --git a/docs/versions/7.7.1/docs/bazel-and-apple.mdx b/docs/versions/7.7.3/docs/bazel-and-apple.mdx similarity index 68% rename from docs/versions/7.7.1/docs/bazel-and-apple.mdx rename to docs/versions/7.7.3/docs/bazel-and-apple.mdx index 0508d67..fb167a2 100644 --- a/docs/versions/7.7.1/docs/bazel-and-apple.mdx +++ b/docs/versions/7.7.3/docs/bazel-and-apple.mdx
@@ -10,17 +10,17 @@ The following resources will help you work with Bazel on macOS and iOS projects: -* [Tutorial: Building an iOS app](/versions/7.7.1/start/ios-app)) -* [Objective-C build rules](/versions/7.7.1/reference/be/objective-c) +* [Tutorial: Building an iOS app](/versions/7.7.3/start/ios-app)) +* [Objective-C build rules](/versions/7.7.3/reference/be/objective-c) * [General Apple rules](https://github.com/bazelbuild/rules_apple) -* [Integration with Xcode](/versions/7.7.1/install/ide) +* [Integration with Xcode](/versions/7.7.3/install/ide) ## Migrating to Bazel {#migrating-to-bazel} If you currently build your macOS and iOS projects with Xcode, follow the steps in the migration guide to start building them with Bazel: -* [Migrating from Xcode to Bazel](/versions/7.7.1/migrate/xcode) +* [Migrating from Xcode to Bazel](/versions/7.7.3/migrate/xcode) ## Apple apps and new rules {#apple-apps-new-rules} @@ -28,25 +28,25 @@ You do not need it when getting started with Bazel. The following modules, configuration fragments, and providers will help you -[extend Bazel's capabilities](/versions/7.7.1/extending/concepts) +[extend Bazel's capabilities](/versions/7.7.3/extending/concepts) when building your macOS and iOS projects: * Modules: - * [`apple_bitcode_mode`](/versions/7.7.1/rules/lib/builtins/apple_bitcode_mode) - * [`apple_common`](/versions/7.7.1/rules/lib/toplevel/apple_common) - * [`apple_platform`](/versions/7.7.1/rules/lib/builtins/apple_platform) - * [`apple_platform_type`](/versions/7.7.1/rules/lib/builtins/apple_platform_type) - * [`apple_toolchain`](/versions/7.7.1/rules/lib/builtins/apple_toolchain) + * [`apple_bitcode_mode`](/versions/7.7.3/rules/lib/builtins/apple_bitcode_mode) + * [`apple_common`](/versions/7.7.3/rules/lib/toplevel/apple_common) + * [`apple_platform`](/versions/7.7.3/rules/lib/builtins/apple_platform) + * [`apple_platform_type`](/versions/7.7.3/rules/lib/builtins/apple_platform_type) + * [`apple_toolchain`](/versions/7.7.3/rules/lib/builtins/apple_toolchain) * Configuration fragments: - * [`apple`](/versions/7.7.1/rules/lib/fragments/apple) + * [`apple`](/versions/7.7.3/rules/lib/fragments/apple) * Providers: - * [`ObjcProvider`](/versions/7.7.1/rules/lib/providers/ObjcProvider) - * [`XcodeVersionConfig`](/versions/7.7.1/rules/lib/providers/XcodeVersionConfig) + * [`ObjcProvider`](/versions/7.7.3/rules/lib/providers/ObjcProvider) + * [`XcodeVersionConfig`](/versions/7.7.3/rules/lib/providers/XcodeVersionConfig) ## Xcode selection {#xcode-selection} @@ -58,24 +58,24 @@ represented in the `--xcode_config` target. If you do not pass `--xcode_config`, Bazel will use the autogenerated -[`XcodeVersionConfig`](/versions/7.7.1/rules/lib/providers/XcodeVersionConfig) that represents the +[`XcodeVersionConfig`](/versions/7.7.3/rules/lib/providers/XcodeVersionConfig) that represents the Xcode versions available on your host machine. The default version is the newest available Xcode version. This is appropriate for local execution. If you are performing remote builds, you should set `--xcode_config` to an -[`xcode_config`](/versions/7.7.1/reference/be/objective-c#xcode_config) +[`xcode_config`](/versions/7.7.3/reference/be/objective-c#xcode_config) target whose `versions` attribute is a list of remotely available -[`xcode_version`](/versions/7.7.1/reference/be/objective-c#xcode_version) +[`xcode_version`](/versions/7.7.3/reference/be/objective-c#xcode_version) targets, and whose `default` attribute is one of these -[`xcode_versions`](/versions/7.7.1/reference/be/objective-c#xcode_version). +[`xcode_versions`](/versions/7.7.3/reference/be/objective-c#xcode_version). If you are using dynamic execution, you should set `--xcode_config` to an -[`xcode_config`](/versions/7.7.1/reference/be/objective-c#xcode_config) +[`xcode_config`](/versions/7.7.3/reference/be/objective-c#xcode_config) target whose `remote_versions` attribute is an -[`available_xcodes`](/versions/7.7.1/reference/be/workspace#available_xcodes) +[`available_xcodes`](/versions/7.7.3/reference/be/workspace#available_xcodes) target containing the remotely available Xcode versions, and whose `local_versions` attribute is an -[`available_xcodes`](/versions/7.7.1/reference/be/workspace#available_xcodes) +[`available_xcodes`](/versions/7.7.3/reference/be/workspace#available_xcodes) target containing the locally available Xcode versions. For `local_versions`, you probably want to use the autogenerated `@local_config_xcode//:host_available_xcodes`. The default Xcode version is the
diff --git a/docs/versions/7.7.1/docs/bazel-and-cpp.mdx b/docs/versions/7.7.3/docs/bazel-and-cpp.mdx similarity index 79% rename from docs/versions/7.7.1/docs/bazel-and-cpp.mdx rename to docs/versions/7.7.3/docs/bazel-and-cpp.mdx index 3e36b09..06de230 100644 --- a/docs/versions/7.7.1/docs/bazel-and-cpp.mdx +++ b/docs/versions/7.7.3/docs/bazel-and-cpp.mdx
@@ -10,27 +10,27 @@ The following resources will help you work with Bazel on C++ projects: -* [Tutorial: Building a C++ project](/versions/7.7.1/start/cpp) -* [C++ common use cases](/versions/7.7.1/tutorials/cpp-use-cases) -* [C/C++ rules](/versions/7.7.1/reference/be/c-cpp) +* [Tutorial: Building a C++ project](/versions/7.7.3/start/cpp) +* [C++ common use cases](/versions/7.7.3/tutorials/cpp-use-cases) +* [C/C++ rules](/versions/7.7.3/reference/be/c-cpp) * Essential Libraries - [Abseil](https://abseil.io/docs/cpp/quickstart) - [Boost](https://github.com/nelhage/rules_boost) - [HTTPS Requests: CPR and libcurl](https://github.com/hedronvision/bazel-make-cc-https-easy) -* [C++ toolchain configuration](/versions/7.7.1/docs/cc-toolchain-config-reference) -* [Tutorial: Configuring C++ toolchains](/versions/7.7.1/tutorials/ccp-toolchain-config) -* [Integrating with C++ rules](/versions/7.7.1/configure/integrate-cpp) +* [C++ toolchain configuration](/versions/7.7.3/docs/cc-toolchain-config-reference) +* [Tutorial: Configuring C++ toolchains](/versions/7.7.3/tutorials/ccp-toolchain-config) +* [Integrating with C++ rules](/versions/7.7.3/configure/integrate-cpp) ## Best practices {#best-practices} -In addition to [general Bazel best practices](/versions/7.7.1/configure/best-practices), below are +In addition to [general Bazel best practices](/versions/7.7.3/configure/best-practices), below are best practices specific to C++ projects. ### BUILD files {#build-files} Follow the guidelines below when creating your BUILD files: -* Each `BUILD` file should contain one [`cc_library`](/versions/7.7.1/reference/be/c-cpp#cc_library) +* Each `BUILD` file should contain one [`cc_library`](/versions/7.7.3/reference/be/c-cpp#cc_library) rule target per compilation unit in the directory. * You should granularize your C++ libraries as much as @@ -76,22 +76,22 @@ * For legacy or `third_party` code that requires includes pointing outside the project repository, such as external repository includes requiring a prefix, - use the [`include_prefix`](/versions/7.7.1/reference/be/c-cpp#cc_library.include_prefix) and - [`strip_include_prefix`](/versions/7.7.1/reference/be/c-cpp#cc_library.strip_include_prefix) + use the [`include_prefix`](/versions/7.7.3/reference/be/c-cpp#cc_library.include_prefix) and + [`strip_include_prefix`](/versions/7.7.3/reference/be/c-cpp#cc_library.strip_include_prefix) arguments on the `cc_library` rule target. ### Toolchain features {#toolchain-features} -The following optional [features](/versions/7.7.1/docs/cc-toolchain-config-reference#features) +The following optional [features](/versions/7.7.3/docs/cc-toolchain-config-reference#features) can improve the hygiene of a C++ project. They can be enabled using the `--features` command-line flag or the `features` attribute of -[`repo`](/versions/7.7.1/external/overview#repo.bazel), -[`package`](/versions/7.7.1/reference/be/functions#package) or `cc_*` rules: +[`repo`](/versions/7.7.3/external/overview#repo.bazel), +[`package`](/versions/7.7.3/reference/be/functions#package) or `cc_*` rules: * The `parse_headers` feature makes it so that the C++ compiler is used to parse (but not compile) all header files in the built targets and their dependencies when using the - [`--process_headers_in_dependencies`](/versions/7.7.1/reference/command-line-reference#flag--process_headers_in_dependencies) + [`--process_headers_in_dependencies`](/versions/7.7.3/reference/command-line-reference#flag--process_headers_in_dependencies) flag. This can help catch issues in header-only libraries and ensure that headers are self-contained and independent of the order in which they are included.
diff --git a/docs/versions/7.7.1/docs/bazel-and-java.mdx b/docs/versions/7.7.3/docs/bazel-and-java.mdx similarity index 90% rename from docs/versions/7.7.1/docs/bazel-and-java.mdx rename to docs/versions/7.7.3/docs/bazel-and-java.mdx index 8a21017..f6b4396 100644 --- a/docs/versions/7.7.1/docs/bazel-and-java.mdx +++ b/docs/versions/7.7.3/docs/bazel-and-java.mdx
@@ -10,15 +10,15 @@ The following resources will help you work with Bazel on Java projects: -* [Tutorial: Building a Java Project](/versions/7.7.1/start/java) -* [Java rules](/versions/7.7.1/reference/be/java) +* [Tutorial: Building a Java Project](/versions/7.7.3/start/java) +* [Java rules](/versions/7.7.3/reference/be/java) ## Migrating to Bazel {#migrating-to-bazel} If you currently build your Java projects with Maven, follow the steps in the migration guide to start building your Maven projects with Bazel: -* [Migrating from Maven to Bazel](/versions/7.7.1/migrate/maven) +* [Migrating from Maven to Bazel](/versions/7.7.3/migrate/maven) ## Java versions {#java-versions} @@ -36,7 +36,7 @@ `.bazelrc` file, where `{ver}` is for example `11`. Bazel repository owners should set this flag so that Bazel and its users can reference the source code's Java version number. For more details, see -[Java language version flag](/versions/7.7.1/docs/user-manual#java-language-version). +[Java language version flag](/versions/7.7.3/docs/user-manual#java-language-version). ### Configuring the JVM used to execute and test the code {#config-jvm} @@ -58,7 +58,7 @@ To create a hermetic compile, you can use command line flag `--java_runtime_version=remotejdk_11`. The code is compiled for, executed, and tested on the JVM downloaded from a remote repository. For more details, see -[Java runtime version flag](/versions/7.7.1/docs/user-manual#java_runtime_version). +[Java runtime version flag](/versions/7.7.3/docs/user-manual#java_runtime_version). ### Configuring compilation and execution of build tools in Java {#config-build-tools-java} @@ -83,7 +83,7 @@ ## Best practices {#best-practices} -In addition to [general Bazel best practices](/versions/7.7.1/configure/best-practices), below are +In addition to [general Bazel best practices](/versions/7.7.3/configure/best-practices), below are best practices specific to Java projects. ### Directory structure {#directory-structure} @@ -113,7 +113,7 @@ `BUILD` file. This makes the label of the library shorter, that is use `"//package"` instead of `"//package:package"`. -* The sources should be a non-recursive [`glob`](/versions/7.7.1/reference/be/functions#glob) of +* The sources should be a non-recursive [`glob`](/versions/7.7.3/reference/be/functions#glob) of all Java files in the directory. * Tests should be in a matching directory under `src/test` and depend on this @@ -125,20 +125,20 @@ not need it when getting started with Bazel. The following modules, configuration fragments, and providers will help you -[extend Bazel's capabilities](/versions/7.7.1/extending/concepts) when building your Java +[extend Bazel's capabilities](/versions/7.7.3/extending/concepts) when building your Java projects: -* Main Java module: [`java_common`](/versions/7.7.1/rules/lib/toplevel/java_common) -* Main Java provider: [`JavaInfo`](/versions/7.7.1/rules/lib/providers/JavaInfo) -* Configuration fragment: [`java`](/versions/7.7.1/rules/lib/fragments/java) +* Main Java module: [`java_common`](/versions/7.7.3/rules/lib/toplevel/java_common) +* Main Java provider: [`JavaInfo`](/versions/7.7.3/rules/lib/providers/JavaInfo) +* Configuration fragment: [`java`](/versions/7.7.3/rules/lib/fragments/java) * Other modules: - * [`java_annotation_processing`](/versions/7.7.1/rules/lib/builtins/java_annotation_processing) - * [`java_compilation_info`](/versions/7.7.1/rules/lib/providers/java_compilation_info) - * [`java_output`](/versions/7.7.1/rules/lib/builtins/java_output) - * [`java_output_jars`](/versions/7.7.1/rules/lib/providers/java_output_jars) - * [`JavaRuntimeInfo`](/versions/7.7.1/rules/lib/providers/JavaRuntimeInfo) - * [`JavaToolchainInfo`](/versions/7.7.1/rules/lib/providers/JavaToolchainInfo) + * [`java_annotation_processing`](/versions/7.7.3/rules/lib/builtins/java_annotation_processing) + * [`java_compilation_info`](/versions/7.7.3/rules/lib/providers/java_compilation_info) + * [`java_output`](/versions/7.7.3/rules/lib/builtins/java_output) + * [`java_output_jars`](/versions/7.7.3/rules/lib/providers/java_output_jars) + * [`JavaRuntimeInfo`](/versions/7.7.3/rules/lib/providers/JavaRuntimeInfo) + * [`JavaToolchainInfo`](/versions/7.7.3/rules/lib/providers/JavaToolchainInfo) ## Configuring the Java toolchains {#config-java-toolchains} @@ -233,7 +233,7 @@ You can reconfigure the compilation by adding `default_java_toolchain` macro to a `BUILD` file and registering it either by adding `register_toolchains` rule to the `WORKSPACE` file or by using -[`--extra_toolchains`](/versions/7.7.1/docs/user-manual#extra-toolchains) flag. +[`--extra_toolchains`](/versions/7.7.3/docs/user-manual#extra-toolchains) flag. The toolchain is only used when the `source_version` attribute matches the value specified by `--java_language_version` flag. @@ -242,7 +242,7 @@ ```python load( - "@bazel_tools@bazel_tools//tools/jdk:default_java_toolchain.bzl", + "@bazel_tools//tools/jdk:default_java_toolchain.bzl", "default_java_toolchain", "DEFAULT_TOOLCHAIN_CONFIGURATION", "BASE_JDK9_JVM_OPTS", "DEFAULT_JAVACOPTS" ) @@ -290,7 +290,7 @@ Please refer to the example below. ```python -load("@bazel_tools@bazel_tools//tools/jdk:default_java_toolchain.bzl", "default_java_toolchain") +load("@bazel_tools//tools/jdk:default_java_toolchain.bzl", "default_java_toolchain") # This is a convenience macro that inherits values from Bazel's default java_toolchain default_java_toolchain(
diff --git a/docs/versions/7.7.1/docs/bazel-and-javascript.mdx b/docs/versions/7.7.3/docs/bazel-and-javascript.mdx similarity index 100% rename from docs/versions/7.7.1/docs/bazel-and-javascript.mdx rename to docs/versions/7.7.3/docs/bazel-and-javascript.mdx
diff --git a/docs/versions/7.7.1/docs/cc-toolchain-config-reference.mdx b/docs/versions/7.7.3/docs/cc-toolchain-config-reference.mdx similarity index 99% rename from docs/versions/7.7.1/docs/cc-toolchain-config-reference.mdx rename to docs/versions/7.7.3/docs/cc-toolchain-config-reference.mdx index 8f2abf6..44f36cf 100644 --- a/docs/versions/7.7.1/docs/cc-toolchain-config-reference.mdx +++ b/docs/versions/7.7.3/docs/cc-toolchain-config-reference.mdx
@@ -25,14 +25,14 @@ If the compiler has support for multiple architectures, Bazel needs to configure them separately. -[`CcToolchainConfigInfo`](/versions/7.7.1/rules/lib/providers/CcToolchainConfigInfo) is a provider that provides the necessary level of +[`CcToolchainConfigInfo`](/versions/7.7.3/rules/lib/providers/CcToolchainConfigInfo) is a provider that provides the necessary level of granularity for configuring the behavior of Bazel's C++ rules. By default, Bazel automatically configures `CcToolchainConfigInfo` for your build, but you have the option to configure it manually. For that, you need a Starlark rule that provides the `CcToolchainConfigInfo` and you need to point the -[`toolchain_config`](/versions/7.7.1/reference/be/c-cpp#cc_toolchain.toolchain_config) attribute of the `cc_toolchain` to your rule. +[`toolchain_config`](/versions/7.7.3/reference/be/c-cpp#cc_toolchain.toolchain_config) attribute of the `cc_toolchain` to your rule. You can create the `CcToolchainConfigInfo` by calling -[`cc_common.create_cc_toolchain_config_info()`](/versions/7.7.1/rules/lib/toplevel/cc_common#create_cc_toolchain_config_info). +[`cc_common.create_cc_toolchain_config_info()`](/versions/7.7.3/rules/lib/toplevel/cc_common#create_cc_toolchain_config_info). You can find Starlark constructors for all structs you'll need in the process in [`@rules_cc//cc:cc_toolchain_config_lib.bzl`](https://github.com/bazelbuild/rules_cc/blob/master/cc/cc_toolchain_config_lib.bzl). @@ -64,7 +64,7 @@ 1. User specifies a `cc_toolchain_suite` target in the `BUILD` file and points Bazel to the target using the - [`--crosstool_top` option](/versions/7.7.1/docs/user-manual#flag--crosstool_top). + [`--crosstool_top` option](/versions/7.7.3/docs/user-manual#flag--crosstool_top). 2. The `cc_toolchain_suite` target references multiple toolchains. The values of the `--cpu` and `--compiler` flags determine which of those
diff --git a/docs/versions/7.7.1/docs/configurable-attributes.mdx b/docs/versions/7.7.3/docs/configurable-attributes.mdx similarity index 94% rename from docs/versions/7.7.1/docs/configurable-attributes.mdx rename to docs/versions/7.7.3/docs/configurable-attributes.mdx index 2cfddcc..3d8f338 100644 --- a/docs/versions/7.7.1/docs/configurable-attributes.mdx +++ b/docs/versions/7.7.3/docs/configurable-attributes.mdx
@@ -2,7 +2,7 @@ title: 'Configurable Build Attributes' --- -**_Configurable attributes_**, commonly known as [`select()`](/versions/7.7.1/reference/be/functions#select), is a Bazel feature that lets users toggle the values +**_Configurable attributes_**, commonly known as [`select()`](/versions/7.7.3/reference/be/functions#select), is a Bazel feature that lets users toggle the values of build rule attributes at the command line. This can be used, for example, for a multiplatform library that automatically @@ -65,7 +65,7 @@ </table> `select()` serves as a placeholder for a value that will be chosen based on -*configuration conditions*, which are labels referencing [`config_setting`](/versions/7.7.1/reference/be/general#config_setting) +*configuration conditions*, which are labels referencing [`config_setting`](/versions/7.7.3/reference/be/general#config_setting) targets. By using `select()` in a configurable attribute, the attribute effectively adopts different values when different conditions hold. @@ -82,7 +82,7 @@ `resources`, `cmd`, and most other attributes. Only a small number of attributes are *non-configurable*, and these are clearly annotated. For example, `config_setting`'s own -[`values`](/versions/7.7.1/reference/be/general#config_setting.values) attribute is non-configurable. +[`values`](/versions/7.7.3/reference/be/general#config_setting.values) attribute is non-configurable. ## `select()` and dependencies {#select-and-dependencies} @@ -90,7 +90,7 @@ under a target. For example, `genrule`'s `tools` changes `--cpu` to the CPU of the machine running Bazel (which, thanks to cross-compilation, may be different than the CPU the target is built for). This is known as a -[configuration transition](/versions/7.7.1/reference/glossary#transition). +[configuration transition](/versions/7.7.3/reference/glossary#transition). Given @@ -143,8 +143,8 @@ ## Configuration conditions {#configuration-conditions} Each key in a configurable attribute is a label reference to a -[`config_setting`](/versions/7.7.1/reference/be/general#config_setting) or -[`constraint_value`](/versions/7.7.1/reference/be/platforms-and-toolchains#constraint_value). +[`config_setting`](/versions/7.7.3/reference/be/general#config_setting) or +[`constraint_value`](/versions/7.7.3/reference/be/platforms-and-toolchains#constraint_value). `config_setting` is just a collection of expected command line flag settings. By encapsulating these in a target, it's @@ -156,8 +156,8 @@ Flags like `--cpu` are built into Bazel: the build tool natively understands them for all builds in all projects. These are specified with -[`config_setting`](/versions/7.7.1/reference/be/general#config_setting)'s -[`values`](/versions/7.7.1/reference/be/general#config_setting.values) attribute: +[`config_setting`](/versions/7.7.3/reference/be/general#config_setting)'s +[`values`](/versions/7.7.3/reference/be/general#config_setting.values) attribute: ```python config_setting( @@ -181,7 +181,7 @@ * `values = { "force_pic": "0" }` matches `bazel build --noforce_pic` `config_setting` only supports flags that affect target behavior. For example, -[`--show_progress`](/versions/7.7.1/docs/user-manual#show-progress) isn't allowed because +[`--show_progress`](/versions/7.7.3/docs/user-manual#show-progress) isn't allowed because it only affects how Bazel reports progress to the user. Targets can't use that flag to construct their results. The exact set of supported flags isn't documented. In practice, most flags that "make sense" work. @@ -192,8 +192,8 @@ [Starlark build settings][BuildSettings]. Unlike built-in flags, these are defined as build targets, so Bazel references them with target labels. -These are triggered with [`config_setting`](/versions/7.7.1/reference/be/general#config_setting)'s -[`flag_values`](/versions/7.7.1/reference/be/general#config_setting.flag_values) +These are triggered with [`config_setting`](/versions/7.7.3/reference/be/general#config_setting)'s +[`flag_values`](/versions/7.7.3/reference/be/general#config_setting.flag_values) attribute: ```python @@ -210,12 +210,12 @@ Behavior is the same as for [built-in flags](#built-in-flags). See [here](https://github.com/bazelbuild/examples/tree/HEAD/configurations/select_on_build_setting) for a working example. -[`--define`](/versions/7.7.1/reference/command-line-reference#flag--define) +[`--define`](/versions/7.7.3/reference/command-line-reference#flag--define) is an alternative legacy syntax for custom flags (for example `--define foo=bar`). This can be expressed either in the -[values](/versions/7.7.1/reference/be/general#config_setting.values) attribute +[values](/versions/7.7.3/reference/be/general#config_setting.values) attribute (`values = {"define": "foo=bar"}`) or the -[define_values](/versions/7.7.1/reference/be/general#config_setting.define_values) attribute +[define_values](/versions/7.7.3/reference/be/general#config_setting.define_values) attribute (`define_values = {"foo": "bar"}`). `--define` is only supported for backwards compatibility. Prefer Starlark build settings whenever possible. @@ -263,7 +263,7 @@ While the ability to specify multiple flags on the command line provides flexibility, it can also be burdensome to individually set each one every time you want to build a target. - [Platforms](/versions/7.7.1/extending/platforms) + [Platforms](/versions/7.7.3/extending/platforms) let you consolidate these into simple bundles. ```python @@ -358,7 +358,7 @@ check against single values. Platforms are still under development. See the -[documentation](/versions/7.7.1/concepts/platforms) for details. +[documentation](/versions/7.7.3/concepts/platforms) for details. ## Combining `select()`s {#combining-selects} @@ -560,7 +560,7 @@ //tools/cc_target_os:android ``` -This can be customized with the [`no_match_error`](/versions/7.7.1/reference/be/functions#select) +This can be customized with the [`no_match_error`](/versions/7.7.3/reference/be/functions#select) attribute: ```python @@ -622,7 +622,7 @@ This is for two reasons. First, macros that need to know which path a `select` will choose *cannot work* -because macros are evaluated in Bazel's [loading phase](/versions/7.7.1/run/build#loading), +because macros are evaluated in Bazel's [loading phase](/versions/7.7.3/run/build#loading), which occurs before flag values are known. This is a core Bazel design restriction that's unlikely to change any time soon. @@ -632,14 +632,14 @@ ## Bazel query and cquery {#query-and-cquery} -Bazel [`query`](/versions/7.7.1/query/guide) operates over Bazel's -[loading phase](/versions/7.7.1/reference/glossary#loading-phase). +Bazel [`query`](/versions/7.7.3/query/guide) operates over Bazel's +[loading phase](/versions/7.7.3/reference/glossary#loading-phase). This means it doesn't know what command line flags a target uses since those flags aren't evaluated until later in the build (in the -[analysis phase](/versions/7.7.1/reference/glossary#analysis-phase)). +[analysis phase](/versions/7.7.3/reference/glossary#analysis-phase)). So it can't determine which `select()` branches are chosen. -Bazel [`cquery`](/versions/7.7.1/query/cquery) operates after Bazel's analysis phase, so it has +Bazel [`cquery`](/versions/7.7.3/query/cquery) operates after Bazel's analysis phase, so it has all this information and can accurately resolve `select()`s. Consider: @@ -700,7 +700,7 @@ The key issue this question usually means is that select() doesn't work in *macros*. These are different than *rules*. See the -documentation on [rules](/versions/7.7.1/extending/rules) and [macros](/versions/7.7.1/extending/macros) +documentation on [rules](/versions/7.7.3/extending/rules) and [macros](/versions/7.7.3/extending/macros) to understand the difference. Here's an end-to-end example: @@ -911,14 +911,14 @@ First of all, do not use `bind()`. It is deprecated in favor of `alias()`. -The technical answer is that [`bind()`](/versions/7.7.1/reference/be/workspace#bind) is a repo +The technical answer is that [`bind()`](/versions/7.7.3/reference/be/workspace#bind) is a repo rule, not a BUILD rule. Repo rules do not have a specific configuration, and aren't evaluated in the same way as BUILD rules. Therefore, a `select()` in a `bind()` can't actually evaluate to any specific branch. -Instead, you should use [`alias()`](/versions/7.7.1/reference/be/general#alias), with a `select()` in +Instead, you should use [`alias()`](/versions/7.7.3/reference/be/general#alias), with a `select()` in the `actual` attribute, to perform this type of run-time determination. This works correctly, since `alias()` is a BUILD rule, and is evaluated with a specific configuration. @@ -958,7 +958,7 @@ ### Why doesn't my select() choose what I expect? {#faq-select-choose-condition} If `//myapp:foo` has a `select()` that doesn't choose the condition you expect, -use [cquery](/versions/7.7.1/query/cquery) and `bazel config` to debug: +use [cquery](/versions/7.7.3/query/cquery) and `bazel config` to debug: If `//myapp:foo` is the top-level target you're building, run: @@ -999,7 +999,7 @@ Then compare this output against the settings expected by each `config_setting`. `//myapp:foo` may exist in different configurations in the same build. See the -[cquery docs](/versions/7.7.1/query/cquery) for guidance on using `somepath` to get the right +[cquery docs](/versions/7.7.3/query/cquery) for guidance on using `somepath` to get the right one. Caution: To prevent restarting the Bazel server, invoke `bazel config` with the
diff --git a/docs/versions/7.7.1/docs/images/a_b_a_c.svg b/docs/versions/7.7.3/docs/images/a_b_a_c.svg similarity index 100% rename from docs/versions/7.7.1/docs/images/a_b_a_c.svg rename to docs/versions/7.7.3/docs/images/a_b_a_c.svg
diff --git a/docs/versions/7.7.1/docs/images/a_b_c.svg b/docs/versions/7.7.3/docs/images/a_b_c.svg similarity index 100% rename from docs/versions/7.7.1/docs/images/a_b_c.svg rename to docs/versions/7.7.3/docs/images/a_b_c.svg
diff --git a/docs/versions/7.7.1/docs/images/a_b_c_ac.svg b/docs/versions/7.7.3/docs/images/a_b_c_ac.svg similarity index 100% rename from docs/versions/7.7.1/docs/images/a_b_c_ac.svg rename to docs/versions/7.7.3/docs/images/a_b_c_ac.svg
diff --git a/docs/versions/7.7.1/docs/images/ab_c.svg b/docs/versions/7.7.3/docs/images/ab_c.svg similarity index 100% rename from docs/versions/7.7.1/docs/images/ab_c.svg rename to docs/versions/7.7.3/docs/images/ab_c.svg
diff --git a/docs/versions/7.7.1/docs/images/allpaths.svg b/docs/versions/7.7.3/docs/images/allpaths.svg similarity index 100% rename from docs/versions/7.7.1/docs/images/allpaths.svg rename to docs/versions/7.7.3/docs/images/allpaths.svg
diff --git a/docs/versions/7.7.1/docs/images/android_instrumentation_test.png b/docs/versions/7.7.3/docs/images/android_instrumentation_test.png similarity index 100% rename from docs/versions/7.7.1/docs/images/android_instrumentation_test.png rename to docs/versions/7.7.3/docs/images/android_instrumentation_test.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/android_ndk.png b/docs/versions/7.7.3/docs/images/android_ndk.png similarity index 100% rename from docs/versions/7.7.1/docs/images/android_ndk.png rename to docs/versions/7.7.3/docs/images/android_ndk.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/android_test.gif b/docs/versions/7.7.3/docs/images/android_test.gif similarity index 100% rename from docs/versions/7.7.1/docs/images/android_test.gif rename to docs/versions/7.7.3/docs/images/android_test.gif Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/android_tutorial_app.png b/docs/versions/7.7.3/docs/images/android_tutorial_app.png similarity index 100% rename from docs/versions/7.7.1/docs/images/android_tutorial_app.png rename to docs/versions/7.7.3/docs/images/android_tutorial_app.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/android_tutorial_before.png b/docs/versions/7.7.3/docs/images/android_tutorial_before.png similarity index 100% rename from docs/versions/7.7.1/docs/images/android_tutorial_before.png rename to docs/versions/7.7.3/docs/images/android_tutorial_before.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/bep-graph.png b/docs/versions/7.7.3/docs/images/bep-graph.png similarity index 100% rename from docs/versions/7.7.1/docs/images/bep-graph.png rename to docs/versions/7.7.3/docs/images/bep-graph.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/bep-graph.svg b/docs/versions/7.7.3/docs/images/bep-graph.svg similarity index 100% rename from docs/versions/7.7.1/docs/images/bep-graph.svg rename to docs/versions/7.7.3/docs/images/bep-graph.svg
diff --git a/docs/versions/7.7.1/docs/images/cpp-tutorial-stage1.png b/docs/versions/7.7.3/docs/images/cpp-tutorial-stage1.png similarity index 100% rename from docs/versions/7.7.1/docs/images/cpp-tutorial-stage1.png rename to docs/versions/7.7.3/docs/images/cpp-tutorial-stage1.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/cpp-tutorial-stage2.png b/docs/versions/7.7.3/docs/images/cpp-tutorial-stage2.png similarity index 100% rename from docs/versions/7.7.1/docs/images/cpp-tutorial-stage2.png rename to docs/versions/7.7.3/docs/images/cpp-tutorial-stage2.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/cpp-tutorial-stage3.png b/docs/versions/7.7.3/docs/images/cpp-tutorial-stage3.png similarity index 100% rename from docs/versions/7.7.1/docs/images/cpp-tutorial-stage3.png rename to docs/versions/7.7.3/docs/images/cpp-tutorial-stage3.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/deps.svg b/docs/versions/7.7.3/docs/images/deps.svg similarity index 100% rename from docs/versions/7.7.1/docs/images/deps.svg rename to docs/versions/7.7.3/docs/images/deps.svg
diff --git a/docs/versions/7.7.1/docs/images/dyn-trace-alldynamic.png b/docs/versions/7.7.3/docs/images/dyn-trace-alldynamic.png similarity index 100% rename from docs/versions/7.7.1/docs/images/dyn-trace-alldynamic.png rename to docs/versions/7.7.3/docs/images/dyn-trace-alldynamic.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/dyn-trace-javaconly.png b/docs/versions/7.7.3/docs/images/dyn-trace-javaconly.png similarity index 100% rename from docs/versions/7.7.1/docs/images/dyn-trace-javaconly.png rename to docs/versions/7.7.3/docs/images/dyn-trace-javaconly.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/e4b-workflow.png b/docs/versions/7.7.3/docs/images/e4b-workflow.png similarity index 100% rename from docs/versions/7.7.1/docs/images/e4b-workflow.png rename to docs/versions/7.7.3/docs/images/e4b-workflow.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/e4b-workflow.svg b/docs/versions/7.7.3/docs/images/e4b-workflow.svg similarity index 100% rename from docs/versions/7.7.1/docs/images/e4b-workflow.svg rename to docs/versions/7.7.3/docs/images/e4b-workflow.svg
diff --git a/docs/versions/7.7.1/docs/images/error_example_1.png b/docs/versions/7.7.3/docs/images/error_example_1.png similarity index 100% rename from docs/versions/7.7.1/docs/images/error_example_1.png rename to docs/versions/7.7.3/docs/images/error_example_1.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/error_example_2.png b/docs/versions/7.7.3/docs/images/error_example_2.png similarity index 100% rename from docs/versions/7.7.1/docs/images/error_example_2.png rename to docs/versions/7.7.3/docs/images/error_example_2.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/error_example_3.png b/docs/versions/7.7.3/docs/images/error_example_3.png similarity index 100% rename from docs/versions/7.7.1/docs/images/error_example_3.png rename to docs/versions/7.7.3/docs/images/error_example_3.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/error_example_4.png b/docs/versions/7.7.3/docs/images/error_example_4.png similarity index 100% rename from docs/versions/7.7.1/docs/images/error_example_4.png rename to docs/versions/7.7.3/docs/images/error_example_4.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/graph.png b/docs/versions/7.7.3/docs/images/graph.png similarity index 100% rename from docs/versions/7.7.1/docs/images/graph.png rename to docs/versions/7.7.3/docs/images/graph.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/graph_ex_1.svg b/docs/versions/7.7.3/docs/images/graph_ex_1.svg similarity index 100% rename from docs/versions/7.7.1/docs/images/graph_ex_1.svg rename to docs/versions/7.7.3/docs/images/graph_ex_1.svg
diff --git a/docs/versions/7.7.1/docs/images/graph_hello-world.svg b/docs/versions/7.7.3/docs/images/graph_hello-world.svg similarity index 100% rename from docs/versions/7.7.1/docs/images/graph_hello-world.svg rename to docs/versions/7.7.3/docs/images/graph_hello-world.svg
diff --git a/docs/versions/7.7.1/docs/images/json-trace-profile-network-usage.png b/docs/versions/7.7.3/docs/images/json-trace-profile-network-usage.png similarity index 100% rename from docs/versions/7.7.1/docs/images/json-trace-profile-network-usage.png rename to docs/versions/7.7.3/docs/images/json-trace-profile-network-usage.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/json-trace-profile-system-load-average.png b/docs/versions/7.7.3/docs/images/json-trace-profile-system-load-average.png similarity index 100% rename from docs/versions/7.7.1/docs/images/json-trace-profile-system-load-average.png rename to docs/versions/7.7.3/docs/images/json-trace-profile-system-load-average.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/json-trace-profile-workers-memory-usage.png b/docs/versions/7.7.3/docs/images/json-trace-profile-workers-memory-usage.png similarity index 100% rename from docs/versions/7.7.1/docs/images/json-trace-profile-workers-memory-usage.png rename to docs/versions/7.7.3/docs/images/json-trace-profile-workers-memory-usage.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/json-trace-profile.png b/docs/versions/7.7.3/docs/images/json-trace-profile.png similarity index 100% rename from docs/versions/7.7.1/docs/images/json-trace-profile.png rename to docs/versions/7.7.3/docs/images/json-trace-profile.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/mobile-install-performance.svg b/docs/versions/7.7.3/docs/images/mobile-install-performance.svg similarity index 100% rename from docs/versions/7.7.1/docs/images/mobile-install-performance.svg rename to docs/versions/7.7.3/docs/images/mobile-install-performance.svg
diff --git a/docs/versions/7.7.1/docs/images/namedsetoffiles-bep-graph.png b/docs/versions/7.7.3/docs/images/namedsetoffiles-bep-graph.png similarity index 100% rename from docs/versions/7.7.1/docs/images/namedsetoffiles-bep-graph.png rename to docs/versions/7.7.3/docs/images/namedsetoffiles-bep-graph.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/out-ranked.svg b/docs/versions/7.7.3/docs/images/out-ranked.svg similarity index 100% rename from docs/versions/7.7.1/docs/images/out-ranked.svg rename to docs/versions/7.7.3/docs/images/out-ranked.svg
diff --git a/docs/versions/7.7.1/docs/images/rbe-ci-1.png b/docs/versions/7.7.3/docs/images/rbe-ci-1.png similarity index 100% rename from docs/versions/7.7.1/docs/images/rbe-ci-1.png rename to docs/versions/7.7.3/docs/images/rbe-ci-1.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/rbe-ci-2.png b/docs/versions/7.7.3/docs/images/rbe-ci-2.png similarity index 100% rename from docs/versions/7.7.1/docs/images/rbe-ci-2.png rename to docs/versions/7.7.3/docs/images/rbe-ci-2.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/somepath1.svg b/docs/versions/7.7.3/docs/images/somepath1.svg similarity index 100% rename from docs/versions/7.7.1/docs/images/somepath1.svg rename to docs/versions/7.7.3/docs/images/somepath1.svg
diff --git a/docs/versions/7.7.1/docs/images/somepath2.svg b/docs/versions/7.7.3/docs/images/somepath2.svg similarity index 100% rename from docs/versions/7.7.1/docs/images/somepath2.svg rename to docs/versions/7.7.3/docs/images/somepath2.svg
diff --git a/docs/versions/7.7.1/docs/images/targets.svg b/docs/versions/7.7.3/docs/images/targets.svg similarity index 100% rename from docs/versions/7.7.1/docs/images/targets.svg rename to docs/versions/7.7.3/docs/images/targets.svg
diff --git a/docs/versions/7.7.1/docs/images/tutorial_java_01.svg b/docs/versions/7.7.3/docs/images/tutorial_java_01.svg similarity index 100% rename from docs/versions/7.7.1/docs/images/tutorial_java_01.svg rename to docs/versions/7.7.3/docs/images/tutorial_java_01.svg
diff --git a/docs/versions/7.7.1/docs/images/tutorial_java_02.svg b/docs/versions/7.7.3/docs/images/tutorial_java_02.svg similarity index 100% rename from docs/versions/7.7.1/docs/images/tutorial_java_02.svg rename to docs/versions/7.7.3/docs/images/tutorial_java_02.svg
diff --git a/docs/versions/7.7.1/docs/images/tutorial_java_03.svg b/docs/versions/7.7.3/docs/images/tutorial_java_03.svg similarity index 100% rename from docs/versions/7.7.1/docs/images/tutorial_java_03.svg rename to docs/versions/7.7.3/docs/images/tutorial_java_03.svg
diff --git a/docs/versions/7.7.1/docs/images/workers-clean-chart.png b/docs/versions/7.7.3/docs/images/workers-clean-chart.png similarity index 100% rename from docs/versions/7.7.1/docs/images/workers-clean-chart.png rename to docs/versions/7.7.3/docs/images/workers-clean-chart.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/workers-incremental-chart.png b/docs/versions/7.7.3/docs/images/workers-incremental-chart.png similarity index 100% rename from docs/versions/7.7.1/docs/images/workers-incremental-chart.png rename to docs/versions/7.7.3/docs/images/workers-incremental-chart.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/ws-diamond.png b/docs/versions/7.7.3/docs/images/ws-diamond.png similarity index 100% rename from docs/versions/7.7.1/docs/images/ws-diamond.png rename to docs/versions/7.7.3/docs/images/ws-diamond.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/ws-line.png b/docs/versions/7.7.3/docs/images/ws-line.png similarity index 100% rename from docs/versions/7.7.1/docs/images/ws-line.png rename to docs/versions/7.7.3/docs/images/ws-line.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/images/ws-multiline.png b/docs/versions/7.7.3/docs/images/ws-multiline.png similarity index 100% rename from docs/versions/7.7.1/docs/images/ws-multiline.png rename to docs/versions/7.7.3/docs/images/ws-multiline.png Binary files differ
diff --git a/docs/versions/7.7.1/docs/mobile-install.mdx b/docs/versions/7.7.3/docs/mobile-install.mdx similarity index 99% rename from docs/versions/7.7.1/docs/mobile-install.mdx rename to docs/versions/7.7.3/docs/mobile-install.mdx index eee73d3..a44cfd7 100644 --- a/docs/versions/7.7.1/docs/mobile-install.mdx +++ b/docs/versions/7.7.3/docs/mobile-install.mdx
@@ -189,7 +189,7 @@ The following numbers were computed for a few Google products: -<img src="/versions/7.7.1/docs/images/mobile-install-performance.svg"/> +<img src="/versions/7.7.3/docs/images/mobile-install-performance.svg"/> This, of course, depends on the nature of the change: recompilation after changing a base library takes more time.
diff --git a/docs/versions/7.7.1/docs/sandboxing.mdx b/docs/versions/7.7.3/docs/sandboxing.mdx similarity index 96% rename from docs/versions/7.7.1/docs/sandboxing.mdx rename to docs/versions/7.7.3/docs/sandboxing.mdx index 4337839..f802e73 100644 --- a/docs/versions/7.7.1/docs/sandboxing.mdx +++ b/docs/versions/7.7.3/docs/sandboxing.mdx
@@ -48,10 +48,10 @@ ## What sandbox strategy to use {#sandboxing-strategies} You can choose which kind of sandboxing to use, if any, with the -[strategy flags](/versions/7.7.1/docs/user-manual#strategy-options). Using the `sandboxed` +[strategy flags](/versions/7.7.3/docs/user-manual#strategy-options). Using the `sandboxed` strategy makes Bazel pick one of the sandbox implementations listed below, preferring an OS-specific sandbox to the less hermetic generic one. -[Persistent workers](/versions/7.7.1/remote/persistent) run in a generic sandbox if you pass +[Persistent workers](/versions/7.7.3/remote/persistent) run in a generic sandbox if you pass the `--worker_sandboxing` flag. The `local` (a.k.a. `standalone`) strategy does not do any kind of sandboxing. @@ -96,7 +96,7 @@ Dynamic execution usually requires sandboxing for local execution. To opt out, pass the `--experimental_local_lockfree_output` flag. Dynamic execution silently -sandboxes [persistent workers](/versions/7.7.1/remote/persistent). +sandboxes [persistent workers](/versions/7.7.3/remote/persistent). ## Downsides to sandboxing {#sandboxing_downsides} @@ -107,10 +107,10 @@ mitigate the setup and teardown cost. - Sandboxing effectively disables any cache the tool may have. You can - mitigate this by using [persistent workers](/versions/7.7.1/remote/persistent), at + mitigate this by using [persistent workers](/versions/7.7.3/remote/persistent), at the cost of weaker sandbox guarantees. -- [Multiplex workers](/versions/7.7.1/remote/multiplex) require explicit worker support +- [Multiplex workers](/versions/7.7.3/remote/multiplex) require explicit worker support to be sandboxed. Workers that do not support multiplex sandboxing run as singleplex workers under dynamic execution, which can cost extra memory.
diff --git a/docs/versions/7.7.1/docs/user-manual.mdx b/docs/versions/7.7.3/docs/user-manual.mdx similarity index 97% rename from docs/versions/7.7.1/docs/user-manual.mdx rename to docs/versions/7.7.3/docs/user-manual.mdx index 9a1d233..07c6e02 100644 --- a/docs/versions/7.7.1/docs/user-manual.mdx +++ b/docs/versions/7.7.3/docs/user-manual.mdx
@@ -4,13 +4,13 @@ This page covers the options that are available with various Bazel commands, such as `bazel build`, `bazel run`, and `bazel test`. This page is a companion -to the list of Bazel's commands in [Build with Bazel](/versions/7.7.1/run/build). +to the list of Bazel's commands in [Build with Bazel](/versions/7.7.3/run/build). ## Target syntax {#target-syntax} Some commands, like `build` or `test`, can operate on a list of targets. They use a syntax more flexible than labels, which is documented in -[Specifying targets to build](/versions/7.7.1/run/build#specifying-build-targets). +[Specifying targets to build](/versions/7.7.3/run/build#specifying-build-targets). ## Options {#build-options} @@ -59,7 +59,7 @@ `/home/bob/clients/bob_client/bazel/foo` directory. If you use a non-default package path, specify it in your -[Bazel configuration file](/versions/7.7.1/run/bazelrc) for convenience. +[Bazel configuration file](/versions/7.7.3/run/bazelrc) for convenience. _Bazel doesn't require any packages to be in the current directory_, so you can do a build from an empty bazel @@ -226,7 +226,7 @@ Build rules can also specify link options in their attributes. This option's settings always take precedence. Also see -[cc_library.linkopts](/versions/7.7.1/reference/be/c-cpp#cc_library.linkopts). +[cc_library.linkopts](/versions/7.7.3/reference/be/c-cpp#cc_library.linkopts). #### `--strip (always|never|sometimes)` {#strip} @@ -264,7 +264,7 @@ #### `--stripopt=strip-option` {#stripopt} This is an additional option to pass to the `strip` command when generating -a [`*.stripped` binary](/versions/7.7.1/reference/be/c-cpp#cc_binary_implicit_outputs). The default +a [`*.stripped` binary](/versions/7.7.3/reference/be/c-cpp#cc_binary_implicit_outputs). The default is `-S -p`. This option can be used multiple times. Note: `--stripopt` does not apply to the stripping of the main @@ -450,17 +450,17 @@ #### `--experimental_action_listener=label` {#experimental-action-listener} Warning: Extra actions are deprecated. Use -[aspects](/versions/7.7.1/extending/aspects) +[aspects](/versions/7.7.3/extending/aspects) instead. The `experimental_action_listener` option instructs Bazel to use -details from the [`action_listener`](/versions/7.7.1/reference/be/extra-actions#action_listener) rule specified by label to -insert [`extra_actions`](/versions/7.7.1/reference/be/extra-actions#extra_action) into the build graph. +details from the [`action_listener`](/versions/7.7.3/reference/be/extra-actions#action_listener) rule specified by label to +insert [`extra_actions`](/versions/7.7.3/reference/be/extra-actions#extra_action) into the build graph. #### `--[no]experimental_extra_action_top_level_only` {#experimental-extra-action-top-level-only} Warning: Extra actions are deprecated. Use -[aspects](/versions/7.7.1/extending/aspects) instead. +[aspects](/versions/7.7.3/extending/aspects) instead. If this option is set to true, extra actions specified by the [ `--experimental_action_listener`](#experimental-action-listener) command @@ -469,7 +469,7 @@ #### `--experimental_extra_action_filter=regex` {#experimental-extra-action-filter} Warning: Extra actions are deprecated. Use -[aspects](/versions/7.7.1/extending/aspects) instead. +[aspects](/versions/7.7.3/extending/aspects) instead. The `experimental_extra_action_filter` option instructs Bazel to filter the set of targets to schedule `extra_actions` for. @@ -557,17 +557,17 @@ #### `--dynamic_mode=mode` {#dynamic-mode} Determines whether C++ binaries will be linked dynamically, interacting with -the [linkstatic attribute](/versions/7.7.1/reference/be/c-cpp#cc_binary.linkstatic) on build rules. +the [linkstatic attribute](/versions/7.7.3/reference/be/c-cpp#cc_binary.linkstatic) on build rules. Modes: * `default`: Allows bazel to choose whether to link dynamically. - See [linkstatic](/versions/7.7.1/reference/be/c-cpp#cc_binary.linkstatic) for more + See [linkstatic](/versions/7.7.3/reference/be/c-cpp#cc_binary.linkstatic) for more information. * `fully`: Links all targets dynamically. This will speed up linking time, and reduce the size of the resulting binaries. * `off`: Links all targets in - [mostly static](/versions/7.7.1/reference/be/c-cpp#cc_binary.linkstatic) mode. + [mostly static](/versions/7.7.3/reference/be/c-cpp#cc_binary.linkstatic) mode. If `-static` is set in linkopts, targets will change to fully static. #### `--fission (yes|no|[dbg][,opt][,fastbuild])` {#fission} @@ -602,7 +602,7 @@ #### `--android_resource_shrinking` {#flag--android_resource_shrinking} Selects whether to perform resource shrinking for android_binary rules. Sets the default for the -[shrink_resources attribute](/versions/7.7.1/reference/be/android#android_binary.shrink_resources) on +[shrink_resources attribute](/versions/7.7.3/reference/be/android#android_binary.shrink_resources) on android_binary rules; see the documentation for that rule for further details. Defaults to off. #### `--custom_malloc=malloc-library-target` {#custom-malloc} @@ -677,7 +677,7 @@ This option sets the _label_ of the base Java installation to use for _bazel run_, _bazel test_, and for Java binaries built by `java_binary` and `java_test` rules. The `JAVABASE` and `JAVA` -["Make" variables](/versions/7.7.1/reference/be/make-variables) are derived from this option. +["Make" variables](/versions/7.7.3/reference/be/make-variables) are derived from this option. #### `--host_javabase=label` {#host-javabase} @@ -820,9 +820,9 @@ When this option is enabled, Bazel will discard the analysis cache right before execution starts, thus freeing up additional memory -(around 10%) for the [execution phase](/versions/7.7.1/run/build#execution). +(around 10%) for the [execution phase](/versions/7.7.3/run/build#execution). The drawback is that further incremental builds will be slower. See also -[memory-saving mode](/versions/7.7.1/configure/memory). +[memory-saving mode](/versions/7.7.3/configure/memory). #### `--[no]keep_going` (-k) {#keep-going} @@ -1148,7 +1148,7 @@ regression tests). In the former case, the result information is very useful whereas in the latter case it is less so. As with all options, this can be specified implicitly via -the [`.bazelrc`](/versions/7.7.1/run/bazelrc) file. +the [`.bazelrc`](/versions/7.7.3/run/bazelrc) file. The files are printed so as to make it easy to copy and paste the filename to the shell, to run built executables. The "up-to-date" @@ -1187,9 +1187,9 @@ See also [--verbose_failures](#verbose-failures), below. For logging subcommands to a file in a tool-friendly format, see -[--execution_log_json_file](/versions/7.7.1/reference/command-line-reference#flag--execution_log_json_file) +[--execution_log_json_file](/versions/7.7.3/reference/command-line-reference#flag--execution_log_json_file) and -[--execution_log_binary_file](/versions/7.7.1/reference/command-line-reference#flag--execution_log_binary_file). +[--execution_log_binary_file](/versions/7.7.3/reference/command-line-reference#flag--execution_log_binary_file). #### `--verbose_failures` {#verbose-failures} @@ -1304,7 +1304,7 @@ Use these options to control the host and target platforms that configure how builds work, and to control what execution platforms and toolchains are available to Bazel rules. -Please see background information on [Platforms](/versions/7.7.1/extending/platforms) and [Toolchains](/versions/7.7.1/extending/toolchains). +Please see background information on [Platforms](/versions/7.7.3/extending/platforms) and [Toolchains](/versions/7.7.3/extending/toolchains). #### `--platforms=labels` {#platforms} @@ -1320,7 +1320,7 @@ The platforms that are available as execution platforms to run actions. Platforms can be specified by exact target, or as a target pattern. These platforms will be considered before those declared in the WORKSPACE file by -[register_execution_platforms()](/versions/7.7.1/rules/lib/globals/workspace#register_execution_platforms). +[register_execution_platforms()](/versions/7.7.3/rules/lib/globals/workspace#register_execution_platforms). This option accepts a comma-separated list of platforms in order of priority. If the flag is passed multiple times, the most recent overrides. @@ -1329,7 +1329,7 @@ The toolchain rules to be considered during toolchain resolution. Toolchains can be specified by exact target, or as a target pattern. These toolchains will be considered before those declared in the WORKSPACE file by -[register_toolchains()](/versions/7.7.1/rules/lib/globals/workspace#register_toolchains). +[register_toolchains()](/versions/7.7.3/rules/lib/globals/workspace#register_toolchains). #### `--toolchain_resolution_debug=regex` {#toolchain-resolution-debug} @@ -1344,7 +1344,7 @@ A convenience flag used to bind longer Starlark build settings to a shorter name. For more details, see the -[Starlark Configurations](/versions/7.7.1/extending/config#using-build-setting-aliases). +[Starlark Configurations](/versions/7.7.3/extending/config#using-build-setting-aliases). #### `--symlink_prefix=string` {#symlink-prefix} @@ -1429,11 +1429,11 @@ When using Bazel for release builds, the same issues arise as for other scripts that perform a build. For more details, see -[Call Bazel from scripts](/versions/7.7.1/run/scripts). In particular, the following options +[Call Bazel from scripts](/versions/7.7.3/run/scripts). In particular, the following options are strongly recommended: -* [`--bazelrc=/dev/null`](/versions/7.7.1/run/bazelrc) -* [`--nokeep_state_after_build`](/versions/7.7.1/reference/command-line-reference#flag--keep_state_after_build) +* [`--bazelrc=/dev/null`](/versions/7.7.3/run/bazelrc) +* [`--nokeep_state_after_build`](/versions/7.7.3/reference/command-line-reference#flag--keep_state_after_build) These options are also important: @@ -1635,7 +1635,7 @@ order). In either form, zero or a negative value for any of the test sizes will be substituted by the default timeout for the given timeout categories as -defined by the page [Writing Tests](/versions/7.7.1/reference/test-encyclopedia). +defined by the page [Writing Tests](/versions/7.7.3/reference/test-encyclopedia). By default, Bazel will use these timeouts for all tests by inferring the timeout limit from the test's size whether the size is implicitly or explicitly set. @@ -1705,7 +1705,7 @@ #### Other options for `bazel test` {#bazel-test-other-options} The syntax and the remaining options are exactly like -[`bazel build`](/versions/7.7.1/run/build). +[`bazel build`](/versions/7.7.3/run/build). ## Running executables {#running-executables} @@ -1784,7 +1784,7 @@ `bazel run` can also execute test binaries, which has the effect of running the test in a close approximation of the environment described at -[Writing Tests](/versions/7.7.1/reference/test-encyclopedia). Note that none of the +[Writing Tests](/versions/7.7.3/reference/test-encyclopedia). Note that none of the `--test_*` arguments have an effect when running a test in this manner except `--test_arg` . @@ -1838,14 +1838,14 @@ Bazel includes a query language for asking questions about the dependency graph used during the build. The query language is used by two commands: query and cquery. The major difference between the -two commands is that query runs after the [loading phase](/versions/7.7.1/run/build#loading) -and cquery runs after the [analysis phase](/versions/7.7.1/run/build#analysis). These tools are an +two commands is that query runs after the [loading phase](/versions/7.7.3/run/build#loading) +and cquery runs after the [analysis phase](/versions/7.7.3/run/build#analysis). These tools are an invaluable aid to many software engineering tasks. The query language is based on the idea of algebraic operations over graphs; it is documented in detail in -[Bazel Query Reference](/versions/7.7.1/query/language). +[Bazel Query Reference](/versions/7.7.3/query/language). Please refer to that document for reference, for examples, and for query-specific command-line options. @@ -1890,7 +1890,7 @@ `query` but `siblings`, `buildfiles` and `tests`. -For more details, see [Action Graph Query](/versions/7.7.1/query/aquery). +For more details, see [Action Graph Query](/versions/7.7.3/query/aquery). ## Miscellaneous commands and options {#misc-commands-options} @@ -1898,7 +1898,7 @@ The `help` command provides on-line help. By default, it shows a summary of available commands and help topics, as shown in -[Building with Bazel](/versions/7.7.1/run/build#quickstart). +[Building with Bazel](/versions/7.7.3/run/build#quickstart). Specifying an argument displays detailed help for a particular topic. Most topics are Bazel commands, such as `build` or `query`, but there are some additional help topics @@ -1917,7 +1917,7 @@ command. This command causes the Bazel server to exit as soon as it becomes idle (for example, after the completion of any builds or other commands that are currently in progress). For more details, see -[Client/server implementation](/versions/7.7.1/run/client-server). +[Client/server implementation](/versions/7.7.3/run/client-server). Bazel servers stop themselves after an idle timeout, so this command is rarely necessary; however, it can be useful in scripts when it is @@ -2023,7 +2023,7 @@ the value reported by `bazel info`, instead of assuming the existence of the symlink, will be more robust. * The complete - ["Make" environment](/versions/7.7.1/reference/be/make-variables). If the `--show_make_env` flag is + ["Make" environment](/versions/7.7.3/reference/be/make-variables). If the `--show_make_env` flag is specified, all variables in the current configuration's "Make" environment are also displayed (such as `CC`, `GLIBC_VERSION`, etc). These are the variables accessed using the `$(CC)` @@ -2074,7 +2074,7 @@ The `mobile-install` command installs apps to mobile devices. Currently only Android devices running ART are supported. -See [bazel mobile-install](/versions/7.7.1/docs/mobile-install) for more information. +See [bazel mobile-install](/versions/7.7.3/docs/mobile-install) for more information. Note: This command does not install the same thing that `bazel build` produces: Bazel tweaks the app so that it can be @@ -2214,12 +2214,12 @@ ### `analyze-profile` {#analyze-profile} The `analyze-profile` command analyzes a -[JSON trace profile](/versions/7.7.1/advanced/performance/json-trace-profile) previously +[JSON trace profile](/versions/7.7.3/advanced/performance/json-trace-profile) previously gathered during a Bazel invocation. ### `canonicalize-flags` {#canonicalize-flags} -The [`canonicalize-flags`](/versions/7.7.1/reference/command-line-reference#canonicalize-flags-options) +The [`canonicalize-flags`](/versions/7.7.3/reference/command-line-reference#canonicalize-flags-options) command, which takes a list of options for a Bazel command and returns a list of options that has the same effect. The new list of options is canonical. For example, two lists of options with the same effect are canonicalized to the same new list. @@ -2373,7 +2373,7 @@ #### `--batch` {#batch} Batch mode causes Bazel to not use the -[standard client/server mode](/versions/7.7.1/run/client-server), but instead runs a bazel +[standard client/server mode](/versions/7.7.3/run/client-server), but instead runs a bazel java process for a single command, which has been used for more predictable semantics with respect to signal handling, job control, and environment variable inheritance, and is necessary for running bazel in a chroot jail. @@ -2479,7 +2479,7 @@ #### `--config=name` {#config} Selects additional config section from -[the rc files](/versions/7.7.1/run/bazelrc#bazelrc-file-locations); for the current `command`, +[the rc files](/versions/7.7.3/run/bazelrc#bazelrc-file-locations); for the current `command`, it also pulls in the options from `command:name` if such a section exists. Can be specified multiple times to add flags from several config sections. Expansions can refer to other definitions (for example, expansions can be chained).
diff --git a/docs/versions/7.7.1/extending/aspects.mdx b/docs/versions/7.7.3/extending/aspects.mdx similarity index 92% rename from docs/versions/7.7.1/extending/aspects.mdx rename to docs/versions/7.7.3/extending/aspects.mdx index dcad327..4a4a720 100644 --- a/docs/versions/7.7.1/extending/aspects.mdx +++ b/docs/versions/7.7.3/extending/aspects.mdx
@@ -3,7 +3,7 @@ --- This page explains the basics and benefits of using -[aspects](/versions/7.7.1/rules/lib/globals/bzl#aspect) and provides simple and advanced +[aspects](/versions/7.7.3/rules/lib/globals/bzl#aspect) and provides simple and advanced examples. Aspects allow augmenting build dependency graphs with additional information @@ -40,16 +40,16 @@ This `BUILD` file defines a dependency graph shown in the following figure: - + **Figure 1.** `BUILD` file dependency graph. Bazel analyzes this dependency graph by calling an implementation function of -the corresponding [rule](/versions/7.7.1/extending/rules) (in this case "java_library") for every +the corresponding [rule](/versions/7.7.3/extending/rules) (in this case "java_library") for every target in the above example. Rule implementation functions generate actions that build artifacts, such as `.jar` files, and pass information, such as locations and names of those artifacts, to the reverse dependencies of those targets in -[providers](/versions/7.7.1/extending/rules#providers). +[providers](/versions/7.7.3/extending/rules#providers). Aspects are similar to rules in that they have an implementation function that generates actions and returns providers. However, their power comes from @@ -63,7 +63,7 @@ Thus a single act of applying aspect A to a target X yields a "shadow graph" of the original dependency graph of targets shown in the following figure: - + **Figure 2.** Build graph with aspects. @@ -108,7 +108,7 @@ ) ``` Aspect definitions are similar to rule definitions, and defined using -the [`aspect`](/versions/7.7.1/rules/lib/globals/bzl#aspect) function. +the [`aspect`](/versions/7.7.3/rules/lib/globals/bzl#aspect) function. Just like a rule, an aspect has an implementation function which in this case is ``_print_aspect_impl``. @@ -135,15 +135,15 @@ ``` Aspect implementation functions are similar to the rule implementation -functions. They return [providers](/versions/7.7.1/extending/rules#providers), can generate -[actions](/versions/7.7.1/extending/rules#actions), and take two arguments: +functions. They return [providers](/versions/7.7.3/extending/rules#providers), can generate +[actions](/versions/7.7.3/extending/rules#actions), and take two arguments: -* `target`: the [target](/versions/7.7.1/rules/lib/builtins/Target) the aspect is being applied to. -* `ctx`: [`ctx`](/versions/7.7.1/rules/lib/builtins/ctx) object that can be used to access attributes +* `target`: the [target](/versions/7.7.3/rules/lib/builtins/Target) the aspect is being applied to. +* `ctx`: [`ctx`](/versions/7.7.3/rules/lib/builtins/ctx) object that can be used to access attributes and generate outputs and actions. The implementation function can access the attributes of the target rule via -[`ctx.rule.attr`](/versions/7.7.1/rules/lib/builtins/ctx#rule). It can examine providers that are +[`ctx.rule.attr`](/versions/7.7.3/rules/lib/builtins/ctx#rule). It can examine providers that are provided by the target to which it is applied (via the `target` argument). Aspects are required to return a list of providers. In this example, the aspect @@ -152,7 +152,7 @@ ### Invoking the aspect using the command line The simplest way to apply an aspect is from the command line using the -[`--aspects`](/versions/7.7.1/reference/command-line-reference#flag--aspects) +[`--aspects`](/versions/7.7.3/reference/command-line-reference#flag--aspects) argument. Assuming the aspect above were defined in a file named `print.bzl` this: @@ -276,7 +276,7 @@ (see the definition of ``file_count_rule``). For command-line aspects, the parameters values can be passed using -[``--aspects_parameters``](/versions/7.7.1/reference/command-line-reference#flag--aspects_parameters) +[``--aspects_parameters``](/versions/7.7.3/reference/command-line-reference#flag--aspects_parameters) flag. The ``values`` restriction of ``int`` and ``string`` parameters may be omitted. @@ -335,12 +335,12 @@ are created and frozen before aspects are applied and cannot be modified from an aspect. It is an error if a target and an aspect that is applied to it each provide a provider with the same type, with the exceptions of -[`OutputGroupInfo`](/versions/7.7.1/rules/lib/providers/OutputGroupInfo) +[`OutputGroupInfo`](/versions/7.7.3/rules/lib/providers/OutputGroupInfo) (which is merged, so long as the rule and aspect specify different output groups) and -[`InstrumentedFilesInfo`](/versions/7.7.1/rules/lib/providers/InstrumentedFilesInfo) +[`InstrumentedFilesInfo`](/versions/7.7.3/rules/lib/providers/InstrumentedFilesInfo) (which is taken from the aspect). This means that aspect implementations may -never return [`DefaultInfo`](/versions/7.7.1/rules/lib/providers/DefaultInfo). +never return [`DefaultInfo`](/versions/7.7.3/rules/lib/providers/DefaultInfo). The parameters and private attributes are passed in the attributes of the ``ctx``. This example references the ``extension`` parameter and determines @@ -407,4 +407,4 @@ ## References -* [`aspect` API reference](/versions/7.7.1/rules/lib/globals/bzl#aspect) +* [`aspect` API reference](/versions/7.7.3/rules/lib/globals/bzl#aspect)
diff --git a/docs/versions/7.7.1/extending/concepts.mdx b/docs/versions/7.7.3/extending/concepts.mdx similarity index 76% rename from docs/versions/7.7.1/extending/concepts.mdx rename to docs/versions/7.7.3/extending/concepts.mdx index fd94b4a..96b49ab 100644 --- a/docs/versions/7.7.1/extending/concepts.mdx +++ b/docs/versions/7.7.3/extending/concepts.mdx
@@ -7,26 +7,26 @@ and rules. Bazel extensions are files ending in `.bzl`. Use a -[load statement](/versions/7.7.1/concepts/build-files#load) to import a symbol from an extension. +[load statement](/versions/7.7.3/concepts/build-files#load) to import a symbol from an extension. Before learning the more advanced concepts, first: -* Read about the [Starlark language](/versions/7.7.1/rules/language), used in both the +* Read about the [Starlark language](/versions/7.7.3/rules/language), used in both the `BUILD` and `.bzl` files. -* Learn how you can [share variables](/versions/7.7.1/build/share-variables) +* Learn how you can [share variables](/versions/7.7.3/build/share-variables) between two `BUILD` files. ## Macros and rules {#macros-and-rules} -A [macro](/versions/7.7.1/extending/macros) is a function that instantiates rules. It is useful when a +A [macro](/versions/7.7.3/extending/macros) is a function that instantiates rules. It is useful when a `BUILD` file is getting too repetitive or too complex, as it allows you to reuse some code. The function is evaluated as soon as the `BUILD` file is read. After the evaluation of the `BUILD` file, Bazel has little information about macros: if your macro generates a `genrule`, Bazel will behave as if you wrote the `genrule`. As a result, `bazel query` will only list the generated `genrule`. -A [rule](/versions/7.7.1/extending/rules) is more powerful than a macro. It can access Bazel +A [rule](/versions/7.7.3/extending/rules) is more powerful than a macro. It can access Bazel internals and have full control over what is going on. It may for example pass information to other rules. @@ -69,34 +69,34 @@ ## Creating extensions -* [Create your first macro](/versions/7.7.1/rules/macro-tutorial) in order to - reuse some code. Then [learn more about macros](/versions/7.7.1/extending/macros) and - [using them to create "custom verbs"](/versions/7.7.1/rules/verbs-tutorial). +* [Create your first macro](/versions/7.7.3/rules/macro-tutorial) in order to + reuse some code. Then [learn more about macros](/versions/7.7.3/extending/macros) and + [using them to create "custom verbs"](/versions/7.7.3/rules/verbs-tutorial). -* [Follow the rules tutorial](/versions/7.7.1/rules/rules-tutorial) to get started with rules. - Next, you can read more about the [rules concepts](/versions/7.7.1/extending/rules). +* [Follow the rules tutorial](/versions/7.7.3/rules/rules-tutorial) to get started with rules. + Next, you can read more about the [rules concepts](/versions/7.7.3/extending/rules). The two links below will be very useful when writing your own extensions. Keep them within reach: -* The [API reference](/versions/7.7.1/rules/lib) +* The [API reference](/versions/7.7.3/rules/lib) * [Examples](https://github.com/bazelbuild/examples/tree/master/rules) ## Going further -In addition to [macros](/versions/7.7.1/extending/macros) and [rules](/versions/7.7.1/extending/rules), you may want to write -[aspects](/versions/7.7.1/extending/aspects) and [repository rules](/versions/7.7.1/extending/repo). +In addition to [macros](/versions/7.7.3/extending/macros) and [rules](/versions/7.7.3/extending/rules), you may want to write +[aspects](/versions/7.7.3/extending/aspects) and [repository rules](/versions/7.7.3/extending/repo). * Use [Buildifier](https://github.com/bazelbuild/buildtools) consistently to format and lint your code. -* Follow the [`.bzl` style guide](/versions/7.7.1/rules/bzl-style). +* Follow the [`.bzl` style guide](/versions/7.7.3/rules/bzl-style). -* [Test](/versions/7.7.1/rules/testing) your code. +* [Test](/versions/7.7.3/rules/testing) your code. * [Generate documentation](https://skydoc.bazel.build/) to help your users. -* [Optimize the performance](/versions/7.7.1/rules/performance) of your code. +* [Optimize the performance](/versions/7.7.3/rules/performance) of your code. -* [Deploy](/versions/7.7.1/rules/deploying) your extensions to other people. +* [Deploy](/versions/7.7.3/rules/deploying) your extensions to other people.
diff --git a/docs/versions/7.7.1/extending/config.mdx b/docs/versions/7.7.3/extending/config.mdx similarity index 96% rename from docs/versions/7.7.1/extending/config.mdx rename to docs/versions/7.7.3/extending/config.mdx index b84ba79..d7131a8 100644 --- a/docs/versions/7.7.1/extending/config.mdx +++ b/docs/versions/7.7.3/extending/config.mdx
@@ -11,9 +11,9 @@ This makes it possible to: * define custom flags for your project, obsoleting the need for - [`--define`](/versions/7.7.1/docs/configurable-attributes#custom-keys) + [`--define`](/versions/7.7.3/docs/configurable-attributes#custom-keys) * write - [transitions](/versions/7.7.1/rules/lib/builtins/transition#transition) to configure deps in + [transitions](/versions/7.7.3/rules/lib/builtins/transition#transition) to configure deps in different configurations than their parents (such as `--compilation_mode=opt` or `--cpu=arm`) * bake better defaults into rules (such as automatically build `//my:android_app` @@ -26,7 +26,7 @@ ## User-defined build settings {#user-defined-build-settings} A build setting is a single piece of -[configuration](/versions/7.7.1/extending/rules#configurations) +[configuration](/versions/7.7.3/extending/rules#configurations) information. Think of a configuration as a key/value map. Setting `--cpu=ppc` and `--copt="-DFoo"` produces a configuration that looks like `{cpu: ppc, copt: "-DFoo"}`. Each entry is a build setting. @@ -49,7 +49,7 @@ Build settings are rules like any other rule and are differentiated using the Starlark `rule()` function's `build_setting` -[attribute](/versions/7.7.1/rules/lib/globals/bzl#rule.build_setting). +[attribute](/versions/7.7.3/rules/lib/globals/bzl#rule.build_setting). ```python # example/buildsettings/build_settings.bzl @@ -62,13 +62,13 @@ The `build_setting` attribute takes a function that designates the type of the build setting. The type is limited to a set of basic Starlark types like `bool` and `string`. See the `config` module -[documentation](/versions/7.7.1/rules/lib/toplevel/config) for details. More complicated typing can be +[documentation](/versions/7.7.3/rules/lib/toplevel/config) for details. More complicated typing can be done in the rule's implementation function. More on this below. The `config` module's functions takes an optional boolean parameter, `flag`, which is set to false by default. if `flag` is set to true, the build setting can be set on the command line by users as well as internally by rule writers -via default values and [transitions](/versions/7.7.1/rules/lib/builtins/transition#transition). +via default values and [transitions](/versions/7.7.3/rules/lib/builtins/transition#transition). Not all settings should be settable by users. For example, if you as a rule writer have some debug mode that you'd like to turn on inside test rules, you don't want to give users the ability to indiscriminately turn on that @@ -76,10 +76,10 @@ #### Using ctx.build_setting_value {#ctx-build-setting-value} -Like all rules, build setting rules have [implementation functions](/versions/7.7.1/extending/rules#implementation-function). +Like all rules, build setting rules have [implementation functions](/versions/7.7.3/extending/rules#implementation-function). The basic Starlark-type value of the build settings can be accessed via the `ctx.build_setting_value` method. This method is only available to -[`ctx`](/versions/7.7.1/rules/lib/builtins/ctx) objects of build setting rules. These implementation +[`ctx`](/versions/7.7.3/rules/lib/builtins/ctx) objects of build setting rules. These implementation methods can directly forward the build settings value or do additional work on it, like type checking or more complex struct creation. Here's how you would implement an `enum`-typed build setting: @@ -327,7 +327,7 @@ Label-typed settings will eventually replace the functionality of late-bound defaults. Late-bound default attributes are Label-typed attributes whose final values can be affected by configuration. In Starlark, this will replace -the [`configuration_field`](/versions/7.7.1/rules/lib/globals/bzl#configuration_field) +the [`configuration_field`](/versions/7.7.3/rules/lib/globals/bzl#configuration_field) API. ```python @@ -371,7 +371,7 @@ [End to end example](https://github.com/bazelbuild/examples/tree/HEAD/configurations/select_on_build_setting) Users can configure attributes on build settings by using - [`select()`](/versions/7.7.1/reference/be/functions#select). Build setting targets can be passed to the `flag_values` attribute of + [`select()`](/versions/7.7.3/reference/be/functions#select). Build setting targets can be passed to the `flag_values` attribute of `config_setting`. The value to match to the configuration is passed as a `String` then parsed to the type of the build setting for matching. @@ -387,7 +387,7 @@ ## User-defined transitions {#user-defined-transitions} A configuration -[transition](/versions/7.7.1/rules/lib/builtins/transition#transition) +[transition](/versions/7.7.3/rules/lib/builtins/transition#transition) maps the transformation from one configured target to another within the build graph. @@ -422,7 +422,7 @@ In Starlark, transitions are defined much like rules, with a defining `transition()` -[function](/versions/7.7.1/rules/lib/builtins/transition#transition) +[function](/versions/7.7.3/rules/lib/builtins/transition#transition) and an implementation function. ```python @@ -592,7 +592,7 @@ Crucially, `--config` may include flags that don't affect build configuration, such as -[`--spawn_strategy`](/versions/7.7.1/docs/user-manual#spawn-strategy) +[`--spawn_strategy`](/versions/7.7.3/docs/user-manual#spawn-strategy) . Bazel, by design, can't bind such flags to individual targets. This means there's no coherent way to apply them in transitions. @@ -736,7 +736,7 @@ Many native flags today, like `--cpu` and `--crosstool_top` are related to toolchain resolution. In the future, explicit transitions on these types of flags will likely be replaced by transitioning on the -[target platform](/versions/7.7.1/extending/platforms). +[target platform](/versions/7.7.3/extending/platforms). ## Memory and performance considerations {#memory-performance-considerations} @@ -748,7 +748,7 @@ ### Badly behaved builds: a case study {#badly-behaved-builds} - + **Figure 1.** Scalability graph showing a top level target and its dependencies. @@ -772,7 +772,7 @@ In other words, `//pkg:i_b` appends `b` to the old value of `--owner` for all its deps. -This produces the following [configured targets](/versions/7.7.1/reference/glossary#configured-target): +This produces the following [configured targets](/versions/7.7.3/reference/glossary#configured-target): ``` //pkg:app //foo:owner="" @@ -802,5 +802,5 @@ For more details on modifying build configurations, see: * [Starlark Build Configuration](https://docs.google.com/document/d/1vc8v-kXjvgZOdQdnxPTaV0rrLxtP2XwnD2tAZlYJOqw/edit?usp=sharing) - * [Bazel Configurability Roadmap](https://bazel.build/versions/7.7.1/community/roadmaps-configurability) + * [Bazel Configurability Roadmap](https://bazel.build/versions/7.7.3/community/roadmaps-configurability) * Full [set](https://github.com/bazelbuild/examples/tree/HEAD/configurations) of end to end examples
diff --git a/docs/versions/7.7.1/extending/depsets.mdx b/docs/versions/7.7.3/extending/depsets.mdx similarity index 97% rename from docs/versions/7.7.1/extending/depsets.mdx rename to docs/versions/7.7.3/extending/depsets.mdx index c9f14ca..7f85587 100644 --- a/docs/versions/7.7.1/extending/depsets.mdx +++ b/docs/versions/7.7.3/extending/depsets.mdx
@@ -2,7 +2,7 @@ title: 'Depsets' --- -[Depsets](/versions/7.7.1/rules/lib/builtins/depset) are a specialized data structure for efficiently +[Depsets](/versions/7.7.3/rules/lib/builtins/depset) are a specialized data structure for efficiently collecting data across a target’s transitive dependencies. They are an essential element of rule processing. @@ -32,7 +32,7 @@ Each node in the DAG holds a list of direct elements and a list of child nodes. The contents of the depset are the transitive elements, such as the direct elements of all the nodes. A new depset can be created using the -[depset](/versions/7.7.1/rules/lib/globals/bzl#depset) constructor: it accepts a list of direct +[depset](/versions/7.7.3/rules/lib/globals/bzl#depset) constructor: it accepts a list of direct elements and another list of child nodes. ```python @@ -44,7 +44,7 @@ ``` To retrieve the contents of a depset, use the -[to_list()](/versions/7.7.1/rules/lib/builtins/depset#to_list) method. It returns a list of all transitive +[to_list()](/versions/7.7.3/rules/lib/builtins/depset#to_list) method. It returns a list of all transitive elements, not including duplicates. There is no way to directly inspect the precise structure of the DAG, although this structure does affect the order in which the elements are returned. @@ -334,9 +334,9 @@ when many non-terminal targets try to call `to_list()` that quadratic behavior occurs. -For more information about using depsets efficiently, see the [performance](/versions/7.7.1/rules/performance) page. +For more information about using depsets efficiently, see the [performance](/versions/7.7.3/rules/performance) page. ## API Reference -Please see [here](/versions/7.7.1/rules/lib/builtins/depset) for more details. +Please see [here](/versions/7.7.3/rules/lib/builtins/depset) for more details.
diff --git a/docs/versions/7.7.1/extending/exec-groups.mdx b/docs/versions/7.7.3/extending/exec-groups.mdx similarity index 90% rename from docs/versions/7.7.1/extending/exec-groups.mdx rename to docs/versions/7.7.3/extending/exec-groups.mdx index a2d07e8..a5a97c3 100644 --- a/docs/versions/7.7.1/extending/exec-groups.mdx +++ b/docs/versions/7.7.3/extending/exec-groups.mdx
@@ -3,8 +3,8 @@ --- Execution groups allow for multiple execution platforms within a single target. -Each execution group has its own [toolchain](/versions/7.7.1/extending/toolchains) dependencies and -performs its own [toolchain resolution](/versions/7.7.1/extending/toolchains#toolchain-resolution). +Each execution group has its own [toolchain](/versions/7.7.3/extending/toolchains) dependencies and +performs its own [toolchain resolution](/versions/7.7.3/extending/toolchains#toolchain-resolution). ## Background {#background} @@ -22,7 +22,7 @@ ## Defining execution groups {#defining-exec-groups} During rule definition, rule authors can -[declare](/versions/7.7.1/rules/lib/globals/bzl#exec_group) +[declare](/versions/7.7.3/rules/lib/globals/bzl#exec_group) a set of execution groups. On each execution group, the rule author can specify everything needed to select an execution platform for that execution group, namely any constraints via `exec_compatible_with` and toolchain types via @@ -49,9 +49,9 @@ In the code snippet above, you can see that tool dependencies can also specify transition for an exec group using the -[`cfg`](/versions/7.7.1/rules/lib/toplevel/attr#label) +[`cfg`](/versions/7.7.3/rules/lib/toplevel/attr#label) attribute param and the -[`config`](/versions/7.7.1/rules/lib/toplevel/config) +[`config`](/versions/7.7.3/rules/lib/toplevel/config) module. The module exposes an `exec` function which takes a single string parameter which is the name of the exec group for which the dependency should be built. @@ -63,8 +63,8 @@ In the rule implementation, you can declare that actions should be run on the execution platform of an execution group. You can do this by using the `exec_group` -param of action generating methods, specifically [`ctx.actions.run`](/versions/7.7.1/rules/lib/builtins/actions#run) and -[`ctx.actions.run_shell`](/versions/7.7.1/rules/lib/builtins/actions#run_shell). +param of action generating methods, specifically [`ctx.actions.run`](/versions/7.7.3/rules/lib/builtins/actions#run) and +[`ctx.actions.run_shell`](/versions/7.7.3/rules/lib/builtins/actions#run_shell). ```python # foo.bzl @@ -76,7 +76,7 @@ ) ``` -Rule authors will also be able to access the [resolved toolchains](/versions/7.7.1/extending/toolchains#toolchain-resolution) +Rule authors will also be able to access the [resolved toolchains](/versions/7.7.3/extending/toolchains#toolchain-resolution) of execution groups, similarly to how you can access the resolved toolchain of a target: @@ -99,7 +99,7 @@ ## Using execution groups to set execution properties {#using-exec-groups-for-exec-properties} Execution groups are integrated with the -[`exec_properties`](/versions/7.7.1/reference/be/common-definitions#common-attributes) +[`exec_properties`](/versions/7.7.3/reference/be/common-definitions#common-attributes) attribute that exists on every rule and allows the target writer to specify a string dict of properties that is then passed to the execution machinery. For example, if you wanted to set some property, say memory, for the target and give
diff --git a/docs/versions/7.7.1/extending/macros.mdx b/docs/versions/7.7.3/extending/macros.mdx similarity index 93% rename from docs/versions/7.7.1/extending/macros.mdx rename to docs/versions/7.7.3/extending/macros.mdx index 79be8d6..71ecec5 100644 --- a/docs/versions/7.7.1/extending/macros.mdx +++ b/docs/versions/7.7.3/extending/macros.mdx
@@ -8,7 +8,7 @@ A macro is a function called from the `BUILD` file that can instantiate rules. Macros are mainly used for encapsulation and code reuse of existing rules and other macros. By the end of the -[loading phase](/versions/7.7.1/extending/concepts#evaluation-model), macros don't exist anymore, +[loading phase](/versions/7.7.3/extending/concepts#evaluation-model), macros don't exist anymore, and Bazel sees only the concrete set of instantiated rules. ## Usage {#usage} @@ -27,7 +27,7 @@ ) ``` -Note: `$@` is a [Make variable](/versions/7.7.1/reference/be/make-variables#predefined_genrule_variables) +Note: `$@` is a [Make variable](/versions/7.7.3/reference/be/make-variables#predefined_genrule_variables) that refers to the execution-time locations of the files in the `outs` attribute list. It is equivalent to `$(locations :file.txt)`. @@ -122,7 +122,7 @@ ## Instantiating native rules Native rules (rules that don't need a `load()` statement) can be -instantiated from the [native](/versions/7.7.1/rules/lib/toplevel/native) module: +instantiated from the [native](/versions/7.7.3/rules/lib/toplevel/native) module: ```python def my_macro(name, visibility=None): @@ -134,12 +134,12 @@ ``` If you need to know the package name (for example, which `BUILD` file is calling the -macro), use the function [native.package_name()](/versions/7.7.1/rules/lib/toplevel/native#package_name). +macro), use the function [native.package_name()](/versions/7.7.3/rules/lib/toplevel/native#package_name). Note that `native` can only be used in `.bzl` files, and not in `BUILD` files. ## Label resolution in macros -Since macros are evaluated in the [loading phase](/versions/7.7.1/extending/concepts#evaluation-model), +Since macros are evaluated in the [loading phase](/versions/7.7.3/extending/concepts#evaluation-model), label strings such as `"//foo:bar"` that occur in a macro are interpreted relative to the `BUILD` file in which the macro is used rather than relative to the `.bzl` file in which it is defined. This behavior is generally undesirable @@ -147,7 +147,7 @@ are part of a published Starlark ruleset. To get the same behavior as for Starlark rules, wrap the label strings with the -[`Label`](/versions/7.7.1/rules/lib/builtins/Label#Label) constructor: +[`Label`](/versions/7.7.3/rules/lib/builtins/Label#Label) constructor: ```python # @my_ruleset//rules:defs.bzl @@ -187,7 +187,7 @@ the rule `foo` is created (due to a name conflict), which will show you the full stack trace. -* You can also use [print](/versions/7.7.1/rules/lib/globals/all#print) for debugging. It displays +* You can also use [print](/versions/7.7.3/rules/lib/globals/all#print) for debugging. It displays the message as a `DEBUG` log line during the loading phase. Except in rare cases, either remove `print` calls, or make them conditional under a `debugging` parameter that defaults to `False` before submitting the code to @@ -195,7 +195,7 @@ ## Errors -If you want to throw an error, use the [fail](/versions/7.7.1/rules/lib/globals/all#fail) function. +If you want to throw an error, use the [fail](/versions/7.7.3/rules/lib/globals/all#fail) function. Explain clearly to the user what went wrong and how to fix their `BUILD` file. It is not possible to catch an error.
diff --git a/docs/versions/7.7.1/extending/platforms.mdx b/docs/versions/7.7.3/extending/platforms.mdx similarity index 92% rename from docs/versions/7.7.1/extending/platforms.mdx rename to docs/versions/7.7.3/extending/platforms.mdx index a16a241..78334cb 100644 --- a/docs/versions/7.7.1/extending/platforms.mdx +++ b/docs/versions/7.7.3/extending/platforms.mdx
@@ -13,10 +13,10 @@ Modeling the environment as a platform helps Bazel to automatically select the appropriate -[toolchains](/versions/7.7.1/extending/toolchains) +[toolchains](/versions/7.7.3/extending/toolchains) for build actions. Platforms can also be used in combination with the -[config_setting](/versions/7.7.1/reference/be/general#config_setting) -rule to write [configurable attributes](/versions/7.7.1/docs/configurable-attributes). +[config_setting](/versions/7.7.3/reference/be/general#config_setting) +rule to write [configurable attributes](/versions/7.7.3/docs/configurable-attributes). Bazel recognizes three roles that a platform may serve: @@ -39,7 +39,7 @@ different. Tip: for detailed instructions on migrating your project to platforms, see -[Migrating to Platforms](/versions/7.7.1/concepts/platforms). +[Migrating to Platforms](/versions/7.7.3/concepts/platforms). ## Defining constraints and platforms @@ -74,7 +74,7 @@ controls. If visibility allows, you can extend an existing constraint setting by defining your own value for it. -The [`platform`](/versions/7.7.1/reference/be/platforms-and-toolchains#platform) rule introduces a new platform with +The [`platform`](/versions/7.7.3/reference/be/platforms-and-toolchains#platform) rule introduces a new platform with certain choices of constraint values. The following creates a platform named `linux_x86`, and says that it describes any environment that runs a Linux operating system on an x86_64 architecture with a @@ -130,7 +130,7 @@ targets that will never work on that platform. For example, your Windows device driver is likely going to generate lots of compiler errors when building on a Linux machine with `//...`. Use the -[`target_compatible_with`](/versions/7.7.1/reference/be/common-definitions#common.target_compatible_with) +[`target_compatible_with`](/versions/7.7.3/reference/be/common-definitions#common.target_compatible_with) attribute to tell Bazel what target platform constraints your code has. The simplest use of this attribute restricts a target to a single platform. @@ -168,9 +168,9 @@ $ bazel build --platforms=//:myplatform //:all ``` -Incompatible tests in a [`test_suite`](/versions/7.7.1/reference/be/general#test_suite) are +Incompatible tests in a [`test_suite`](/versions/7.7.3/reference/be/general#test_suite) are similarly skipped if the `test_suite` is specified on the command line with -[`--expand_test_suites`](/versions/7.7.1/reference/command-line-reference#flag--expand_test_suites). +[`--expand_test_suites`](/versions/7.7.3/reference/command-line-reference#flag--expand_test_suites). In other words, `test_suite` targets on the command line behave like `:all` and `...`. Using `--noexpand_test_suites` prevents expansion and causes `test_suite` targets with incompatible tests to also be incompatible. @@ -193,10 +193,10 @@ For more flexibility in expressing constraints, use the `@platforms//:incompatible` -[`constraint_value`](/versions/7.7.1/reference/be/platforms-and-toolchains#constraint_value) +[`constraint_value`](/versions/7.7.3/reference/be/platforms-and-toolchains#constraint_value) that no platform satisfies. -Use [`select()`](/versions/7.7.1/reference/be/functions#select) in combination with +Use [`select()`](/versions/7.7.3/reference/be/functions#select) in combination with `@platforms//:incompatible` to express more complicated restrictions. For example, use it to implement basic OR logic. The following marks a library compatible with macOS and Linux, but no other platforms. @@ -244,8 +244,8 @@ ### Detecting incompatible targets using `bazel cquery` {#cquery-incompatible-target-detection} You can use the -[`IncompatiblePlatformProvider`](/versions/7.7.1/rules/lib/providers/IncompatiblePlatformProvider) -in `bazel cquery`'s [Starlark output format](/versions/7.7.1/query/cquery#output-format-definition) to distinguish +[`IncompatiblePlatformProvider`](/versions/7.7.3/rules/lib/providers/IncompatiblePlatformProvider) +in `bazel cquery`'s [Starlark output format](/versions/7.7.3/query/cquery#output-format-definition) to distinguish incompatible targets from compatible ones. This can be used to filter out incompatible targets. The example below will
diff --git a/docs/versions/7.7.1/extending/repo.mdx b/docs/versions/7.7.3/extending/repo.mdx similarity index 91% rename from docs/versions/7.7.1/extending/repo.mdx rename to docs/versions/7.7.3/extending/repo.mdx index 6296d90..7a458e3 100644 --- a/docs/versions/7.7.1/extending/repo.mdx +++ b/docs/versions/7.7.3/extending/repo.mdx
@@ -5,7 +5,7 @@ This page covers how to define repository rules and provides examples for more details. -An [external repository](/versions/7.7.1/external/overview#repository) is a directory tree, +An [external repository](/versions/7.7.3/external/overview#repository) is a directory tree, containing source files usable in a Bazel build, which is generated on demand by running its corresponding **repo rule**. Repos can be defined in a multitude of ways, but ultimately, each repo is defined by invoking a repo rule, just as @@ -16,10 +16,10 @@ ## Repository rule definition In a `.bzl` file, use the -[repository_rule](/versions/7.7.1/rules/lib/globals/bzl#repository_rule) function to define a +[repository_rule](/versions/7.7.3/rules/lib/globals/bzl#repository_rule) function to define a new repo rule and store it in a global variable. After a repo rule is defined, it can be invoked as a function to define repos. This invocation is usually -performed from inside a [module extension](/versions/7.7.1/external/extension) implementation +performed from inside a [module extension](/versions/7.7.3/external/extension) implementation function. The two major components of a repo rule definition are its attribute schema and @@ -74,7 +74,7 @@ The input parameter `repository_ctx` can be used to access attribute values, and non-hermetic functions (finding a binary, executing a binary, creating a file in -the repository or downloading a file from the Internet). See [the API docs](/versions/7.7.1/rules/lib/builtins/repository_ctx) for more context. Example: +the repository or downloading a file from the Internet). See [the API docs](/versions/7.7.3/rules/lib/builtins/repository_ctx) for more context. Example: ```python def _impl(repository_ctx): @@ -104,17 +104,17 @@ * The Starlark code comprising the implementation of the repo rule. * The value of any environment variable passed to `repository_ctx`'s `getenv()` method or declared with the `environ` attribute of the - [`repository_rule`](/versions/7.7.1/rules/lib/globals/bzl#repository_rule). The values of + [`repository_rule`](/versions/7.7.3/rules/lib/globals/bzl#repository_rule). The values of these environment variables can be hard-wired on the command line with the - [`--repo_env`](/versions/7.7.1/reference/command-line-reference#flag--repo_env) flag. + [`--repo_env`](/versions/7.7.3/reference/command-line-reference#flag--repo_env) flag. * The existence, contents, and type of any paths being - [`watch`ed](/versions/7.7.1/rules/lib/builtins/repository_ctx#watch) in the implementation + [`watch`ed](/versions/7.7.3/rules/lib/builtins/repository_ctx#watch) in the implementation function of the repo rule. * Certain other methods of `repository_ctx` with a `watch` parameter, such as `read()`, `execute()`, and `extract()`, can also cause paths to be watched. - * Similarly, [`repository_ctx.watch_tree`](/versions/7.7.1/rules/lib/builtins/repository_ctx#watch_tree) - and [`path.readdir`](/versions/7.7.1/rules/lib/builtins/path#readdir) can cause paths + * Similarly, [`repository_ctx.watch_tree`](/versions/7.7.3/rules/lib/builtins/repository_ctx#watch_tree) + and [`path.readdir`](/versions/7.7.3/rules/lib/builtins/path#readdir) can cause paths to be watched in other ways. * When `bazel fetch --force` is executed. @@ -137,7 +137,7 @@ Moreover, some repo rules inspect the local machine and might become outdated if the local machine was upgraded. Here you can ask Bazel to only refetch those -external repos where the [`repository_rule`](/versions/7.7.1/rules/lib/globals#repository_rule) +external repos where the [`repository_rule`](/versions/7.7.3/rules/lib/globals#repository_rule) definition has the `configure` attribute set, use `bazel fetch --force --configure`.
diff --git a/docs/versions/7.7.1/extending/rules.mdx b/docs/versions/7.7.3/extending/rules.mdx similarity index 89% rename from docs/versions/7.7.1/extending/rules.mdx rename to docs/versions/7.7.3/extending/rules.mdx index d8643b7..afc27e9 100644 --- a/docs/versions/7.7.1/extending/rules.mdx +++ b/docs/versions/7.7.3/extending/rules.mdx
@@ -21,10 +21,10 @@ the actions. Before creating or modifying any rule, ensure you are familiar with Bazel's -[build phases](/versions/7.7.1/extending/concepts). It is important to understand the three +[build phases](/versions/7.7.3/extending/concepts). It is important to understand the three phases of a build (loading, analysis, and execution). It is also useful to -learn about [macros](/versions/7.7.1/extending/macros) to understand the difference between rules and -macros. To get started, first review the [Rules Tutorial](/versions/7.7.1/rules/rules-tutorial). +learn about [macros](/versions/7.7.3/extending/macros) to understand the difference between rules and +macros. To get started, first review the [Rules Tutorial](/versions/7.7.3/rules/rules-tutorial). Then, use this page as a reference. A few rules are built into Bazel itself. These *native rules*, such as @@ -33,21 +33,21 @@ that Bazel does not support natively. Bazel provides an extensibility model for writing rules using the -[Starlark](/versions/7.7.1/rules/language) language. These rules are written in `.bzl` files, which +[Starlark](/versions/7.7.3/rules/language) language. These rules are written in `.bzl` files, which can be loaded directly from `BUILD` files. When defining your own rule, you get to decide what attributes it supports and how it generates its outputs. The rule's `implementation` function defines its exact behavior during the -[analysis phase](/versions/7.7.1/extending/concepts#evaluation-model). This function does not run any +[analysis phase](/versions/7.7.3/extending/concepts#evaluation-model). This function does not run any external commands. Rather, it registers [actions](#actions) that will be used later during the execution phase to build the rule's outputs, if they are needed. ## Rule creation -In a `.bzl` file, use the [rule](/versions/7.7.1/rules/lib/globals/bzl#rule) function to define a new +In a `.bzl` file, use the [rule](/versions/7.7.3/rules/lib/globals/bzl#rule) function to define a new rule, and store the result in a global variable. The call to `rule` specifies [attributes](#attributes) and an [implementation function](#implementation_function): @@ -62,7 +62,7 @@ ) ``` -This defines a [kind of rule](/versions/7.7.1/query/language#kind) named `example_library`. +This defines a [kind of rule](/versions/7.7.3/query/language#kind) named `example_library`. The call to `rule` also must specify if the rule creates an [executable](#executable-rules) output (with `executable=True`), or specifically @@ -71,7 +71,7 @@ ## Target instantiation -Rules can be [loaded](/versions/7.7.1/concepts/build-files#load) and called in `BUILD` files: +Rules can be [loaded](/versions/7.7.3/concepts/build-files#load) and called in `BUILD` files: ```python load('//some/pkg:rules.bzl', 'example_library') @@ -88,9 +88,9 @@ new target and values for the target's [attributes](#attributes). Rules can also be called from Starlark functions and loaded in `.bzl` files. -Starlark functions that call rules are called [Starlark macros](/versions/7.7.1/extending/macros). +Starlark functions that call rules are called [Starlark macros](/versions/7.7.3/extending/macros). Starlark macros must ultimately be called from `BUILD` files, and can only be -called during the [loading phase](/versions/7.7.1/extending/concepts#evaluation-model), when `BUILD` +called during the [loading phase](/versions/7.7.3/extending/concepts#evaluation-model), when `BUILD` files are evaluated to instantiate targets. ## Attributes @@ -100,9 +100,9 @@ targets, creating a graph of dependencies. Rule-specific attributes, such as `srcs` or `deps`, are defined by passing a map -from attribute names to schemas (created using the [`attr`](/versions/7.7.1/rules/lib/toplevel/attr) +from attribute names to schemas (created using the [`attr`](/versions/7.7.3/rules/lib/toplevel/attr) module) to the `attrs` parameter of `rule`. -[Common attributes](/versions/7.7.1/reference/be/common-definitions#common-attributes), such as +[Common attributes](/versions/7.7.3/reference/be/common-definitions#common-attributes), such as `name` and `visibility`, are implicitly added to all rules. Additional attributes are implicitly added to [executable and test rules](#executable-rules) specifically. Attributes which @@ -112,7 +112,7 @@ ### Dependency attributes Rules that process source code usually define the following attributes to handle -various [types of dependencies](/versions/7.7.1/concepts/dependencies#types_of_dependencies): +various [types of dependencies](/versions/7.7.3/concepts/dependencies#types_of_dependencies): * `srcs` specifies source files processed by a target's actions. Often, the attribute schema specifies which file extensions are expected for the sort @@ -141,12 +141,12 @@ These are examples of *dependency attributes*. Any attribute that specifies an input label (those defined with -[`attr.label_list`](/versions/7.7.1/rules/lib/toplevel/attr#label_list), -[`attr.label`](/versions/7.7.1/rules/lib/toplevel/attr#label), or -[`attr.label_keyed_string_dict`](/versions/7.7.1/rules/lib/toplevel/attr#label_keyed_string_dict)) +[`attr.label_list`](/versions/7.7.3/rules/lib/toplevel/attr#label_list), +[`attr.label`](/versions/7.7.3/rules/lib/toplevel/attr#label), or +[`attr.label_keyed_string_dict`](/versions/7.7.3/rules/lib/toplevel/attr#label_keyed_string_dict)) specifies dependencies of a certain type between a target and the targets whose labels (or the corresponding -[`Label`](/versions/7.7.1/rules/lib/builtins/Label) objects) are listed in that attribute when the target +[`Label`](/versions/7.7.3/rules/lib/builtins/Label) objects) are listed in that attribute when the target is defined. The repository, and possibly the path, for these labels is resolved relative to the defined target. @@ -212,13 +212,13 @@ Implicit dependencies are generally used for tools that reside in the same repository as the rule implementation. If the tool comes from the -[execution platform](/versions/7.7.1/extending/platforms) or a different repository instead, the -rule should obtain that tool from a [toolchain](/versions/7.7.1/extending/toolchains). +[execution platform](/versions/7.7.3/extending/platforms) or a different repository instead, the +rule should obtain that tool from a [toolchain](/versions/7.7.3/extending/toolchains). ### Output attributes -*Output attributes*, such as [`attr.output`](/versions/7.7.1/rules/lib/toplevel/attr#output) and -[`attr.output_list`](/versions/7.7.1/rules/lib/toplevel/attr#output_list), declare an output file that the +*Output attributes*, such as [`attr.output`](/versions/7.7.3/rules/lib/toplevel/attr#output) and +[`attr.output_list`](/versions/7.7.3/rules/lib/toplevel/attr#output_list), declare an output file that the target generates. These differ from dependency attributes in two ways: * They define output file targets instead of referring to targets defined @@ -237,7 +237,7 @@ ## Implementation function Every rule requires an `implementation` function. These functions are executed -strictly in the [analysis phase](/versions/7.7.1/extending/concepts#evaluation-model) and transform the +strictly in the [analysis phase](/versions/7.7.3/extending/concepts#evaluation-model) and transform the graph of targets generated in the loading phase into a graph of [actions](#actions) to be performed during the execution phase. As such, implementation functions can not actually read or write files. @@ -247,16 +247,16 @@ with `_impl`. Implementation functions take exactly one parameter: a -[rule context](/versions/7.7.1/rules/lib/builtins/ctx), conventionally named `ctx`. They return a list of +[rule context](/versions/7.7.3/rules/lib/builtins/ctx), conventionally named `ctx`. They return a list of [providers](#providers). ### Targets -Dependencies are represented at analysis time as [`Target`](/versions/7.7.1/rules/lib/builtins/Target) +Dependencies are represented at analysis time as [`Target`](/versions/7.7.3/rules/lib/builtins/Target) objects. These objects contain the [providers](#providers) generated when the target's implementation function was executed. -[`ctx.attr`](/versions/7.7.1/rules/lib/builtins/ctx#attr) has fields corresponding to the names of each +[`ctx.attr`](/versions/7.7.3/rules/lib/builtins/ctx#attr) has fields corresponding to the names of each dependency attribute, containing `Target` objects representing each direct dependency via that attribute. For `label_list` attributes, this is a list of `Targets`. For `label` attributes, this is a single `Target` or `None`. @@ -269,7 +269,7 @@ Those can be accessed using index notation (`[]`), with the type of provider as a key. These can be [custom providers](#custom_providers) defined in Starlark or -[providers for native rules](/versions/7.7.1/rules/lib/providers) available as Starlark +[providers for native rules](/versions/7.7.3/rules/lib/providers) available as Starlark global variables. For example, if a rule takes header files via a `hdrs` attribute and provides @@ -282,7 +282,7 @@ transitive_headers = [hdr[ExampleInfo].headers for hdr in ctx.attr.hdrs] ``` -For the legacy style in which a [`struct`](/versions/7.7.1/rules/lib/builtins/struct) is returned from a +For the legacy style in which a [`struct`](/versions/7.7.3/rules/lib/builtins/struct) is returned from a target's implementation function instead of a list of provider objects: ```python @@ -300,10 +300,10 @@ ### Files -Files are represented by [`File`](/versions/7.7.1/rules/lib/builtins/File) objects. Since Bazel does not +Files are represented by [`File`](/versions/7.7.3/rules/lib/builtins/File) objects. Since Bazel does not perform file I/O during the analysis phase, these objects cannot be used to directly read or write file content. Rather, they are passed to action-emitting -functions (see [`ctx.actions`](/versions/7.7.1/rules/lib/builtins/actions)) to construct pieces of the +functions (see [`ctx.actions`](/versions/7.7.3/rules/lib/builtins/actions)) to construct pieces of the action graph. A `File` can either be a source file or a generated file. Each generated file @@ -311,7 +311,7 @@ any action. For each dependency attribute, the corresponding field of -[`ctx.files`](/versions/7.7.1/rules/lib/builtins/ctx#files) contains a list of the default outputs of all +[`ctx.files`](/versions/7.7.3/rules/lib/builtins/ctx#files) contains a list of the default outputs of all dependencies via that attribute: ```python @@ -322,9 +322,9 @@ ... ``` -[`ctx.file`](/versions/7.7.1/rules/lib/builtins/ctx#file) contains a single `File` or `None` for +[`ctx.file`](/versions/7.7.3/rules/lib/builtins/ctx#file) contains a single `File` or `None` for dependency attributes whose specs set `allow_single_file=True`. -[`ctx.executable`](/versions/7.7.1/rules/lib/builtins/ctx#executable) behaves the same as `ctx.file`, but only +[`ctx.executable`](/versions/7.7.3/rules/lib/builtins/ctx#executable) behaves the same as `ctx.file`, but only contains fields for dependency attributes whose specs set `executable=True`. ### Declaring outputs @@ -332,10 +332,10 @@ During the analysis phase, a rule's implementation function can create outputs. Since all labels have to be known during the loading phase, these additional outputs have no labels. `File` objects for outputs can be created using -[`ctx.actions.declare_file`](/versions/7.7.1/rules/lib/builtins/actions#declare_file) and -[`ctx.actions.declare_directory`](/versions/7.7.1/rules/lib/builtins/actions#declare_directory). Often, +[`ctx.actions.declare_file`](/versions/7.7.3/rules/lib/builtins/actions#declare_file) and +[`ctx.actions.declare_directory`](/versions/7.7.3/rules/lib/builtins/actions#declare_directory). Often, the names of outputs are based on the target's name, -[`ctx.label.name`](/versions/7.7.1/rules/lib/builtins/ctx#label): +[`ctx.label.name`](/versions/7.7.3/rules/lib/builtins/ctx#label): ```python def _example_library_impl(ctx): @@ -346,7 +346,7 @@ For *predeclared outputs*, like those created for [output attributes](#output_attributes), `File` objects instead can be retrieved -from the corresponding fields of [`ctx.outputs`](/versions/7.7.1/rules/lib/builtins/ctx#outputs). +from the corresponding fields of [`ctx.outputs`](/versions/7.7.3/rules/lib/builtins/ctx#outputs). ### Actions @@ -357,16 +357,16 @@ the linker must be called after the compiler. General-purpose functions that create actions are defined in -[`ctx.actions`](/versions/7.7.1/rules/lib/builtins/actions): +[`ctx.actions`](/versions/7.7.3/rules/lib/builtins/actions): -* [`ctx.actions.run`](/versions/7.7.1/rules/lib/builtins/actions#run), to run an executable. -* [`ctx.actions.run_shell`](/versions/7.7.1/rules/lib/builtins/actions#run_shell), to run a shell +* [`ctx.actions.run`](/versions/7.7.3/rules/lib/builtins/actions#run), to run an executable. +* [`ctx.actions.run_shell`](/versions/7.7.3/rules/lib/builtins/actions#run_shell), to run a shell command. -* [`ctx.actions.write`](/versions/7.7.1/rules/lib/builtins/actions#write), to write a string to a file. -* [`ctx.actions.expand_template`](/versions/7.7.1/rules/lib/builtins/actions#expand_template), to +* [`ctx.actions.write`](/versions/7.7.3/rules/lib/builtins/actions#write), to write a string to a file. +* [`ctx.actions.expand_template`](/versions/7.7.3/rules/lib/builtins/actions#expand_template), to generate a file from a template. -[`ctx.actions.args`](/versions/7.7.1/rules/lib/builtins/actions#args) can be used to efficiently +[`ctx.actions.args`](/versions/7.7.3/rules/lib/builtins/actions#args) can be used to efficiently accumulate the arguments for actions. It avoids flattening depsets until execution time: @@ -397,7 +397,7 @@ Actions take a list or depset of input files and generate a (non-empty) list of output files. The set of input and output files must be known during the -[analysis phase](/versions/7.7.1/extending/concepts#evaluation-model). It might depend on the value of +[analysis phase](/versions/7.7.3/extending/concepts#evaluation-model). It might depend on the value of attributes, including providers from dependencies, but it cannot depend on the result of the execution. For example, if your action runs the unzip command, you must specify which files you expect to be inflated (before running unzip). @@ -431,13 +431,13 @@ Since a rule's implementation function can only read providers from the instantiated target's immediate dependencies, rules need to forward any information from a target's dependencies that needs to be known by a target's -consumers, generally by accumulating that into a [`depset`](/versions/7.7.1/rules/lib/builtins/depset). +consumers, generally by accumulating that into a [`depset`](/versions/7.7.3/rules/lib/builtins/depset). A target's providers are specified by a list of `Provider` objects returned by the implementation function. Old implementation functions can also be written in a legacy style where the -implementation function returns a [`struct`](/versions/7.7.1/rules/lib/builtins/struct) instead of list of +implementation function returns a [`struct`](/versions/7.7.3/rules/lib/builtins/struct) instead of list of provider objects. This style is strongly discouraged and rules should be [migrated away from it](#migrating_from_legacy_providers). @@ -449,7 +449,7 @@ will be built by the command `bazel build //pkg:foo`. Default outputs are specified by the `files` parameter of -[`DefaultInfo`](/versions/7.7.1/rules/lib/providers/DefaultInfo): +[`DefaultInfo`](/versions/7.7.3/rules/lib/providers/DefaultInfo): ```python def _example_library_impl(ctx): @@ -474,18 +474,18 @@ #### Runfiles Runfiles are a set of files used by a target at runtime (as opposed to build -time). During the [execution phase](/versions/7.7.1/extending/concepts#evaluation-model), Bazel creates +time). During the [execution phase](/versions/7.7.3/extending/concepts#evaluation-model), Bazel creates a directory tree containing symlinks pointing to the runfiles. This stages the environment for the binary so it can access the runfiles during runtime. Runfiles can be added manually during rule creation. -[`runfiles`](/versions/7.7.1/rules/lib/builtins/runfiles) objects can be created by the `runfiles` method -on the rule context, [`ctx.runfiles`](/versions/7.7.1/rules/lib/builtins/ctx#runfiles) and passed to the +[`runfiles`](/versions/7.7.3/rules/lib/builtins/runfiles) objects can be created by the `runfiles` method +on the rule context, [`ctx.runfiles`](/versions/7.7.3/rules/lib/builtins/ctx#runfiles) and passed to the `runfiles` parameter on `DefaultInfo`. The executable output of [executable rules](#executable-rules) is implicitly added to the runfiles. Some rules specify attributes, generally named -[`data`](/versions/7.7.1/reference/be/common-definitions#common.data), whose outputs are added to +[`data`](/versions/7.7.3/reference/be/common-definitions#common.data), whose outputs are added to a targets' runfiles. Runfiles should also be merged in from `data`, as well as from any attributes which might provide code for eventual execution, generally `srcs` (which might contain `filegroup` targets with associated `data`) and @@ -513,7 +513,7 @@ #### Custom providers -Providers can be defined using the [`provider`](/versions/7.7.1/rules/lib/globals/bzl#provider) +Providers can be defined using the [`provider`](/versions/7.7.3/rules/lib/globals/bzl#provider) function to convey rule-specific information: ```python @@ -552,7 +552,7 @@ obtaining an instance. This is done by passing an `init` callback to the -[`provider`](/versions/7.7.1/rules/lib/globals/bzl#provider) function. If this callback is given, the +[`provider`](/versions/7.7.3/rules/lib/globals/bzl#provider) function. If this callback is given, the return type of `provider()` changes to be a tuple of two values: the provider symbol that is the ordinary return value when `init` is not used, and a "raw constructor". @@ -634,8 +634,8 @@ Executable rules define targets that can be invoked by a `bazel run` command. Test rules are a special kind of executable rule whose targets can also be invoked by a `bazel test` command. Executable and test rules are created by -setting the respective [`executable`](/versions/7.7.1/rules/lib/globals/bzl#rule.executable) or -[`test`](/versions/7.7.1/rules/lib/globals/bzl#rule.test) argument to `True` in the call to `rule`: +setting the respective [`executable`](/versions/7.7.3/rules/lib/globals/bzl#rule.executable) or +[`test`](/versions/7.7.3/rules/lib/globals/bzl#rule.test) argument to `True` in the call to `rule`: ```python example_binary = rule( @@ -658,7 +658,7 @@ Both kinds of rules must produce an executable output file (which may or may not be predeclared) that will be invoked by the `run` or `test` commands. To tell Bazel which of a rule's outputs to use as this executable, pass it as the -`executable` argument of a returned [`DefaultInfo`](/versions/7.7.1/rules/lib/providers/DefaultInfo) +`executable` argument of a returned [`DefaultInfo`](/versions/7.7.3/rules/lib/providers/DefaultInfo) provider. That `executable` is added to the default outputs of the rule (so you don't need to pass that to both `executable` and `files`). It's also implicitly added to the [runfiles](#runfiles): @@ -674,10 +674,10 @@ ``` The action that generates this file must set the executable bit on the file. For -a [`ctx.actions.run`](/versions/7.7.1/rules/lib/builtins/actions#run) or -[`ctx.actions.run_shell`](/versions/7.7.1/rules/lib/builtins/actions#run_shell) action this should be done +a [`ctx.actions.run`](/versions/7.7.3/rules/lib/builtins/actions#run) or +[`ctx.actions.run_shell`](/versions/7.7.3/rules/lib/builtins/actions#run_shell) action this should be done by the underlying tool that is invoked by the action. For a -[`ctx.actions.write`](/versions/7.7.1/rules/lib/builtins/actions#write) action, pass `is_executable=True`. +[`ctx.actions.write`](/versions/7.7.3/rules/lib/builtins/actions#write) action, pass `is_executable=True`. As [legacy behavior](#deprecated_predeclared_outputs), executable rules have a special `ctx.outputs.executable` predeclared output. This file serves as the @@ -690,12 +690,12 @@ and a [test rule](https://github.com/bazelbuild/examples/blob/main/rules/test_rule/line_length.bzl). -[Executable rules](/versions/7.7.1/reference/be/common-definitions#common-attributes-binaries) and -[test rules](/versions/7.7.1/reference/be/common-definitions#common-attributes-tests) have additional +[Executable rules](/versions/7.7.3/reference/be/common-definitions#common-attributes-binaries) and +[test rules](/versions/7.7.3/reference/be/common-definitions#common-attributes-tests) have additional attributes implicitly defined, in addition to those added for -[all rules](/versions/7.7.1/reference/be/common-definitions#common-attributes). The defaults of +[all rules](/versions/7.7.3/reference/be/common-definitions#common-attributes). The defaults of implicitly-added attributes cannot be changed, though this can be worked around -by wrapping a private rule in a [Starlark macro](/versions/7.7.1/extending/macros) which alters the +by wrapping a private rule in a [Starlark macro](/versions/7.7.3/extending/macros) which alters the default: ```python @@ -722,7 +722,7 @@ ``` The path to a `File` under the runfiles directory corresponds to -[`File.short_path`](/versions/7.7.1/rules/lib/builtins/File#short_path). +[`File.short_path`](/versions/7.7.3/rules/lib/builtins/File#short_path). The binary executed directly by `bazel` is adjacent to the root of the `runfiles` directory. However, binaries called *from* the runfiles can't make @@ -747,14 +747,14 @@ be explicitly requested on the command line. Rules can specify predeclared outputs via [output attributes](#output_attributes). In that case, the user explicitly chooses labels for outputs when they instantiate the rule. To obtain -[`File`](/versions/7.7.1/rules/lib/builtins/File) objects for output attributes, use the corresponding -attribute of [`ctx.outputs`](/versions/7.7.1/rules/lib/builtins/ctx#outputs). Rules can +[`File`](/versions/7.7.3/rules/lib/builtins/File) objects for output attributes, use the corresponding +attribute of [`ctx.outputs`](/versions/7.7.3/rules/lib/builtins/ctx#outputs). Rules can [implicitly define predeclared outputs](#deprecated_predeclared_outputs) based on the target name as well, but this feature is deprecated. In addition to default outputs, there are *output groups*, which are collections of output files that may be requested together. These can be requested with -[`--output_groups`](/versions/7.7.1/reference/command-line-reference#flag--output_groups). For +[`--output_groups`](/versions/7.7.3/reference/command-line-reference#flag--output_groups). For example, if a target `//pkg:mytarget` is of a rule type that has a `debug_files` output group, these files can be built by running `bazel build //pkg:mytarget --output_groups=debug_files`. Since non-predeclared outputs don't have labels, @@ -762,7 +762,7 @@ group. Output groups can be specified with the -[`OutputGroupInfo`](/versions/7.7.1/rules/lib/providers/OutputGroupInfo) provider. Note that unlike many +[`OutputGroupInfo`](/versions/7.7.3/rules/lib/providers/OutputGroupInfo) provider. Note that unlike many built-in providers, `OutputGroupInfo` can take parameters with arbitrary names to define output groups with that name: @@ -782,7 +782,7 @@ ``` Also unlike most providers, `OutputGroupInfo` can be returned by both an -[aspect](/versions/7.7.1/extending/aspects) and the rule target to which that aspect is applied, as +[aspect](/versions/7.7.3/extending/aspects) and the rule target to which that aspect is applied, as long as they do not define the same output groups. In that case, the resulting providers are merged. @@ -795,7 +795,7 @@ Imagine that you want to build a C++ binary for a different architecture. The build can be complex and involve multiple steps. Some of the intermediate binaries, like compilers and code generators, have to run on -[the execution platform](/versions/7.7.1/extending/platforms#overview) (which could be your host, +[the execution platform](/versions/7.7.3/extending/platforms#overview) (which could be your host, or a remote executor). Some binaries like the final output must be built for the target architecture. @@ -837,10 +837,10 @@ which means `cfg` is optional, only set this when it truly helps readability. You can also use `cfg=my_transition` to use -[user-defined transitions](/versions/7.7.1/extending/config#user-defined-transitions), which allow +[user-defined transitions](/versions/7.7.3/extending/config#user-defined-transitions), which allow rule authors a great deal of flexibility in changing configurations, with the drawback of -[making the build graph larger and less comprehensible](/versions/7.7.1/extending/config#memory-and-performance-considerations). +[making the build graph larger and less comprehensible](/versions/7.7.3/extending/config#memory-and-performance-considerations). **Note**: Historically, Bazel didn't have the concept of execution platforms, and instead all build actions were considered to run on the host machine. Bazel @@ -854,7 +854,7 @@ ### Configuration fragments Rules may access -[configuration fragments](/versions/7.7.1/rules/lib/fragments) such as +[configuration fragments](/versions/7.7.3/rules/lib/fragments) such as `cpp`, `java` and `jvm`. However, all required fragments must be declared in order to avoid access errors: @@ -911,18 +911,18 @@ ### Code coverage -When the [`coverage`](/versions/7.7.1/reference/command-line-reference#coverage) command is run, +When the [`coverage`](/versions/7.7.3/reference/command-line-reference#coverage) command is run, the build may need to add coverage instrumentation for certain targets. The build also gathers the list of source files that are instrumented. The subset of targets that are considered is controlled by the flag -[`--instrumentation_filter`](/versions/7.7.1/reference/command-line-reference#flag--instrumentation_filter). +[`--instrumentation_filter`](/versions/7.7.3/reference/command-line-reference#flag--instrumentation_filter). Test targets are excluded, unless -[`--instrument_test_targets`](/versions/7.7.1/reference/command-line-reference#flag--instrument_test_targets) +[`--instrument_test_targets`](/versions/7.7.3/reference/command-line-reference#flag--instrument_test_targets) is specified. If a rule implementation adds coverage instrumentation at build time, it needs to account for that in its implementation function. -[ctx.coverage_instrumented](/versions/7.7.1/rules/lib/builtins/ctx#coverage_instrumented) returns true in +[ctx.coverage_instrumented](/versions/7.7.3/rules/lib/builtins/ctx#coverage_instrumented) returns true in coverage mode if a target's sources should be instrumented: ```python @@ -933,7 +933,7 @@ Logic that always needs to be on in coverage mode (whether a target's sources specifically are instrumented or not) can be conditioned on -[ctx.configuration.coverage_enabled](/versions/7.7.1/rules/lib/builtins/configuration#coverage_enabled). +[ctx.configuration.coverage_enabled](/versions/7.7.3/rules/lib/builtins/configuration#coverage_enabled). If the rule directly includes sources from its dependencies before compilation (such as header files), it may also need to turn on compile-time instrumentation if @@ -950,7 +950,7 @@ Rules also should provide information about which attributes are relevant for coverage with the `InstrumentedFilesInfo` provider, constructed using -[`coverage_common.instrumented_files_info`](/versions/7.7.1/rules/lib/toplevel/coverage_common#instrumented_files_info). +[`coverage_common.instrumented_files_info`](/versions/7.7.3/rules/lib/toplevel/coverage_common#instrumented_files_info). The `dependency_attributes` parameter of `instrumented_files_info` should list all runtime dependency attributes, including code dependencies like `deps` and data dependencies like `data`. The `source_attributes` parameter should list the @@ -1005,7 +1005,7 @@ file, and artificially add that output to the inputs of some other important action in the build: -<img src="/versions/7.7.1/rules/validation_action_historical.svg" width="35%" /> +<img src="/versions/7.7.3/rules/validation_action_historical.svg" width="35%" /> This works, because Bazel will always run the validation action when the compile action is run, but this has significant drawbacks: @@ -1037,7 +1037,7 @@ validation action previously succeeded, then the validation action will not be run. -<img src="/versions/7.7.1/rules/validation_action.svg" width="35%" /> +<img src="/versions/7.7.3/rules/validation_action.svg" width="35%" /> Using this output group still requires that validation actions output some file, even an empty one. This might require wrapping some tools that normally don't @@ -1135,7 +1135,7 @@ There are two **deprecated** ways of using predeclared outputs: -* The [`outputs`](/versions/7.7.1/rules/lib/globals/bzl#rule.outputs) parameter of `rule` specifies +* The [`outputs`](/versions/7.7.3/rules/lib/globals/bzl#rule.outputs) parameter of `rule` specifies a mapping between output attribute names and string templates for generating predeclared output labels. Prefer using non-predeclared outputs and explicitly adding outputs to `DefaultInfo.files`. Use the rule target's @@ -1151,12 +1151,12 @@ ### Runfiles features to avoid -[`ctx.runfiles`](/versions/7.7.1/rules/lib/builtins/ctx#runfiles) and the [`runfiles`](/versions/7.7.1/rules/lib/builtins/runfiles) +[`ctx.runfiles`](/versions/7.7.3/rules/lib/builtins/ctx#runfiles) and the [`runfiles`](/versions/7.7.3/rules/lib/builtins/runfiles) type have a complex set of features, many of which are kept for legacy reasons. The following recommendations help reduce complexity: * **Avoid** use of the `collect_data` and `collect_default` modes of - [`ctx.runfiles`](/versions/7.7.1/rules/lib/builtins/ctx#runfiles). These modes implicitly collect + [`ctx.runfiles`](/versions/7.7.3/rules/lib/builtins/ctx#runfiles). These modes implicitly collect runfiles across certain hardcoded dependency edges in confusing ways. Instead, add files using the `files` or `transitive_files` parameters of `ctx.runfiles`, or by merging in runfiles from dependencies with @@ -1169,7 +1169,7 @@ `data_runfiles`, but not `default_runfiles`. Instead of using `data_runfiles`, rules should *both* include default outputs and merge in `default_runfiles` from attributes which provide runfiles (often - [`data`](/versions/7.7.1/reference/be/common-definitions#common-attributes.data)). + [`data`](/versions/7.7.3/reference/be/common-definitions#common-attributes.data)). * When retrieving `runfiles` from `DefaultInfo` (generally only for merging runfiles between the current rule and its dependencies), use @@ -1214,14 +1214,14 @@ * The fields `files`, `runfiles`, `data_runfiles`, `default_runfiles`, and `executable` correspond to the same-named fields of - [`DefaultInfo`](/versions/7.7.1/rules/lib/providers/DefaultInfo). It is not allowed to specify any of + [`DefaultInfo`](/versions/7.7.3/rules/lib/providers/DefaultInfo). It is not allowed to specify any of these fields while also returning a `DefaultInfo` provider. * The field `output_groups` takes a struct value and corresponds to an - [`OutputGroupInfo`](/versions/7.7.1/rules/lib/providers/OutputGroupInfo). + [`OutputGroupInfo`](/versions/7.7.3/rules/lib/providers/OutputGroupInfo). -In [`provides`](/versions/7.7.1/rules/lib/globals/bzl#rule.provides) declarations of rules, and in -[`providers`](/versions/7.7.1/rules/lib/toplevel/attr#label_list.providers) declarations of dependency +In [`provides`](/versions/7.7.3/rules/lib/globals/bzl#rule.provides) declarations of rules, and in +[`providers`](/versions/7.7.3/rules/lib/toplevel/attr#label_list.providers) declarations of dependency attributes, legacy providers are passed in as strings and modern providers are passed in by their `*Info` symbol. Be sure to change from strings to symbols when migrating. For complex or large rule sets where it is difficult to update
diff --git a/docs/versions/7.7.1/extending/toolchains.mdx b/docs/versions/7.7.3/extending/toolchains.mdx similarity index 94% rename from docs/versions/7.7.1/extending/toolchains.mdx rename to docs/versions/7.7.3/extending/toolchains.mdx index 31cd0b8..6ef4457 100644 --- a/docs/versions/7.7.1/extending/toolchains.mdx +++ b/docs/versions/7.7.3/extending/toolchains.mdx
@@ -4,7 +4,7 @@ This page describes the toolchain framework, which is a way for rule authors to decouple their rule logic from platform-based selection of tools. It is -recommended to read the [rules](/versions/7.7.1/extending/rules) and [platforms](/versions/7.7.1/extending/platforms) +recommended to read the [rules](/versions/7.7.3/extending/rules) and [platforms](/versions/7.7.3/extending/platforms) pages before continuing. This page covers why toolchains are needed, how to define and use them, and how Bazel selects an appropriate toolchain based on platform constraints. @@ -82,7 +82,7 @@ ``` You can improve on this solution by using `select` to choose the `compiler` -[based on the platform](/versions/7.7.1/docs/configurable-attributes): +[based on the platform](/versions/7.7.3/docs/configurable-attributes): ```python config_setting( @@ -170,7 +170,7 @@ ``` `ctx.toolchains["//bar_tools:toolchain_type"]` returns the -[`ToolchainInfo` provider](/versions/7.7.1/rules/lib/toplevel/platform_common#ToolchainInfo) +[`ToolchainInfo` provider](/versions/7.7.3/rules/lib/toplevel/platform_common#ToolchainInfo) of whatever target Bazel resolved the toolchain dependency to. The fields of the `ToolchainInfo` object are set by the underlying tool's rule; in the next section, this rule is defined such that there is a `barcinfo` field that wraps @@ -204,7 +204,7 @@ When an optional toolchain type cannot be resolved, analysis continues, and the result of `ctx.toolchains["//bar_tools:toolchain_type"]` is `None`. -The [`config_common.toolchain_type`](/versions/7.7.1/rules/lib/toplevel/config_common#toolchain_type) +The [`config_common.toolchain_type`](/versions/7.7.3/rules/lib/toplevel/config_common#toolchain_type) function defaults to mandatory. The following forms can be used: @@ -265,7 +265,7 @@ suite for different platforms. 3. For each such target, an associated target of the generic - [`toolchain`](/versions/7.7.1/reference/be/platforms-and-toolchains#toolchain) + [`toolchain`](/versions/7.7.3/reference/be/platforms-and-toolchains#toolchain) rule, to provide metadata used by the toolchain framework. This `toolchain` target also refers to the `toolchain_type` associated with this toolchain. This means that a given `_toolchain` rule could be associated with any @@ -375,7 +375,7 @@ ### Toolchains and configurations An important question for rule authors is, when a `bar_toolchain` target is -analyzed, what [configuration](/versions/7.7.1/reference/glossary#configuration) does it see, and what transitions +analyzed, what [configuration](/versions/7.7.3/reference/glossary#configuration) does it see, and what transitions should be used for dependencies? The example above uses string attributes, but what would happen for a more complicated toolchain that depends on other targets in the Bazel repository? @@ -404,7 +404,7 @@ ) ``` -The use of [`attr.label`](/versions/7.7.1/rules/lib/toplevel/attr#label) is the same as for a standard rule, +The use of [`attr.label`](/versions/7.7.3/rules/lib/toplevel/attr#label) is the same as for a standard rule, but the meaning of the `cfg` parameter is slightly different. The dependency from a target (called the "parent") to a toolchain via toolchain @@ -481,7 +481,7 @@ ## Toolchain resolution {#toolchain-resolution} -Note: [Some Bazel rules](/versions/7.7.1/concepts/platforms#status) do not yet support +Note: [Some Bazel rules](/versions/7.7.3/concepts/platforms#status) do not yet support toolchain resolution. For each target that uses toolchains, Bazel's toolchain resolution procedure @@ -493,15 +493,15 @@ The available execution platforms and toolchains are gathered from the external dependency graph via -[`register_execution_platforms`](/versions/7.7.1/rules/lib/globals/module#register_execution_platforms) +[`register_execution_platforms`](/versions/7.7.3/rules/lib/globals/module#register_execution_platforms) and -[`register_toolchains`](/versions/7.7.1/rules/lib/globals/module#register_toolchains) calls in +[`register_toolchains`](/versions/7.7.3/rules/lib/globals/module#register_toolchains) calls in `MODULE.bazel`` files. Additional execution platforms and toolchains may also be specified on the command line via -[`--extra_execution_platforms`](/versions/7.7.1/reference/command-line-reference#flag--extra_execution_platforms) +[`--extra_execution_platforms`](/versions/7.7.3/reference/command-line-reference#flag--extra_execution_platforms) and -[`--extra_toolchains`](/versions/7.7.1/reference/command-line-reference#flag--extra_toolchains). +[`--extra_toolchains`](/versions/7.7.3/reference/command-line-reference#flag--extra_toolchains). The host platform is automatically included as an available execution platform. Available platforms and toolchains are tracked as ordered lists for determinism, with preference given to earlier items in the list. @@ -524,7 +524,7 @@ certain native rules bundled with the Bazel installation. **NOTE:** [Pseudo-targets like `:all`, `:*`, and -`/...`](/versions/7.7.1/run/build#specifying-build-targets) are ordered by Bazel's package +`/...`](/versions/7.7.3/run/build#specifying-build-targets) are ordered by Bazel's package loading mechanism, which uses a lexicographic ordering. The resolution steps are as follows. @@ -537,9 +537,9 @@ referenced by the clause, these do not affect matching. 1. If the target being built specifies the - [`exec_compatible_with` attribute](/versions/7.7.1/reference/be/common-definitions#common.exec_compatible_with) + [`exec_compatible_with` attribute](/versions/7.7.3/reference/be/common-definitions#common.exec_compatible_with) (or its rule definition specifies the - [`exec_compatible_with` argument](/versions/7.7.1/rules/lib/globals/bzl#rule.exec_compatible_with)), + [`exec_compatible_with` argument](/versions/7.7.3/rules/lib/globals/bzl#rule.exec_compatible_with)), the list of available execution platforms is filtered to remove any that do not match the execution constraints. @@ -559,7 +559,7 @@ for different CPUs) within the same build, the resolution procedure is applied independently to each version of the target. -If the rule uses [execution groups](/versions/7.7.1/extending/exec-groups), each execution +If the rule uses [execution groups](/versions/7.7.3/extending/exec-groups), each execution group performs toolchain resolution separately, and each has its own execution platform and toolchains. @@ -571,8 +571,8 @@ can use `.*` to output all information. Bazel will output names of toolchains it checks and skips during the resolution process. -If you'd like to see which [`cquery`](/versions/7.7.1/query/cquery) dependencies are from toolchain -resolution, use `cquery`'s [`--transitions`](/versions/7.7.1/query/cquery#transitions) flag: +If you'd like to see which [`cquery`](/versions/7.7.3/query/cquery) dependencies are from toolchain +resolution, use `cquery`'s [`--transitions`](/versions/7.7.3/query/cquery#transitions) flag: ``` # Find all direct dependencies of //cc:my_cc_lib. This includes explicitly
diff --git a/docs/versions/7.7.1/external/advanced.mdx b/docs/versions/7.7.3/external/advanced.mdx similarity index 88% rename from docs/versions/7.7.1/external/advanced.mdx rename to docs/versions/7.7.3/external/advanced.mdx index 407e805..f466e25 100644 --- a/docs/versions/7.7.1/external/advanced.mdx +++ b/docs/versions/7.7.3/external/advanced.mdx
@@ -4,8 +4,8 @@ ## Shadowing dependencies in WORKSPACE -Note: This section applies to the [WORKSPACE system](/versions/7.7.1/external/overview#workspace-system) only. For -[Bzlmod](/versions/7.7.1/external/overview#bzlmod), use a [multiple-version override](/versions/7.7.1/external/module#multiple-version_override). +Note: This section applies to the [WORKSPACE system](/versions/7.7.3/external/overview#workspace-system) only. For +[Bzlmod](/versions/7.7.3/external/overview#bzlmod), use a [multiple-version override](/versions/7.7.3/external/module#multiple-version_override). Whenever possible, have a single version policy in your project, which is required for dependencies that you compile against and end up in your final @@ -90,7 +90,7 @@ To override a declared repository with a local repository from the command line, use the -[`--override_repository`](/versions/7.7.1/reference/command-line-reference#flag--override_repository) +[`--override_repository`](/versions/7.7.3/reference/command-line-reference#flag--override_repository) flag. Using this flag changes the contents of external repositories without changing your source code. @@ -105,11 +105,11 @@ override the network-based repository rules to point to local directories instead. -Note: With [Bzlmod](/versions/7.7.1/external/overview#bzlmod), remember to use canonical repo +Note: With [Bzlmod](/versions/7.7.3/external/overview#bzlmod), remember to use canonical repo names here. Alternatively, use the -[`--override_module`](/versions/7.7.1/reference/command-line-reference#flag--override_module) +[`--override_module`](/versions/7.7.3/reference/command-line-reference#flag--override_module) flag to override a module to a local directory, similar to the -[`local_path_override`](/versions/7.7.1/rules/lib/globals/module#local_path_override) directive in +[`local_path_override`](/versions/7.7.3/rules/lib/globals/module#local_path_override) directive in `MODULE.bazel`. ## Using proxies @@ -129,14 +129,14 @@ [`java.net.preferIPv6Addresses=true` system property](https://docs.oracle.com/javase/8/docs/api/java/net/doc-files/net-properties.html). Specifically: -* Use `--host_jvm_args=-Djava.net.preferIPv6Addresses=true` [startup option](/versions/7.7.1/docs/user-manual#startup-options), for example by adding the - following line in your [`.bazelrc` file](/versions/7.7.1/run/bazelrc): +* Use `--host_jvm_args=-Djava.net.preferIPv6Addresses=true` [startup option](/versions/7.7.3/docs/user-manual#startup-options), for example by adding the + following line in your [`.bazelrc` file](/versions/7.7.3/run/bazelrc): `startup --host_jvm_args=-Djava.net.preferIPv6Addresses=true` * When running Java build targets that need to connect to the internet (such as for integration tests), use the - `--jvmopt=-Djava.net.preferIPv6Addresses=true` [tool flag](/versions/7.7.1/docs/user-manual#jvmopt). For example, include in your [`.bazelrc` file](/versions/7.7.1/run/bazelrc): + `--jvmopt=-Djava.net.preferIPv6Addresses=true` [tool flag](/versions/7.7.3/docs/user-manual#jvmopt). For example, include in your [`.bazelrc` file](/versions/7.7.3/run/bazelrc): `build --jvmopt=-Djava.net.preferIPv6Addresses` @@ -155,8 +155,8 @@ For true offline builds, where a different entity supplies all needed files, Bazel supports the option `--distdir`. This flag tells Bazel to look first into the directories specified by that option when a repository rule asks Bazel to -fetch a file with [`ctx.download`](/versions/7.7.1/rules/lib/builtins/repository_ctx#download) or -[`ctx.download_and_extract`](/versions/7.7.1/rules/lib/builtins/repository_ctx#download_and_extract). By +fetch a file with [`ctx.download`](/versions/7.7.3/rules/lib/builtins/repository_ctx#download) or +[`ctx.download_and_extract`](/versions/7.7.3/rules/lib/builtins/repository_ctx#download_and_extract). By providing a hash sum of the file needed, Bazel looks for a file matching the basename of the first URL, and uses the local copy if the hash matches.
diff --git a/docs/versions/7.7.1/external/extension.mdx b/docs/versions/7.7.3/external/extension.mdx similarity index 93% rename from docs/versions/7.7.1/external/extension.mdx rename to docs/versions/7.7.3/external/extension.mdx index 934377f..d6ad54e 100644 --- a/docs/versions/7.7.1/external/extension.mdx +++ b/docs/versions/7.7.3/external/extension.mdx
@@ -20,7 +20,7 @@ Extensions are hosted in Bazel modules themselves. To use an extension in a module, first add a `bazel_dep` on the module hosting the extension, and then -call the [`use_extension`](/versions/7.7.1/rules/lib/globals/module#use_extension) built-in function +call the [`use_extension`](/versions/7.7.3/rules/lib/globals/module#use_extension) built-in function to bring it into scope. Consider the following example — a snippet from a `MODULE.bazel` file to use the "maven" extension defined in the [`rules_jvm_external`](https://github.com/bazelbuild/rules_jvm_external) @@ -45,7 +45,7 @@ exclusions = ["com.google.j2objc:j2objc-annotations"]) ``` -Use the [`use_repo`](/versions/7.7.1/rules/lib/globals/module#use_repo) directive to bring repos +Use the [`use_repo`](/versions/7.7.3/rules/lib/globals/module#use_repo) directive to bring repos generated by the extension into the scope of the current module. ```python @@ -67,9 +67,9 @@ ## Extension definition You can define module extensions similarly to repo rules, using the -[`module_extension`](/versions/7.7.1/rules/lib/globals/bzl#module_extension) function. However, +[`module_extension`](/versions/7.7.3/rules/lib/globals/bzl#module_extension) function. However, while repo rules have a number of attributes, module extensions have -[`tag_class`es](/versions/7.7.1/rules/lib/globals/bzl#tag_class), each of which has a number of +[`tag_class`es](/versions/7.7.3/rules/lib/globals/bzl#tag_class), each of which has a number of attributes. The tag classes define schemas for tags used by this extension. For example, the "maven" extension above might be defined like this: @@ -88,7 +88,7 @@ specified using the specified attribute schema. The implementation function of module extensions are similar to those of repo -rules, except that they get a [`module_ctx`](/versions/7.7.1/rules/lib/builtins/module_ctx) object, +rules, except that they get a [`module_ctx`](/versions/7.7.3/rules/lib/builtins/module_ctx) object, which grants access to all modules using the extension and all pertinent tags. The implementation function then calls repo rules to generate repos. @@ -152,8 +152,8 @@ several repo visibility rules: * A Bazel module repo can see all repos introduced in its `MODULE.bazel` file - via [`bazel_dep`](/versions/7.7.1/rules/lib/globals/module#bazel_dep) and - [`use_repo`](/versions/7.7.1/rules/lib/globals/module#use_repo). + via [`bazel_dep`](/versions/7.7.3/rules/lib/globals/module#bazel_dep) and + [`use_repo`](/versions/7.7.3/rules/lib/globals/module#use_repo). * A repo generated by a module extension can see all repos visible to the module that hosts the extension, *plus* all other repos generated by the same module extension (using the names specified in the repo rule calls as @@ -167,15 +167,15 @@ attributes, regardless of the order in which they are created. * In case of a conflict with a repository visible to the module, labels passed to repository rule attributes can be wrapped in a call to - [`Label`](/versions/7.7.1/rules/lib/toplevel/attr#label) to ensure that they refer to + [`Label`](/versions/7.7.3/rules/lib/toplevel/attr#label) to ensure that they refer to the repo visible to the module instead of the extension-generated repo of the same name. ### Overriding and injecting module extension repos The root module can use -[`override_repo`](/versions/7.7.1/rules/lib/globals/module#override_repo) and -[`inject_repo`](/versions/7.7.1/rules/lib/globals/module#inject_repo) to override or inject +[`override_repo`](/versions/7.7.3/rules/lib/globals/module#override_repo) and +[`inject_repo`](/versions/7.7.3/rules/lib/globals/module#inject_repo) to override or inject module extension repos. #### Example: Replacing `rules_java`'s `java_tools` with a vendored copy @@ -246,9 +246,9 @@ If your extension always defines the same repositories given the same inputs (extension tags, files it reads, etc.) and in particular doesn't rely on -any [downloads](/versions/7.7.1/rules/lib/builtins/module_ctx#download) that aren't guarded by +any [downloads](/versions/7.7.3/rules/lib/builtins/module_ctx#download) that aren't guarded by a checksum, consider returning -[`extension_metadata`](/versions/7.7.1/rules/lib/builtins/module_ctx#extension_metadata) with +[`extension_metadata`](/versions/7.7.3/rules/lib/builtins/module_ctx#extension_metadata) with `reproducible = True`. This allows Bazel to skip this extension when writing to the lockfile.
diff --git a/docs/versions/7.7.1/external/images/mod_exampleBefore.svg b/docs/versions/7.7.3/external/images/mod_exampleBefore.svg similarity index 100% rename from docs/versions/7.7.1/external/images/mod_exampleBefore.svg rename to docs/versions/7.7.3/external/images/mod_exampleBefore.svg
diff --git a/docs/versions/7.7.1/external/images/mod_exampleResolved.svg b/docs/versions/7.7.3/external/images/mod_exampleResolved.svg similarity index 100% rename from docs/versions/7.7.1/external/images/mod_exampleResolved.svg rename to docs/versions/7.7.3/external/images/mod_exampleResolved.svg
diff --git a/docs/versions/7.7.1/external/lockfile.mdx b/docs/versions/7.7.3/external/lockfile.mdx similarity index 98% rename from docs/versions/7.7.1/external/lockfile.mdx rename to docs/versions/7.7.3/external/lockfile.mdx index 2384de6..4265c41 100644 --- a/docs/versions/7.7.1/external/lockfile.mdx +++ b/docs/versions/7.7.3/external/lockfile.mdx
@@ -29,7 +29,7 @@ ## Lockfile Usage {#lockfile-usage} The lockfile can be controlled by the flag -[`--lockfile_mode`](/versions/7.7.1/reference/command-line-reference#flag--lockfile_mode) to +[`--lockfile_mode`](/versions/7.7.3/reference/command-line-reference#flag--lockfile_mode) to customize the behavior of Bazel when the project state differs from the lockfile. The available modes are: @@ -215,11 +215,11 @@ ensure that all team members have access to the same lockfile, promoting consistent development environments across the project. -* Use [`bazelisk`](/versions/7.7.1/install/bazelisk) to run Bazel, and include a +* Use [`bazelisk`](/versions/7.7.3/install/bazelisk) to run Bazel, and include a `.bazelversion` file in version control that specifies the Bazel version corresponding to the lockfile. Because Bazel itself is a dependency of your build, the lockfile is specific to the Bazel version, and will - change even between [backwards compatible](/versions/7.7.1/release/backward-compatibility) + change even between [backwards compatible](/versions/7.7.3/release/backward-compatibility) Bazel releases. Using `bazelisk` ensures that all developers are using a Bazel version that matches the lockfile.
diff --git a/docs/versions/7.7.1/external/migration.mdx b/docs/versions/7.7.3/external/migration.mdx similarity index 94% rename from docs/versions/7.7.1/external/migration.mdx rename to docs/versions/7.7.3/external/migration.mdx index 25fb84d..9e8dbba 100644 --- a/docs/versions/7.7.1/external/migration.mdx +++ b/docs/versions/7.7.3/external/migration.mdx
@@ -2,7 +2,7 @@ title: 'Bzlmod Migration Guide' --- -Due to the [shortcomings of WORKSPACE](/versions/7.7.1/external/overview#workspace-shortcomings), Bzlmod is going to +Due to the [shortcomings of WORKSPACE](/versions/7.7.3/external/overview#workspace-shortcomings), Bzlmod is going to replace the legacy WORKSPACE system in future Bazel releases. This guide helps you migrate your project to Bzlmod and drop WORKSPACE for fetching external dependencies. @@ -44,7 +44,7 @@ * **WORKSPACE** - The [`workspace`](/versions/7.7.1/rules/lib/globals/workspace#workspace) function is used + The [`workspace`](/versions/7.7.3/rules/lib/globals/workspace#workspace) function is used to specify a repository name for your workspace. This allows a target `//foo:bar` in the workspace to be referenced as `@<workspace name>//foo:bar`. If not specified, the default repository name for your @@ -60,10 +60,10 @@ It's recommended to reference targets in the same workspace with the `//foo:bar` syntax without `@<repo name>`. But if you do need the old syntax , you can use the module name specified by the - [`module`](/versions/7.7.1/rules/lib/globals/module#module) function as the repository + [`module`](/versions/7.7.3/rules/lib/globals/module#module) function as the repository name. If the module name is different from the needed repository name, you can use `repo_name` attribute of the - [`module`](/versions/7.7.1/rules/lib/globals/module#module) function to override the + [`module`](/versions/7.7.3/rules/lib/globals/module#module) function to override the repository name. ```python @@ -82,8 +82,8 @@ * **WORKSPACE** With WORKSPACE, it's common to use the - [`http_archive`](/versions/7.7.1/rules/lib/repo/http#http_archive) or - [`git_repository`](/versions/7.7.1/rules/lib/repo/git#git_repository) repository rules to + [`http_archive`](/versions/7.7.3/rules/lib/repo/http#http_archive) or + [`git_repository`](/versions/7.7.3/rules/lib/repo/git#git_repository) repository rules to download the sources of the Bazel project. ```python @@ -115,8 +115,8 @@ * **Bzlmod** - With Bzlmod, as long as the your dependency is available in [Bazel Central Registry](https://registry.bazel.build) or your custom [Bazel registry](/versions/7.7.1/external/registry), you can simply depend on it with a - [`bazel_dep`](/versions/7.7.1/rules/lib/globals/module#bazel_dep) directive. + With Bzlmod, as long as the your dependency is available in [Bazel Central Registry](https://registry.bazel.build) or your custom [Bazel registry](/versions/7.7.3/external/registry), you can simply depend on it with a + [`bazel_dep`](/versions/7.7.3/rules/lib/globals/module#bazel_dep) directive. ```python ## MODULE.bazel @@ -133,7 +133,7 @@ As the root module, you can override Bazel module dependencies in different ways. -Please read the [overrides](/versions/7.7.1/external/module#overrides) section for more +Please read the [overrides](/versions/7.7.3/external/module#overrides) section for more information. You can find some example usages in the @@ -146,11 +146,11 @@ If your dependency is not a Bazel project or not yet available in any Bazel registry, you can introduce it using -[`use_repo_rule`](/versions/7.7.1/external/module#use_repo_rule) or [module extensions](/versions/7.7.1/external/extension). +[`use_repo_rule`](/versions/7.7.3/external/module#use_repo_rule) or [module extensions](/versions/7.7.3/external/extension). * **WORKSPACE** - Download a file using the [`http_file`](/versions/7.7.1/rules/lib/repo/http#http_file) + Download a file using the [`http_file`](/versions/7.7.3/rules/lib/repo/http#http_file) repository rule. ```python @@ -323,7 +323,7 @@ provides a great way for rules authors to enhance the rulesets that integrate package managers for specific languages. -Please read the [module extensions](/versions/7.7.1/external/extension) page to learn more +Please read the [module extensions](/versions/7.7.3/external/extension) page to learn more about how to use module extensions. Here is a list of the rulesets that already adopted Bzlmod to fetch dependencies @@ -450,7 +450,7 @@ * **Bzlmod** With Bzlmod, the - [`register_toolchains`](/versions/7.7.1/rules/lib/globals/module#register_toolchains) and + [`register_toolchains`](/versions/7.7.3/rules/lib/globals/module#register_toolchains) and [`register_execution_platforms`][register_execution_platforms] APIs are only available in the MODULE.bazel file. You cannot call `native.register_toolchains` in a module extension. @@ -473,7 +473,7 @@ 3. toolchains and execution platforms registered by modules that are (transitive) dependencies of the root module. 4. when not using `WORKSPACE.bzlmod`: toolchains registered in the `WORKSPACE` - [suffix](/versions/7.7.1/external/migration#builtin-default-deps). + [suffix](/versions/7.7.3/external/migration#builtin-default-deps). [register_execution_platforms]: /rules/lib/globals/module#register_execution_platforms @@ -486,8 +486,8 @@ * **WORKSPACE** With WORKSPACE, this is achieved by two native repository rules, - [`local_repository`](/versions/7.7.1/reference/be/workspace#local_repository) and - [`new_local_repository`](/versions/7.7.1/reference/be/workspace#new_local_repository). + [`local_repository`](/versions/7.7.3/reference/be/workspace#local_repository) and + [`new_local_repository`](/versions/7.7.3/reference/be/workspace#new_local_repository). ```python ## WORKSPACE @@ -500,7 +500,7 @@ * **Bzlmod** With Bzlmod, you can use - [`local_path_override`](/versions/7.7.1/rules/lib/globals/module#local_path_override) to + [`local_path_override`](/versions/7.7.3/rules/lib/globals/module#local_path_override) to override a module with a local path. ```python @@ -528,7 +528,7 @@ ### Bind targets {#bind-targets} -The [`bind`](/versions/7.7.1/reference/be/workspace#bind) rule in WORKSPACE is deprecated and +The [`bind`](/versions/7.7.3/reference/be/workspace#bind) rule in WORKSPACE is deprecated and not supported in Bzlmod. It was introduced to give a target an alias in the special `//external` package. All users depending on this should migrate away. @@ -548,7 +548,7 @@ * Replace all usages of `//external:openssl` with `@my-ssl//src:openssl-lib`. -* Or use the [`alias`](/versions/7.7.1/reference/be/general#alias) build rule +* Or use the [`alias`](/versions/7.7.3/reference/be/general#alias) build rule * Define the following target in a package (e.g. `//third_party`) ```python @@ -652,7 +652,7 @@ if a WORKSPACE.bzlmod file also exists at the workspace root: * `WORKSPACE.bzlmod` takes effect and the content of `WORKSPACE` is ignored. -* No [prefixes or suffixes](/versions/7.7.1/external/migration#builtin-default-deps) are +* No [prefixes or suffixes](/versions/7.7.3/external/migration#builtin-default-deps) are added to the WORKSPACE.bzlmod file. Using the WORKSPACE.bzlmod file can make the migration easier because: @@ -669,7 +669,7 @@ #### Repository visibility {#repository-visibility} Bzlmod is able to control which other repositories are visible from a given -repository, check [repository names and strict deps](/versions/7.7.1/external/module#repository_names_and_strict_deps) for more details. +repository, check [repository names and strict deps](/versions/7.7.3/external/module#repository_names_and_strict_deps) for more details. Here is a summary of repository visibilities from different types of repositories when also taking WORKSPACE into consideration. @@ -682,11 +682,11 @@ | WORKSPACE Repos | All visible | Not visible | Not visible | All visible | Note: For the root module, if a repository `@foo` is defined in WORKSPACE and -`@foo` is also used as an [apparent repository name](/versions/7.7.1/external/overview#apparent-repo-name) in MODULE.bazel, then `@foo` +`@foo` is also used as an [apparent repository name](/versions/7.7.3/external/overview#apparent-repo-name) in MODULE.bazel, then `@foo` refers to the one introduced in MODULE.bazel. Note: For a module extension generated repository `@bar`, if `@foo` is used as -an [apparent repository name](/versions/7.7.1/external/overview#apparent-repo-name) of +an [apparent repository name](/versions/7.7.3/external/overview#apparent-repo-name) of another repository generated by the same module extension and direct dependencies of the module hosting the module extension, then for repository `@bar`, `@foo` refers to the latter. @@ -766,8 +766,8 @@ archive with reduced size by stripping out unnecessary sources, please make sure the stripped source tree is a subset of the original source tree. This makes it easier for end users to override the module to a non-release - version by [`archive_override`](/versions/7.7.1/rules/lib/globals/module#archive_override) - and [`git_override`](/versions/7.7.1/rules/lib/globals/module#git_override). + version by [`archive_override`](/versions/7.7.3/rules/lib/globals/module#archive_override) + and [`git_override`](/versions/7.7.3/rules/lib/globals/module#git_override). * **Include a test module in a subdirectory that tests your most common APIs.** @@ -804,8 +804,8 @@ #### Specify dev dependencies You can set the `dev_dependency` attribute to true for -[`bazel_dep`](/versions/7.7.1/rules/lib/globals/module#bazel_dep) and -[`use_extension`](/versions/7.7.1/rules/lib/globals/module#use_extension) directives so that +[`bazel_dep`](/versions/7.7.3/rules/lib/globals/module#bazel_dep) and +[`use_extension`](/versions/7.7.3/rules/lib/globals/module#use_extension) directives so that they don't propagate to dependent projects. As the root module, you can use the [`--ignore_dev_dependency`][ignore_dev_dep_flag] flag to verify if your targets still build without dev dependencies and overrides.
diff --git a/docs/versions/7.7.1/external/mod-command.mdx b/docs/versions/7.7.3/external/mod-command.mdx similarity index 98% rename from docs/versions/7.7.1/external/mod-command.mdx rename to docs/versions/7.7.3/external/mod-command.mdx index bb7e62d..69b8291 100644 --- a/docs/versions/7.7.1/external/mod-command.mdx +++ b/docs/versions/7.7.3/external/mod-command.mdx
@@ -62,9 +62,9 @@ * `<name>`: All present versions of the module `<name>`. -* `@<repo_name>`: The repo with the given [apparent name](/versions/7.7.1/external/overview#apparent-repo-name) in the context of the `--base_module`. +* `@<repo_name>`: The repo with the given [apparent name](/versions/7.7.3/external/overview#apparent-repo-name) in the context of the `--base_module`. -* `@@<repo_name>`: The repo with the given [canonical name](/versions/7.7.1/external/overview#canonical-repo-name). +* `@@<repo_name>`: The repo with the given [canonical name](/versions/7.7.3/external/overview#canonical-repo-name). In a context requiring specifying modules, `<arg>`s referring to repos that correspond to modules (as opposed to extension-generated repos) can also be @@ -86,7 +86,7 @@ information about the version resolution of each module. If the module version changed during resolution, show either which version replaced it or what was the original version, the reason it was replaced, and which modules - requested the new version if the reason was [Minimal Version Selection](/versions/7.7.1/external/module#version-selection). + requested the new version if the reason was [Minimal Version Selection](/versions/7.7.3/external/module#version-selection). * `--include_unused` *default: "false"*: Include in the output graph the modules which were originally present in the dependency graph, but became
diff --git a/docs/versions/7.7.1/external/module.mdx b/docs/versions/7.7.3/external/module.mdx similarity index 89% rename from docs/versions/7.7.1/external/module.mdx rename to docs/versions/7.7.3/external/module.mdx index 89e652b..6bfcbd3 100644 --- a/docs/versions/7.7.1/external/module.mdx +++ b/docs/versions/7.7.3/external/module.mdx
@@ -18,12 +18,12 @@ bazel_dep(name = "protobuf", version = "3.19.0") ``` -See the [full list](/versions/7.7.1/rules/lib/globals/module) of directives available in +See the [full list](/versions/7.7.3/rules/lib/globals/module) of directives available in `MODULE.bazel` files. To perform module resolution, Bazel starts by reading the root module's `MODULE.bazel` file, and then repeatedly requests any dependency's -`MODULE.bazel` file from a [Bazel registry](/versions/7.7.1/external/registry) until it +`MODULE.bazel` file from a [Bazel registry](/versions/7.7.3/external/registry) until it discovers the entire dependency graph. By default, Bazel then [selects](#version-selection) one version of each module @@ -83,7 +83,7 @@ (such as for security vulnerabilities). Bazel throws an error when selecting a yanked version of a module. To fix this error, either upgrade to a newer, non-yanked version, or use the -[`--allow_yanked_versions`](/versions/7.7.1/reference/command-line-reference#flag--allow_yanked_versions) +[`--allow_yanked_versions`](/versions/7.7.3/reference/command-line-reference#flag--allow_yanked_versions) flag to explicitly allow the yanked version. ## Compatibility level @@ -115,14 +115,14 @@ ### Single-version override -The [`single_version_override`](/versions/7.7.1/rules/lib/globals/module#single_version_override) +The [`single_version_override`](/versions/7.7.3/rules/lib/globals/module#single_version_override) serves multiple purposes: * With the `version` attribute, you can pin a dependency to a specific version, regardless of which versions of the dependency are requested in the dependency graph. * With the `registry` attribute, you can force this dependency to come from a - specific registry, instead of following the normal [registry selection](/versions/7.7.1/external/registry#selecting_registries) process. + specific registry, instead of following the normal [registry selection](/versions/7.7.3/external/registry#selecting_registries) process. * With the `patch*` attributes, you can specify a set of patches to apply to the downloaded module. @@ -130,7 +130,7 @@ ### Multiple-version override -A [`multiple_version_override`](/versions/7.7.1/rules/lib/globals/module#multiple_version_override) +A [`multiple_version_override`](/versions/7.7.3/rules/lib/globals/module#multiple_version_override) can be specified to allow multiple versions of the same module to coexist in the resolved dependency graph. @@ -165,9 +165,9 @@ Bazel supports the following non-registry overrides: -* [`archive_override`](/versions/7.7.1/rules/lib/globals/module#archive_override) -* [`git_override`](/versions/7.7.1/rules/lib/globals/module#git_override) -* [`local_path_override`](/versions/7.7.1/rules/lib/globals/module#local_path_override) +* [`archive_override`](/versions/7.7.3/rules/lib/globals/module#archive_override) +* [`git_override`](/versions/7.7.3/rules/lib/globals/module#git_override) +* [`local_path_override`](/versions/7.7.3/rules/lib/globals/module#local_path_override) ## Define repos that don't represent Bazel modules {#use_repo_rule} @@ -175,36 +175,36 @@ Sometimes there is a need to define a repo that does _not_ represent a Bazel module; for example, one that contains a plain JSON file to be read as data. -In this case, you could use the [`use_repo_rule` directive](/versions/7.7.1/rules/lib/globals/module#use_repo_rule) to directly define a repo +In this case, you could use the [`use_repo_rule` directive](/versions/7.7.3/rules/lib/globals/module#use_repo_rule) to directly define a repo by invoking a repo rule. This repo will only be visible to the module it's defined in. -Under the hood, this is implemented using the same mechanism as [module extensions](/versions/7.7.1/external/extension), which lets you define repos with more +Under the hood, this is implemented using the same mechanism as [module extensions](/versions/7.7.3/external/extension), which lets you define repos with more flexibility. ## Repository names and strict deps -The [apparent name](/versions/7.7.1/external/overview#apparent-repo-name) of a repo backing a +The [apparent name](/versions/7.7.3/external/overview#apparent-repo-name) of a repo backing a module to its direct dependents defaults to its module name, unless the -`repo_name` attribute of the [`bazel_dep`](/versions/7.7.1/rules/lib/globals/module#bazel_dep) +`repo_name` attribute of the [`bazel_dep`](/versions/7.7.3/rules/lib/globals/module#bazel_dep) directive says otherwise. Note that this means a module can only find its direct dependencies. This helps prevent accidental breakages due to changes in transitive dependencies. -The [canonical name](/versions/7.7.1/external/overview#canonical-repo-name) of a repo backing a +The [canonical name](/versions/7.7.3/external/overview#canonical-repo-name) of a repo backing a module is either `module_name~version` (for example, `bazel_skylib~1.0.3`) or `module_name~` (for example, `bazel_features~`), depending on whether there are multiple versions of the module in the entire dependency graph (see -[`multiple_version_override`](/versions/7.7.1/rules/lib/globals/module#multiple_version_override)). +[`multiple_version_override`](/versions/7.7.3/rules/lib/globals/module#multiple_version_override)). Note that **the canonical name format** is not an API you should depend on and **is subject to change at any time**. Instead of hard-coding the canonical name, use a supported way to get it directly from Bazel: * In BUILD and `.bzl` files, use - [`Label.repo_name`](/versions/7.7.1/rules/lib/builtins/Label#repo_name) on a `Label` instance + [`Label.repo_name`](/versions/7.7.3/rules/lib/builtins/Label#repo_name) on a `Label` instance constructed from a label string given by the apparent name of the repo, e.g., `Label("@bazel_skylib").repo_name`. * When looking up runfiles, use - [`$(rlocationpath ...)`](https://bazel.build/versions/7.7.1/reference/be/make-variables#predefined_label_variables) + [`$(rlocationpath ...)`](https://bazel.build/versions/7.7.3/reference/be/make-variables#predefined_label_variables) or one of the runfiles libraries in `@bazel_tools//tools/{bash,cpp,java}/runfiles` or, for a ruleset `rules_foo`, in `@rules_foo//foo/runfiles`. @@ -212,5 +212,5 @@ server, use the `bazel mod dump_repo_mapping` command to get the mapping from apparent names to canonical names for a given set of repositories. -[Module extensions](/versions/7.7.1/external/extension) can also introduce additional repos +[Module extensions](/versions/7.7.3/external/extension) can also introduce additional repos into the visible scope of a module.
diff --git a/docs/versions/7.7.1/external/overview.mdx b/docs/versions/7.7.3/external/overview.mdx similarity index 92% rename from docs/versions/7.7.1/external/overview.mdx rename to docs/versions/7.7.3/external/overview.mdx index f3154c0..26d740a 100644 --- a/docs/versions/7.7.1/external/overview.mdx +++ b/docs/versions/7.7.3/external/overview.mdx
@@ -12,7 +12,7 @@ the newer module-focused [`MODULE.bazel` system](#bzlmod) (codenamed *Bzlmod*, and enabled with the flag `--enable_bzlmod`). The two systems can be used together, but Bzlmod is replacing the `WORKSPACE` system in future Bazel -releases, check the [Bzlmod migration guide](/versions/7.7.1/external/migration) on how to +releases, check the [Bzlmod migration guide](/versions/7.7.3/external/migration) on how to migrate. This document explains the concepts surrounding external dependency management @@ -76,13 +76,13 @@ `java_import` target", or simply "symlink a local directory". Every repo is **defined** by calling a repo rule with an appropriate number of arguments. -See [Repository rules](/versions/7.7.1/extending/repo) for more information about how to write +See [Repository rules](/versions/7.7.3/extending/repo) for more information about how to write your own repository rules. The most common repo rules by far are -[`http_archive`](/versions/7.7.1/rules/lib/repo/http#http_archive), which downloads an archive +[`http_archive`](/versions/7.7.3/rules/lib/repo/http#http_archive), which downloads an archive from a URL and extracts it, and -[`local_repository`](/versions/7.7.1/reference/be/workspace#local_repository), which symlinks a +[`local_repository`](/versions/7.7.3/reference/be/workspace#local_repository), which symlinks a local directory that is already a Bazel repository. ### Fetch a repository {#fetch-repository} @@ -104,13 +104,13 @@ version of the dependency, and if none exists, the command will result in failure. -See [fetch options](/versions/7.7.1/reference/command-line-reference#fetch-options) for more +See [fetch options](/versions/7.7.3/reference/command-line-reference#fetch-options) for more information about controlling fetch. ### Directory layout {#directory-layout} After being fetched, the repo can be found in the subdirectory `external` in the -[output base](/versions/7.7.1/remote/output-directories), under its canonical name. +[output base](/versions/7.7.3/remote/output-directories), under its canonical name. You can run the following command to see the contents of the repo with the canonical name `canonical_name`: @@ -128,7 +128,7 @@ The syntax of a `REPO.bazel` file is similar to `BUILD` files, except that no `load` statements are supported, and only a single function, `repo()`, is -available. `repo()` takes the same arguments as the [`package()` function](/versions/7.7.1/reference/be/functions#package) in `BUILD` files; whereas `package()` +available. `repo()` takes the same arguments as the [`package()` function](/versions/7.7.3/reference/be/functions#package) in `BUILD` files; whereas `package()` specifies common attributes for all build targets inside the package, `repo()` analogously does so for all build targets inside the repo. @@ -147,7 +147,7 @@ definitions. Instead, it builds a dependency graph from _modules_, runs _extensions_ on top of the graph, and defines repos accordingly. -A [Bazel **module**](/versions/7.7.1/external/module) is a Bazel project that can have multiple +A [Bazel **module**](/versions/7.7.3/external/module) is a Bazel project that can have multiple versions, each of which publishes metadata about other modules that it depends on. A module must have a `MODULE.bazel` file at its repo root, next to the `WORKSPACE` file. This file is the module's manifest, declaring its name, @@ -162,7 +162,7 @@ ``` A module must only list its direct dependencies, which Bzlmod looks up in a -[Bazel registry](/versions/7.7.1/external/registry) — by default, the [Bazel Central Registry](https://bcr.bazel.build/). The registry provides the +[Bazel registry](/versions/7.7.3/external/registry) — by default, the [Bazel Central Registry](https://bcr.bazel.build/). The registry provides the dependencies' `MODULE.bazel` files, which allows Bazel to discover the entire transitive dependency graph before performing version resolution. @@ -171,7 +171,7 @@ (in most cases, using `http_archive`). Modules can also specify customized pieces of data called *tags*, which are -consumed by [**module extensions**](/versions/7.7.1/external/extension) after module resolution +consumed by [**module extensions**](/versions/7.7.3/external/extension) after module resolution to define additional repos. These extensions have capabilities similar to repo rules, enabling them to perform actions like file I/O and sending network requests. Among other things, they allow Bazel to interact with other package @@ -208,7 +208,7 @@ system, by default, the canonical name of a repo is also its apparent name to all other repos. -See the [full list](/versions/7.7.1/rules/lib/globals/workspace) of functions available in +See the [full list](/versions/7.7.3/rules/lib/globals/workspace) of functions available in `WORKSPACE` files. ### Shortcomings of the `WORKSPACE` system {#workspace-shortcomings} @@ -233,4 +233,4 @@ `B` and `C`; `B` and `C` both depend on different versions of `D`). Due to the shortcomings of WORKSPACE, Bzlmod is going to replace the legacy -WORKSPACE system in future Bazel releases. Please read the [Bzlmod migration guide](/versions/7.7.1/external/migration) on how to migrate to Bzlmod. \ No newline at end of file +WORKSPACE system in future Bazel releases. Please read the [Bzlmod migration guide](/versions/7.7.3/external/migration) on how to migrate to Bzlmod. \ No newline at end of file
diff --git a/docs/versions/7.7.1/external/registry.mdx b/docs/versions/7.7.3/external/registry.mdx similarity index 96% rename from docs/versions/7.7.1/external/registry.mdx rename to docs/versions/7.7.3/external/registry.mdx index adc7764..5521799 100644 --- a/docs/versions/7.7.1/external/registry.mdx +++ b/docs/versions/7.7.3/external/registry.mdx
@@ -42,7 +42,7 @@ project * `versions`: A list of all the versions of this module to be found in this registry - * `yanked_versions`: A map of [*yanked* versions](/versions/7.7.1/external/module#yanked_versions) of this module. The keys + * `yanked_versions`: A map of [*yanked* versions](/versions/7.7.3/external/module#yanked_versions) of this module. The keys should be versions to yank and the values should be descriptions of why the version is yanked, ideally containing a link to more information @@ -100,7 +100,7 @@ * `versions`: An array of strings, each denoting a version of the module available in this registry. This array should match the children of the module directory. -* `yanked_versions`: A JSON object specifying the [*yanked* versions](/versions/7.7.1/external/module#yanked_versions) of this module. The keys +* `yanked_versions`: A JSON object specifying the [*yanked* versions](/versions/7.7.3/external/module#yanked_versions) of this module. The keys should be versions to yank, and the values should be descriptions of why the version is yanked, ideally containing a link to more information. @@ -114,7 +114,7 @@ field, which defaults to `archive`. * If `type` is `archive` (the default), this module version is backed by an - [`http_archive`](/versions/7.7.1/rules/lib/repo/http#http_archive) repo rule; it's fetched + [`http_archive`](/versions/7.7.3/rules/lib/repo/http#http_archive) repo rule; it's fetched by downloading an archive from a given URL and extracting its contents. It supports the following fields: * `url`: A string, the URL of the source archive @@ -137,16 +137,16 @@ * `patch_strip`: A number; the same as the `--strip` argument of Unix `patch`. * `archive_type`: A string, the archive type of the downloaded file (Same - as [`type` on `http_archive`](/versions/7.7.1/rules/lib/repo/http#http_archive-type)). + as [`type` on `http_archive`](/versions/7.7.3/rules/lib/repo/http#http_archive-type)). * If `type` is `git_repository`, this module version is backed by a - [`git_repository`](/versions/7.7.1/rules/lib/repo/git#git_repository) repo rule; it's + [`git_repository`](/versions/7.7.3/rules/lib/repo/git#git_repository) repo rule; it's fetched by cloning a Git repository. * The following fields are supported, and are directly forwarded to the underlying `git_repository` repo rule: `remote`, `commit`, `shallow_since`, `tag`, `init_submodules`, `verbose`, and `strip_prefix`. * If `type` is `local_path`, this module version is backed by a - [`local_repository`](/versions/7.7.1/rules/lib/repo/local#local_repository) repo rule; + [`local_repository`](/versions/7.7.3/rules/lib/repo/local#local_repository) repo rule; it's symlinked to a directory on local disk. It supports the following field: * `path`: The local path to the repo, calculated as following:
diff --git a/docs/versions/7.7.1/external/vendor.mdx b/docs/versions/7.7.3/external/vendor.mdx similarity index 95% rename from docs/versions/7.7.1/external/vendor.mdx rename to docs/versions/7.7.3/external/vendor.mdx index 89ed087..d3005b6 100644 --- a/docs/versions/7.7.1/external/vendor.mdx +++ b/docs/versions/7.7.3/external/vendor.mdx
@@ -23,7 +23,7 @@ ## Vendor a specific external repository {#vendor-specific-repository} You can use the `vendor` command with the `--repo` flag to specify which repo -to vendor, it accepts both [canonical repo name](/versions/7.7.1/external/overview#canonical-repo-name) and [apparent repo name](/versions/7.7.1/external/overview#apparent-repo-name). +to vendor, it accepts both [canonical repo name](/versions/7.7.3/external/overview#canonical-repo-name) and [apparent repo name](/versions/7.7.3/external/overview#apparent-repo-name). For example, running: @@ -99,7 +99,7 @@ under the vendor directory. There are two directives available, both accepting a list of -[canonical repo names](/versions/7.7.1/external/overview#canonical-repo-name) as arguments: +[canonical repo names](/versions/7.7.3/external/overview#canonical-repo-name) as arguments: - `ignore()`: to completely ignore a repository from vendor mode. - `pin()`: to pin a repository to its current vendored source as if there is a @@ -124,8 +124,8 @@ first. Note: Repository rules with -[`local`](/versions/7.7.1/rules/lib/globals/bzl#repository_rule.local) or -[`configure`](/versions/7.7.1/rules/lib/globals/bzl#repository_rule.configure) set to true are +[`local`](/versions/7.7.3/rules/lib/globals/bzl#repository_rule.local) or +[`configure`](/versions/7.7.3/rules/lib/globals/bzl#repository_rule.configure) set to true are always excluded from vendoring. ## Understand how vendor mode works {#how-vendor-mode-works}
diff --git a/docs/versions/7.7.1/help.mdx b/docs/versions/7.7.3/help.mdx similarity index 94% rename from docs/versions/7.7.1/help.mdx rename to docs/versions/7.7.3/help.mdx index 47ae230..86a4c26 100644 --- a/docs/versions/7.7.1/help.mdx +++ b/docs/versions/7.7.3/help.mdx
@@ -36,11 +36,11 @@ * Starting a discussion on [GitHub](https://github.com/bazelbuild/bazel/discussions) * Asking a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/bazel) * Chatting with other Bazel contributors on [Slack](https://slack.bazel.build/) -* Consulting a [Bazel community expert](/versions/7.7.1/community/experts) +* Consulting a [Bazel community expert](/versions/7.7.3/community/experts) ## Understand Bazel's support level {#support-level} -Please read the [release page](/versions/7.7.1/release) to understand Bazel's release model and +Please read the [release page](/versions/7.7.3/release) to understand Bazel's release model and what level of support Bazel provides. ## File a bug {#file-bug}
diff --git a/docs/versions/7.7.1/images/about.svg b/docs/versions/7.7.3/images/about.svg similarity index 100% rename from docs/versions/7.7.1/images/about.svg rename to docs/versions/7.7.3/images/about.svg
diff --git a/docs/versions/7.7.1/images/basics.svg b/docs/versions/7.7.3/images/basics.svg similarity index 100% rename from docs/versions/7.7.1/images/basics.svg rename to docs/versions/7.7.3/images/basics.svg
diff --git a/docs/versions/7.7.1/images/bazel_hero.svg b/docs/versions/7.7.3/images/bazel_hero.svg similarity index 100% rename from docs/versions/7.7.1/images/bazel_hero.svg rename to docs/versions/7.7.3/images/bazel_hero.svg
diff --git a/docs/versions/7.7.1/images/community.svg b/docs/versions/7.7.3/images/community.svg similarity index 100% rename from docs/versions/7.7.1/images/community.svg rename to docs/versions/7.7.3/images/community.svg
diff --git a/docs/versions/7.7.1/images/distributed-build-remote-cache.png b/docs/versions/7.7.3/images/distributed-build-remote-cache.png similarity index 100% rename from docs/versions/7.7.1/images/distributed-build-remote-cache.png rename to docs/versions/7.7.3/images/distributed-build-remote-cache.png Binary files differ
diff --git a/docs/versions/7.7.1/images/essential_guide.svg b/docs/versions/7.7.3/images/essential_guide.svg similarity index 100% rename from docs/versions/7.7.1/images/essential_guide.svg rename to docs/versions/7.7.3/images/essential_guide.svg
diff --git a/docs/versions/7.7.1/images/essential_reference.svg b/docs/versions/7.7.3/images/essential_reference.svg similarity index 100% rename from docs/versions/7.7.1/images/essential_reference.svg rename to docs/versions/7.7.3/images/essential_reference.svg
diff --git a/docs/versions/7.7.1/images/essential_start.svg b/docs/versions/7.7.3/images/essential_start.svg similarity index 100% rename from docs/versions/7.7.1/images/essential_start.svg rename to docs/versions/7.7.3/images/essential_start.svg
diff --git a/docs/versions/7.7.1/images/extend.svg b/docs/versions/7.7.3/images/extend.svg similarity index 100% rename from docs/versions/7.7.1/images/extend.svg rename to docs/versions/7.7.3/images/extend.svg
diff --git a/docs/versions/7.7.1/images/guide.svg b/docs/versions/7.7.3/images/guide.svg similarity index 100% rename from docs/versions/7.7.1/images/guide.svg rename to docs/versions/7.7.3/images/guide.svg
diff --git a/docs/versions/7.7.1/images/high-level-build-system.png b/docs/versions/7.7.3/images/high-level-build-system.png similarity index 100% rename from docs/versions/7.7.1/images/high-level-build-system.png rename to docs/versions/7.7.3/images/high-level-build-system.png Binary files differ
diff --git a/docs/versions/7.7.1/images/new_1.svg b/docs/versions/7.7.3/images/new_1.svg similarity index 100% rename from docs/versions/7.7.1/images/new_1.svg rename to docs/versions/7.7.3/images/new_1.svg
diff --git a/docs/versions/7.7.1/images/new_2.svg b/docs/versions/7.7.3/images/new_2.svg similarity index 100% rename from docs/versions/7.7.1/images/new_2.svg rename to docs/versions/7.7.3/images/new_2.svg
diff --git a/docs/versions/7.7.1/images/new_3.svg b/docs/versions/7.7.3/images/new_3.svg similarity index 100% rename from docs/versions/7.7.1/images/new_3.svg rename to docs/versions/7.7.3/images/new_3.svg
diff --git a/docs/versions/7.7.1/images/placeholder.png b/docs/versions/7.7.3/images/placeholder.png similarity index 100% rename from docs/versions/7.7.1/images/placeholder.png rename to docs/versions/7.7.3/images/placeholder.png Binary files differ
diff --git a/docs/versions/7.7.1/images/reference.svg b/docs/versions/7.7.3/images/reference.svg similarity index 100% rename from docs/versions/7.7.1/images/reference.svg rename to docs/versions/7.7.3/images/reference.svg
diff --git a/docs/versions/7.7.1/images/release_notes.svg b/docs/versions/7.7.3/images/release_notes.svg similarity index 100% rename from docs/versions/7.7.1/images/release_notes.svg rename to docs/versions/7.7.3/images/release_notes.svg
diff --git a/docs/versions/7.7.1/images/remote-execution-system.png b/docs/versions/7.7.3/images/remote-execution-system.png similarity index 100% rename from docs/versions/7.7.1/images/remote-execution-system.png rename to docs/versions/7.7.3/images/remote-execution-system.png Binary files differ
diff --git a/docs/versions/7.7.1/images/start.svg b/docs/versions/7.7.3/images/start.svg similarity index 100% rename from docs/versions/7.7.1/images/start.svg rename to docs/versions/7.7.3/images/start.svg
diff --git a/docs/versions/7.7.1/images/task-dependencies.png b/docs/versions/7.7.3/images/task-dependencies.png similarity index 100% rename from docs/versions/7.7.1/images/task-dependencies.png rename to docs/versions/7.7.3/images/task-dependencies.png Binary files differ
diff --git a/docs/versions/7.7.1/images/test.png b/docs/versions/7.7.3/images/test.png similarity index 100% rename from docs/versions/7.7.1/images/test.png rename to docs/versions/7.7.3/images/test.png Binary files differ
diff --git a/docs/versions/7.7.1/images/transitive-dependencies.png b/docs/versions/7.7.3/images/transitive-dependencies.png similarity index 100% rename from docs/versions/7.7.1/images/transitive-dependencies.png rename to docs/versions/7.7.3/images/transitive-dependencies.png Binary files differ
diff --git a/docs/versions/7.7.1/images/trunk-logo-dark.svg b/docs/versions/7.7.3/images/trunk-logo-dark.svg similarity index 100% rename from docs/versions/7.7.1/images/trunk-logo-dark.svg rename to docs/versions/7.7.3/images/trunk-logo-dark.svg
diff --git a/docs/versions/7.7.1/images/why_faq.svg b/docs/versions/7.7.3/images/why_faq.svg similarity index 100% rename from docs/versions/7.7.1/images/why_faq.svg rename to docs/versions/7.7.3/images/why_faq.svg
diff --git a/docs/versions/7.7.1/images/why_overview.svg b/docs/versions/7.7.3/images/why_overview.svg similarity index 100% rename from docs/versions/7.7.1/images/why_overview.svg rename to docs/versions/7.7.3/images/why_overview.svg
diff --git a/docs/versions/7.7.1/images/why_vision.svg b/docs/versions/7.7.3/images/why_vision.svg similarity index 100% rename from docs/versions/7.7.1/images/why_vision.svg rename to docs/versions/7.7.3/images/why_vision.svg
diff --git a/docs/versions/7.7.1/install/bazelisk.mdx b/docs/versions/7.7.3/install/bazelisk.mdx similarity index 95% rename from docs/versions/7.7.1/install/bazelisk.mdx rename to docs/versions/7.7.3/install/bazelisk.mdx index 5ab2f98..175ba20 100644 --- a/docs/versions/7.7.1/install/bazelisk.mdx +++ b/docs/versions/7.7.3/install/bazelisk.mdx
@@ -15,8 +15,8 @@ ## Updating Bazel -Bazel has a [backward compatibility policy](/versions/7.7.1/release/backward-compatibility) -(see [guidance for rolling out incompatible changes](/versions/7.7.1/contribute/breaking-changes) if you +Bazel has a [backward compatibility policy](/versions/7.7.3/release/backward-compatibility) +(see [guidance for rolling out incompatible changes](/versions/7.7.3/contribute/breaking-changes) if you are the author of one). That page summarizes best practices on how to test and migrate your project with upcoming incompatible changes and how to provide feedback to the incompatible change authors.
diff --git a/docs/versions/7.7.1/install/compile-source.mdx b/docs/versions/7.7.3/install/compile-source.mdx similarity index 98% rename from docs/versions/7.7.1/install/compile-source.mdx rename to docs/versions/7.7.3/install/compile-source.mdx index 061badd..4c73c67 100644 --- a/docs/versions/7.7.1/install/compile-source.mdx +++ b/docs/versions/7.7.3/install/compile-source.mdx
@@ -45,7 +45,7 @@ **Reason**: To build Bazel from a GitHub source tree, you need a pre-existing Bazel binary. You can install one from a package manager or download one from -GitHub. See [Installing Bazel](/versions/7.7.1/install). (Or you can [build from scratch (bootstrap)](#bootstrap-bazel).) +GitHub. See [Installing Bazel](/versions/7.7.3/install). (Or you can [build from scratch (bootstrap)](#bootstrap-bazel).) **Troubleshooting**: @@ -173,7 +173,7 @@ 2. Unpack the distribution archive somewhere on disk. You should verify the signature made by Bazel's - [release key](https://bazel.build/versions/7.7.1/bazel-release.pub.gpg) 3D5919B448457EE0. + [release key](https://bazel.build/versions/7.7.3/bazel-release.pub.gpg) 3D5919B448457EE0. ### Step 2a: Bootstrap Bazel on Ubuntu Linux, macOS, and other Unix-like systems {#bootstrap-unix-overview}
diff --git a/docs/versions/7.7.1/install/completion.mdx b/docs/versions/7.7.3/install/completion.mdx similarity index 98% rename from docs/versions/7.7.1/install/completion.mdx rename to docs/versions/7.7.3/install/completion.mdx index 1df7cf6..27ea318 100644 --- a/docs/versions/7.7.1/install/completion.mdx +++ b/docs/versions/7.7.3/install/completion.mdx
@@ -40,7 +40,7 @@ source /path/to/bazel-complete.bash ``` -* Via [bootstrapping](/versions/7.7.1/install/compile-source), then: +* Via [bootstrapping](/versions/7.7.3/install/compile-source), then: 1. Build the completion script: ```
diff --git a/docs/versions/7.7.1/install/docker-container.mdx b/docs/versions/7.7.3/install/docker-container.mdx similarity index 100% rename from docs/versions/7.7.1/install/docker-container.mdx rename to docs/versions/7.7.3/install/docker-container.mdx
diff --git a/docs/versions/7.7.1/install/ide.mdx b/docs/versions/7.7.3/install/ide.mdx similarity index 100% rename from docs/versions/7.7.1/install/ide.mdx rename to docs/versions/7.7.3/install/ide.mdx
diff --git a/docs/versions/7.7.1/install/images/bazelisk.svg b/docs/versions/7.7.3/install/images/bazelisk.svg similarity index 100% rename from docs/versions/7.7.1/install/images/bazelisk.svg rename to docs/versions/7.7.3/install/images/bazelisk.svg
diff --git a/docs/versions/7.7.1/install/images/cli.svg b/docs/versions/7.7.3/install/images/cli.svg similarity index 100% rename from docs/versions/7.7.1/install/images/cli.svg rename to docs/versions/7.7.3/install/images/cli.svg
diff --git a/docs/versions/7.7.1/install/images/docker.svg b/docs/versions/7.7.3/install/images/docker.svg similarity index 100% rename from docs/versions/7.7.1/install/images/docker.svg rename to docs/versions/7.7.3/install/images/docker.svg
diff --git a/docs/versions/7.7.1/install/images/github.svg b/docs/versions/7.7.3/install/images/github.svg similarity index 100% rename from docs/versions/7.7.1/install/images/github.svg rename to docs/versions/7.7.3/install/images/github.svg
diff --git a/docs/versions/7.7.1/install/images/install.svg b/docs/versions/7.7.3/install/images/install.svg similarity index 100% rename from docs/versions/7.7.1/install/images/install.svg rename to docs/versions/7.7.3/install/images/install.svg
diff --git a/docs/versions/7.7.1/install/images/mac.svg b/docs/versions/7.7.3/install/images/mac.svg similarity index 100% rename from docs/versions/7.7.1/install/images/mac.svg rename to docs/versions/7.7.3/install/images/mac.svg
diff --git a/docs/versions/7.7.1/install/images/redhat.svg b/docs/versions/7.7.3/install/images/redhat.svg similarity index 100% rename from docs/versions/7.7.1/install/images/redhat.svg rename to docs/versions/7.7.3/install/images/redhat.svg
diff --git a/docs/versions/7.7.1/install/images/suse.png b/docs/versions/7.7.3/install/images/suse.png similarity index 100% rename from docs/versions/7.7.1/install/images/suse.png rename to docs/versions/7.7.3/install/images/suse.png Binary files differ
diff --git a/docs/versions/7.7.1/install/images/tune.svg b/docs/versions/7.7.3/install/images/tune.svg similarity index 100% rename from docs/versions/7.7.1/install/images/tune.svg rename to docs/versions/7.7.3/install/images/tune.svg
diff --git a/docs/versions/7.7.1/install/images/ubuntu.svg b/docs/versions/7.7.3/install/images/ubuntu.svg similarity index 100% rename from docs/versions/7.7.1/install/images/ubuntu.svg rename to docs/versions/7.7.3/install/images/ubuntu.svg
diff --git a/docs/versions/7.7.1/install/images/windows.svg b/docs/versions/7.7.3/install/images/windows.svg similarity index 100% rename from docs/versions/7.7.1/install/images/windows.svg rename to docs/versions/7.7.3/install/images/windows.svg
diff --git a/docs/versions/7.7.1/install/index.mdx b/docs/versions/7.7.3/install/index.mdx similarity index 81% rename from docs/versions/7.7.1/install/index.mdx rename to docs/versions/7.7.3/install/index.mdx index 96aad89..888685c 100644 --- a/docs/versions/7.7.1/install/index.mdx +++ b/docs/versions/7.7.3/install/index.mdx
@@ -5,7 +5,7 @@ This page describes the various platforms supported by Bazel and links to the packages for more details. -[Bazelisk](/versions/7.7.1/install/bazelisk) is the recommended way to install Bazel on [Ubuntu Linux](/versions/7.7.1/install/ubuntu), [macOS](/versions/7.7.1/install/os-x), and [Windows](/versions/7.7.1/install/windows). +[Bazelisk](/versions/7.7.3/install/bazelisk) is the recommended way to install Bazel on [Ubuntu Linux](/versions/7.7.3/install/ubuntu), [macOS](/versions/7.7.3/install/os-x), and [Windows](/versions/7.7.3/install/windows). ## Community-supported packages {#community-supported-packages} @@ -19,7 +19,7 @@ * [Gentoo](https://packages.gentoo.org/packages/dev-util/bazel) * [Linuxbrew](https://github.com/Linuxbrew/homebrew-core/blob/master/Formula/bazel.rb) * [Nixpkgs](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/tools/build-managers/bazel) -* [openSUSE](/versions/7.7.1/install/suse) +* [openSUSE](/versions/7.7.3/install/suse) * [Parabola](https://www.parabola.nu/packages/?q=bazel) * [Scoop](https://github.com/scoopinstaller/scoop-main/blob/master/bucket/bazel.json) * [Raspberry Pi](https://github.com/koenvervloesem/bazel-on-arm/blob/master/README.md) @@ -28,6 +28,6 @@ * [ppc64el](https://ftp2.osuosl.org/pub/ppc64el/bazel/) -For other platforms, you can try to [compile from source](/versions/7.7.1/install/compile-source). +For other platforms, you can try to [compile from source](/versions/7.7.3/install/compile-source). [arch]: https://archlinux.org/packages/extra/x86_64/bazel/
diff --git a/docs/versions/7.7.1/install/os-x.mdx b/docs/versions/7.7.3/install/os-x.mdx similarity index 93% rename from docs/versions/7.7.1/install/os-x.mdx rename to docs/versions/7.7.3/install/os-x.mdx index 69fc6e3..a220409 100644 --- a/docs/versions/7.7.1/install/os-x.mdx +++ b/docs/versions/7.7.3/install/os-x.mdx
@@ -6,15 +6,15 @@ You can install Bazel on macOS using one of the following methods: -* *Recommended*: [Use Bazelisk](/versions/7.7.1/install/bazelisk) +* *Recommended*: [Use Bazelisk](/versions/7.7.3/install/bazelisk) * [Use Homebrew](#install-on-mac-os-x-homebrew) * [Use the binary installer](#install-with-installer-mac-os-x) -* [Compile Bazel from source](/versions/7.7.1/install/compile-source) +* [Compile Bazel from source](/versions/7.7.3/install/compile-source) Bazel comes with two completion scripts. After installing Bazel, you can: -* Access the [bash completion script](/versions/7.7.1/install/completion#bash) -* Install the [zsh completion script](/versions/7.7.1/install/completion#zsh) +* Access the [bash completion script](/versions/7.7.3/install/completion#bash) +* Install the [zsh completion script](/versions/7.7.3/install/completion#zsh) <h2 id="install-on-mac-os-x-homebrew">Installing using Homebrew</h2>
diff --git a/docs/versions/7.7.1/install/suse.mdx b/docs/versions/7.7.3/install/suse.mdx similarity index 100% rename from docs/versions/7.7.1/install/suse.mdx rename to docs/versions/7.7.3/install/suse.mdx
diff --git a/docs/versions/7.7.1/install/ubuntu.mdx b/docs/versions/7.7.3/install/ubuntu.mdx similarity index 95% rename from docs/versions/7.7.1/install/ubuntu.mdx rename to docs/versions/7.7.3/install/ubuntu.mdx index ea383df..fbfff4b 100644 --- a/docs/versions/7.7.1/install/ubuntu.mdx +++ b/docs/versions/7.7.3/install/ubuntu.mdx
@@ -17,11 +17,11 @@ Install Bazel on Ubuntu using one of the following methods: -* *Recommended*: [Use Bazelisk](/versions/7.7.1/install/bazelisk) +* *Recommended*: [Use Bazelisk](/versions/7.7.3/install/bazelisk) * [Use our custom APT repository](#install-on-ubuntu) * [Use the binary installer](#binary-installer) * [Use the Bazel Docker container](#docker-container) -* [Compile Bazel from source](/versions/7.7.1/install/compile-source) +* [Compile Bazel from source](/versions/7.7.3/install/compile-source) **Note:** For Arm-based systems, the APT repository does not contain an `arm64` release, and there is no binary installer available. Either use Bazelisk or @@ -29,8 +29,8 @@ Bazel comes with two completion scripts. After installing Bazel, you can: -* Access the [bash completion script](/versions/7.7.1/install/completion#bash) -* Install the [zsh completion script](/versions/7.7.1/install/completion#zsh) +* Access the [bash completion script](/versions/7.7.3/install/completion#bash) +* Install the [zsh completion script](/versions/7.7.3/install/completion#zsh) ## Using Bazel's apt repository {#install-on-ubuntu}
diff --git a/docs/versions/7.7.1/install/windows.mdx b/docs/versions/7.7.3/install/windows.mdx similarity index 93% rename from docs/versions/7.7.1/install/windows.mdx rename to docs/versions/7.7.3/install/windows.mdx index fa155dc..e4eefae 100644 --- a/docs/versions/7.7.1/install/windows.mdx +++ b/docs/versions/7.7.3/install/windows.mdx
@@ -27,14 +27,14 @@ ### Download Bazel {#download-bazel} -*Recommended*: [Use Bazelisk](/versions/7.7.1/install/bazelisk) +*Recommended*: [Use Bazelisk](/versions/7.7.3/install/bazelisk) Alternatively you can: * [Download the Bazel binary (`bazel-version-windows-x86_64.exe`) from GitHub](https://github.com/bazelbuild/bazel/releases). * [Install Bazel from Chocolatey](#chocolately) * [Install Bazel from Scoop](#scoop) -* [Build Bazel from source](/versions/7.7.1/install/compile-source) +* [Build Bazel from source](/versions/7.7.3/install/compile-source) ### Set up your environment {#set-environment} @@ -44,7 +44,7 @@ set PATH=%PATH%;path to the Bazel binary ``` -You can also change your system `PATH` environment variable to make it permanent. Check out how to [set environment variables](/versions/7.7.1/configure/windows#set-environment-variables). +You can also change your system `PATH` environment variable to make it permanent. Check out how to [set environment variables](/versions/7.7.3/configure/windows#set-environment-variables). ### Done {#done} @@ -60,8 +60,8 @@ * [Installing compilers and language runtimes](#install-compilers) * [Troubleshooting](#troubleshooting) -* [Best practices on Windows](/versions/7.7.1/configure/windows#best-practices) -* [Tutorials](/versions/7.7.1/start/#tutorials) +* [Best practices on Windows](/versions/7.7.3/configure/windows#best-practices) +* [Tutorials](/versions/7.7.3/start/#tutorials) ## Installing compilers and language runtimes {#install-compilers} @@ -207,7 +207,7 @@ its dependencies, such as the MSYS2 shell. This will not install Visual C++ though. -See [Chocolatey installation and package maintenance guide](/versions/7.7.1/contribute/windows-chocolatey-maintenance) for more +See [Chocolatey installation and package maintenance guide](/versions/7.7.3/contribute/windows-chocolatey-maintenance) for more information about the Chocolatey package. ### Using Scoop {#scoop} @@ -224,9 +224,9 @@ scoop install bazel ``` -See [Scoop installation and package maintenance guide](/versions/7.7.1/contribute/windows-scoop-maintenance) for more +See [Scoop installation and package maintenance guide](/versions/7.7.3/contribute/windows-scoop-maintenance) for more information about the Scoop package. ### Build from source {#build-from-source} -To build Bazel from scratch instead of installing, see [Compiling from source](/versions/7.7.1/install/compile-source). +To build Bazel from scratch instead of installing, see [Compiling from source](/versions/7.7.3/install/compile-source).
diff --git a/docs/versions/7.7.3/migrate/index.mdx b/docs/versions/7.7.3/migrate/index.mdx new file mode 100644 index 0000000..612e9c2 --- /dev/null +++ b/docs/versions/7.7.3/migrate/index.mdx
@@ -0,0 +1,9 @@ +--- +title: 'Migrating to Bazel' +--- + +This page links to migration guides for Bazel. + +* [Maven](/versions/7.7.3/migrate/maven) +* [Xcode](/versions/7.7.3/migrate/xcode) +* [CocoaPods](/versions/7.7.3/migrate/cocoapods)
diff --git a/docs/versions/7.7.1/migrate/maven.mdx b/docs/versions/7.7.3/migrate/maven.mdx similarity index 98% rename from docs/versions/7.7.1/migrate/maven.mdx rename to docs/versions/7.7.3/migrate/maven.mdx index 6c09fc0..828a6d3 100644 --- a/docs/versions/7.7.1/migrate/maven.mdx +++ b/docs/versions/7.7.3/migrate/maven.mdx
@@ -19,9 +19,9 @@ ## Before you begin {#before-you-begin} -* [Install Bazel](/versions/7.7.1/install) if it's not yet installed. +* [Install Bazel](/versions/7.7.3/install) if it's not yet installed. * If you're new to Bazel, go through the tutorial - [Introduction to Bazel: Build Java](/versions/7.7.1/start/java) before you start + [Introduction to Bazel: Build Java](/versions/7.7.3/start/java) before you start migrating. The tutorial explains Bazel's concepts, structure, and label syntax.
diff --git a/docs/versions/7.7.1/migrate/xcode.mdx b/docs/versions/7.7.3/migrate/xcode.mdx similarity index 96% rename from docs/versions/7.7.1/migrate/xcode.mdx rename to docs/versions/7.7.3/migrate/xcode.mdx index 9d75130..79146a0 100644 --- a/docs/versions/7.7.1/migrate/xcode.mdx +++ b/docs/versions/7.7.3/migrate/xcode.mdx
@@ -30,10 +30,10 @@ Before you begin, do the following: -1. [Install Bazel](/versions/7.7.1/install) if you have not already done so. +1. [Install Bazel](/versions/7.7.3/install) if you have not already done so. 2. If you're not familiar with Bazel and its concepts, complete the - [iOS app tutorial](/versions/7.7.1/start/ios-app)). You should understand the Bazel + [iOS app tutorial](/versions/7.7.3/start/ios-app)). You should understand the Bazel workspace, including the `WORKSPACE` and `BUILD` files, as well as the concepts of targets, build rules, and Bazel packages. @@ -45,7 +45,7 @@ every target in the `BUILD` file. For more information on external dependencies, see -[Working with external dependencies](/versions/7.7.1/docs/external). +[Working with external dependencies](/versions/7.7.3/docs/external). ## Build or test an Xcode project with Bazel {#build-xcode-project} @@ -101,7 +101,7 @@ * [Step 3c: Add the library target(s)](#step-3c-add-the-library-target-s) **Tip:** To learn more about packages and other Bazel concepts, see -[Workspaces, packages, and targets](/versions/7.7.1/concepts/build-ref). +[Workspaces, packages, and targets](/versions/7.7.3/concepts/build-ref). #### Step 3a: Add the application target {#add-app-target} @@ -149,7 +149,7 @@ #### Step 3c: Add the library target(s) {#add-library-target} -Add an [`objc_library`](/versions/7.7.1/reference/be/objective-c#objc_library) +Add an [`objc_library`](/versions/7.7.3/reference/be/objective-c#objc_library) target for each Objective-C library and a [`swift_library`](https://github.com/bazelbuild/rules_swift/blob/master/doc/rules.md#swift_library) target for each Swift library on which the application and/or tests depend. @@ -164,7 +164,7 @@ * List the headers in the `hdrs` attribute. -Note: You can use the [`glob`](/versions/7.7.1/reference/be/functions#glob) +Note: You can use the [`glob`](/versions/7.7.3/reference/be/functions#glob) function to include all sources and/or headers of a certain type. Use it carefully as it might include files you do not want Bazel to build.
diff --git a/docs/versions/7.7.1/query/aquery.mdx b/docs/versions/7.7.3/query/aquery.mdx similarity index 96% rename from docs/versions/7.7.1/query/aquery.mdx rename to docs/versions/7.7.3/query/aquery.mdx index eff668c..289a430 100644 --- a/docs/versions/7.7.1/query/aquery.mdx +++ b/docs/versions/7.7.3/query/aquery.mdx
@@ -41,7 +41,7 @@ * `aquery_function(...)`: functions specific to `aquery`. More details [below](#using-aquery-functions). -* `function(...)`: the standard [functions](/versions/7.7.1/query/language#functions) +* `function(...)`: the standard [functions](/versions/7.7.3/query/language#functions) as traditional `query`. * `//target` is the label to the interested target. @@ -103,7 +103,7 @@ ### Build options {#build-options} `aquery` runs on top of a regular Bazel build and thus inherits the set of -[options](/versions/7.7.1/reference/command-line-reference#build-options) +[options](/versions/7.7.3/reference/command-line-reference#build-options) available during a build. ### Aquery options {#aquery-options} @@ -154,9 +154,9 @@ ### Querying against the state of Skyframe {#querying-against-skyframe} -[Skyframe](/versions/7.7.1/reference/skyframe) is the evaluation and +[Skyframe](/versions/7.7.3/reference/skyframe) is the evaluation and incrementality model of Bazel. On each instance of Bazel server, Skyframe stores the dependency graph -constructed from the previous runs of the [Analysis phase](/versions/7.7.1/run/build#analysis). +constructed from the previous runs of the [Analysis phase](/versions/7.7.3/run/build#analysis). In some cases, it is useful to query the Action Graph on Skyframe. An example use case would be: @@ -268,7 +268,7 @@ ### Aspect-on-aspect {#aspect-on-aspect} -It is possible for [Aspects](/versions/7.7.1/extending/aspects) +It is possible for [Aspects](/versions/7.7.3/extending/aspects) to be applied on top of each other. The aquery output of the action generated by these Aspects would then include the _Aspect path_, which is the sequence of Aspects applied to the target which generated the action. @@ -314,12 +314,12 @@ `AspectClass` could be the name of the Aspect class (for native Aspects) or `bzl_file%aspect_name` (for Starlark Aspects). `AspectDescriptor` are sorted in topological order of the -[dependency graph](/versions/7.7.1/extending/aspects#aspect_basics). +[dependency graph](/versions/7.7.3/extending/aspects#aspect_basics). ### Linking with the JSON profile {#linking-with-json-profile} While aquery provides information about the actions being run in a build (why they're being run, -their inputs/outputs), the [JSON profile](/versions/7.7.1/rules/performance#performance-profiling) +their inputs/outputs), the [JSON profile](/versions/7.7.3/rules/performance#performance-profiling) tells us the timing and duration of their execution. It is possible to combine these 2 sets of information via a common denominator: an action's primary output.
diff --git a/docs/versions/7.7.1/query/cquery.mdx b/docs/versions/7.7.3/query/cquery.mdx similarity index 90% rename from docs/versions/7.7.1/query/cquery.mdx rename to docs/versions/7.7.3/query/cquery.mdx index 28a72c2..036e9a3 100644 --- a/docs/versions/7.7.1/query/cquery.mdx +++ b/docs/versions/7.7.3/query/cquery.mdx
@@ -2,11 +2,11 @@ title: ' Configurable Query (cquery)' --- -`cquery` is a variant of [`query`](/versions/7.7.1/query/language) that correctly handles -[`select()`](/versions/7.7.1/docs/configurable-attributes) and build options' effects on the build +`cquery` is a variant of [`query`](/versions/7.7.3/query/language) that correctly handles +[`select()`](/versions/7.7.3/docs/configurable-attributes) and build options' effects on the build graph. -It achieves this by running over the results of Bazel's [analysis phase](/versions/7.7.1/extending/concepts#evaluation-model), +It achieves this by running over the results of Bazel's [analysis phase](/versions/7.7.3/extending/concepts#evaluation-model), which integrates these effects. `query`, by contrast, runs over the results of Bazel's loading phase, before options are evaluated. @@ -57,12 +57,12 @@ </pre> Each result includes a [unique identifier](#configurations) `(9f87702)` of -the [configuration](/versions/7.7.1/reference/glossary#configuration) the +the [configuration](/versions/7.7.3/reference/glossary#configuration) the target is built with. Since `cquery` runs over the configured target graph. it doesn't have insight -into artifacts like build actions nor access to [`test_suite`](/versions/7.7.1/reference/be/general#test_suite) -rules as they are not configured targets. For the former, see [`aquery`](/versions/7.7.1/query/aquery). +into artifacts like build actions nor access to [`test_suite`](/versions/7.7.3/reference/be/general#test_suite) +rules as they are not configured targets. For the former, see [`aquery`](/versions/7.7.3/query/aquery). ## Basic syntax {#basic-syntax} @@ -74,13 +74,13 @@ * **`function(...)`** is the function to run on the target. `cquery` supports most - of `query`'s [functions](/versions/7.7.1/query/language#functions), plus a + of `query`'s [functions](/versions/7.7.3/query/language#functions), plus a few new ones. * **`//target`** is the expression fed to the function. In this example, the expression is a simple target. But the query language also allows nesting of functions. - See the [Query guide](/versions/7.7.1/query/guide) for examples. + See the [Query guide](/versions/7.7.3/query/guide) for examples. -`cquery` requires a target to run through the [loading and analysis](/versions/7.7.1/extending/concepts#evaluation-model) +`cquery` requires a target to run through the [loading and analysis](/versions/7.7.3/extending/concepts#evaluation-model) phases. Unless otherwise specified, `cquery` parses the target(s) listed in the query expression. See [`--universe_scope`](#universe-scope) for querying dependencies of top-level build targets. @@ -118,7 +118,7 @@ For `cquery`, a target pattern in the query expression evaluates to every configured target with a label that matches that pattern. Output is deterministic, but `cquery` makes no ordering guarantee beyond the -[core query ordering contract](/versions/7.7.1/query/language#graph-order). +[core query ordering contract](/versions/7.7.3/query/language#graph-order). This produces subtler results for query expressions than with `query`. For example, the following can produce multiple results: @@ -136,14 +136,14 @@ If you want to precisely declare which instance to query over, use the [`config`](#config) function. -See `query`'s [target pattern documentation](/versions/7.7.1/query/language#target-patterns) for more information on target patterns. +See `query`'s [target pattern documentation](/versions/7.7.3/query/language#target-patterns) for more information on target patterns. ## Functions {#functions} -Of the [set of functions](/versions/7.7.1/query/language#functions "list of query functions") -supported by `query`, `cquery` supports all but [`visible`](/versions/7.7.1/query/language#visible), -[`siblings`](/versions/7.7.1/query/language#siblings), [`buildfiles`](/versions/7.7.1/query/language#buildfiles), -and [`tests`](/versions/7.7.1/query/language#tests). +Of the [set of functions](/versions/7.7.3/query/language#functions "list of query functions") +supported by `query`, `cquery` supports all but [`visible`](/versions/7.7.3/query/language#visible), +[`siblings`](/versions/7.7.3/query/language#siblings), [`buildfiles`](/versions/7.7.3/query/language#buildfiles), +and [`tests`](/versions/7.7.3/query/language#tests). `cquery` also introduces the following new functions: @@ -182,14 +182,14 @@ ### Build options {#build-options} `cquery` runs over a regular Bazel build and thus inherits the set of -[options](/versions/7.7.1/reference/command-line-reference#build-options) available during a build. +[options](/versions/7.7.3/reference/command-line-reference#build-options) available during a build. ### Using cquery options {#using-cquery-options} #### `--universe_scope` (comma-separated list) {#universe-scope} Often, the dependencies of configured targets go through -[transitions](/versions/7.7.1/extending/rules#configurations), +[transitions](/versions/7.7.3/extending/rules#configurations), which causes their configuration to differ from their dependent. This flag allows you to query a target as if it were built as a dependency or a transitive dependency of another target. For example: @@ -210,7 +210,7 @@ </pre> Genrules configure their tools in the -[exec configuration](/versions/7.7.1/extending/rules#configurations) +[exec configuration](/versions/7.7.3/extending/rules#configurations) so the following queries would produce the following outputs: <table class="table table-condensed table-bordered table-params"> @@ -261,7 +261,7 @@ Setting this flag to false filters out all configured targets for which the path from the queried target to them crosses a transition between the target configuration and the -[non-target configurations](/versions/7.7.1/extending/rules#configurations). +[non-target configurations](/versions/7.7.3/extending/rules#configurations). If the queried target is in the target configuration, setting `--notool_deps` will only return targets that also are in the target configuration. If the queried target is in a non-target configuration, setting `--notool_deps` will only return @@ -270,7 +270,7 @@ #### `--include_aspects` (boolean, default=True) {#include-aspects} -Include dependencies added by [aspects](/versions/7.7.1/extending/aspects). +Include dependencies added by [aspects](/versions/7.7.3/extending/aspects). If this flag is disabled, `cquery somepath(X, Y)` and `cquery deps(X) | grep 'Y'` omit Y if X only depends on it through an aspect. @@ -287,7 +287,7 @@ --transitions=full </pre> -Configuration [transitions](/versions/7.7.1/extending/rules#configurations) +Configuration [transitions](/versions/7.7.3/extending/rules#configurations) are used to build targets underneath the top level targets in different configurations than the top level targets. @@ -325,7 +325,7 @@ configured target. If you'd like to omit this information and get proto output that is formatted exactly like query's proto output, set this flag to false. -See [query's proto output documentation](/versions/7.7.1/query/language#output-formats) +See [query's proto output documentation](/versions/7.7.3/query/language#output-formats) for more proto output-related options. Note: While selects are resolved both at the top level of returned @@ -339,9 +339,9 @@ </pre> This option generates output as a Graphviz-compatible .dot file. See `query`'s -[graph output documentation](/versions/7.7.1/query/language#display-result-graph) for details. `cquery` -also supports [`--graph:node_limit`](/versions/7.7.1/query/language#graph-nodelimit) and -[`--graph:factored`](/versions/7.7.1/query/language#graph-factored). +[graph output documentation](/versions/7.7.3/query/language#display-result-graph) for details. `cquery` +also supports [`--graph:node_limit`](/versions/7.7.3/query/language#graph-nodelimit) and +[`--graph:factored`](/versions/7.7.3/query/language#graph-factored). ### Files output {#files-output} @@ -353,11 +353,11 @@ by the query similar to the list printed at the end of a `bazel build` invocation. The output contains only the files advertised in the requested output groups as determined by the -[`--output_groups`](/versions/7.7.1/reference/command-line-reference#flag--output_groups) flag. +[`--output_groups`](/versions/7.7.3/reference/command-line-reference#flag--output_groups) flag. It does include source files. All paths emitted by this output format are relative to the -[execroot](https://bazel.build/versions/7.7.1/remote/output-directories), which can be obtained +[execroot](https://bazel.build/versions/7.7.3/remote/output-directories), which can be obtained via `bazel info execution_root`. If the `bazel-out` convenience symlink exists, paths to files in the main repository also resolve relative to the workspace directory. @@ -373,11 +373,11 @@ --output=starlark </pre> -This output format calls a [Starlark](/versions/7.7.1/rules/language) +This output format calls a [Starlark](/versions/7.7.3/rules/language) function for each configured target in the query result, and prints the value returned by the call. The `--starlark:file` flag specifies the location of a Starlark file that defines a function named `format` with a single parameter, -`target`. This function is called for each [Target](/versions/7.7.1/rules/lib/builtins/Target) +`target`. This function is called for each [Target](/versions/7.7.3/rules/lib/builtins/Target) in the query result. Alternatively, for convenience, you may specify just the body of a function declared as `def format(target): return expr` by using the `--starlark:expr` flag. @@ -393,7 +393,7 @@ ##### build_options(target) {#build-options-function} `build_options(target)` returns a map whose keys are build option identifiers (see -[Configurations](/versions/7.7.1/extending/config)) +[Configurations](/versions/7.7.3/extending/config)) and whose values are their Starlark values. Build options whose values are not legal Starlark values are omitted from this map. @@ -403,7 +403,7 @@ ##### providers(target) {#providers} `providers(target)` returns a map whose keys are names of -[providers](/versions/7.7.1/extending/rules#providers) +[providers](/versions/7.7.3/extending/rules#providers) (for example, `"DefaultInfo"`) and whose values are their Starlark values. Providers whose values are not legal Starlark values are omitted from this map. @@ -521,7 +521,7 @@ evaluates _configured targets_ while `query` only evaluates _targets_. This takes more time and uses more memory. * `cquery`'s interpretation of - the [query language](/versions/7.7.1/query/language) introduces ambiguity + the [query language](/versions/7.7.3/query/language) introduces ambiguity that `query` avoids. For example, if `"//foo"` exists in two configurations, which one should `cquery "deps(//foo)"` use? @@ -542,7 +542,7 @@ While these generally share the top-level "target" configuration, rules can change their own configuration with -[incoming edge transitions](/versions/7.7.1/extending/config#incoming-edge-transitions). +[incoming edge transitions](/versions/7.7.3/extending/config#incoming-edge-transitions). This is where `cquery` falls short. Workaround: If possible, set `--universe_scope` to a stricter @@ -561,7 +561,7 @@ $ bazel cquery 'somepath(//foo, //bar)' --universe_scope=//foo </pre> -**No support for [`--output=xml`](/versions/7.7.1/query/language#xml).** +**No support for [`--output=xml`](/versions/7.7.3/query/language#xml).** **Non-deterministic output.** @@ -569,7 +569,7 @@ previous commands and is therefore prone to picking up results from past queries. For example, `genquery` exerts an exec transition on its `tools` attribute - that is, it configures its tools in the -[exec configuration](/versions/7.7.1/extending/rules#configurations). +[exec configuration](/versions/7.7.3/extending/rules#configurations). You can see the lingering effects of that transition below.
diff --git a/docs/versions/7.7.1/query/guide.mdx b/docs/versions/7.7.3/query/guide.mdx similarity index 98% rename from docs/versions/7.7.1/query/guide.mdx rename to docs/versions/7.7.3/query/guide.mdx index baf5e65..b92fb47 100644 --- a/docs/versions/7.7.1/query/guide.mdx +++ b/docs/versions/7.7.3/query/guide.mdx
@@ -6,8 +6,8 @@ dependencies in your code. For a language details and `--output` flag details, please see the -reference manuals, [Bazel query reference](/versions/7.7.1/query/language) -and [Bazel cquery reference](/versions/7.7.1/query/cquery). You can get help by +reference manuals, [Bazel query reference](/versions/7.7.3/query/language) +and [Bazel cquery reference](/versions/7.7.3/query/cquery). You can get help by typing `bazel help query` or `bazel help cquery` on the command line. @@ -69,7 +69,7 @@ you're about to break. You can use `rdeps(u, x)` to find the reverse dependencies of the targets in `x` within the transitive closure of `u`. -Bazel's [Sky Query](/versions/7.7.1/query/language#sky-query) +Bazel's [Sky Query](/versions/7.7.3/query/language#sky-query) supports the `allrdeps` function which allows you to query reverse dependencies in a universe you specify.
diff --git a/docs/versions/7.7.1/query/images/query_graph1.png b/docs/versions/7.7.3/query/images/query_graph1.png similarity index 100% rename from docs/versions/7.7.1/query/images/query_graph1.png rename to docs/versions/7.7.3/query/images/query_graph1.png Binary files differ
diff --git a/docs/versions/7.7.1/query/images/query_graph2.png b/docs/versions/7.7.3/query/images/query_graph2.png similarity index 100% rename from docs/versions/7.7.1/query/images/query_graph2.png rename to docs/versions/7.7.3/query/images/query_graph2.png Binary files differ
diff --git a/docs/versions/7.7.1/query/images/query_graph3.png b/docs/versions/7.7.3/query/images/query_graph3.png similarity index 100% rename from docs/versions/7.7.1/query/images/query_graph3.png rename to docs/versions/7.7.3/query/images/query_graph3.png Binary files differ
diff --git a/docs/versions/7.7.1/query/language.mdx b/docs/versions/7.7.3/query/language.mdx similarity index 98% rename from docs/versions/7.7.1/query/language.mdx rename to docs/versions/7.7.3/query/language.mdx index 34f87ef..f7c962d 100644 --- a/docs/versions/7.7.1/query/language.mdx +++ b/docs/versions/7.7.3/query/language.mdx
@@ -6,7 +6,7 @@ when you use `bazel query` to analyze build dependencies. It also describes the output formats `bazel query` supports. -For practical use cases, see the [Bazel Query How-To](/versions/7.7.1/query/guide). +For practical use cases, see the [Bazel Query How-To](/versions/7.7.3/query/guide). ## Additional query reference @@ -21,18 +21,18 @@ properties of the Actions/Artifacts generated from the Configured Target Graph. For example, the actual commands run and their inputs, outputs, and mnemonics. -For more details, see the [aquery reference](/versions/7.7.1/query/aquery). +For more details, see the [aquery reference](/versions/7.7.3/query/aquery). ### Configurable query {#cquery} Traditional Bazel query runs on the post-loading phase target graph and therefore has no concept of configurations and their related concepts. Notably, -it doesn't correctly resolve [select statements](/versions/7.7.1/reference/be/functions#select) +it doesn't correctly resolve [select statements](/versions/7.7.3/reference/be/functions#select) and instead returns all possible resolutions of selects. However, the configurable query environment, `cquery`, properly handles configurations but doesn't provide all of the functionality of this original query. -For more details, see the [cquery reference](/versions/7.7.1/query/cquery). +For more details, see the [cquery reference](/versions/7.7.3/query/cquery). ## Examples {#examples} @@ -81,7 +81,7 @@ and the special characters `*/@.-_:$~[]` (asterisk, forward slash, at, period, hyphen, underscore, colon, dollar sign, tilde, left square brace, right square brace). However, unquoted words may not start with a hyphen `-` or asterisk `*` - even though relative [target names](/versions/7.7.1/concepts/labels#target-names) may start + even though relative [target names](/versions/7.7.3/concepts/labels#target-names) may start with those characters. As a special rule meant to simplify the handling of labels referring to external repositories, unquoted words that start with `@@` may contain `+` characters. @@ -178,7 +178,7 @@ that this graph is somewhat abstract, and does not constitute a complete description of how to perform all the steps of a build. In order to perform a build, a _configuration_ is required too; -see the [configurations](/versions/7.7.1/docs/user-manual#configurations) +see the [configurations](/versions/7.7.3/docs/user-manual#configurations) section of the User's Guide for more detail. The result of evaluating an expression in the Bazel query language @@ -286,7 +286,7 @@ two operators ([`allrdeps`](#allrdeps) and [`rbuildfiles`](#rbuildfiles)) that are not available in the default query. As well, Sky Query does its work by introspecting the -[Skyframe](/versions/7.7.1/reference/skyframe) graph, rather than creating a new +[Skyframe](/versions/7.7.3/reference/skyframe) graph, rather than creating a new graph, which is what the default implementation does. Thus, there are some circumstances in which it is faster and uses less memory. @@ -339,7 +339,7 @@ target patterns like `foo/...`) is typically more useful for builds. `bazel query` target patterns work the same as `bazel build` build targets do. -For more details, see [Target Patterns](/versions/7.7.1/docs/user-manual#target-patterns), or +For more details, see [Target Patterns](/versions/7.7.3/docs/user-manual#target-patterns), or type `bazel help target-syntax`. Target patterns may evaluate to a singleton set (in the case of a label), to a @@ -651,7 +651,7 @@ <tr> <td> <figure> - <img src="/versions/7.7.1/docs/images/somepath1.svg" alt="Somepath" /> + <img src="/versions/7.7.3/docs/images/somepath1.svg" alt="Somepath" /> <figcaption><code>somepath(S1 + S2, E)</code>, one possible result.</figcaption> </figure> {/* digraph somepath1 { @@ -682,7 +682,7 @@ </td> <td> <figure> - <img src="/versions/7.7.1/docs/images/somepath2.svg" alt="Somepath" /> + <img src="/versions/7.7.3/docs/images/somepath2.svg" alt="Somepath" /> <figcaption><code>somepath(S1 + S2, E)</code>, another possible result.</figcaption> </figure> {/* digraph somepath2 { @@ -711,7 +711,7 @@ </td> <td> <figure> - <img src="/versions/7.7.1/docs/images/allpaths.svg" alt="Allpaths" /> + <img src="/versions/7.7.3/docs/images/allpaths.svg" alt="Allpaths" /> <figcaption><code>allpaths(S1 + S2, E)</code></figcaption> </figure> {/* digraph allpaths { @@ -1282,7 +1282,7 @@ <table> <tr> - <td><img src="/versions/7.7.1/docs/images/out-ranked.svg" alt="Out ranked" /> + <td><img src="/versions/7.7.3/docs/images/out-ranked.svg" alt="Out ranked" /> </td> <td> <pre> @@ -1502,7 +1502,7 @@ ### Querying with external repositories {#querying-external-repositories} -If the build depends on rules from [external repositories](/versions/7.7.1/external/overview) +If the build depends on rules from [external repositories](/versions/7.7.3/external/overview) then query results will include these dependencies. For example, if `//foo:bar` depends on `@other-repo//baz:lib`, then `bazel query 'deps(//foo:bar)'` will list `@other-repo//baz:lib` as a
diff --git a/docs/versions/7.7.1/query/quickstart.mdx b/docs/versions/7.7.3/query/quickstart.mdx similarity index 95% rename from docs/versions/7.7.1/query/quickstart.mdx rename to docs/versions/7.7.3/query/quickstart.mdx index 1702b37..7592aab 100644 --- a/docs/versions/7.7.1/query/quickstart.mdx +++ b/docs/versions/7.7.3/query/quickstart.mdx
@@ -4,7 +4,7 @@ This tutorial covers how to work with Bazel to trace dependencies in your code using a premade Bazel project. -For language and `--output` flag details, see the [Bazel query reference](/versions/7.7.1/query/language) and [Bazel cquery reference](/versions/7.7.1/query/cquery) manuals. Get help in your IDE by typing `bazel help query` or `bazel help cquery` on the command line. +For language and `--output` flag details, see the [Bazel query reference](/versions/7.7.3/query/language) and [Bazel cquery reference](/versions/7.7.3/query/cquery) manuals. Get help in your IDE by typing `bazel help query` or `bazel help cquery` on the command line. ## Objective @@ -12,7 +12,7 @@ ## Prerequisites -Start by installing [Bazel](https://bazel.build/versions/7.7.1/install), if you haven’t already. This tutorial uses Git for source control, so for best results, install [Git](https://github.com/git-guides/install-git) as well. +Start by installing [Bazel](https://bazel.build/versions/7.7.3/install), if you haven’t already. This tutorial uses Git for source control, so for best results, install [Git](https://github.com/git-guides/install-git) as well. To visualize dependency graphs, the tool called Graphviz is used, which you can [download](https://graphviz.org/download/) in order to follow along. @@ -30,7 +30,7 @@ ### What are Bazel queries? -Queries help you to learn about a Bazel codebase by analyzing the relationships between `BUILD` files and examining the resulting output for useful information. This guide previews some basic query functions, but for more options see the [query guide](https://bazel.build/versions/7.7.1/query/guide). Queries help you learn about dependencies in large scale projects without manually navigating through `BUILD` files. +Queries help you to learn about a Bazel codebase by analyzing the relationships between `BUILD` files and examining the resulting output for useful information. This guide previews some basic query functions, but for more options see the [query guide](https://bazel.build/versions/7.7.3/query/guide). Queries help you learn about dependencies in large scale projects without manually navigating through `BUILD` files. To run a query, open your command line terminal and enter: @@ -84,7 +84,7 @@ This project contains a main method inside of `Runner.java` that you can execute to print out a menu of the Cafe. Build the project using Bazel with the command `bazel build` and use `:` to signal that the target is named `runner`. See -[target names](https://bazel.build/versions/7.7.1/concepts/labels#target-names) to learn how to +[target names](https://bazel.build/versions/7.7.3/concepts/labels#target-names) to learn how to reference targets. To build this project, paste this command into a terminal: @@ -189,7 +189,7 @@ Note: This section uses Graphviz, so make sure to [download Graphviz](https://graphviz.org/download/) to follow along. -The section describes how you can visualize the dependency paths for a specific query. [Graphviz](https://graphviz.org/) helps to see the path as a directed acyclic graph image as opposed to a flattened list. You can alter the display of the Bazel query graph by using various `--output` command line options. See [Output Formats](https://bazel.build/versions/7.7.1/query/language#output-formats) for options. +The section describes how you can visualize the dependency paths for a specific query. [Graphviz](https://graphviz.org/) helps to see the path as a directed acyclic graph image as opposed to a flattened list. You can alter the display of the Bazel query graph by using various `--output` command line options. See [Output Formats](https://bazel.build/versions/7.7.3/query/language#output-formats) for options. Start by running your desired query and add the flag `--noimplicit_deps` to remove excessive tool dependencies. Then, follow the query with the output flag and store the graph into a file called `graph.in` to create a text representation of the graph. @@ -205,7 +205,7 @@ ``` If you open up `graph.png`, you should see something like this. The graph below has been simplified to make the essential path details clearer in this guide. - + This helps when you want to see the outputs of the different query functions throughout this guide. @@ -215,7 +215,7 @@ For instance, you want to make some edits to the ingredient `cheese`. To avoid causing an issue for Cafe Bazel, you need to check what dishes rely on `cheese`. -Caution: Since `ingredients` is its own package, you must use a different naming convention for the target `cheese` in the form of `//package:target`. Read more about referencing targets, or [Labels](https://bazel.build/versions/7.7.1/concepts/labels). +Caution: Since `ingredients` is its own package, you must use a different naming convention for the target `cheese` in the form of `//package:target`. Read more about referencing targets, or [Labels](https://bazel.build/versions/7.7.3/concepts/labels). To see what targets depend on a particular target/package, you can use `rdeps(universe_scope, target)`. The `rdeps()` query function takes in at least two arguments: a `universe_scope` — the relevant directory — and a `target`. Bazel searches for the target’s reverse dependencies within the `universe_scope` provided. The `rdeps()` operator accepts an optional third argument: an integer literal specifying the upper bound on the depth of the search. @@ -409,7 +409,7 @@ ) ``` -Build `cafe` again to confirm that there are no errors. If it builds successfully, congratulations! You’ve added a new dependency for the 'Cafe'. If not, look out for spelling mistakes and package naming. For more information about writing `BUILD` files see [BUILD Style Guide](https://bazel.build/versions/7.7.1/build/style-guide). +Build `cafe` again to confirm that there are no errors. If it builds successfully, congratulations! You’ve added a new dependency for the 'Cafe'. If not, look out for spelling mistakes and package naming. For more information about writing `BUILD` files see [BUILD Style Guide](https://bazel.build/versions/7.7.3/build/style-guide). Now, visualize the new dependency graph with the addition of the `Smoothie` to compare with the previous one. For clarity, name the graph input as `graph2.in` and `graph2.png`. @@ -421,7 +421,7 @@ dot -Tpng < graph2.in > graph2.png ``` -[](/query/images/query_graph2.png) +[](/query/images/query_graph2.png) Looking at `graph2.png`, you can see that `Smoothie` has no shared dependencies with other dishes but is just another target that the `Chef` relies on. @@ -465,7 +465,7 @@ //src/main/java/com/example/restaurant:chef ``` - + The output of `allpaths()` is a little harder to read as it is a flattened list of the dependencies. Visualizing this graph using Graphviz makes the relationship clearer to understand. @@ -493,4 +493,4 @@ ## Wrapping up -Congratulations! You have now run several basic queries, which you can try out on own projects. To learn more about the query language syntax, refer to the [Query reference page](https://bazel.build/versions/7.7.1/query/language). Want more advanced queries? The [Query guide](https://bazel.build/versions/7.7.1/query/guide) showcases an in-depth list of more use cases than are covered in this guide. +Congratulations! You have now run several basic queries, which you can try out on own projects. To learn more about the query language syntax, refer to the [Query reference page](https://bazel.build/versions/7.7.3/query/language). Want more advanced queries? The [Query guide](https://bazel.build/versions/7.7.3/query/guide) showcases an in-depth list of more use cases than are covered in this guide.
diff --git a/docs/versions/7.7.1/reference/be/android.mdx b/docs/versions/7.7.3/reference/be/android.mdx similarity index 89% rename from docs/versions/7.7.1/reference/be/android.mdx rename to docs/versions/7.7.3/reference/be/android.mdx index 4a726e3..591933f 100644 --- a/docs/versions/7.7.1/reference/be/android.mdx +++ b/docs/versions/7.7.3/reference/be/android.mdx
@@ -42,15 +42,15 @@ the result of running ProGuard on the `name_deploy.jar`. This output is only produced if - [proguard\_specs](/versions/7.7.1/reference/be/android#android_binary.proguard_specs) attribute is + [proguard\_specs](/versions/7.7.3/reference/be/android#android_binary.proguard_specs) attribute is specified. * `name_proguard.map`: A mapping file result of running ProGuard on the `name_deploy.jar`. This output is only produced if - [proguard\_specs](/versions/7.7.1/reference/be/android#android_binary.proguard_specs) attribute is + [proguard\_specs](/versions/7.7.3/reference/be/android#android_binary.proguard_specs) attribute is specified and - [proguard\_generate\_mapping](/versions/7.7.1/reference/be/android#android_binary.proguard_generate_mapping) - or [shrink\_resources](/versions/7.7.1/reference/be/android#android_binary.shrink_resources) is set. + [proguard\_generate\_mapping](/versions/7.7.3/reference/be/android#android_binary.proguard_generate_mapping) + or [shrink\_resources](/versions/7.7.3/reference/be/android#android_binary.shrink_resources) is set. #### Examples @@ -61,40 +61,40 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of other libraries to be linked in to the binary target. Permitted library types are: `android_library`, `java_library` with `android` constraint and `cc_library` wrapping or producing `.so` native libraries for the Android target platform. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of source files that are processed to create the target. `srcs` files of type `.java` are compiled. *For readability's sake*, it is not good to put the name of a generated `.java` source file into the `srcs`. Instead, put the depended-on rule name in the `srcs`, as described below. `srcs` files of type `.srcjar` are unpacked and compiled. (This is useful if you need to generate a set of .java files with a genrule or build extension.) | -| `assets` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of assets to be packaged. This is typically a `glob` of all files under the `assets` directory. You can also reference other rules (any rule that produces files) or exported files in the other packages, as long as all those files are under the `assets_dir` directory in the corresponding package. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of other libraries to be linked in to the binary target. Permitted library types are: `android_library`, `java_library` with `android` constraint and `cc_library` wrapping or producing `.so` native libraries for the Android target platform. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of source files that are processed to create the target. `srcs` files of type `.java` are compiled. *For readability's sake*, it is not good to put the name of a generated `.java` source file into the `srcs`. Instead, put the depended-on rule name in the `srcs`, as described below. `srcs` files of type `.srcjar` are unpacked and compiled. (This is useful if you need to generate a set of .java files with a genrule or build extension.) | +| `assets` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of assets to be packaged. This is typically a `glob` of all files under the `assets` directory. You can also reference other rules (any rule that produces files) or exported files in the other packages, as long as all those files are under the `assets_dir` directory in the corresponding package. | | `assets_dir` | String; default is `""` The string giving the path to the files in `assets`. The pair `assets` and `assets_dir` describe packaged assets and either both attributes should be provided or none of them. | | `crunch_png` | Boolean; default is `True` Do PNG crunching (or not). This is independent of nine-patch processing, which is always done. This is a deprecated workaround for an [aapt bug](https://code.google.com/p/android/issues/detail?id=74334) which has been fixed in aapt2. | | `custom_package` | String; default is `""` Java package for which java sources will be generated. By default the package is inferred from the directory where the BUILD file containing the rule is. You can specify a different package but this is highly discouraged since it can introduce classpath conflicts with other libraries that will only be detected at runtime. | -| `debug_key` | [Label](/versions/7.7.1/concepts/labels); default is `"@bazel_tools//tools/android:debug_keystore"` File containing the debug keystore to be used to sign the debug apk. Usually you do not want to use a key other than the default key, so this attribute should be omitted. *WARNING: Do not use your production keys, they should be strictly safeguarded and not kept in your source tree*. | -| `debug_signing_keys` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` List of files, debug keystores to be used to sign the debug apk. Usually you do not want to use keys other than the default key, so this attribute should be omitted. *WARNING: Do not use your production keys, they should be strictly safeguarded and not kept in your source tree*. | -| `debug_signing_lineage_file` | [Label](/versions/7.7.1/concepts/labels); default is `None` File containing the signing lineage for the debug\_signing\_keys. Usually you do not want to use keys other than the default key, so this attribute should be omitted. *WARNING: Do not use your production keys, they should be strictly safeguarded and not kept in your source tree*. | +| `debug_key` | [Label](/versions/7.7.3/concepts/labels); default is `"@bazel_tools//tools/android:debug_keystore"` File containing the debug keystore to be used to sign the debug apk. Usually you do not want to use a key other than the default key, so this attribute should be omitted. *WARNING: Do not use your production keys, they should be strictly safeguarded and not kept in your source tree*. | +| `debug_signing_keys` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` List of files, debug keystores to be used to sign the debug apk. Usually you do not want to use keys other than the default key, so this attribute should be omitted. *WARNING: Do not use your production keys, they should be strictly safeguarded and not kept in your source tree*. | +| `debug_signing_lineage_file` | [Label](/versions/7.7.3/concepts/labels); default is `None` File containing the signing lineage for the debug\_signing\_keys. Usually you do not want to use keys other than the default key, so this attribute should be omitted. *WARNING: Do not use your production keys, they should be strictly safeguarded and not kept in your source tree*. | | `densities` | List of strings; default is `[]` Densities to filter for when building the apk. This will strip out raster drawable resources that would not be loaded by a device with the specified screen densities, to reduce APK size. A corresponding compatible-screens section will also be added to the manifest if it does not already contain a superset listing. | | `dex_shards` | Integer; default is `1` Number of shards dexing should be decomposed into. This is makes dexing much faster at the expense of app installation and startup time. The larger the binary, the more shards should be used. 25 is a good value to start experimenting with. Note that each shard will result in at least one dex in the final app. For this reason, setting this to more than 1 is not recommended for release binaries. | -| `dexopts` | List of strings; default is `[]` Additional command-line flags for the dx tool when generating classes.dex. Subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). | -| `enable_data_binding` | Boolean; default is `False` If true, this rule processes [data binding](https://developer.android.com/topic/libraries/data-binding/index.html) expressions in layout resources included through the [resource\_files](/versions/7.7.1/reference/be/android#android_binary.resource_files) attribute. Without this setting, data binding expressions produce build failures. To build an Android app with data binding, you must also do the following: 1. Set this attribute for all Android rules that transitively depend on this one. This is because dependers inherit the rule's data binding expressions through resource merging. So they also need to build with data binding to parse those expressions.- Add a `deps =` entry for the data binding runtime library to all targets that set this attribute. The location of this library depends on your depot setup. | -| `incremental_dexing` | Integer; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `-1` Force the target to be built with or without incremental dexing, overriding defaults and --incremental\_dexing flag. | -| `instruments` | [Label](/versions/7.7.1/concepts/labels); default is `None` The `android_binary` target to instrument. If this attribute is set, this `android_binary` will be treated as a test application for instrumentation tests. An `android_instrumentation_test` target can then specify this target in its [test\_app](/versions/7.7.1/reference/be/android#android_instrumentation_test.test_app) attribute. | -| `javacopts` | List of strings; default is `[]` Extra compiler options for this target. Subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). These compiler options are passed to javac after the global compiler options. | +| `dexopts` | List of strings; default is `[]` Additional command-line flags for the dx tool when generating classes.dex. Subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). | +| `enable_data_binding` | Boolean; default is `False` If true, this rule processes [data binding](https://developer.android.com/topic/libraries/data-binding/index.html) expressions in layout resources included through the [resource\_files](/versions/7.7.3/reference/be/android#android_binary.resource_files) attribute. Without this setting, data binding expressions produce build failures. To build an Android app with data binding, you must also do the following: 1. Set this attribute for all Android rules that transitively depend on this one. This is because dependers inherit the rule's data binding expressions through resource merging. So they also need to build with data binding to parse those expressions.- Add a `deps =` entry for the data binding runtime library to all targets that set this attribute. The location of this library depends on your depot setup. | +| `incremental_dexing` | Integer; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `-1` Force the target to be built with or without incremental dexing, overriding defaults and --incremental\_dexing flag. | +| `instruments` | [Label](/versions/7.7.3/concepts/labels); default is `None` The `android_binary` target to instrument. If this attribute is set, this `android_binary` will be treated as a test application for instrumentation tests. An `android_instrumentation_test` target can then specify this target in its [test\_app](/versions/7.7.3/reference/be/android#android_instrumentation_test.test_app) attribute. | +| `javacopts` | List of strings; default is `[]` Extra compiler options for this target. Subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). These compiler options are passed to javac after the global compiler options. | | `key_rotation_min_sdk` | String; default is `""` Sets the minimum Android platform version (API Level) for which an APK's rotated signing key should be used to produce the APK's signature. The original signing key for the APK will be used for all previous platform versions. | -| `main_dex_list` | [Label](/versions/7.7.1/concepts/labels); default is `None` A text file contains a list of class file names. Classes defined by those class files are put in the primary classes.dex. e.g.: ``` android/support/multidex/MultiDex$V19.class android/support/multidex/MultiDex.class android/support/multidex/MultiDexApplication.class com/google/common/base/Objects.class ``` Must be used with `multidex="manual_main_dex"`. | +| `main_dex_list` | [Label](/versions/7.7.3/concepts/labels); default is `None` A text file contains a list of class file names. Classes defined by those class files are put in the primary classes.dex. e.g.: ``` android/support/multidex/MultiDex$V19.class android/support/multidex/MultiDex.class android/support/multidex/MultiDexApplication.class com/google/common/base/Objects.class ``` Must be used with `multidex="manual_main_dex"`. | | `main_dex_list_opts` | List of strings; default is `[]` Command line options to pass to the main dex list builder. Use this option to affect the classes included in the main dex list. | -| `main_dex_proguard_specs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Files to be used as the Proguard specifications to determine classes that must be kept in the main dex. Only allowed if the `multidex` attribute is set to `legacy`. | -| `manifest` | [Label](/versions/7.7.1/concepts/labels); required The name of the Android manifest file, normally `AndroidManifest.xml`. Must be defined if resource\_files or assets are defined. | +| `main_dex_proguard_specs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Files to be used as the Proguard specifications to determine classes that must be kept in the main dex. Only allowed if the `multidex` attribute is set to `legacy`. | +| `manifest` | [Label](/versions/7.7.3/concepts/labels); required The name of the Android manifest file, normally `AndroidManifest.xml`. Must be defined if resource\_files or assets are defined. | | `manifest_values` | Dictionary: String -> String; default is `{}` A dictionary of values to be overridden in the manifest. Any instance of `${name}` in the manifest will be replaced with the value corresponding to name in this dictionary. `applicationId`, `versionCode`, `versionName`, `minSdkVersion`, `targetSdkVersion` and `maxSdkVersion` will also override the corresponding attributes in the manifest and `uses-sdk` tags. `packageName` will be ignored and will be set from either `applicationId` if specified or the package in manifest. When `manifest_merger` is set to `legacy`, only `applicationId`, `versionCode` and `versionName` will have any effect. | -| `multidex` | String; default is `"native"` Whether to split code into multiple dex files. Possible values: * `native`: Split code into multiple dex files when the dex 64K index limit is exceeded. Assumes native platform support for loading multidex classes at runtime. *This works with only Android L and newer*. * `legacy`: Split code into multiple dex files when the dex 64K index limit is exceeded. Assumes multidex classes are loaded through application code (i.e. no native platform support). * `manual_main_dex`: Split code into multiple dex files when the dex 64K index limit is exceeded. The content of the main dex file needs to be specified by providing a list of classes in a text file using the [main\_dex\_list](/versions/7.7.1/reference/be/android#android_binary.main_dex_list) attribute. * `off`: Compile all code to a single dex file, even if it exceeds the index limit. | +| `multidex` | String; default is `"native"` Whether to split code into multiple dex files. Possible values: * `native`: Split code into multiple dex files when the dex 64K index limit is exceeded. Assumes native platform support for loading multidex classes at runtime. *This works with only Android L and newer*. * `legacy`: Split code into multiple dex files when the dex 64K index limit is exceeded. Assumes multidex classes are loaded through application code (i.e. no native platform support). * `manual_main_dex`: Split code into multiple dex files when the dex 64K index limit is exceeded. The content of the main dex file needs to be specified by providing a list of classes in a text file using the [main\_dex\_list](/versions/7.7.3/reference/be/android#android_binary.main_dex_list) attribute. * `off`: Compile all code to a single dex file, even if it exceeds the index limit. | | `nocompress_extensions` | List of strings; default is `[]` A list of file extension to leave uncompressed in apk. | | `package_id` | Integer; default is `0` Package ID to be assigned to resources in this binary. See AAPT2's `--package-id` argument for more information. This can (and should) typically be left unset, resulting in the default value of 127 (`0x7F`). | -| `plugins` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Java compiler plugins to run at compile-time. Every `java_plugin` specified in the plugins attribute will be run whenever this target is built. Resources generated by the plugin will be included in the result jar of the target. | -| `proguard_apply_dictionary` | [Label](/versions/7.7.1/concepts/labels); default is `None` File to be used as a mapping for proguard. A line separated file of "words" to pull from when renaming classes and members during obfuscation. | -| `proguard_apply_mapping` | [Label](/versions/7.7.1/concepts/labels); default is `None` File to be used as a mapping for proguard. A mapping file generated by `proguard_generate_mapping` to be re-used to apply the same mapping to a new build. | -| `proguard_generate_mapping` | Boolean; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `False` Whether to generate Proguard mapping file. The mapping file will be generated only if `proguard_specs` is specified. This file will list the mapping between the original and obfuscated class, method, and field names. *WARNING: If this attribute is used, the Proguard specification should contain neither `-dontobfuscate` nor `-printmapping`.* | -| `proguard_specs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Files to be used as Proguard specification. This file will describe the set of specifications to be used by Proguard. | +| `plugins` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Java compiler plugins to run at compile-time. Every `java_plugin` specified in the plugins attribute will be run whenever this target is built. Resources generated by the plugin will be included in the result jar of the target. | +| `proguard_apply_dictionary` | [Label](/versions/7.7.3/concepts/labels); default is `None` File to be used as a mapping for proguard. A line separated file of "words" to pull from when renaming classes and members during obfuscation. | +| `proguard_apply_mapping` | [Label](/versions/7.7.3/concepts/labels); default is `None` File to be used as a mapping for proguard. A mapping file generated by `proguard_generate_mapping` to be re-used to apply the same mapping to a new build. | +| `proguard_generate_mapping` | Boolean; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `False` Whether to generate Proguard mapping file. The mapping file will be generated only if `proguard_specs` is specified. This file will list the mapping between the original and obfuscated class, method, and field names. *WARNING: If this attribute is used, the Proguard specification should contain neither `-dontobfuscate` nor `-printmapping`.* | +| `proguard_specs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Files to be used as Proguard specification. This file will describe the set of specifications to be used by Proguard. | | `resource_configuration_filters` | List of strings; default is `[]` A list of resource configuration filters, such 'en' that will limit the resources in the apk to only the ones in the 'en' configuration. To enable pseudolocalization, include the `en_XA` and/or `ar_XB` pseudo-locales. | -| `resource_files` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of resources to be packaged. This is typically a `glob` of all files under the `res` directory. Generated files (from genrules) can be referenced by [Label](/versions/7.7.1/concepts/labels) here as well. The only restriction is that the generated outputs must be under the same "`res`" directory as any other resource files that are included. | -| `shrink_resources` | Integer; default is `-1` Whether to perform resource shrinking. Resources that are not used by the binary will be removed from the APK. This is only supported for rules using local resources (i.e. the `manifest` and `resource_files` attributes) and requires ProGuard. It operates in mostly the same manner as the Gradle resource shrinker (https://developer.android.com/studio/build/shrink-code.html#shrink-resources). Notable differences: * resources in `values/` will be removed as well as file based resources * uses `strict mode` by default * removing unused ID resources is only supported with aapt2 If resource shrinking is enabled, `name_files/resource_shrinker.log` will also be generated, detailing the analysis and deletions performed. Possible values: * `shrink_resources = 1`: Turns on Android resource shrinking * `shrink_resources = 0`: Turns off Android resource shrinking * `shrink_resources = -1`: Shrinking is controlled by the [--android\_resource\_shrinking](/versions/7.7.1/docs/user-manual#flag--android_resource_shrinking) flag. | +| `resource_files` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of resources to be packaged. This is typically a `glob` of all files under the `res` directory. Generated files (from genrules) can be referenced by [Label](/versions/7.7.3/concepts/labels) here as well. The only restriction is that the generated outputs must be under the same "`res`" directory as any other resource files that are included. | +| `shrink_resources` | Integer; default is `-1` Whether to perform resource shrinking. Resources that are not used by the binary will be removed from the APK. This is only supported for rules using local resources (i.e. the `manifest` and `resource_files` attributes) and requires ProGuard. It operates in mostly the same manner as the Gradle resource shrinker (https://developer.android.com/studio/build/shrink-code.html#shrink-resources). Notable differences: * resources in `values/` will be removed as well as file based resources * uses `strict mode` by default * removing unused ID resources is only supported with aapt2 If resource shrinking is enabled, `name_files/resource_shrinker.log` will also be generated, detailing the analysis and deletions performed. Possible values: * `shrink_resources = 1`: Turns on Android resource shrinking * `shrink_resources = 0`: Turns off Android resource shrinking * `shrink_resources = -1`: Shrinking is controlled by the [--android\_resource\_shrinking](/versions/7.7.3/docs/user-manual#flag--android_resource_shrinking) flag. | ## aar\_import @@ -128,10 +128,10 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `aar` | [Label](/versions/7.7.1/concepts/labels); required The `.aar` file to provide to the Android targets that depend on this target. | -| `exports` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Targets to export to rules that depend on this rule. See [java\_library.exports.](/versions/7.7.1/reference/be/java#java_library.exports) | -| `srcjar` | [Label](/versions/7.7.1/concepts/labels); default is `None` A JAR file that contains source code for the compiled JAR files in the AAR. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `aar` | [Label](/versions/7.7.3/concepts/labels); required The `.aar` file to provide to the Android targets that depend on this target. | +| `exports` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Targets to export to rules that depend on this rule. See [java\_library.exports.](/versions/7.7.3/reference/be/java#java_library.exports) | +| `srcjar` | [Label](/versions/7.7.3/concepts/labels); default is `None` A JAR file that contains source code for the compiled JAR files in the AAR. | ## android\_library @@ -236,26 +236,26 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of other libraries to link against. Permitted library types are: `android_library`, `java_library` with `android` constraint and `cc_library` wrapping or producing `.so` native libraries for the Android target platform. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of `.java` or `.srcjar` files that are processed to create the target. `srcs` files of type `.java` are compiled. *For readability's sake*, it is not good to put the name of a generated `.java` source file into the `srcs`. Instead, put the depended-on rule name in the `srcs`, as described below. `srcs` files of type `.srcjar` are unpacked and compiled. (This is useful if you need to generate a set of .java files with a genrule or build extension.) If `srcs` is omitted, then any dependency specified in `deps` is exported from this rule (see [java\_library's exports](/versions/7.7.1/reference/be/java#java_library.exports) for more information about exporting dependencies). However, this behavior will be deprecated soon; try not to rely on it. | -| `assets` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of assets to be packaged. This is typically a `glob` of all files under the `assets` directory. You can also reference other rules (any rule that produces files) or exported files in the other packages, as long as all those files are under the `assets_dir` directory in the corresponding package. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of other libraries to link against. Permitted library types are: `android_library`, `java_library` with `android` constraint and `cc_library` wrapping or producing `.so` native libraries for the Android target platform. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of `.java` or `.srcjar` files that are processed to create the target. `srcs` files of type `.java` are compiled. *For readability's sake*, it is not good to put the name of a generated `.java` source file into the `srcs`. Instead, put the depended-on rule name in the `srcs`, as described below. `srcs` files of type `.srcjar` are unpacked and compiled. (This is useful if you need to generate a set of .java files with a genrule or build extension.) If `srcs` is omitted, then any dependency specified in `deps` is exported from this rule (see [java\_library's exports](/versions/7.7.3/reference/be/java#java_library.exports) for more information about exporting dependencies). However, this behavior will be deprecated soon; try not to rely on it. | +| `assets` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of assets to be packaged. This is typically a `glob` of all files under the `assets` directory. You can also reference other rules (any rule that produces files) or exported files in the other packages, as long as all those files are under the `assets_dir` directory in the corresponding package. | | `assets_dir` | String; default is `""` The string giving the path to the files in `assets`. The pair `assets` and `assets_dir` describe packaged assets and either both attributes should be provided or none of them. | | `custom_package` | String; default is `""` Java package for which java sources will be generated. By default the package is inferred from the directory where the BUILD file containing the rule is. You can specify a different package but this is highly discouraged since it can introduce classpath conflicts with other libraries that will only be detected at runtime. | -| `enable_data_binding` | Boolean; default is `False` If true, this rule processes [data binding](https://developer.android.com/topic/libraries/data-binding/index.html) expressions in layout resources included through the [resource\_files](/versions/7.7.1/reference/be/android#android_binary.resource_files) attribute. Without this setting, data binding expressions produce build failures. To build an Android app with data binding, you must also do the following: 1. Set this attribute for all Android rules that transitively depend on this one. This is because dependers inherit the rule's data binding expressions through resource merging. So they also need to build with data binding to parse those expressions.- Add a `deps =` entry for the data binding runtime library to all targets that set this attribute. The location of this library depends on your depot setup. | -| `exported_plugins` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of `java_plugin`s (e.g. annotation processors) to export to libraries that directly depend on this library. The specified list of `java_plugin`s will be applied to any library which directly depends on this library, just as if that library had explicitly declared these labels in `plugins`. | -| `exports` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The closure of all rules reached via `exports` attributes are considered direct dependencies of any rule that directly depends on the target with `exports`. The `exports` are not direct deps of the rule they belong to. | +| `enable_data_binding` | Boolean; default is `False` If true, this rule processes [data binding](https://developer.android.com/topic/libraries/data-binding/index.html) expressions in layout resources included through the [resource\_files](/versions/7.7.3/reference/be/android#android_binary.resource_files) attribute. Without this setting, data binding expressions produce build failures. To build an Android app with data binding, you must also do the following: 1. Set this attribute for all Android rules that transitively depend on this one. This is because dependers inherit the rule's data binding expressions through resource merging. So they also need to build with data binding to parse those expressions.- Add a `deps =` entry for the data binding runtime library to all targets that set this attribute. The location of this library depends on your depot setup. | +| `exported_plugins` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of `java_plugin`s (e.g. annotation processors) to export to libraries that directly depend on this library. The specified list of `java_plugin`s will be applied to any library which directly depends on this library, just as if that library had explicitly declared these labels in `plugins`. | +| `exports` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The closure of all rules reached via `exports` attributes are considered direct dependencies of any rule that directly depends on the target with `exports`. The `exports` are not direct deps of the rule they belong to. | | `exports_manifest` | Integer; default is `1` Whether to export manifest entries to `android_binary` targets that depend on this target. `uses-permissions` attributes are never exported. | -| `idl_import_root` | String; default is `""` Package-relative path to the root of the java package tree containing idl sources included in this library. This path will be used as the import root when processing idl sources that depend on this library. When `idl_import_root` is specified, both `idl_parcelables` and `idl_srcs` must be at the path specified by the java package of the object they represent under `idl_import_root`. When `idl_import_root` is not specified, both `idl_parcelables` and `idl_srcs` must be at the path specified by their package under a Java root. See [examples](/versions/7.7.1/reference/be/android#android_library_examples.idl_import_root). | -| `idl_parcelables` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` List of Android IDL definitions to supply as imports. These files will be made available as imports for any `android_library` target that depends on this library, directly or via its transitive closure, but will not be translated to Java or compiled. Only `.aidl` files that correspond directly to `.java` sources in this library should be included (e.g., custom implementations of Parcelable), otherwise `idl_srcs` should be used. These files must be placed appropriately for the aidl compiler to find them. See [the description of idl\_import\_root](/versions/7.7.1/reference/be/android#android_library.idl_import_root) for information about what this means. | -| `idl_preprocessed` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` List of preprocessed Android IDL definitions to supply as imports. These files will be made available as imports for any `android_library` target that depends on this library, directly or via its transitive closure, but will not be translated to Java or compiled. Only preprocessed `.aidl` files that correspond directly to `.java` sources in this library should be included (e.g., custom implementations of Parcelable), otherwise use `idl_srcs` for Android IDL definitions that need to be translated to Java interfaces and use `idl_parcelable` for non-preprocessed AIDL files. | -| `idl_srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` List of Android IDL definitions to translate to Java interfaces. After the Java interfaces are generated, they will be compiled together with the contents of `srcs`. These files will be made available as imports for any `android_library` target that depends on this library, directly or via its transitive closure. These files must be placed appropriately for the aidl compiler to find them. See [the description of idl\_import\_root](/versions/7.7.1/reference/be/android#android_library.idl_import_root) for information about what this means. | -| `javacopts` | List of strings; default is `[]` Extra compiler options for this target. Subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). These compiler options are passed to javac after the global compiler options. | -| `manifest` | [Label](/versions/7.7.1/concepts/labels); default is `None` The name of the Android manifest file, normally `AndroidManifest.xml`. Must be defined if resource\_files or assets are defined. | +| `idl_import_root` | String; default is `""` Package-relative path to the root of the java package tree containing idl sources included in this library. This path will be used as the import root when processing idl sources that depend on this library. When `idl_import_root` is specified, both `idl_parcelables` and `idl_srcs` must be at the path specified by the java package of the object they represent under `idl_import_root`. When `idl_import_root` is not specified, both `idl_parcelables` and `idl_srcs` must be at the path specified by their package under a Java root. See [examples](/versions/7.7.3/reference/be/android#android_library_examples.idl_import_root). | +| `idl_parcelables` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` List of Android IDL definitions to supply as imports. These files will be made available as imports for any `android_library` target that depends on this library, directly or via its transitive closure, but will not be translated to Java or compiled. Only `.aidl` files that correspond directly to `.java` sources in this library should be included (e.g., custom implementations of Parcelable), otherwise `idl_srcs` should be used. These files must be placed appropriately for the aidl compiler to find them. See [the description of idl\_import\_root](/versions/7.7.3/reference/be/android#android_library.idl_import_root) for information about what this means. | +| `idl_preprocessed` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` List of preprocessed Android IDL definitions to supply as imports. These files will be made available as imports for any `android_library` target that depends on this library, directly or via its transitive closure, but will not be translated to Java or compiled. Only preprocessed `.aidl` files that correspond directly to `.java` sources in this library should be included (e.g., custom implementations of Parcelable), otherwise use `idl_srcs` for Android IDL definitions that need to be translated to Java interfaces and use `idl_parcelable` for non-preprocessed AIDL files. | +| `idl_srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` List of Android IDL definitions to translate to Java interfaces. After the Java interfaces are generated, they will be compiled together with the contents of `srcs`. These files will be made available as imports for any `android_library` target that depends on this library, directly or via its transitive closure. These files must be placed appropriately for the aidl compiler to find them. See [the description of idl\_import\_root](/versions/7.7.3/reference/be/android#android_library.idl_import_root) for information about what this means. | +| `javacopts` | List of strings; default is `[]` Extra compiler options for this target. Subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). These compiler options are passed to javac after the global compiler options. | +| `manifest` | [Label](/versions/7.7.3/concepts/labels); default is `None` The name of the Android manifest file, normally `AndroidManifest.xml`. Must be defined if resource\_files or assets are defined. | | `neverlink` | Boolean; default is `False` Only use this library for compilation and not at runtime. The outputs of a rule marked as `neverlink` will not be used in `.apk` creation. Useful if the library will be provided by the runtime environment during execution. | -| `plugins` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Java compiler plugins to run at compile-time. Every `java_plugin` specified in the plugins attribute will be run whenever this target is built. Resources generated by the plugin will be included in the result jar of the target. | -| `proguard_specs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Files to be used as Proguard specification. These will describe the set of specifications to be used by Proguard. If specified, they will be added to any `android_binary` target depending on this library. The files included here must only have idempotent rules, namely -dontnote, -dontwarn, assumenosideeffects, and rules that start with -keep. Other options can only appear in `android_binary`'s proguard\_specs, to ensure non-tautological merges. | -| `resource_files` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of resources to be packaged. This is typically a `glob` of all files under the `res` directory. Generated files (from genrules) can be referenced by [Label](/versions/7.7.1/concepts/labels) here as well. The only restriction is that the generated outputs must be under the same "`res`" directory as any other resource files that are included. | +| `plugins` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Java compiler plugins to run at compile-time. Every `java_plugin` specified in the plugins attribute will be run whenever this target is built. Resources generated by the plugin will be included in the result jar of the target. | +| `proguard_specs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Files to be used as Proguard specification. These will describe the set of specifications to be used by Proguard. If specified, they will be added to any `android_binary` target depending on this library. The files included here must only have idempotent rules, namely -dontnote, -dontwarn, assumenosideeffects, and rules that start with -keep. Other options can only appear in `android_binary`'s proguard\_specs, to ensure non-tautological merges. | +| `resource_files` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of resources to be packaged. This is typically a `glob` of all files under the `res` directory. Generated files (from genrules) can be referenced by [Label](/versions/7.7.3/concepts/labels) here as well. The only restriction is that the generated outputs must be under the same "`res`" directory as any other resource files that are included. | ## android\_instrumentation\_test @@ -269,10 +269,10 @@ start an emulator, install the application being tested, the test application, and any other needed applications, and run the tests defined in the test package. -The [test\_app](/versions/7.7.1/reference/be/android#android_instrumentation_test.test_app) attribute specifies the +The [test\_app](/versions/7.7.3/reference/be/android#android_instrumentation_test.test_app) attribute specifies the `android_binary` which contains the test. This `android_binary` in turn specifies the `android_binary` application under test through its -[instruments](/versions/7.7.1/reference/be/android#android_binary.instruments) attribute. +[instruments](/versions/7.7.3/reference/be/android#android_binary.instruments) attribute. #### Example @@ -325,10 +325,10 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `support_apks` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Other APKs to install on the device before the instrumentation test starts. | -| `target_device` | [Label](/versions/7.7.1/concepts/labels); required The [android\_device](/versions/7.7.1/reference/be/android#android_device) the test should run on. To run the test on an emulator that is already running or on a physical device, use these arguments: `--test_output=streamed --test_arg=--device_broker_type=LOCAL_ADB_SERVER --test_arg=--device_serial_number=$device_identifier` | -| `test_app` | [Label](/versions/7.7.1/concepts/labels); required The [android\_binary](/versions/7.7.1/reference/be/android#android_binary) target containing the test classes. The `android_binary` target must specify which target it is testing through its [`instruments`](/versions/7.7.1/reference/be/android#android_binary.instruments) attribute. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `support_apks` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Other APKs to install on the device before the instrumentation test starts. | +| `target_device` | [Label](/versions/7.7.3/concepts/labels); required The [android\_device](/versions/7.7.3/reference/be/android#android_device) the test should run on. To run the test on an emulator that is already running or on a physical device, use these arguments: `--test_output=streamed --test_arg=--device_broker_type=LOCAL_ADB_SERVER --test_arg=--device_serial_number=$device_identifier` | +| `test_app` | [Label](/versions/7.7.3/concepts/labels); required The [android\_binary](/versions/7.7.3/reference/be/android#android_binary) target containing the test classes. The `android_binary` target must specify which target it is testing through its [`instruments`](/versions/7.7.3/reference/be/android#android_binary.instruments) attribute. | ## android\_local\_test @@ -399,25 +399,25 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of libraries to be tested as well as additional libraries to be linked in to the target. All resources, assets and manifest files declared in Android rules in the transitive closure of this attribute are made available in the test. The list of allowed rules in `deps` are `android_library`, `aar_import`, `java_import`, `java_library`, and `java_lite_proto_library`. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of source files that are processed to create the target. Required except in special case described below. `srcs` files of type `.java` are compiled. *For readability's sake*, it is not good to put the name of a generated `.java` source file into the `srcs`. Instead, put the depended-on rule name in the `srcs`, as described below. `srcs` files of type `.srcjar` are unpacked and compiled. (This is useful if you need to generate a set of .java files with a genrule or build extension.) All other files are ignored, as long as there is at least one file of a file type described above. Otherwise an error is raised. The `srcs` attribute is required and cannot be empty, unless `runtime_deps` is specified. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of libraries to be tested as well as additional libraries to be linked in to the target. All resources, assets and manifest files declared in Android rules in the transitive closure of this attribute are made available in the test. The list of allowed rules in `deps` are `android_library`, `aar_import`, `java_import`, `java_library`, and `java_lite_proto_library`. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of source files that are processed to create the target. Required except in special case described below. `srcs` files of type `.java` are compiled. *For readability's sake*, it is not good to put the name of a generated `.java` source file into the `srcs`. Instead, put the depended-on rule name in the `srcs`, as described below. `srcs` files of type `.srcjar` are unpacked and compiled. (This is useful if you need to generate a set of .java files with a genrule or build extension.) All other files are ignored, as long as there is at least one file of a file type described above. Otherwise an error is raised. The `srcs` attribute is required and cannot be empty, unless `runtime_deps` is specified. | | `custom_package` | String; default is `""` Java package in which the R class will be generated. By default the package is inferred from the directory where the BUILD file containing the rule is. If you use this attribute, you will likely need to use `test_class` as well. | | `densities` | List of strings; default is `[]` Densities to filter for when building the apk. A corresponding compatible-screens section will also be added to the manifest if it does not already contain a superset StarlarkListing. | | `enable_data_binding` | Boolean; default is `False` If true, this rule processes [data binding](https://developer.android.com/topic/libraries/data-binding/index.html) references used in data-binding enabled dependencies used by this test. Without this setting, data-binding dependencies won't have necessary binary-level code generation, and may produce build failures. | -| `javacopts` | List of strings; default is `[]` Extra compiler options for this library. Subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). These compiler options are passed to javac after the global compiler options. | -| `jvm_flags` | List of strings; default is `[]` A list of flags to embed in the wrapper script generated for running this binary. Subject to [$(location)](/versions/7.7.1/reference/be/make-variables#location) and ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution, and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). The wrapper script for a Java binary includes a CLASSPATH definition (to find all the dependent jars) and invokes the right Java interpreter. The command line generated by the wrapper script includes the name of the main class followed by a `"$@"` so you can pass along other arguments after the classname. However, arguments intended for parsing by the JVM must be specified *before* the classname on the command line. The contents of `jvm_flags` are added to the wrapper script before the classname is listed. Note that this attribute has *no effect* on `*_deploy.jar` outputs. | -| `manifest` | [Label](/versions/7.7.1/concepts/labels); default is `None` The name of the Android manifest file, normally `AndroidManifest.xml`. Must be defined if resource\_files or assets are defined or if any of the manifests from the libraries under test have a `minSdkVersion` tag in them. | +| `javacopts` | List of strings; default is `[]` Extra compiler options for this library. Subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). These compiler options are passed to javac after the global compiler options. | +| `jvm_flags` | List of strings; default is `[]` A list of flags to embed in the wrapper script generated for running this binary. Subject to [$(location)](/versions/7.7.3/reference/be/make-variables#location) and ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution, and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). The wrapper script for a Java binary includes a CLASSPATH definition (to find all the dependent jars) and invokes the right Java interpreter. The command line generated by the wrapper script includes the name of the main class followed by a `"$@"` so you can pass along other arguments after the classname. However, arguments intended for parsing by the JVM must be specified *before* the classname on the command line. The contents of `jvm_flags` are added to the wrapper script before the classname is listed. Note that this attribute has *no effect* on `*_deploy.jar` outputs. | +| `manifest` | [Label](/versions/7.7.3/concepts/labels); default is `None` The name of the Android manifest file, normally `AndroidManifest.xml`. Must be defined if resource\_files or assets are defined or if any of the manifests from the libraries under test have a `minSdkVersion` tag in them. | | `manifest_values` | Dictionary: String -> String; default is `{}` A dictionary of values to be overridden in the manifest. Any instance of ${name} in the manifest will be replaced with the value corresponding to name in this dictionary. `applicationId`, `versionCode`, `versionName`, `minSdkVersion`, `targetSdkVersion` and `maxSdkVersion` will also override the corresponding attributes of the manifest and uses-sdk tags. `packageName` will be ignored and will be set from either `applicationId` if specified or the package in the manifest. It is not necessary to have a manifest on the rule in order to use manifest\_values. | | `nocompress_extensions` | List of strings; default is `[]` A list of file extensions to leave uncompressed in the resource apk. | -| `plugins` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Java compiler plugins to run at compile-time. Every `java_plugin` specified in this attribute will be run whenever this rule is built. A library may also inherit plugins from dependencies that use `exported_plugins`. Resources generated by the plugin will be included in the resulting jar of this rule. | +| `plugins` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Java compiler plugins to run at compile-time. Every `java_plugin` specified in this attribute will be run whenever this rule is built. A library may also inherit plugins from dependencies that use `exported_plugins`. Resources generated by the plugin will be included in the resulting jar of this rule. | | `resource_configuration_filters` | List of strings; default is `[]` A list of resource configuration filters, such as 'en' that will limit the resources in the apk to only the ones in the 'en' configuration. | -| `resource_jars` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Deprecated: Use java\_import and deps or runtime\_deps instead. | +| `resource_jars` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Deprecated: Use java\_import and deps or runtime\_deps instead. | | `resource_strip_prefix` | String; default is `""` The path prefix to strip from Java resources. If specified, this path prefix is stripped from every file in the `resources` attribute. It is an error for a resource file not to be under this directory. If not specified (the default), the path of resource file is determined according to the same logic as the Java package of source files. For example, a source file at `stuff/java/foo/bar/a.txt` will be located at `foo/bar/a.txt`. | -| `runtime_deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Libraries to make available to the final binary or test at runtime only. Like ordinary `deps`, these will appear on the runtime classpath, but unlike them, not on the compile-time classpath. Dependencies needed only at runtime should be listed here. Dependency-analysis tools should ignore targets that appear in both `runtime_deps` and `deps`. | -| `stamp` | Integer; default is `0` Whether to encode build information into the binary. Possible values: * `stamp = 1`: Always stamp the build information into the binary, even in [`--nostamp`](/versions/7.7.1/docs/user-manual#flag--stamp) builds. **This setting should be avoided**, since it potentially kills remote caching for the binary and any downstream actions that depend on it. * `stamp = 0`: Always replace build information by constant values. This gives good build result caching. * `stamp = -1`: Embedding of build information is controlled by the [`--[no]stamp`](/versions/7.7.1/docs/user-manual#flag--stamp) flag. Stamped binaries are *not* rebuilt unless their dependencies change. | +| `runtime_deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Libraries to make available to the final binary or test at runtime only. Like ordinary `deps`, these will appear on the runtime classpath, but unlike them, not on the compile-time classpath. Dependencies needed only at runtime should be listed here. Dependency-analysis tools should ignore targets that appear in both `runtime_deps` and `deps`. | +| `stamp` | Integer; default is `0` Whether to encode build information into the binary. Possible values: * `stamp = 1`: Always stamp the build information into the binary, even in [`--nostamp`](/versions/7.7.3/docs/user-manual#flag--stamp) builds. **This setting should be avoided**, since it potentially kills remote caching for the binary and any downstream actions that depend on it. * `stamp = 0`: Always replace build information by constant values. This gives good build result caching. * `stamp = -1`: Embedding of build information is controlled by the [`--[no]stamp`](/versions/7.7.3/docs/user-manual#flag--stamp) flag. Stamped binaries are *not* rebuilt unless their dependencies change. | | `test_class` | String; default is `""` The Java class to be loaded by the test runner. This attribute specifies the name of a Java class to be run by this test. It is rare to need to set this. If this argument is omitted, the Java class whose name corresponds to the `name` of this `android_local_test` rule will be used. The test class needs to be annotated with `org.junit.runner.RunWith`. | -| `use_launcher` | Boolean; default is `True` Whether the binary should use a custom launcher. If this attribute is set to false, the [launcher](/versions/7.7.1/reference/be/java#java_binary.launcher) attribute and the related [`--java_launcher`](/versions/7.7.1/docs/user-manual#flag--java_launcher) flag will be ignored for this target. | +| `use_launcher` | Boolean; default is `True` Whether the binary should use a custom launcher. If this attribute is set to false, the [launcher](/versions/7.7.3/reference/be/java#java_binary.launcher) attribute and the related [`--java_launcher`](/versions/7.7.3/docs/user-manual#flag--java_launcher) flag will be ignored for this target. | ## android\_device @@ -437,7 +437,7 @@ and tests it or runs it as appropriate. `android_device` supports creating KVM images if the underlying -[system\_image](/versions/7.7.1/reference/be/android#android_device.system_image) is X86 based and is +[system\_image](/versions/7.7.3/reference/be/android#android_device.system_image) is X86 based and is optimized for at most the I686 CPU architecture. To use KVM add `tags = ['requires-kvm']` to the `android_device` rule. @@ -501,14 +501,14 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | | `cache` | Integer; required The size in megabytes of the emulator's cache partition. The minimum value of this is 16 megabytes. | -| `default_properties` | [Label](/versions/7.7.1/concepts/labels); default is `None` A single properties file to be placed in /default.prop on the emulator. This allows the rule author to further configure the emulator to appear more like a real device (In particular controlling its UserAgent strings and other behaviour that might cause an application or server to behave differently to a specific device). The properties in this file will override read only properties typically set by the emulator such as ro.product.model. | +| `default_properties` | [Label](/versions/7.7.3/concepts/labels); default is `None` A single properties file to be placed in /default.prop on the emulator. This allows the rule author to further configure the emulator to appear more like a real device (In particular controlling its UserAgent strings and other behaviour that might cause an application or server to behave differently to a specific device). The properties in this file will override read only properties typically set by the emulator such as ro.product.model. | | `horizontal_resolution` | Integer; required The horizontal screen resolution in pixels to emulate. The minimum value is 240. | -| `platform_apks` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` A list of apks to be installed on the device at boot time. | +| `platform_apks` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` A list of apks to be installed on the device at boot time. | | `ram` | Integer; required The amount of ram in megabytes to emulate for the device. This is for the entire device, not just for a particular app installed on the device. The minimum value is 64 megabytes. | | `screen_density` | Integer; required The density of the emulated screen in pixels per inch. The minimum value of this is 30 ppi. | -| `system_image` | [Label](/versions/7.7.1/concepts/labels); required A filegroup containing the following files: * system.img: The system partition * kernel-qemu: The Linux kernel the emulator will load * ramdisk.img: The initrd image to use at boot time * userdata.img: The initial userdata partition * source.properties: A properties file containing information about the images These files are part of the android sdk or provided by third parties (for example Intel provides x86 images). | +| `system_image` | [Label](/versions/7.7.3/concepts/labels); required A filegroup containing the following files: * system.img: The system partition * kernel-qemu: The Linux kernel the emulator will load * ramdisk.img: The initrd image to use at boot time * userdata.img: The initial userdata partition * source.properties: A properties file containing information about the images These files are part of the android sdk or provided by third parties (for example Intel provides x86 images). | | `vertical_resolution` | Integer; required The vertical screen resolution in pixels to emulate. The minimum value is 240. | | `vm_heap` | Integer; required The size in megabytes of the virtual machine heap Android will use for each process. The minimum value is 16 megabytes. | @@ -532,7 +532,7 @@ Note that building for Android also requires an `android_sdk_repository` rule in your `WORKSPACE` file. -For more information, read the [full documentation on using Android NDK with Bazel](https://bazel.build/versions/7.7.1/docs/android-ndk). +For more information, read the [full documentation on using Android NDK with Bazel](https://bazel.build/versions/7.7.3/docs/android-ndk). #### Examples @@ -583,9 +583,9 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `api_level` | Integer; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `0` The Android API level to build against. If not specified, the highest API level installed will be used. | -| `path` | String; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `""` An absolute or relative path to an Android NDK. Either this attribute or the `$ANDROID_NDK_HOME` environment variable must be set. The Android NDK can be downloaded from [the Android developer site](https://developer.android.com/ndk/downloads/index.html). | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `api_level` | Integer; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `0` The Android API level to build against. If not specified, the highest API level installed will be used. | +| `path` | String; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `""` An absolute or relative path to an Android NDK. Either this attribute or the `$ANDROID_NDK_HOME` environment variable must be set. The Android NDK can be downloaded from [the Android developer site](https://developer.android.com/ndk/downloads/index.html). | | `repo_mapping` | Dictionary: String -> String; default is `{}` A dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository. For example, an entry `"@foo": "@bar"` declares that, for any time this repository depends on `"@foo"` (such as a dependency on `"@foo//some:target"`), it should actually resolve that dependency within globally-declared `"@bar"` (`"@bar//some:target"`). | ## android\_sdk\_repository @@ -655,8 +655,8 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `api_level` | Integer; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `0` The Android API level to build against by default. If not specified, the highest API level installed will be used. The API level used for a given build can be overridden by the `android_sdk` flag. `android_sdk_repository` creates an `android_sdk` target for each API level installed in the SDK with name `@androidsdk//:sdk-${level}`, whether or not this attribute is specified. For example, to build against a non-default API level: `bazel build --android_sdk=@androidsdk//:sdk-19 //java/com/example:app`. To view all `android_sdk` targets generated by `android_sdk_repository`, you can run `bazel query "kind(android_sdk, @androidsdk//...)"`. | -| `build_tools_version` | String; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `""` The version of the Android build tools to use from within the Android SDK. If not specified, the latest build tools version installed will be used. Bazel requires build tools version 30.0.0 or later. | -| `path` | String; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `""` An absolute or relative path to an Android SDK. Either this attribute or the `$ANDROID_HOME` environment variable must be set. The Android SDK can be downloaded from [the Android developer site](https://developer.android.com). | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `api_level` | Integer; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `0` The Android API level to build against by default. If not specified, the highest API level installed will be used. The API level used for a given build can be overridden by the `android_sdk` flag. `android_sdk_repository` creates an `android_sdk` target for each API level installed in the SDK with name `@androidsdk//:sdk-${level}`, whether or not this attribute is specified. For example, to build against a non-default API level: `bazel build --android_sdk=@androidsdk//:sdk-19 //java/com/example:app`. To view all `android_sdk` targets generated by `android_sdk_repository`, you can run `bazel query "kind(android_sdk, @androidsdk//...)"`. | +| `build_tools_version` | String; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `""` The version of the Android build tools to use from within the Android SDK. If not specified, the latest build tools version installed will be used. Bazel requires build tools version 30.0.0 or later. | +| `path` | String; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `""` An absolute or relative path to an Android SDK. Either this attribute or the `$ANDROID_HOME` environment variable must be set. The Android SDK can be downloaded from [the Android developer site](https://developer.android.com). | | `repo_mapping` | Dictionary: String -> String; default is `{}` A dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository. For example, an entry `"@foo": "@bar"` declares that, for any time this repository depends on `"@foo"` (such as a dependency on `"@foo//some:target"`), it should actually resolve that dependency within globally-declared `"@bar"` (`"@bar//some:target"`). | \ No newline at end of file
diff --git a/docs/versions/7.7.3/reference/be/be-nav.mdx b/docs/versions/7.7.3/reference/be/be-nav.mdx new file mode 100644 index 0000000..56822ea --- /dev/null +++ b/docs/versions/7.7.3/reference/be/be-nav.mdx
@@ -0,0 +1,32 @@ +\*\*Build Encyclopedia\*\* + +* [Overview](/versions/7.7.3/reference/be/overview) +* [Concepts](#be-menu) + + [Common Definitions](/versions/7.7.3/reference/be/common-definitions) + + ["Make" variables](/versions/7.7.3/reference/be/make-variables) +* [Rules](#be-rules) + + [Functions](/versions/7.7.3/reference/be/functions) + + [Android](/versions/7.7.3/reference/be/android) + + [C / C++](/versions/7.7.3/reference/be/c-cpp) + + [Java](/versions/7.7.3/reference/be/java) + + [Objective-C](/versions/7.7.3/reference/be/objective-c) + + [Protocol Buffer](/versions/7.7.3/reference/be/protocol-buffer) + + [Python](/versions/7.7.3/reference/be/python) + + [Shell](/versions/7.7.3/reference/be/shell) + + [Extra Actions](/versions/7.7.3/reference/be/extra-actions) + + [General](/versions/7.7.3/reference/be/general) + + [Platforms and Toolchains](/versions/7.7.3/reference/be/platforms-and-toolchains) + + [Workspace](/versions/7.7.3/reference/be/workspace) + + [AppEngine](https://github.com/bazelbuild/rules_appengine) + + [Apple (Swift, iOS, macOS, tvOS, visionOS, watchOS)](https://github.com/bazelbuild/rules_apple) + + [C#](https://github.com/bazelbuild/rules_dotnet) + + [D](https://github.com/bazelbuild/rules_d) + + [Docker](https://github.com/bazelbuild/rules_docker) + + [Groovy](https://github.com/bazelbuild/rules_groovy) + + [Go](https://github.com/bazelbuild/rules_go) + + [JavaScript (Closure)](https://github.com/bazelbuild/rules_closure) + + [Jsonnet](https://github.com/bazelbuild/rules_jsonnet) + + [Packaging](/versions/7.7.3/reference/be/pkg) + + [Rust](https://github.com/bazelbuild/rules_rust) + + [Sass](https://github.com/bazelbuild/rules_sass) + + [Scala](https://github.com/bazelbuild/rules_scala) \ No newline at end of file
diff --git a/docs/versions/7.7.1/reference/be/c-cpp.mdx b/docs/versions/7.7.3/reference/be/c-cpp.mdx similarity index 88% rename from docs/versions/7.7.1/reference/be/c-cpp.mdx rename to docs/versions/7.7.3/reference/be/c-cpp.mdx index 948a6a7..374893e 100644 --- a/docs/versions/7.7.1/reference/be/c-cpp.mdx +++ b/docs/versions/7.7.3/reference/be/c-cpp.mdx
@@ -41,22 +41,22 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of other libraries to be linked in to the binary target. These can be `cc_library` or `objc_library` targets. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of C and C++ files that are processed to create the target. These are C/C++ source and header files, either non-generated (normal source code) or generated. All `.cc`, `.c`, and `.cpp` files will be compiled. These might be generated files: if a named file is in the `outs` of some other rule, this rule will automatically depend on that other rule. A `.h` file will not be compiled, but will be available for inclusion by sources in this rule. Both `.cc` and `.h` files can directly include headers listed in these `srcs` or in the `hdrs` of any rule listed in the `deps` argument. All `#include`d files must be mentioned in the `srcs` attribute of this rule, or in the `hdrs` attribute of referenced `cc_library()`s. The recommended style is for headers associated with a library to be listed in that library's `hdrs` attribute, and any remaining headers associated with this rule's sources to be listed in `srcs`. See ["Header inclusion checking"](#hdrs) for a more detailed description. If a rule's name is in the `srcs`, then this rule automatically depends on that one. If the named rule's `outs` are C or C++ source files, they are compiled into this rule; if they are library files, they are linked in. Permitted `srcs` file types: * C and C++ source files: `.c`, `.cc`, `.cpp`, `.cxx`, `.c++`, `.C` * C and C++ header files: `.h`, `.hh`, `.hpp`, `.hxx`, `.inc`, `.inl`, `.H` * Assembler with C preprocessor: `.S` * Archive: `.a`, `.pic.a` * "Always link" library: `.lo`, `.pic.lo` * Shared library, versioned or unversioned: `.so`, `.so.version` * Object file: `.o`, `.pic.o` ...and any rules that produce those files. Different extensions denote different programming languages in accordance with gcc convention. | -| `additional_linker_inputs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Pass these files to the C++ linker command. For example, compiled Windows .res files can be provided here to be embedded in the binary target. | -| `copts` | List of strings; default is `[]` Add these options to the C++ compilation command. Subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). Each string in this attribute is added in the given order to `COPTS` before compiling the binary target. The flags take effect only for compiling this target, not its dependencies, so be careful about header files included elsewhere. All paths should be relative to the workspace, not to the current package. If the package declares the [feature](/versions/7.7.1/reference/be/functions#package.features) `no_copts_tokenization`, Bourne shell tokenization applies only to strings that consist of a single "Make" variable. | -| `defines` | List of strings; default is `[]` List of defines to add to the compile line. Subject to ["Make" variable](/versions/7.7.1/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). Each string, which must consist of a single Bourne shell token, is prepended with `-D` and added to the compile command line to this target, as well as to every rule that depends on it. Be very careful, since this may have far-reaching effects. When in doubt, add define values to [`local_defines`](#cc_binary.local_defines) instead. | -| `includes` | List of strings; default is `[]` List of include dirs to be added to the compile line. Subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution. Each string is prepended with `-isystem` and added to `COPTS`. Unlike [COPTS](#cc_binary.copts), these flags are added for this rule and every rule that depends on it. (Note: not the rules it depends upon!) Be very careful, since this may have far-reaching effects. When in doubt, add "-I" flags to [COPTS](#cc_binary.copts) instead. Headers must be added to srcs or hdrs, otherwise they will not be available to dependent rules when compilation is sandboxed (the default). | -| `link_extra_lib` | [Label](/versions/7.7.1/concepts/labels); default is `"@bazel_tools//tools/cpp:link_extra_lib"` Control linking of extra libraries. By default, C++ binaries are linked against `//tools/cpp:link_extra_lib`, which by default depends on the label flag `//tools/cpp:link_extra_libs`. Without setting the flag, this library is empty by default. Setting the label flag allows linking optional dependencies, such as overrides for weak symbols, interceptors for shared library functions, or special runtime libraries (for malloc replacements, prefer `malloc` or `--custom_malloc`). Setting this attribute to `None` disables this behaviour. | -| `linkopts` | List of strings; default is `[]` Add these flags to the C++ linker command. Subject to ["Make" variable](/versions/7.7.1/reference/be/make-variables) substitution, [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization) and [label expansion](/versions/7.7.1/reference/be/common-definitions#label-expansion). Each string in this attribute is added to `LINKOPTS` before linking the binary target. Each element of this list that does not start with `$` or `-` is assumed to be the label of a target in `deps`. The list of files generated by that target is appended to the linker options. An error is reported if the label is invalid, or is not declared in `deps`. | -| `linkshared` | Boolean; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `False` Create a shared library. To enable this attribute, include `linkshared=True` in your rule. By default this option is off. The presence of this flag means that linking occurs with the `-shared` flag to `gcc`, and the resulting shared library is suitable for loading into for example a Java program. However, for build purposes it will never be linked into the dependent binary, as it is assumed that shared libraries built with a [cc\_binary](#cc_binary) rule are only loaded manually by other programs, so it should not be considered a substitute for the [cc\_library](#cc_library) rule. For sake of scalability we recommend avoiding this approach altogether and simply letting `java_library` depend on `cc_library` rules instead. If you specify both `linkopts=['-static']` and `linkshared=True`, you get a single completely self-contained unit. If you specify both `linkstatic=True` and `linkshared=True`, you get a single, mostly self-contained unit. | -| `linkstatic` | Boolean; default is `True` For [`cc_binary`](/versions/7.7.1/reference/be/c-cpp#cc_binary) and [`cc_test`](/versions/7.7.1/reference/be/c-cpp#cc_test): link the binary in static mode. For `cc_library.linkstatic`: see below. By default this option is on for `cc_binary` and off for the rest. If enabled and this is a binary or test, this option tells the build tool to link in `.a`'s instead of `.so`'s for user libraries whenever possible. Some system libraries may still be linked dynamically, as are libraries for which there is no static library. So the resulting executable will still be dynamically linked, hence only *mostly* static. There are really three different ways to link an executable: * STATIC with fully\_static\_link feature, in which everything is linked statically; e.g. "`gcc -static foo.o libbar.a libbaz.a -lm`". This mode is enabled by specifying `fully_static_link` in the [`features`](/versions/7.7.1/reference/be/common-definitions#features) attribute. * STATIC, in which all user libraries are linked statically (if a static version is available), but where system libraries (excluding C/C++ runtime libraries) are linked dynamically, e.g. "`gcc foo.o libfoo.a libbaz.a -lm`". This mode is enabled by specifying `linkstatic=True`. * DYNAMIC, in which all libraries are linked dynamically (if a dynamic version is available), e.g. "`gcc foo.o libfoo.so libbaz.so -lm`". This mode is enabled by specifying `linkstatic=False`. The `linkstatic` attribute has a different meaning if used on a [`cc_library()`](/versions/7.7.1/reference/be/c-cpp#cc_library) rule. For a C++ library, `linkstatic=True` indicates that only static linking is allowed, so no `.so` will be produced. linkstatic=False does not prevent static libraries from being created. The attribute is meant to control the creation of dynamic libraries. If `linkstatic=False`, then the build tool will create symlinks to depended-upon shared libraries in the `*.runfiles` area. | -| `local_defines` | List of strings; default is `[]` List of defines to add to the compile line. Subject to ["Make" variable](/versions/7.7.1/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). Each string, which must consist of a single Bourne shell token, is prepended with `-D` and added to the compile command line for this target, but not to its dependents. | -| `malloc` | [Label](/versions/7.7.1/concepts/labels); default is `"@bazel_tools//tools/cpp:malloc"` Override the default dependency on malloc. By default, C++ binaries are linked against `//tools/cpp:malloc`, which is an empty library so the binary ends up using libc malloc. This label must refer to a `cc_library`. If compilation is for a non-C++ rule, this option has no effect. The value of this attribute is ignored if `linkshared=True` is specified. | -| `nocopts` | String; default is `""` Remove matching options from the C++ compilation command. Subject to ["Make" variable](/versions/7.7.1/reference/be/make-variables) substitution. The value of this attribute is interpreted as a regular expression. Any preexisting `COPTS` that match this regular expression (including values explicitly specified in the rule's [copts](#cc_binary.copts) attribute) will be removed from `COPTS` for purposes of compiling this rule. This attribute should rarely be needed. | -| `stamp` | Integer; default is `-1` Whether to encode build information into the binary. Possible values: * `stamp = 1`: Always stamp the build information into the binary, even in [`--nostamp`](/versions/7.7.1/docs/user-manual#flag--stamp) builds. **This setting should be avoided**, since it potentially kills remote caching for the binary and any downstream actions that depend on it. * `stamp = 0`: Always replace build information by constant values. This gives good build result caching. * `stamp = -1`: Embedding of build information is controlled by the [`--[no]stamp`](/versions/7.7.1/docs/user-manual#flag--stamp) flag. Stamped binaries are *not* rebuilt unless their dependencies change. | -| `win_def_file` | [Label](/versions/7.7.1/concepts/labels); default is `None` The Windows DEF file to be passed to linker. This attribute should only be used when Windows is the target platform. It can be used to [export symbols](https://msdn.microsoft.com/en-us/library/d91k01sh.aspx) during linking a shared library. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of other libraries to be linked in to the binary target. These can be `cc_library` or `objc_library` targets. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of C and C++ files that are processed to create the target. These are C/C++ source and header files, either non-generated (normal source code) or generated. All `.cc`, `.c`, and `.cpp` files will be compiled. These might be generated files: if a named file is in the `outs` of some other rule, this rule will automatically depend on that other rule. A `.h` file will not be compiled, but will be available for inclusion by sources in this rule. Both `.cc` and `.h` files can directly include headers listed in these `srcs` or in the `hdrs` of any rule listed in the `deps` argument. All `#include`d files must be mentioned in the `srcs` attribute of this rule, or in the `hdrs` attribute of referenced `cc_library()`s. The recommended style is for headers associated with a library to be listed in that library's `hdrs` attribute, and any remaining headers associated with this rule's sources to be listed in `srcs`. See ["Header inclusion checking"](#hdrs) for a more detailed description. If a rule's name is in the `srcs`, then this rule automatically depends on that one. If the named rule's `outs` are C or C++ source files, they are compiled into this rule; if they are library files, they are linked in. Permitted `srcs` file types: * C and C++ source files: `.c`, `.cc`, `.cpp`, `.cxx`, `.c++`, `.C` * C and C++ header files: `.h`, `.hh`, `.hpp`, `.hxx`, `.inc`, `.inl`, `.H` * Assembler with C preprocessor: `.S` * Archive: `.a`, `.pic.a` * "Always link" library: `.lo`, `.pic.lo` * Shared library, versioned or unversioned: `.so`, `.so.version` * Object file: `.o`, `.pic.o` ...and any rules that produce those files. Different extensions denote different programming languages in accordance with gcc convention. | +| `additional_linker_inputs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Pass these files to the C++ linker command. For example, compiled Windows .res files can be provided here to be embedded in the binary target. | +| `copts` | List of strings; default is `[]` Add these options to the C++ compilation command. Subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). Each string in this attribute is added in the given order to `COPTS` before compiling the binary target. The flags take effect only for compiling this target, not its dependencies, so be careful about header files included elsewhere. All paths should be relative to the workspace, not to the current package. If the package declares the [feature](/versions/7.7.3/reference/be/functions#package.features) `no_copts_tokenization`, Bourne shell tokenization applies only to strings that consist of a single "Make" variable. | +| `defines` | List of strings; default is `[]` List of defines to add to the compile line. Subject to ["Make" variable](/versions/7.7.3/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). Each string, which must consist of a single Bourne shell token, is prepended with `-D` and added to the compile command line to this target, as well as to every rule that depends on it. Be very careful, since this may have far-reaching effects. When in doubt, add define values to [`local_defines`](#cc_binary.local_defines) instead. | +| `includes` | List of strings; default is `[]` List of include dirs to be added to the compile line. Subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution. Each string is prepended with `-isystem` and added to `COPTS`. Unlike [COPTS](#cc_binary.copts), these flags are added for this rule and every rule that depends on it. (Note: not the rules it depends upon!) Be very careful, since this may have far-reaching effects. When in doubt, add "-I" flags to [COPTS](#cc_binary.copts) instead. Headers must be added to srcs or hdrs, otherwise they will not be available to dependent rules when compilation is sandboxed (the default). | +| `link_extra_lib` | [Label](/versions/7.7.3/concepts/labels); default is `"@bazel_tools//tools/cpp:link_extra_lib"` Control linking of extra libraries. By default, C++ binaries are linked against `//tools/cpp:link_extra_lib`, which by default depends on the label flag `//tools/cpp:link_extra_libs`. Without setting the flag, this library is empty by default. Setting the label flag allows linking optional dependencies, such as overrides for weak symbols, interceptors for shared library functions, or special runtime libraries (for malloc replacements, prefer `malloc` or `--custom_malloc`). Setting this attribute to `None` disables this behaviour. | +| `linkopts` | List of strings; default is `[]` Add these flags to the C++ linker command. Subject to ["Make" variable](/versions/7.7.3/reference/be/make-variables) substitution, [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization) and [label expansion](/versions/7.7.3/reference/be/common-definitions#label-expansion). Each string in this attribute is added to `LINKOPTS` before linking the binary target. Each element of this list that does not start with `$` or `-` is assumed to be the label of a target in `deps`. The list of files generated by that target is appended to the linker options. An error is reported if the label is invalid, or is not declared in `deps`. | +| `linkshared` | Boolean; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `False` Create a shared library. To enable this attribute, include `linkshared=True` in your rule. By default this option is off. The presence of this flag means that linking occurs with the `-shared` flag to `gcc`, and the resulting shared library is suitable for loading into for example a Java program. However, for build purposes it will never be linked into the dependent binary, as it is assumed that shared libraries built with a [cc\_binary](#cc_binary) rule are only loaded manually by other programs, so it should not be considered a substitute for the [cc\_library](#cc_library) rule. For sake of scalability we recommend avoiding this approach altogether and simply letting `java_library` depend on `cc_library` rules instead. If you specify both `linkopts=['-static']` and `linkshared=True`, you get a single completely self-contained unit. If you specify both `linkstatic=True` and `linkshared=True`, you get a single, mostly self-contained unit. | +| `linkstatic` | Boolean; default is `True` For [`cc_binary`](/versions/7.7.3/reference/be/c-cpp#cc_binary) and [`cc_test`](/versions/7.7.3/reference/be/c-cpp#cc_test): link the binary in static mode. For `cc_library.linkstatic`: see below. By default this option is on for `cc_binary` and off for the rest. If enabled and this is a binary or test, this option tells the build tool to link in `.a`'s instead of `.so`'s for user libraries whenever possible. Some system libraries may still be linked dynamically, as are libraries for which there is no static library. So the resulting executable will still be dynamically linked, hence only *mostly* static. There are really three different ways to link an executable: * STATIC with fully\_static\_link feature, in which everything is linked statically; e.g. "`gcc -static foo.o libbar.a libbaz.a -lm`". This mode is enabled by specifying `fully_static_link` in the [`features`](/versions/7.7.3/reference/be/common-definitions#features) attribute. * STATIC, in which all user libraries are linked statically (if a static version is available), but where system libraries (excluding C/C++ runtime libraries) are linked dynamically, e.g. "`gcc foo.o libfoo.a libbaz.a -lm`". This mode is enabled by specifying `linkstatic=True`. * DYNAMIC, in which all libraries are linked dynamically (if a dynamic version is available), e.g. "`gcc foo.o libfoo.so libbaz.so -lm`". This mode is enabled by specifying `linkstatic=False`. The `linkstatic` attribute has a different meaning if used on a [`cc_library()`](/versions/7.7.3/reference/be/c-cpp#cc_library) rule. For a C++ library, `linkstatic=True` indicates that only static linking is allowed, so no `.so` will be produced. linkstatic=False does not prevent static libraries from being created. The attribute is meant to control the creation of dynamic libraries. If `linkstatic=False`, then the build tool will create symlinks to depended-upon shared libraries in the `*.runfiles` area. | +| `local_defines` | List of strings; default is `[]` List of defines to add to the compile line. Subject to ["Make" variable](/versions/7.7.3/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). Each string, which must consist of a single Bourne shell token, is prepended with `-D` and added to the compile command line for this target, but not to its dependents. | +| `malloc` | [Label](/versions/7.7.3/concepts/labels); default is `"@bazel_tools//tools/cpp:malloc"` Override the default dependency on malloc. By default, C++ binaries are linked against `//tools/cpp:malloc`, which is an empty library so the binary ends up using libc malloc. This label must refer to a `cc_library`. If compilation is for a non-C++ rule, this option has no effect. The value of this attribute is ignored if `linkshared=True` is specified. | +| `nocopts` | String; default is `""` Remove matching options from the C++ compilation command. Subject to ["Make" variable](/versions/7.7.3/reference/be/make-variables) substitution. The value of this attribute is interpreted as a regular expression. Any preexisting `COPTS` that match this regular expression (including values explicitly specified in the rule's [copts](#cc_binary.copts) attribute) will be removed from `COPTS` for purposes of compiling this rule. This attribute should rarely be needed. | +| `stamp` | Integer; default is `-1` Whether to encode build information into the binary. Possible values: * `stamp = 1`: Always stamp the build information into the binary, even in [`--nostamp`](/versions/7.7.3/docs/user-manual#flag--stamp) builds. **This setting should be avoided**, since it potentially kills remote caching for the binary and any downstream actions that depend on it. * `stamp = 0`: Always replace build information by constant values. This gives good build result caching. * `stamp = -1`: Embedding of build information is controlled by the [`--[no]stamp`](/versions/7.7.3/docs/user-manual#flag--stamp) flag. Stamped binaries are *not* rebuilt unless their dependencies change. | +| `win_def_file` | [Label](/versions/7.7.3/concepts/labels); default is `None` The Windows DEF file to be passed to linker. This attribute should only be used when Windows is the target platform. It can be used to [export symbols](https://msdn.microsoft.com/en-us/library/d91k01sh.aspx) during linking a shared library. | ## cc\_import @@ -190,13 +190,13 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of other libraries that the target depends upon. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.1/reference/be/common-definitions#typical-attributes). | -| `hdrs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of header files published by this precompiled library to be directly included by sources in dependent rules. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of other libraries that the target depends upon. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.3/reference/be/common-definitions#typical-attributes). | +| `hdrs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of header files published by this precompiled library to be directly included by sources in dependent rules. | | `alwayslink` | Boolean; default is `False` If 1, any binary that depends (directly or indirectly) on this C++ precompiled library will link in all the object files archived in the static library, even if some contain no symbols referenced by the binary. This is useful if your code isn't explicitly called by code in the binary, e.g., if your code registers to receive some callback provided by some service. If alwayslink doesn't work with VS 2017 on Windows, that is due to a [known issue](https://github.com/bazelbuild/bazel/issues/3949), please upgrade your VS 2017 to the latest version. | -| `interface_library` | [Label](/versions/7.7.1/concepts/labels); default is `None` A single interface library for linking the shared library. Permitted file types: `.ifso`, `.tbd`, `.lib`, `.so` or `.dylib` | -| `shared_library` | [Label](/versions/7.7.1/concepts/labels); default is `None` A single precompiled shared library. Bazel ensures it is available to the binary that depends on it during runtime. Permitted file types: `.so`, `.dll` or `.dylib` | -| `static_library` | [Label](/versions/7.7.1/concepts/labels); default is `None` A single precompiled static library. Permitted file types: `.a`, `.pic.a` or `.lib` | +| `interface_library` | [Label](/versions/7.7.3/concepts/labels); default is `None` A single interface library for linking the shared library. Permitted file types: `.ifso`, `.tbd`, `.lib`, `.so` or `.dylib` | +| `shared_library` | [Label](/versions/7.7.3/concepts/labels); default is `None` A single precompiled shared library. Bazel ensures it is available to the binary that depends on it during runtime. Permitted file types: `.so`, `.dll` or `.dylib` | +| `static_library` | [Label](/versions/7.7.3/concepts/labels); default is `None` A single precompiled static library. Permitted file types: `.a`, `.pic.a` or `.lib` | | `system_provided` | Boolean; default is `False` If 1, it indicates the shared library required at runtime is provided by the system. In this case, `interface_library` should be specified and `shared_library` should be empty. | ## cc\_library @@ -291,33 +291,33 @@ and requested explicitly, for example via the `--features=layering_check` command-line flag or the `features` parameter of the -[`package`](/versions/7.7.1/reference/be/functions#package) function. The toolchains +[`package`](/versions/7.7.3/reference/be/functions#package) function. The toolchains provided by Bazel only support this feature with clang on Unix and macOS. ### Arguments | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of other libraries to be linked in to the binary target. These can be `cc_library` or `objc_library` targets. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of C and C++ files that are processed to create the target. These are C/C++ source and header files, either non-generated (normal source code) or generated. All `.cc`, `.c`, and `.cpp` files will be compiled. These might be generated files: if a named file is in the `outs` of some other rule, this rule will automatically depend on that other rule. A `.h` file will not be compiled, but will be available for inclusion by sources in this rule. Both `.cc` and `.h` files can directly include headers listed in these `srcs` or in the `hdrs` of any rule listed in the `deps` argument. All `#include`d files must be mentioned in the `srcs` attribute of this rule, or in the `hdrs` attribute of referenced `cc_library()`s. The recommended style is for headers associated with a library to be listed in that library's `hdrs` attribute, and any remaining headers associated with this rule's sources to be listed in `srcs`. See ["Header inclusion checking"](#hdrs) for a more detailed description. If a rule's name is in the `srcs`, then this rule automatically depends on that one. If the named rule's `outs` are C or C++ source files, they are compiled into this rule; if they are library files, they are linked in. Permitted `srcs` file types: * C and C++ source files: `.c`, `.cc`, `.cpp`, `.cxx`, `.c++`, `.C` * C and C++ header files: `.h`, `.hh`, `.hpp`, `.hxx`, `.inc`, `.inl`, `.H` * Assembler with C preprocessor: `.S` * Archive: `.a`, `.pic.a` * "Always link" library: `.lo`, `.pic.lo` * Shared library, versioned or unversioned: `.so`, `.so.version` * Object file: `.o`, `.pic.o` ...and any rules that produce those files. Different extensions denote different programming languages in accordance with gcc convention. | -| `hdrs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of header files published by this library to be directly included by sources in dependent rules. This is the strongly preferred location for declaring header files that describe the interface for the library. These headers will be made available for inclusion by sources in this rule or in dependent rules. Headers not meant to be included by a client of this library should be listed in the `srcs` attribute instead, even if they are included by a published header. See ["Header inclusion checking"](#hdrs) for a more detailed description. | -| `additional_compiler_inputs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Any additional files you might want to pass to the compiler command line, such as sanitizer ignorelists, for example. Files specified here can then be used in copts with the $(location) function. | -| `additional_linker_inputs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Pass these files to the C++ linker command. For example, compiled Windows .res files can be provided here to be embedded in the binary target. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of other libraries to be linked in to the binary target. These can be `cc_library` or `objc_library` targets. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of C and C++ files that are processed to create the target. These are C/C++ source and header files, either non-generated (normal source code) or generated. All `.cc`, `.c`, and `.cpp` files will be compiled. These might be generated files: if a named file is in the `outs` of some other rule, this rule will automatically depend on that other rule. A `.h` file will not be compiled, but will be available for inclusion by sources in this rule. Both `.cc` and `.h` files can directly include headers listed in these `srcs` or in the `hdrs` of any rule listed in the `deps` argument. All `#include`d files must be mentioned in the `srcs` attribute of this rule, or in the `hdrs` attribute of referenced `cc_library()`s. The recommended style is for headers associated with a library to be listed in that library's `hdrs` attribute, and any remaining headers associated with this rule's sources to be listed in `srcs`. See ["Header inclusion checking"](#hdrs) for a more detailed description. If a rule's name is in the `srcs`, then this rule automatically depends on that one. If the named rule's `outs` are C or C++ source files, they are compiled into this rule; if they are library files, they are linked in. Permitted `srcs` file types: * C and C++ source files: `.c`, `.cc`, `.cpp`, `.cxx`, `.c++`, `.C` * C and C++ header files: `.h`, `.hh`, `.hpp`, `.hxx`, `.inc`, `.inl`, `.H` * Assembler with C preprocessor: `.S` * Archive: `.a`, `.pic.a` * "Always link" library: `.lo`, `.pic.lo` * Shared library, versioned or unversioned: `.so`, `.so.version` * Object file: `.o`, `.pic.o` ...and any rules that produce those files. Different extensions denote different programming languages in accordance with gcc convention. | +| `hdrs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of header files published by this library to be directly included by sources in dependent rules. This is the strongly preferred location for declaring header files that describe the interface for the library. These headers will be made available for inclusion by sources in this rule or in dependent rules. Headers not meant to be included by a client of this library should be listed in the `srcs` attribute instead, even if they are included by a published header. See ["Header inclusion checking"](#hdrs) for a more detailed description. | +| `additional_compiler_inputs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Any additional files you might want to pass to the compiler command line, such as sanitizer ignorelists, for example. Files specified here can then be used in copts with the $(location) function. | +| `additional_linker_inputs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Pass these files to the C++ linker command. For example, compiled Windows .res files can be provided here to be embedded in the binary target. | | `alwayslink` | Boolean; default is `False` If 1, any binary that depends (directly or indirectly) on this C++ library will link in all the object files for the files listed in `srcs`, even if some contain no symbols referenced by the binary. This is useful if your code isn't explicitly called by code in the binary, e.g., if your code registers to receive some callback provided by some service. If alwayslink doesn't work with VS 2017 on Windows, that is due to a [known issue](https://github.com/bazelbuild/bazel/issues/3949), please upgrade your VS 2017 to the latest version. | -| `copts` | List of strings; default is `[]` Add these options to the C++ compilation command. Subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). Each string in this attribute is added in the given order to `COPTS` before compiling the binary target. The flags take effect only for compiling this target, not its dependencies, so be careful about header files included elsewhere. All paths should be relative to the workspace, not to the current package. If the package declares the [feature](/versions/7.7.1/reference/be/functions#package.features) `no_copts_tokenization`, Bourne shell tokenization applies only to strings that consist of a single "Make" variable. | -| `defines` | List of strings; default is `[]` List of defines to add to the compile line. Subject to ["Make" variable](/versions/7.7.1/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). Each string, which must consist of a single Bourne shell token, is prepended with `-D` and added to the compile command line to this target, as well as to every rule that depends on it. Be very careful, since this may have far-reaching effects. When in doubt, add define values to [`local_defines`](#cc_binary.local_defines) instead. | -| `implementation_deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of other libraries that the library target depends on. Unlike with `deps`, the headers and include paths of these libraries (and all their transitive deps) are only used for compilation of this library, and not libraries that depend on it. Libraries specified with `implementation_deps` are still linked in binary targets that depend on this library. For now usage is limited to cc\_libraries and guarded by the flag `--experimental_cc_implementation_deps`. | +| `copts` | List of strings; default is `[]` Add these options to the C++ compilation command. Subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). Each string in this attribute is added in the given order to `COPTS` before compiling the binary target. The flags take effect only for compiling this target, not its dependencies, so be careful about header files included elsewhere. All paths should be relative to the workspace, not to the current package. If the package declares the [feature](/versions/7.7.3/reference/be/functions#package.features) `no_copts_tokenization`, Bourne shell tokenization applies only to strings that consist of a single "Make" variable. | +| `defines` | List of strings; default is `[]` List of defines to add to the compile line. Subject to ["Make" variable](/versions/7.7.3/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). Each string, which must consist of a single Bourne shell token, is prepended with `-D` and added to the compile command line to this target, as well as to every rule that depends on it. Be very careful, since this may have far-reaching effects. When in doubt, add define values to [`local_defines`](#cc_binary.local_defines) instead. | +| `implementation_deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of other libraries that the library target depends on. Unlike with `deps`, the headers and include paths of these libraries (and all their transitive deps) are only used for compilation of this library, and not libraries that depend on it. Libraries specified with `implementation_deps` are still linked in binary targets that depend on this library. For now usage is limited to cc\_libraries and guarded by the flag `--experimental_cc_implementation_deps`. | | `include_prefix` | String; default is `""` The prefix to add to the paths of the headers of this rule. When set, the headers in the `hdrs` attribute of this rule are accessible at is the value of this attribute prepended to their repository-relative path. The prefix in the `strip_include_prefix` attribute is removed before this prefix is added. | -| `includes` | List of strings; default is `[]` List of include dirs to be added to the compile line. Subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution. Each string is prepended with `-isystem` and added to `COPTS`. Unlike [COPTS](#cc_binary.copts), these flags are added for this rule and every rule that depends on it. (Note: not the rules it depends upon!) Be very careful, since this may have far-reaching effects. When in doubt, add "-I" flags to [COPTS](#cc_binary.copts) instead. Headers must be added to srcs or hdrs, otherwise they will not be available to dependent rules when compilation is sandboxed (the default). | -| `linkopts` | List of strings; default is `[]` Add these flags to the C++ linker command. Subject to ["Make" variable](/versions/7.7.1/reference/be/make-variables) substitution, [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization) and [label expansion](/versions/7.7.1/reference/be/common-definitions#label-expansion). Each string in this attribute is added to `LINKOPTS` before linking the binary target. Each element of this list that does not start with `$` or `-` is assumed to be the label of a target in `deps`. The list of files generated by that target is appended to the linker options. An error is reported if the label is invalid, or is not declared in `deps`. | -| `linkstamp` | [Label](/versions/7.7.1/concepts/labels); default is `None` Simultaneously compiles and links the specified C++ source file into the final binary. This trickery is required to introduce timestamp information into binaries; if we compiled the source file to an object file in the usual way, the timestamp would be incorrect. A linkstamp compilation may not include any particular set of compiler flags and so should not depend on any particular header, compiler option, or other build variable. *This option should only be needed in the `base` package.* | -| `linkstatic` | Boolean; default is `False` For [`cc_binary`](/versions/7.7.1/reference/be/c-cpp#cc_binary) and [`cc_test`](/versions/7.7.1/reference/be/c-cpp#cc_test): link the binary in static mode. For `cc_library.linkstatic`: see below. By default this option is on for `cc_binary` and off for the rest. If enabled and this is a binary or test, this option tells the build tool to link in `.a`'s instead of `.so`'s for user libraries whenever possible. Some system libraries may still be linked dynamically, as are libraries for which there is no static library. So the resulting executable will still be dynamically linked, hence only *mostly* static. There are really three different ways to link an executable: * STATIC with fully\_static\_link feature, in which everything is linked statically; e.g. "`gcc -static foo.o libbar.a libbaz.a -lm`". This mode is enabled by specifying `fully_static_link` in the [`features`](/versions/7.7.1/reference/be/common-definitions#features) attribute. * STATIC, in which all user libraries are linked statically (if a static version is available), but where system libraries (excluding C/C++ runtime libraries) are linked dynamically, e.g. "`gcc foo.o libfoo.a libbaz.a -lm`". This mode is enabled by specifying `linkstatic=True`. * DYNAMIC, in which all libraries are linked dynamically (if a dynamic version is available), e.g. "`gcc foo.o libfoo.so libbaz.so -lm`". This mode is enabled by specifying `linkstatic=False`. The `linkstatic` attribute has a different meaning if used on a [`cc_library()`](/versions/7.7.1/reference/be/c-cpp#cc_library) rule. For a C++ library, `linkstatic=True` indicates that only static linking is allowed, so no `.so` will be produced. linkstatic=False does not prevent static libraries from being created. The attribute is meant to control the creation of dynamic libraries. If `linkstatic=False`, then the build tool will create symlinks to depended-upon shared libraries in the `*.runfiles` area. | -| `local_defines` | List of strings; default is `[]` List of defines to add to the compile line. Subject to ["Make" variable](/versions/7.7.1/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). Each string, which must consist of a single Bourne shell token, is prepended with `-D` and added to the compile command line for this target, but not to its dependents. | -| `nocopts` | String; default is `""` Remove matching options from the C++ compilation command. Subject to ["Make" variable](/versions/7.7.1/reference/be/make-variables) substitution. The value of this attribute is interpreted as a regular expression. Any preexisting `COPTS` that match this regular expression (including values explicitly specified in the rule's [copts](#cc_binary.copts) attribute) will be removed from `COPTS` for purposes of compiling this rule. This attribute should rarely be needed. | +| `includes` | List of strings; default is `[]` List of include dirs to be added to the compile line. Subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution. Each string is prepended with `-isystem` and added to `COPTS`. Unlike [COPTS](#cc_binary.copts), these flags are added for this rule and every rule that depends on it. (Note: not the rules it depends upon!) Be very careful, since this may have far-reaching effects. When in doubt, add "-I" flags to [COPTS](#cc_binary.copts) instead. Headers must be added to srcs or hdrs, otherwise they will not be available to dependent rules when compilation is sandboxed (the default). | +| `linkopts` | List of strings; default is `[]` Add these flags to the C++ linker command. Subject to ["Make" variable](/versions/7.7.3/reference/be/make-variables) substitution, [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization) and [label expansion](/versions/7.7.3/reference/be/common-definitions#label-expansion). Each string in this attribute is added to `LINKOPTS` before linking the binary target. Each element of this list that does not start with `$` or `-` is assumed to be the label of a target in `deps`. The list of files generated by that target is appended to the linker options. An error is reported if the label is invalid, or is not declared in `deps`. | +| `linkstamp` | [Label](/versions/7.7.3/concepts/labels); default is `None` Simultaneously compiles and links the specified C++ source file into the final binary. This trickery is required to introduce timestamp information into binaries; if we compiled the source file to an object file in the usual way, the timestamp would be incorrect. A linkstamp compilation may not include any particular set of compiler flags and so should not depend on any particular header, compiler option, or other build variable. *This option should only be needed in the `base` package.* | +| `linkstatic` | Boolean; default is `False` For [`cc_binary`](/versions/7.7.3/reference/be/c-cpp#cc_binary) and [`cc_test`](/versions/7.7.3/reference/be/c-cpp#cc_test): link the binary in static mode. For `cc_library.linkstatic`: see below. By default this option is on for `cc_binary` and off for the rest. If enabled and this is a binary or test, this option tells the build tool to link in `.a`'s instead of `.so`'s for user libraries whenever possible. Some system libraries may still be linked dynamically, as are libraries for which there is no static library. So the resulting executable will still be dynamically linked, hence only *mostly* static. There are really three different ways to link an executable: * STATIC with fully\_static\_link feature, in which everything is linked statically; e.g. "`gcc -static foo.o libbar.a libbaz.a -lm`". This mode is enabled by specifying `fully_static_link` in the [`features`](/versions/7.7.3/reference/be/common-definitions#features) attribute. * STATIC, in which all user libraries are linked statically (if a static version is available), but where system libraries (excluding C/C++ runtime libraries) are linked dynamically, e.g. "`gcc foo.o libfoo.a libbaz.a -lm`". This mode is enabled by specifying `linkstatic=True`. * DYNAMIC, in which all libraries are linked dynamically (if a dynamic version is available), e.g. "`gcc foo.o libfoo.so libbaz.so -lm`". This mode is enabled by specifying `linkstatic=False`. The `linkstatic` attribute has a different meaning if used on a [`cc_library()`](/versions/7.7.3/reference/be/c-cpp#cc_library) rule. For a C++ library, `linkstatic=True` indicates that only static linking is allowed, so no `.so` will be produced. linkstatic=False does not prevent static libraries from being created. The attribute is meant to control the creation of dynamic libraries. If `linkstatic=False`, then the build tool will create symlinks to depended-upon shared libraries in the `*.runfiles` area. | +| `local_defines` | List of strings; default is `[]` List of defines to add to the compile line. Subject to ["Make" variable](/versions/7.7.3/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). Each string, which must consist of a single Bourne shell token, is prepended with `-D` and added to the compile command line for this target, but not to its dependents. | +| `nocopts` | String; default is `""` Remove matching options from the C++ compilation command. Subject to ["Make" variable](/versions/7.7.3/reference/be/make-variables) substitution. The value of this attribute is interpreted as a regular expression. Any preexisting `COPTS` that match this regular expression (including values explicitly specified in the rule's [copts](#cc_binary.copts) attribute) will be removed from `COPTS` for purposes of compiling this rule. This attribute should rarely be needed. | | `strip_include_prefix` | String; default is `""` The prefix to strip from the paths of the headers of this rule. When set, the headers in the `hdrs` attribute of this rule are accessible at their path with this prefix cut off. If it's a relative path, it's taken as a package-relative one. If it's an absolute one, it's understood as a repository-relative path. The prefix in the `include_prefix` attribute is added after this prefix is stripped. | -| `textual_hdrs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of header files published by this library to be textually included by sources in dependent rules. This is the location for declaring header files that cannot be compiled on their own; that is, they always need to be textually included by other source files to build valid code. | -| `win_def_file` | [Label](/versions/7.7.1/concepts/labels); default is `None` The Windows DEF file to be passed to linker. This attribute should only be used when Windows is the target platform. It can be used to [export symbols](https://msdn.microsoft.com/en-us/library/d91k01sh.aspx) during linking a shared library. | +| `textual_hdrs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of header files published by this library to be textually included by sources in dependent rules. This is the location for declaring header files that cannot be compiled on their own; that is, they always need to be textually included by other source files to build valid code. | +| `win_def_file` | [Label](/versions/7.7.3/concepts/labels); default is `None` The Windows DEF file to be passed to linker. This attribute should only be used when Windows is the target platform. It can be used to [export symbols](https://msdn.microsoft.com/en-us/library/d91k01sh.aspx) during linking a shared library. | ## cc\_proto\_library @@ -329,7 +329,7 @@ `cc_proto_library` generates C++ code from `.proto` files. -`deps` must point to [`proto_library`](/versions/7.7.1/reference/be/protocol-buffer#proto_library) rules. +`deps` must point to [`proto_library`](/versions/7.7.3/reference/be/protocol-buffer#proto_library) rules. Example: @@ -353,8 +353,8 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of [`proto_library`](/versions/7.7.1/reference/be/protocol-buffer#proto_library) rules to generate C++ code for. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of [`proto_library`](/versions/7.7.3/reference/be/protocol-buffer#proto_library) rules to generate C++ code for. | ## cc\_shared\_library @@ -490,14 +490,14 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Top level libraries that will unconditionally be statically linked into the shared library after being whole-archived. Any transitive library dependency of these direct deps will be linked into this shared library as long as they have not already been linked by a `cc_shared_library` in `dynamic_deps`. During analysis, the rule implementation will consider any target listed in `deps` as being exported by the shared library in order to give errors when multiple `cc_shared_libraries` export the same targets. The rule implementation does not take care of informing the linker about which symbols should be exported by the shared object. The user should take care of this via linker scripts or visibility declarations in the source code. The implementation will also trigger errors whenever the same library is linked statically into more than one `cc_shared_library`. This can be avoided by adding `"LINKABLE_MORE_THAN_ONCE"` to the `cc_library.tags` or by listing the `cc\_library` as an export of one of the shared libraries so that one can be made a `dynamic_dep` of the other. | -| `additional_linker_inputs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Any additional files that you may want to pass to the linker, for example, linker scripts. You have to separately pass any linker flags that the linker needs in order to be aware of this file. You can do so via the `user_link_flags` attribute. | -| `dynamic_deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` These are other `cc_shared_library` dependencies the current target depends on. The `cc_shared_library` implementation will use the list of `dynamic_deps` (transitively, i.e. also the `dynamic_deps` of the current target's `dynamic_deps`) to decide which `cc_libraries` in the transitive `deps` should not be linked in because they are already provided by a different `cc_shared_library`. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Top level libraries that will unconditionally be statically linked into the shared library after being whole-archived. Any transitive library dependency of these direct deps will be linked into this shared library as long as they have not already been linked by a `cc_shared_library` in `dynamic_deps`. During analysis, the rule implementation will consider any target listed in `deps` as being exported by the shared library in order to give errors when multiple `cc_shared_libraries` export the same targets. The rule implementation does not take care of informing the linker about which symbols should be exported by the shared object. The user should take care of this via linker scripts or visibility declarations in the source code. The implementation will also trigger errors whenever the same library is linked statically into more than one `cc_shared_library`. This can be avoided by adding `"LINKABLE_MORE_THAN_ONCE"` to the `cc_library.tags` or by listing the `cc\_library` as an export of one of the shared libraries so that one can be made a `dynamic_dep` of the other. | +| `additional_linker_inputs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Any additional files that you may want to pass to the linker, for example, linker scripts. You have to separately pass any linker flags that the linker needs in order to be aware of this file. You can do so via the `user_link_flags` attribute. | +| `dynamic_deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` These are other `cc_shared_library` dependencies the current target depends on. The `cc_shared_library` implementation will use the list of `dynamic_deps` (transitively, i.e. also the `dynamic_deps` of the current target's `dynamic_deps`) to decide which `cc_libraries` in the transitive `deps` should not be linked in because they are already provided by a different `cc_shared_library`. | | `exports_filter` | List of strings; default is `[]` This attribute contains a list of targets that are claimed to be exported by the current shared library. Any target `deps` is already understood to be exported by the shared library. This attribute should be used to list any targets that are exported by the shared library but are transitive dependencies of `deps`. Note that this attribute is not actually adding a dependency edge to those targets, the dependency edge should instead be created by `deps`.The entries in this attribute are just strings. Keep in mind that when placing a target in this attribute, this is considered a claim that the shared library exports the symbols from that target. The `cc_shared_library` logic doesn't actually handle telling the linker which symbols should be exported. The following syntax is allowed: `//foo:__package__` to account for any target in foo/BUILD `//foo:__subpackages__` to account for any target in foo/BUILD or any other package below foo/ like foo/bar/BUILD | | `shared_lib_name` | String; default is `""` By default cc\_shared\_library will use a name for the shared library output file based on the target's name and the platform. This includes an extension and sometimes a prefix. Sometimes you may not want the default name, for example, when loading C++ shared libraries for Python the default lib\* prefix is often not desired, in which case you can use this attribute to choose a custom name. | | `user_link_flags` | List of strings; default is `[]` Any additional flags that you may want to pass to the linker. For example, to make the linker aware of a linker script passed via additional\_linker\_inputs you can use the following: ``` cc_shared_library( name = "foo_shared", additional_linker_inputs = select({ "//src/conditions:linux": [ ":foo.lds", ":additional_script.txt", ], "//conditions:default": []}), user_link_flags = select({ "//src/conditions:linux": [ "-Wl,-rpath,kittens", "-Wl,--version-script=$(location :foo.lds)", "-Wl,--script=$(location :additional_script.txt)", ], "//conditions:default": []}), ... ) ``` | -| `win_def_file` | [Label](/versions/7.7.1/concepts/labels); default is `None` The Windows DEF file to be passed to linker. This attribute should only be used when Windows is the target platform. It can be used to [export symbols](https://msdn.microsoft.com/en-us/library/d91k01sh.aspx) during linking a shared library. | +| `win_def_file` | [Label](/versions/7.7.3/concepts/labels); default is `None` The Windows DEF file to be passed to linker. This attribute should only be used when Windows is the target platform. It can be used to [export symbols](https://msdn.microsoft.com/en-us/library/d91k01sh.aspx) during linking a shared library. | ## cc\_static\_library @@ -554,8 +554,8 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of targets to combine into a static library, including all their transitive dependencies. Dependencies that do not provide any object files are not included in the static library, but their labels are collected in the file provided by the `linkdeps` output group. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of targets to combine into a static library, including all their transitive dependencies. Dependencies that do not provide any object files are not included in the static library, but their labels are collected in the file provided by the `linkdeps` output group. | ## fdo\_prefetch\_hints @@ -585,8 +585,8 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `profile` | [Label](/versions/7.7.1/concepts/labels); default is `None` Label of the hints profile. The hints file has the .afdo extension The label can also point to an fdo\_absolute\_path\_profile rule. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `profile` | [Label](/versions/7.7.3/concepts/labels); default is `None` Label of the hints profile. The hints file has the .afdo extension The label can also point to an fdo\_absolute\_path\_profile rule. | ## fdo\_profile @@ -615,10 +615,10 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | | `absolute_path_profile` | String; default is `""` Absolute path to the FDO profile. The FDO file can have one of the following extensions: .profraw for unindexed LLVM profile, .profdata for indexed LLVM profile, .zip that holds an LLVM profraw profile, or .afdo for AutoFDO profile. | -| `profile` | [Label](/versions/7.7.1/concepts/labels); default is `None` Label of the FDO profile or a rule which generates it. The FDO file can have one of the following extensions: .profraw for unindexed LLVM profile, .profdata for indexed LLVM profile, .zip that holds an LLVM profraw profile, .afdo for AutoFDO profile, .xfdo for XBinary profile. The label can also point to an fdo\_absolute\_path\_profile rule. | -| `proto_profile` | [Label](/versions/7.7.1/concepts/labels); default is `None` Label of the protobuf profile. | +| `profile` | [Label](/versions/7.7.3/concepts/labels); default is `None` Label of the FDO profile or a rule which generates it. The FDO file can have one of the following extensions: .profraw for unindexed LLVM profile, .profdata for indexed LLVM profile, .zip that holds an LLVM profraw profile, .afdo for AutoFDO profile, .xfdo for XBinary profile. The label can also point to an fdo\_absolute\_path\_profile rule. | +| `proto_profile` | [Label](/versions/7.7.3/concepts/labels); default is `None` Label of the protobuf profile. | ## memprof\_profile @@ -648,9 +648,9 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | | `absolute_path_profile` | String; default is `""` Absolute path to the MEMPROF profile. The file may only have a .profdata or .zip extension (where the zipfile must contain a memprof.profdata file). | -| `profile` | [Label](/versions/7.7.1/concepts/labels); default is `None` Label of the MEMPROF profile. The profile is expected to have either a .profdata extension (for an indexed/symbolized memprof profile), or a .zip extension for a zipfile containing a memprof.profdata file. The label can also point to an fdo\_absolute\_path\_profile rule. | +| `profile` | [Label](/versions/7.7.3/concepts/labels); default is `None` Label of the MEMPROF profile. The profile is expected to have either a .profdata extension (for an indexed/symbolized memprof profile), or a .zip extension for a zipfile containing a memprof.profdata file. The label can also point to an fdo\_absolute\_path\_profile rule. | ## propeller\_optimize @@ -681,8 +681,8 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `ld_profile` | [Label](/versions/7.7.1/concepts/labels); default is `None` Label of the profile passed to the link action. This file has the .txt extension. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `ld_profile` | [Label](/versions/7.7.3/concepts/labels); default is `None` Label of the profile passed to the link action. This file has the .txt extension. | ## cc\_test @@ -696,21 +696,21 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of other libraries to be linked in to the binary target. These can be `cc_library` or `objc_library` targets. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of C and C++ files that are processed to create the target. These are C/C++ source and header files, either non-generated (normal source code) or generated. All `.cc`, `.c`, and `.cpp` files will be compiled. These might be generated files: if a named file is in the `outs` of some other rule, this rule will automatically depend on that other rule. A `.h` file will not be compiled, but will be available for inclusion by sources in this rule. Both `.cc` and `.h` files can directly include headers listed in these `srcs` or in the `hdrs` of any rule listed in the `deps` argument. All `#include`d files must be mentioned in the `srcs` attribute of this rule, or in the `hdrs` attribute of referenced `cc_library()`s. The recommended style is for headers associated with a library to be listed in that library's `hdrs` attribute, and any remaining headers associated with this rule's sources to be listed in `srcs`. See ["Header inclusion checking"](#hdrs) for a more detailed description. If a rule's name is in the `srcs`, then this rule automatically depends on that one. If the named rule's `outs` are C or C++ source files, they are compiled into this rule; if they are library files, they are linked in. Permitted `srcs` file types: * C and C++ source files: `.c`, `.cc`, `.cpp`, `.cxx`, `.c++`, `.C` * C and C++ header files: `.h`, `.hh`, `.hpp`, `.hxx`, `.inc`, `.inl`, `.H` * Assembler with C preprocessor: `.S` * Archive: `.a`, `.pic.a` * "Always link" library: `.lo`, `.pic.lo` * Shared library, versioned or unversioned: `.so`, `.so.version` * Object file: `.o`, `.pic.o` ...and any rules that produce those files. Different extensions denote different programming languages in accordance with gcc convention. | -| `additional_linker_inputs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Pass these files to the C++ linker command. For example, compiled Windows .res files can be provided here to be embedded in the binary target. | -| `copts` | List of strings; default is `[]` Add these options to the C++ compilation command. Subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). Each string in this attribute is added in the given order to `COPTS` before compiling the binary target. The flags take effect only for compiling this target, not its dependencies, so be careful about header files included elsewhere. All paths should be relative to the workspace, not to the current package. If the package declares the [feature](/versions/7.7.1/reference/be/functions#package.features) `no_copts_tokenization`, Bourne shell tokenization applies only to strings that consist of a single "Make" variable. | -| `defines` | List of strings; default is `[]` List of defines to add to the compile line. Subject to ["Make" variable](/versions/7.7.1/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). Each string, which must consist of a single Bourne shell token, is prepended with `-D` and added to the compile command line to this target, as well as to every rule that depends on it. Be very careful, since this may have far-reaching effects. When in doubt, add define values to [`local_defines`](#cc_binary.local_defines) instead. | -| `includes` | List of strings; default is `[]` List of include dirs to be added to the compile line. Subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution. Each string is prepended with `-isystem` and added to `COPTS`. Unlike [COPTS](#cc_binary.copts), these flags are added for this rule and every rule that depends on it. (Note: not the rules it depends upon!) Be very careful, since this may have far-reaching effects. When in doubt, add "-I" flags to [COPTS](#cc_binary.copts) instead. Headers must be added to srcs or hdrs, otherwise they will not be available to dependent rules when compilation is sandboxed (the default). | -| `link_extra_lib` | [Label](/versions/7.7.1/concepts/labels); default is `"@bazel_tools//tools/cpp:link_extra_lib"` Control linking of extra libraries. By default, C++ binaries are linked against `//tools/cpp:link_extra_lib`, which by default depends on the label flag `//tools/cpp:link_extra_libs`. Without setting the flag, this library is empty by default. Setting the label flag allows linking optional dependencies, such as overrides for weak symbols, interceptors for shared library functions, or special runtime libraries (for malloc replacements, prefer `malloc` or `--custom_malloc`). Setting this attribute to `None` disables this behaviour. | -| `linkopts` | List of strings; default is `[]` Add these flags to the C++ linker command. Subject to ["Make" variable](/versions/7.7.1/reference/be/make-variables) substitution, [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization) and [label expansion](/versions/7.7.1/reference/be/common-definitions#label-expansion). Each string in this attribute is added to `LINKOPTS` before linking the binary target. Each element of this list that does not start with `$` or `-` is assumed to be the label of a target in `deps`. The list of files generated by that target is appended to the linker options. An error is reported if the label is invalid, or is not declared in `deps`. | -| `linkstatic` | Boolean; default is `False` For [`cc_binary`](/versions/7.7.1/reference/be/c-cpp#cc_binary) and [`cc_test`](/versions/7.7.1/reference/be/c-cpp#cc_test): link the binary in static mode. For `cc_library.linkstatic`: see below. By default this option is on for `cc_binary` and off for the rest. If enabled and this is a binary or test, this option tells the build tool to link in `.a`'s instead of `.so`'s for user libraries whenever possible. Some system libraries may still be linked dynamically, as are libraries for which there is no static library. So the resulting executable will still be dynamically linked, hence only *mostly* static. There are really three different ways to link an executable: * STATIC with fully\_static\_link feature, in which everything is linked statically; e.g. "`gcc -static foo.o libbar.a libbaz.a -lm`". This mode is enabled by specifying `fully_static_link` in the [`features`](/versions/7.7.1/reference/be/common-definitions#features) attribute. * STATIC, in which all user libraries are linked statically (if a static version is available), but where system libraries (excluding C/C++ runtime libraries) are linked dynamically, e.g. "`gcc foo.o libfoo.a libbaz.a -lm`". This mode is enabled by specifying `linkstatic=True`. * DYNAMIC, in which all libraries are linked dynamically (if a dynamic version is available), e.g. "`gcc foo.o libfoo.so libbaz.so -lm`". This mode is enabled by specifying `linkstatic=False`. The `linkstatic` attribute has a different meaning if used on a [`cc_library()`](/versions/7.7.1/reference/be/c-cpp#cc_library) rule. For a C++ library, `linkstatic=True` indicates that only static linking is allowed, so no `.so` will be produced. linkstatic=False does not prevent static libraries from being created. The attribute is meant to control the creation of dynamic libraries. If `linkstatic=False`, then the build tool will create symlinks to depended-upon shared libraries in the `*.runfiles` area. | -| `local_defines` | List of strings; default is `[]` List of defines to add to the compile line. Subject to ["Make" variable](/versions/7.7.1/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). Each string, which must consist of a single Bourne shell token, is prepended with `-D` and added to the compile command line for this target, but not to its dependents. | -| `malloc` | [Label](/versions/7.7.1/concepts/labels); default is `"@bazel_tools//tools/cpp:malloc"` Override the default dependency on malloc. By default, C++ binaries are linked against `//tools/cpp:malloc`, which is an empty library so the binary ends up using libc malloc. This label must refer to a `cc_library`. If compilation is for a non-C++ rule, this option has no effect. The value of this attribute is ignored if `linkshared=True` is specified. | -| `nocopts` | String; default is `""` Remove matching options from the C++ compilation command. Subject to ["Make" variable](/versions/7.7.1/reference/be/make-variables) substitution. The value of this attribute is interpreted as a regular expression. Any preexisting `COPTS` that match this regular expression (including values explicitly specified in the rule's [copts](#cc_binary.copts) attribute) will be removed from `COPTS` for purposes of compiling this rule. This attribute should rarely be needed. | -| `stamp` | Integer; default is `0` Whether to encode build information into the binary. Possible values: * `stamp = 1`: Always stamp the build information into the binary, even in [`--nostamp`](/versions/7.7.1/docs/user-manual#flag--stamp) builds. **This setting should be avoided**, since it potentially kills remote caching for the binary and any downstream actions that depend on it. * `stamp = 0`: Always replace build information by constant values. This gives good build result caching. * `stamp = -1`: Embedding of build information is controlled by the [`--[no]stamp`](/versions/7.7.1/docs/user-manual#flag--stamp) flag. Stamped binaries are *not* rebuilt unless their dependencies change. | -| `win_def_file` | [Label](/versions/7.7.1/concepts/labels); default is `None` The Windows DEF file to be passed to linker. This attribute should only be used when Windows is the target platform. It can be used to [export symbols](https://msdn.microsoft.com/en-us/library/d91k01sh.aspx) during linking a shared library. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of other libraries to be linked in to the binary target. These can be `cc_library` or `objc_library` targets. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of C and C++ files that are processed to create the target. These are C/C++ source and header files, either non-generated (normal source code) or generated. All `.cc`, `.c`, and `.cpp` files will be compiled. These might be generated files: if a named file is in the `outs` of some other rule, this rule will automatically depend on that other rule. A `.h` file will not be compiled, but will be available for inclusion by sources in this rule. Both `.cc` and `.h` files can directly include headers listed in these `srcs` or in the `hdrs` of any rule listed in the `deps` argument. All `#include`d files must be mentioned in the `srcs` attribute of this rule, or in the `hdrs` attribute of referenced `cc_library()`s. The recommended style is for headers associated with a library to be listed in that library's `hdrs` attribute, and any remaining headers associated with this rule's sources to be listed in `srcs`. See ["Header inclusion checking"](#hdrs) for a more detailed description. If a rule's name is in the `srcs`, then this rule automatically depends on that one. If the named rule's `outs` are C or C++ source files, they are compiled into this rule; if they are library files, they are linked in. Permitted `srcs` file types: * C and C++ source files: `.c`, `.cc`, `.cpp`, `.cxx`, `.c++`, `.C` * C and C++ header files: `.h`, `.hh`, `.hpp`, `.hxx`, `.inc`, `.inl`, `.H` * Assembler with C preprocessor: `.S` * Archive: `.a`, `.pic.a` * "Always link" library: `.lo`, `.pic.lo` * Shared library, versioned or unversioned: `.so`, `.so.version` * Object file: `.o`, `.pic.o` ...and any rules that produce those files. Different extensions denote different programming languages in accordance with gcc convention. | +| `additional_linker_inputs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Pass these files to the C++ linker command. For example, compiled Windows .res files can be provided here to be embedded in the binary target. | +| `copts` | List of strings; default is `[]` Add these options to the C++ compilation command. Subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). Each string in this attribute is added in the given order to `COPTS` before compiling the binary target. The flags take effect only for compiling this target, not its dependencies, so be careful about header files included elsewhere. All paths should be relative to the workspace, not to the current package. If the package declares the [feature](/versions/7.7.3/reference/be/functions#package.features) `no_copts_tokenization`, Bourne shell tokenization applies only to strings that consist of a single "Make" variable. | +| `defines` | List of strings; default is `[]` List of defines to add to the compile line. Subject to ["Make" variable](/versions/7.7.3/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). Each string, which must consist of a single Bourne shell token, is prepended with `-D` and added to the compile command line to this target, as well as to every rule that depends on it. Be very careful, since this may have far-reaching effects. When in doubt, add define values to [`local_defines`](#cc_binary.local_defines) instead. | +| `includes` | List of strings; default is `[]` List of include dirs to be added to the compile line. Subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution. Each string is prepended with `-isystem` and added to `COPTS`. Unlike [COPTS](#cc_binary.copts), these flags are added for this rule and every rule that depends on it. (Note: not the rules it depends upon!) Be very careful, since this may have far-reaching effects. When in doubt, add "-I" flags to [COPTS](#cc_binary.copts) instead. Headers must be added to srcs or hdrs, otherwise they will not be available to dependent rules when compilation is sandboxed (the default). | +| `link_extra_lib` | [Label](/versions/7.7.3/concepts/labels); default is `"@bazel_tools//tools/cpp:link_extra_lib"` Control linking of extra libraries. By default, C++ binaries are linked against `//tools/cpp:link_extra_lib`, which by default depends on the label flag `//tools/cpp:link_extra_libs`. Without setting the flag, this library is empty by default. Setting the label flag allows linking optional dependencies, such as overrides for weak symbols, interceptors for shared library functions, or special runtime libraries (for malloc replacements, prefer `malloc` or `--custom_malloc`). Setting this attribute to `None` disables this behaviour. | +| `linkopts` | List of strings; default is `[]` Add these flags to the C++ linker command. Subject to ["Make" variable](/versions/7.7.3/reference/be/make-variables) substitution, [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization) and [label expansion](/versions/7.7.3/reference/be/common-definitions#label-expansion). Each string in this attribute is added to `LINKOPTS` before linking the binary target. Each element of this list that does not start with `$` or `-` is assumed to be the label of a target in `deps`. The list of files generated by that target is appended to the linker options. An error is reported if the label is invalid, or is not declared in `deps`. | +| `linkstatic` | Boolean; default is `False` For [`cc_binary`](/versions/7.7.3/reference/be/c-cpp#cc_binary) and [`cc_test`](/versions/7.7.3/reference/be/c-cpp#cc_test): link the binary in static mode. For `cc_library.linkstatic`: see below. By default this option is on for `cc_binary` and off for the rest. If enabled and this is a binary or test, this option tells the build tool to link in `.a`'s instead of `.so`'s for user libraries whenever possible. Some system libraries may still be linked dynamically, as are libraries for which there is no static library. So the resulting executable will still be dynamically linked, hence only *mostly* static. There are really three different ways to link an executable: * STATIC with fully\_static\_link feature, in which everything is linked statically; e.g. "`gcc -static foo.o libbar.a libbaz.a -lm`". This mode is enabled by specifying `fully_static_link` in the [`features`](/versions/7.7.3/reference/be/common-definitions#features) attribute. * STATIC, in which all user libraries are linked statically (if a static version is available), but where system libraries (excluding C/C++ runtime libraries) are linked dynamically, e.g. "`gcc foo.o libfoo.a libbaz.a -lm`". This mode is enabled by specifying `linkstatic=True`. * DYNAMIC, in which all libraries are linked dynamically (if a dynamic version is available), e.g. "`gcc foo.o libfoo.so libbaz.so -lm`". This mode is enabled by specifying `linkstatic=False`. The `linkstatic` attribute has a different meaning if used on a [`cc_library()`](/versions/7.7.3/reference/be/c-cpp#cc_library) rule. For a C++ library, `linkstatic=True` indicates that only static linking is allowed, so no `.so` will be produced. linkstatic=False does not prevent static libraries from being created. The attribute is meant to control the creation of dynamic libraries. If `linkstatic=False`, then the build tool will create symlinks to depended-upon shared libraries in the `*.runfiles` area. | +| `local_defines` | List of strings; default is `[]` List of defines to add to the compile line. Subject to ["Make" variable](/versions/7.7.3/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). Each string, which must consist of a single Bourne shell token, is prepended with `-D` and added to the compile command line for this target, but not to its dependents. | +| `malloc` | [Label](/versions/7.7.3/concepts/labels); default is `"@bazel_tools//tools/cpp:malloc"` Override the default dependency on malloc. By default, C++ binaries are linked against `//tools/cpp:malloc`, which is an empty library so the binary ends up using libc malloc. This label must refer to a `cc_library`. If compilation is for a non-C++ rule, this option has no effect. The value of this attribute is ignored if `linkshared=True` is specified. | +| `nocopts` | String; default is `""` Remove matching options from the C++ compilation command. Subject to ["Make" variable](/versions/7.7.3/reference/be/make-variables) substitution. The value of this attribute is interpreted as a regular expression. Any preexisting `COPTS` that match this regular expression (including values explicitly specified in the rule's [copts](#cc_binary.copts) attribute) will be removed from `COPTS` for purposes of compiling this rule. This attribute should rarely be needed. | +| `stamp` | Integer; default is `0` Whether to encode build information into the binary. Possible values: * `stamp = 1`: Always stamp the build information into the binary, even in [`--nostamp`](/versions/7.7.3/docs/user-manual#flag--stamp) builds. **This setting should be avoided**, since it potentially kills remote caching for the binary and any downstream actions that depend on it. * `stamp = 0`: Always replace build information by constant values. This gives good build result caching. * `stamp = -1`: Embedding of build information is controlled by the [`--[no]stamp`](/versions/7.7.3/docs/user-manual#flag--stamp) flag. Stamped binaries are *not* rebuilt unless their dependencies change. | +| `win_def_file` | [Label](/versions/7.7.3/concepts/labels); default is `None` The Windows DEF file to be passed to linker. This attribute should only be used when Windows is the target platform. It can be used to [export symbols](https://msdn.microsoft.com/en-us/library/d91k01sh.aspx) during linking a shared library. | ## cc\_toolchain @@ -733,7 +733,7 @@ Use `toolchain_config` attribute to configure the C++ toolchain. See also this -[page](https://bazel.build/versions/7.7.1/docs/cc-toolchain-config-reference) for elaborate C++ toolchain configuration and toolchain selection documentation. +[page](https://bazel.build/versions/7.7.3/docs/cc-toolchain-config-reference) for elaborate C++ toolchain configuration and toolchain selection documentation. Use `tags = ["manual"]` in order to prevent toolchains from being built and configured unnecessarily when invoking `bazel build //...` @@ -742,26 +742,26 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `all_files` | [Label](/versions/7.7.1/concepts/labels); required Collection of all cc\_toolchain artifacts. These artifacts will be added as inputs to all rules\_cc related actions (with the exception of actions that are using more precise sets of artifacts from attributes below). Bazel assumes that `all_files` is a superset of all other artifact-providing attributes (e.g. linkstamp compilation needs both compile and link files, so it takes `all_files`). This is what `cc_toolchain.files` contains, and this is used by all Starlark rules using C++ toolchain. | -| `ar_files` | [Label](/versions/7.7.1/concepts/labels); default is `None` Collection of all cc\_toolchain artifacts required for archiving actions. | -| `as_files` | [Label](/versions/7.7.1/concepts/labels); default is `None` Collection of all cc\_toolchain artifacts required for assembly actions. | -| `compiler_files` | [Label](/versions/7.7.1/concepts/labels); required Collection of all cc\_toolchain artifacts required for compile actions. | -| `compiler_files_without_includes` | [Label](/versions/7.7.1/concepts/labels); default is `None` Collection of all cc\_toolchain artifacts required for compile actions in case when input discovery is supported (currently Google-only). | -| `coverage_files` | [Label](/versions/7.7.1/concepts/labels); default is `None` Collection of all cc\_toolchain artifacts required for coverage actions. If not specified, all\_files are used. | -| `dwp_files` | [Label](/versions/7.7.1/concepts/labels); required Collection of all cc\_toolchain artifacts required for dwp actions. | -| `dynamic_runtime_lib` | [Label](/versions/7.7.1/concepts/labels); default is `None` Dynamic library artifact for the C++ runtime library (e.g. libstdc++.so). This will be used when 'static\_link\_cpp\_runtimes' feature is enabled, and we're linking dependencies dynamically. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `all_files` | [Label](/versions/7.7.3/concepts/labels); required Collection of all cc\_toolchain artifacts. These artifacts will be added as inputs to all rules\_cc related actions (with the exception of actions that are using more precise sets of artifacts from attributes below). Bazel assumes that `all_files` is a superset of all other artifact-providing attributes (e.g. linkstamp compilation needs both compile and link files, so it takes `all_files`). This is what `cc_toolchain.files` contains, and this is used by all Starlark rules using C++ toolchain. | +| `ar_files` | [Label](/versions/7.7.3/concepts/labels); default is `None` Collection of all cc\_toolchain artifacts required for archiving actions. | +| `as_files` | [Label](/versions/7.7.3/concepts/labels); default is `None` Collection of all cc\_toolchain artifacts required for assembly actions. | +| `compiler_files` | [Label](/versions/7.7.3/concepts/labels); required Collection of all cc\_toolchain artifacts required for compile actions. | +| `compiler_files_without_includes` | [Label](/versions/7.7.3/concepts/labels); default is `None` Collection of all cc\_toolchain artifacts required for compile actions in case when input discovery is supported (currently Google-only). | +| `coverage_files` | [Label](/versions/7.7.3/concepts/labels); default is `None` Collection of all cc\_toolchain artifacts required for coverage actions. If not specified, all\_files are used. | +| `dwp_files` | [Label](/versions/7.7.3/concepts/labels); required Collection of all cc\_toolchain artifacts required for dwp actions. | +| `dynamic_runtime_lib` | [Label](/versions/7.7.3/concepts/labels); default is `None` Dynamic library artifact for the C++ runtime library (e.g. libstdc++.so). This will be used when 'static\_link\_cpp\_runtimes' feature is enabled, and we're linking dependencies dynamically. | | `exec_transition_for_inputs` | Boolean; default is `True` Set to True to build all file inputs to cc\_toolchain for the exec platform, instead of having no transition (i.e. target platform by default). | -| `libc_top` | [Label](/versions/7.7.1/concepts/labels); default is `None` A collection of artifacts for libc passed as inputs to compile/linking actions. | -| `linker_files` | [Label](/versions/7.7.1/concepts/labels); required Collection of all cc\_toolchain artifacts required for linking actions. | -| `module_map` | [Label](/versions/7.7.1/concepts/labels); default is `None` Module map artifact to be used for modular builds. | -| `objcopy_files` | [Label](/versions/7.7.1/concepts/labels); required Collection of all cc\_toolchain artifacts required for objcopy actions. | -| `static_runtime_lib` | [Label](/versions/7.7.1/concepts/labels); default is `None` Static library artifact for the C++ runtime library (e.g. libstdc++.a). This will be used when 'static\_link\_cpp\_runtimes' feature is enabled, and we're linking dependencies statically. | -| `strip_files` | [Label](/versions/7.7.1/concepts/labels); required Collection of all cc\_toolchain artifacts required for strip actions. | +| `libc_top` | [Label](/versions/7.7.3/concepts/labels); default is `None` A collection of artifacts for libc passed as inputs to compile/linking actions. | +| `linker_files` | [Label](/versions/7.7.3/concepts/labels); required Collection of all cc\_toolchain artifacts required for linking actions. | +| `module_map` | [Label](/versions/7.7.3/concepts/labels); default is `None` Module map artifact to be used for modular builds. | +| `objcopy_files` | [Label](/versions/7.7.3/concepts/labels); required Collection of all cc\_toolchain artifacts required for objcopy actions. | +| `static_runtime_lib` | [Label](/versions/7.7.3/concepts/labels); default is `None` Static library artifact for the C++ runtime library (e.g. libstdc++.a). This will be used when 'static\_link\_cpp\_runtimes' feature is enabled, and we're linking dependencies statically. | +| `strip_files` | [Label](/versions/7.7.3/concepts/labels); required Collection of all cc\_toolchain artifacts required for strip actions. | | `supports_header_parsing` | Boolean; default is `False` Set to True when cc\_toolchain supports header parsing actions. | | `supports_param_files` | Boolean; default is `True` Set to True when cc\_toolchain supports using param files for linking actions. | -| `toolchain_config` | [Label](/versions/7.7.1/concepts/labels); required The label of the rule providing `cc_toolchain_config_info`. | -| `toolchain_identifier` | String; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `""` The identifier used to match this cc\_toolchain with the corresponding crosstool\_config.toolchain. Until issue [#5380](https://github.com/bazelbuild/bazel/issues/5380) is fixed this is the recommended way of associating `cc_toolchain` with `CROSSTOOL.toolchain`. It will be replaced by the `toolchain_config` attribute ([#5380](https://github.com/bazelbuild/bazel/issues/5380)). | +| `toolchain_config` | [Label](/versions/7.7.3/concepts/labels); required The label of the rule providing `cc_toolchain_config_info`. | +| `toolchain_identifier` | String; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `""` The identifier used to match this cc\_toolchain with the corresponding crosstool\_config.toolchain. Until issue [#5380](https://github.com/bazelbuild/bazel/issues/5380) is fixed this is the recommended way of associating `cc_toolchain` with `CROSSTOOL.toolchain`. It will be replaced by the `toolchain_config` attribute ([#5380](https://github.com/bazelbuild/bazel/issues/5380)). | ## cc\_toolchain\_suite @@ -780,11 +780,11 @@ passed to Bazel. See also this -[page](https://bazel.build/versions/7.7.1/docs/cc-toolchain-config-reference) for elaborate C++ toolchain configuration and toolchain selection documentation. +[page](https://bazel.build/versions/7.7.3/docs/cc-toolchain-config-reference) for elaborate C++ toolchain configuration and toolchain selection documentation. ### Arguments | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `toolchains` | Dictionary mapping strings to [labels](/versions/7.7.1/concepts/labels); [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); required A map from "<cpu>" or "<cpu>|<compiler>" strings to a `cc_toolchain` label. "<cpu>" will be used when only `--cpu` is passed to Bazel, and "<cpu>|<compiler>" will be used when both `--cpu` and `--compiler` are passed to Bazel. Example: ``` cc_toolchain_suite( name = "toolchain", toolchains = \{ "piii|gcc": ":my_cc_toolchain_for_piii_using_gcc", "piii": ":my_cc_toolchain_for_piii_using_default_compiler", \}, ) ``` | \ No newline at end of file +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `toolchains` | Dictionary mapping strings to [labels](/versions/7.7.3/concepts/labels); [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); required A map from "<cpu>" or "<cpu>|<compiler>" strings to a `cc_toolchain` label. "<cpu>" will be used when only `--cpu` is passed to Bazel, and "<cpu>|<compiler>" will be used when both `--cpu` and `--compiler` are passed to Bazel. Example: ``` cc_toolchain_suite( name = "toolchain", toolchains = \{ "piii|gcc": ":my_cc_toolchain_for_piii_using_gcc", "piii": ":my_cc_toolchain_for_piii_using_default_compiler", \}, ) ``` | \ No newline at end of file
diff --git a/docs/versions/7.7.1/reference/be/common-definitions.mdx b/docs/versions/7.7.3/reference/be/common-definitions.mdx similarity index 90% rename from docs/versions/7.7.1/reference/be/common-definitions.mdx rename to docs/versions/7.7.3/reference/be/common-definitions.mdx index bd450dc..af614a7 100644 --- a/docs/versions/7.7.1/reference/be/common-definitions.mdx +++ b/docs/versions/7.7.3/reference/be/common-definitions.mdx
@@ -42,7 +42,7 @@ substring, such as `//mypkg:target`, and that label is a declared prerequisite of the current rule, it is expanded into the pathname of the file represented by the -[target](https://bazel.build/versions/7.7.1/reference/glossary#target) +[target](https://bazel.build/versions/7.7.3/reference/glossary#target) `//mypkg:target`. Example attributes include `genrule.cmd` and @@ -59,10 +59,10 @@ | Attribute | Description | | --- | --- | -| `data` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Files needed by this rule at runtime. May list file or rule targets. Generally allows any target. The default outputs and runfiles of targets in the `data` attribute should appear in the `*.runfiles` area of any executable which is output by or has a runtime dependency on this target. This may include data files or binaries used when this target's [`srcs`](#typical.srcs) are executed. See the [data dependencies](/versions/7.7.1/concepts/dependencies#data-dependencies) section for more information about how to depend on and use data files. New rules should define a `data` attribute if they process inputs which might use other inputs at runtime. Rules' implementation functions must also [populate the target's runfiles](https://bazel.build/versions/7.7.1/rules/rules#runfiles) from the outputs and runfiles of any `data` attribute, as well as runfiles from any dependency attribute which provides either source code or runtime dependencies. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Dependencies for this target. Generally should only list rule targets. (Though some rules permit files to be listed directly in `deps`, this should be avoided when possible.) Language-specific rules generally limit the listed targets to those with specific [providers](https://bazel.build/versions/7.7.1/extending/rules#providers). The precise semantics of what it means for a target to depend on another using `deps` are specific to the kind of rule, and the rule-specific documentation goes into more detail. For rules which process source code, `deps` generally specifies code dependencies used by the code in [`srcs`](#typical.srcs). Most often, a `deps` dependency is used to allow one module to use symbols defined in another module written in the same programming language and separately compiled. Cross-language dependencies are also permitted in many cases: For example, a `java_library` target may depend on C++ code in a `cc_library` target, by listing the latter in the `deps` attribute. See the definition of [dependencies](/versions/7.7.1/concepts/build-ref#deps) for more information. | +| `data` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Files needed by this rule at runtime. May list file or rule targets. Generally allows any target. The default outputs and runfiles of targets in the `data` attribute should appear in the `*.runfiles` area of any executable which is output by or has a runtime dependency on this target. This may include data files or binaries used when this target's [`srcs`](#typical.srcs) are executed. See the [data dependencies](/versions/7.7.3/concepts/dependencies#data-dependencies) section for more information about how to depend on and use data files. New rules should define a `data` attribute if they process inputs which might use other inputs at runtime. Rules' implementation functions must also [populate the target's runfiles](https://bazel.build/versions/7.7.3/rules/rules#runfiles) from the outputs and runfiles of any `data` attribute, as well as runfiles from any dependency attribute which provides either source code or runtime dependencies. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Dependencies for this target. Generally should only list rule targets. (Though some rules permit files to be listed directly in `deps`, this should be avoided when possible.) Language-specific rules generally limit the listed targets to those with specific [providers](https://bazel.build/versions/7.7.3/extending/rules#providers). The precise semantics of what it means for a target to depend on another using `deps` are specific to the kind of rule, and the rule-specific documentation goes into more detail. For rules which process source code, `deps` generally specifies code dependencies used by the code in [`srcs`](#typical.srcs). Most often, a `deps` dependency is used to allow one module to use symbols defined in another module written in the same programming language and separately compiled. Cross-language dependencies are also permitted in many cases: For example, a `java_library` target may depend on C++ code in a `cc_library` target, by listing the latter in the `deps` attribute. See the definition of [dependencies](/versions/7.7.3/concepts/build-ref#deps) for more information. | | `licenses` | List of strings; [nonconfigurable](#configurable-attributes); default is `["none"]` A list of license-type strings to be used for this particular target. This is part of a deprecated licensing API that Bazel no longer uses. Don't use this. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Files processed or included by this rule. Generally lists files directly, but may list rule targets (like `filegroup` or `genrule`) to include their default outputs. Language-specific rules often require that the listed files have particular file extensions. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Files processed or included by this rule. Generally lists files directly, but may list rule targets (like `filegroup` or `genrule`) to include their default outputs. Language-specific rules often require that the listed files have particular file extensions. | ## Attributes common to all build rules @@ -71,18 +71,18 @@ | Attribute | Description | | --- | --- | -| `compatible_with` | List of [labels](/versions/7.7.1/concepts/labels); [nonconfigurable](#configurable-attributes); default is `[]` The list of environments this target can be built for, in addition to default-supported environments. This is part of Bazel's constraint system, which lets users declare which targets can and cannot depend on each other. For example, externally deployable binaries shouldn't depend on libraries with company-secret code. See [ConstraintSemantics](https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/analysis/constraints/ConstraintSemantics.java#L46) for details. | +| `compatible_with` | List of [labels](/versions/7.7.3/concepts/labels); [nonconfigurable](#configurable-attributes); default is `[]` The list of environments this target can be built for, in addition to default-supported environments. This is part of Bazel's constraint system, which lets users declare which targets can and cannot depend on each other. For example, externally deployable binaries shouldn't depend on libraries with company-secret code. See [ConstraintSemantics](https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/analysis/constraints/ConstraintSemantics.java#L46) for details. | | `deprecation` | String; [nonconfigurable](#configurable-attributes); default is `None` An explanatory warning message associated with this target. Typically this is used to notify users that a target has become obsolete, or has become superseded by another rule, is private to a package, or is perhaps considered harmful for some reason. It is a good idea to include some reference (like a webpage, a bug number or example migration CLs) so that one can easily find out what changes are required to avoid the message. If there is a new target that can be used as a drop in replacement, it is a good idea to just migrate all users of the old target. This attribute has no effect on the way things are built, but it may affect a build tool's diagnostic output. The build tool issues a warning when a rule with a `deprecation` attribute is depended upon by a target in another package. Intra-package dependencies are exempt from this warning, so that, for example, building the tests of a deprecated rule does not encounter a warning. If a deprecated target depends on another deprecated target, no warning message is issued. Once people have stopped using it, the target can be removed. | | `distribs` | List of strings; [nonconfigurable](#configurable-attributes); default is `[]` A list of distribution-method strings to be used for this particular target. This is part of a deprecated licensing API that Bazel no longer uses. Don't use this. | -| `exec_compatible_with` | List of [labels](/versions/7.7.1/concepts/labels); [nonconfigurable](#configurable-attributes); default is `[]` A list of `constraint_values` that must be present in the execution platform for this target. This is in addition to any constraints already set by the rule type. Constraints are used to restrict the list of available execution platforms. For more details, see the description of [toolchain resolution](/versions/7.7.1/docs/toolchains#toolchain-resolution). | -| `exec_properties` | 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](/versions/7.7.1/reference/be/platform) rule. If a key is present in both the platform and target-level properties, the value will be taken from the target. | -| `features` | List of *feature* strings; default is `[]` A feature is string tag that can be enabled or disabled on a target. The meaning of a feature depends on the rule itself. This `features` attribute is combined with the [package](/versions/7.7.1/reference/be/functions#package) level `features` attribute. For example, if the features ["a", "b"] are enabled on the package level, and a target's `features` attribute contains ["-a", "c"], the features enabled for the rule will be "b" and "c". [See example](https://github.com/bazelbuild/examples/blob/main/rules/features/BUILD). | -| `restricted_to` | List of [labels](/versions/7.7.1/concepts/labels); [nonconfigurable](#configurable-attributes); default is `[]` The list of environments this target can be built for, *instead* of default-supported environments. This is part of Bazel's constraint system. See `compatible_with` for details. | -| `tags` | List of strings; [nonconfigurable](#configurable-attributes); default is `[]` *Tags* can be used on any rule. *Tags* on test and `test_suite` rules are useful for categorizing the tests. *Tags* on non-test targets are used to control sandboxed execution of `genrule`s and [Starlark](/versions/7.7.1/rules/concepts) actions, and for parsing by humans and/or external tools. Bazel modifies the behavior of its sandboxing code if it finds the following keywords in the `tags` attribute of any test or `genrule` target, or the keys of `execution_requirements` for any Starlark action. * `no-sandbox` keyword results in the action or test never being sandboxed; it can still be cached or run remotely - use `no-cache` or `no-remote` to prevent either or both of those. * `no-cache` keyword results in the action or test never being cached (remotely or locally) * `no-remote-cache` keyword results in the action or test never being cached remotely (but it may be cached locally; it may also be executed remotely). Note: for the purposes of this tag, the disk-cache is considered a local cache, whereas the http and gRPC caches are considered remote. If a combination of local disk cache and remote cache are used (combined cache), it's treated as a remote cache and disabled entirely unless `--incompatible_remote_results_ignore_disk` is set in which case the local components will be used. * `no-remote-exec` keyword results in the action or test never being executed remotely (but it may be cached remotely). * `no-remote` keyword prevents the action or test from being executed remotely or cached remotely. This is equivalent to using both `no-remote-cache` and `no-remote-exec`. * `no-remote-cache-upload` keyword disables upload part of remote caching of a spawn. it does not disable remote execution. * `local` keyword precludes the action or test from being remotely cached, remotely executed, or run inside the sandbox. For genrules and tests, marking the rule with the `local = True` attribute has the same effect. * `requires-network` keyword allows access to the external network from inside the sandbox. This tag only has an effect if sandboxing is enabled. * `block-network` keyword blocks access to the external network from inside the sandbox. In this case, only communication with localhost is allowed. This tag only has an effect if sandboxing is enabled. * `requires-fakeroot` runs the test or action as uid and gid 0 (i.e., the root user). This is only supported on Linux. This tag takes precedence over the `--sandbox_fake_username` command-line option. *Tags* on tests are generally used to annotate a test's role in your debug and release process. Typically, tags are most useful for C++ and Python tests, which lack any runtime annotation ability. The use of tags and size elements gives flexibility in assembling suites of tests based around codebase check-in policy. Bazel modifies test running behavior if it finds the following keywords in the `tags` attribute of the test rule: * `exclusive` will force the test to be run in the "exclusive" mode, ensuring that no other tests are running at the same time. Such tests will be executed in serial fashion after all build activity and non-exclusive tests have been completed. Remote execution is disabled for such tests because Bazel doesn't have control over what's running on a remote machine. * `exclusive-if-local` will force the test to be run in the "exclusive" mode if it is executed locally, but will run the test in parallel if it's executed remotely. * `manual` keyword will exclude the target from expansion of target pattern wildcards (`...`, `:*`, `:all`, etc.) and `test_suite` rules which do not list the test explicitly when computing the set of top-level targets to build/run for the `build`, `test`, and `coverage` commands. It does not affect target wildcard or test suite expansion in other contexts, including the `query` command. Note that `manual` does not imply that a target should not be built/run automatically by continuous build/test systems. For example, it may be desirable to exclude a target from `bazel test ...` because it requires specific Bazel flags, but still have it included in properly-configured presubmit or continuous test runs. * `external` keyword will force test to be unconditionally executed (regardless of `--cache_test_results` value). See [Tag Conventions](/versions/7.7.1/reference/test-encyclopedia#tag-conventions) in the Test Encyclopedia for more conventions on tags attached to test targets. | -| `target_compatible_with` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` A list of `constraint_value`s that must be present in the target platform for this target to be considered *compatible*. This is in addition to any constraints already set by the rule type. If the target platform does not satisfy all listed constraints then the target is considered *incompatible*. Incompatible targets are skipped for building and testing when the target pattern is expanded (e.g. `//...`, `:all`). When explicitly specified on the command line, incompatible targets cause Bazel to print an error and cause a build or test failure. Targets that transitively depend on incompatible targets are themselves considered incompatible. They are also skipped for building and testing. An empty list (which is the default) signifies that the target is compatible with all platforms. All rules other than [Workspace Rules](/versions/7.7.1/reference/be/workspace) support this attribute. For some rules this attribute has no effect. For example, specifying `target_compatible_with` for a `cc_toolchain` is not useful. See the [Platforms](/versions/7.7.1/docs/platforms#skipping-incompatible-targets) page for more information about incompatible target skipping. | -| `testonly` | Boolean; [nonconfigurable](#configurable-attributes); default is `False` except for test and test suite targets If `True`, only testonly targets (such as tests) can depend on this target. Equivalently, a rule that is not `testonly` is not allowed to depend on any rule that is `testonly`. Tests (`*_test` rules) and test suites ([test\_suite](/versions/7.7.1/reference/be/general#test_suite) rules) are `testonly` by default. This attribute is intended to mean that the target should not be contained in binaries that are released to production. Because testonly is enforced at build time, not run time, and propagates virally through the dependency tree, it should be applied judiciously. For example, stubs and fakes that are useful for unit tests may also be useful for integration tests involving the same binaries that will be released to production, and therefore should probably not be marked testonly. Conversely, rules that are dangerous to even link in, perhaps because they unconditionally override normal behavior, should definitely be marked testonly. | -| `toolchains` | List of [labels](/versions/7.7.1/concepts/labels); [nonconfigurable](#configurable-attributes); default is `[]` The set of targets whose [Make variables](/versions/7.7.1/reference/be/make-variables) this target is allowed to access. These targets are either instances of rules that provide `TemplateVariableInfo` or special targets for toolchain types built into Bazel. These include: * `@bazel_tools//tools/cpp:current_cc_toolchain`* `@bazel_tools//tools/jdk:current_java_runtime` Note that this is distinct from the concept of [toolchain resolution](/versions/7.7.1/docs/toolchains#toolchain-resolution) that is used by rule implementations for platform-dependent configuration. You cannot use this attribute to determine which specific `cc_toolchain` or `java_toolchain` a target will use. | -| `visibility` | List of [labels](/versions/7.7.1/concepts/labels); [nonconfigurable](#configurable-attributes); default is `default_visibility` from [package](/versions/7.7.1/reference/be/functions#package) if specified, or `"//visibility:private"` otherwise The `visibility` attribute on a target controls whether the target can be used in other packages. See the documentation for [visibility](/versions/7.7.1/concepts/visibility). | +| `exec_compatible_with` | List of [labels](/versions/7.7.3/concepts/labels); [nonconfigurable](#configurable-attributes); default is `[]` A list of `constraint_values` that must be present in the execution platform for this target. This is in addition to any constraints already set by the rule type. Constraints are used to restrict the list of available execution platforms. For more details, see the description of [toolchain resolution](/versions/7.7.3/docs/toolchains#toolchain-resolution). | +| `exec_properties` | 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](/versions/7.7.3/reference/be/platform) rule. If a key is present in both the platform and target-level properties, the value will be taken from the target. | +| `features` | List of *feature* strings; default is `[]` A feature is string tag that can be enabled or disabled on a target. The meaning of a feature depends on the rule itself. This `features` attribute is combined with the [package](/versions/7.7.3/reference/be/functions#package) level `features` attribute. For example, if the features ["a", "b"] are enabled on the package level, and a target's `features` attribute contains ["-a", "c"], the features enabled for the rule will be "b" and "c". [See example](https://github.com/bazelbuild/examples/blob/main/rules/features/BUILD). | +| `restricted_to` | List of [labels](/versions/7.7.3/concepts/labels); [nonconfigurable](#configurable-attributes); default is `[]` The list of environments this target can be built for, *instead* of default-supported environments. This is part of Bazel's constraint system. See `compatible_with` for details. | +| `tags` | List of strings; [nonconfigurable](#configurable-attributes); default is `[]` *Tags* can be used on any rule. *Tags* on test and `test_suite` rules are useful for categorizing the tests. *Tags* on non-test targets are used to control sandboxed execution of `genrule`s and [Starlark](/versions/7.7.3/rules/concepts) actions, and for parsing by humans and/or external tools. Bazel modifies the behavior of its sandboxing code if it finds the following keywords in the `tags` attribute of any test or `genrule` target, or the keys of `execution_requirements` for any Starlark action. * `no-sandbox` keyword results in the action or test never being sandboxed; it can still be cached or run remotely - use `no-cache` or `no-remote` to prevent either or both of those. * `no-cache` keyword results in the action or test never being cached (remotely or locally) * `no-remote-cache` keyword results in the action or test never being cached remotely (but it may be cached locally; it may also be executed remotely). Note: for the purposes of this tag, the disk-cache is considered a local cache, whereas the http and gRPC caches are considered remote. If a combination of local disk cache and remote cache are used (combined cache), it's treated as a remote cache and disabled entirely unless `--incompatible_remote_results_ignore_disk` is set in which case the local components will be used. * `no-remote-exec` keyword results in the action or test never being executed remotely (but it may be cached remotely). * `no-remote` keyword prevents the action or test from being executed remotely or cached remotely. This is equivalent to using both `no-remote-cache` and `no-remote-exec`. * `no-remote-cache-upload` keyword disables upload part of remote caching of a spawn. it does not disable remote execution. * `local` keyword precludes the action or test from being remotely cached, remotely executed, or run inside the sandbox. For genrules and tests, marking the rule with the `local = True` attribute has the same effect. * `requires-network` keyword allows access to the external network from inside the sandbox. This tag only has an effect if sandboxing is enabled. * `block-network` keyword blocks access to the external network from inside the sandbox. In this case, only communication with localhost is allowed. This tag only has an effect if sandboxing is enabled. * `requires-fakeroot` runs the test or action as uid and gid 0 (i.e., the root user). This is only supported on Linux. This tag takes precedence over the `--sandbox_fake_username` command-line option. *Tags* on tests are generally used to annotate a test's role in your debug and release process. Typically, tags are most useful for C++ and Python tests, which lack any runtime annotation ability. The use of tags and size elements gives flexibility in assembling suites of tests based around codebase check-in policy. Bazel modifies test running behavior if it finds the following keywords in the `tags` attribute of the test rule: * `exclusive` will force the test to be run in the "exclusive" mode, ensuring that no other tests are running at the same time. Such tests will be executed in serial fashion after all build activity and non-exclusive tests have been completed. Remote execution is disabled for such tests because Bazel doesn't have control over what's running on a remote machine. * `exclusive-if-local` will force the test to be run in the "exclusive" mode if it is executed locally, but will run the test in parallel if it's executed remotely. * `manual` keyword will exclude the target from expansion of target pattern wildcards (`...`, `:*`, `:all`, etc.) and `test_suite` rules which do not list the test explicitly when computing the set of top-level targets to build/run for the `build`, `test`, and `coverage` commands. It does not affect target wildcard or test suite expansion in other contexts, including the `query` command. Note that `manual` does not imply that a target should not be built/run automatically by continuous build/test systems. For example, it may be desirable to exclude a target from `bazel test ...` because it requires specific Bazel flags, but still have it included in properly-configured presubmit or continuous test runs. * `external` keyword will force test to be unconditionally executed (regardless of `--cache_test_results` value). See [Tag Conventions](/versions/7.7.3/reference/test-encyclopedia#tag-conventions) in the Test Encyclopedia for more conventions on tags attached to test targets. | +| `target_compatible_with` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` A list of `constraint_value`s that must be present in the target platform for this target to be considered *compatible*. This is in addition to any constraints already set by the rule type. If the target platform does not satisfy all listed constraints then the target is considered *incompatible*. Incompatible targets are skipped for building and testing when the target pattern is expanded (e.g. `//...`, `:all`). When explicitly specified on the command line, incompatible targets cause Bazel to print an error and cause a build or test failure. Targets that transitively depend on incompatible targets are themselves considered incompatible. They are also skipped for building and testing. An empty list (which is the default) signifies that the target is compatible with all platforms. All rules other than [Workspace Rules](/versions/7.7.3/reference/be/workspace) support this attribute. For some rules this attribute has no effect. For example, specifying `target_compatible_with` for a `cc_toolchain` is not useful. See the [Platforms](/versions/7.7.3/docs/platforms#skipping-incompatible-targets) page for more information about incompatible target skipping. | +| `testonly` | Boolean; [nonconfigurable](#configurable-attributes); default is `False` except for test and test suite targets If `True`, only testonly targets (such as tests) can depend on this target. Equivalently, a rule that is not `testonly` is not allowed to depend on any rule that is `testonly`. Tests (`*_test` rules) and test suites ([test\_suite](/versions/7.7.3/reference/be/general#test_suite) rules) are `testonly` by default. This attribute is intended to mean that the target should not be contained in binaries that are released to production. Because testonly is enforced at build time, not run time, and propagates virally through the dependency tree, it should be applied judiciously. For example, stubs and fakes that are useful for unit tests may also be useful for integration tests involving the same binaries that will be released to production, and therefore should probably not be marked testonly. Conversely, rules that are dangerous to even link in, perhaps because they unconditionally override normal behavior, should definitely be marked testonly. | +| `toolchains` | List of [labels](/versions/7.7.3/concepts/labels); [nonconfigurable](#configurable-attributes); default is `[]` The set of targets whose [Make variables](/versions/7.7.3/reference/be/make-variables) this target is allowed to access. These targets are either instances of rules that provide `TemplateVariableInfo` or special targets for toolchain types built into Bazel. These include: * `@bazel_tools//tools/cpp:current_cc_toolchain`* `@bazel_tools//tools/jdk:current_java_runtime` Note that this is distinct from the concept of [toolchain resolution](/versions/7.7.3/docs/toolchains#toolchain-resolution) that is used by rule implementations for platform-dependent configuration. You cannot use this attribute to determine which specific `cc_toolchain` or `java_toolchain` a target will use. | +| `visibility` | List of [labels](/versions/7.7.3/concepts/labels); [nonconfigurable](#configurable-attributes); default is `default_visibility` from [package](/versions/7.7.3/reference/be/functions#package) if specified, or `"//visibility:private"` otherwise The `visibility` attribute on a target controls whether the target can be used in other packages. See the documentation for [visibility](/versions/7.7.3/concepts/visibility). | ## Attributes common to all test rules (\*\_test) @@ -90,13 +90,13 @@ | Attribute | Description | | --- | --- | -| `args` | List of strings; subject to [$(location)](/versions/7.7.1/reference/be/make-variables#predefined_label_variables) and ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution, and [Bourne shell tokenization](#sh-tokenization); default is `[]` Command line arguments that Bazel passes to the target when it is executed with `bazel test`. These arguments are passed before any `--test_arg` values specified on the `bazel test` command line. | -| `env` | Dictionary of strings; values are subject to [$(location)](/versions/7.7.1/reference/be/make-variables#predefined_label_variables) and ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution; default is `[]` Specifies additional environment variables to set when the test is executed by `bazel test`. This attribute only applies to native rules, like `cc_test`, `py_test`, and `sh_test`. It does not apply to Starlark-defined test rules. For your own Starlark rules, you can add an "env" attribute and use it to populate a [TestEnvironment](/versions/7.7.1/rules/lib/toplevel/testing#TestEnvironment) Provider. | +| `args` | List of strings; subject to [$(location)](/versions/7.7.3/reference/be/make-variables#predefined_label_variables) and ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution, and [Bourne shell tokenization](#sh-tokenization); default is `[]` Command line arguments that Bazel passes to the target when it is executed with `bazel test`. These arguments are passed before any `--test_arg` values specified on the `bazel test` command line. | +| `env` | Dictionary of strings; values are subject to [$(location)](/versions/7.7.3/reference/be/make-variables#predefined_label_variables) and ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution; default is `[]` Specifies additional environment variables to set when the test is executed by `bazel test`. This attribute only applies to native rules, like `cc_test`, `py_test`, and `sh_test`. It does not apply to Starlark-defined test rules. For your own Starlark rules, you can add an "env" attribute and use it to populate a [TestEnvironment](/versions/7.7.3/rules/lib/toplevel/testing#TestEnvironment) Provider. | | `env_inherit` | List of strings; default is `[]` Specifies additional environment variables to inherit from the external environment when the test is executed by `bazel test`. This attribute only applies to native rules, like `cc_test`, `py_test`, and `sh_test`. It does not apply to Starlark-defined test rules. | | `size` | String `"enormous"`, `"large"`, `"medium"`, or `"small"`; [nonconfigurable](#configurable-attributes); default is `"medium"` 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 "enormous". Bazel uses the size to determine a default timeout, which can be overridden using the `timeout` attribute. The timeout is for all tests in the BUILD target, not for each individual test. When the test is run locally, the `size` is additionally used for scheduling purposes: Bazel tries to respect `--local_{ram,cpu}_resources` and not overwhelm 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 usages: | Size | RAM (in MB) | CPU (in CPU cores) | Default timeout | | --- | --- | --- | --- | | small | 20 | 1 | short (1 minute) | | medium | 100 | 1 | moderate (5 minutes) | | large | 300 | 1 | long (15 minutes) | | enormous | 800 | 1 | eternal (60 minutes) | The environment variable `TEST_SIZE` will be set to the value of this attribute when spawning the test. | | `timeout` | String `"short"`, `"moderate"`, `"long"`, or `"eternal"`; [nonconfigurable](#configurable-attributes); default is derived from the test's `size` attribute How long the test is expected to run before returning. While a test's size attribute controls resource estimation, a test's timeout may be set independently. If not explicitly specified, the timeout is based on the [test's size](#test.size). The test timeout can be overridden with the `--test_timeout` flag, e.g. for running under certain conditions which are known to be slow. Test timeout values correspond to the following time periods: | Timeout Value | Time Period | | --- | --- | | short | 1 minute | | moderate | 5 minutes | | long | 15 minutes | | eternal | 60 minutes | For times other than the above, the test timeout can be overridden with the `--test_timeout` bazel flag, e.g. for manually running under conditions which are known to be slow. The `--test_timeout` values are in seconds. For example `--test_timeout=120` will set the test timeout to two minutes. The environment variable `TEST_TIMEOUT` will be set to the test timeout (in seconds) when spawning the test. | | `flaky` | Boolean; [nonconfigurable](#configurable-attributes); default is `False` Marks test as flaky. If set, executes the test up to three times, marking it as failed only if it fails each time. By default, this attribute is set to False and the test is executed only once. Note, that use of this attribute is generally discouraged - tests should pass reliably when their assertions are upheld. | -| `shard_count` | Non-negative integer less than or equal to 50; default is `-1` Specifies the number of parallel shards to use to run the test. If set, this value will override any heuristics used to determine the number of parallel shards with which to run the test. Note that for some test rules, this parameter may be required to enable sharding in the first place. Also see `--test_sharding_strategy`. If test sharding is enabled, the environment variable `TEST_TOTAL_SHARDS` will be set to this value when spawning the test. Sharding requires the test runner to support the test sharding protocol. If it does not, then it will most likely run every test in every shard, which is not what you want. See [Test Sharding](/versions/7.7.1/reference/test-encyclopedia#test-sharding) in the Test Encyclopedia for details on sharding. | +| `shard_count` | Non-negative integer less than or equal to 50; default is `-1` Specifies the number of parallel shards to use to run the test. If set, this value will override any heuristics used to determine the number of parallel shards with which to run the test. Note that for some test rules, this parameter may be required to enable sharding in the first place. Also see `--test_sharding_strategy`. If test sharding is enabled, the environment variable `TEST_TOTAL_SHARDS` will be set to this value when spawning the test. Sharding requires the test runner to support the test sharding protocol. If it does not, then it will most likely run every test in every shard, which is not what you want. See [Test Sharding](/versions/7.7.3/reference/test-encyclopedia#test-sharding) in the Test Encyclopedia for details on sharding. | | `local` | Boolean; [nonconfigurable](#configurable-attributes); default is `False` Forces the test to be run locally, without sandboxing. Setting this to True is equivalent to providing "local" as a tag (`tags=["local"]`). | ## Attributes common to all binary rules (\*\_binary) @@ -105,8 +105,8 @@ | Attribute | Description | | --- | --- | -| `args` | List of strings; subject to [$(location)](/versions/7.7.1/reference/be/make-variables#predefined_label_variables) and ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution, and [Bourne shell tokenization](#sh-tokenization); [nonconfigurable](#configurable-attributes); default is `[]` Command line arguments that Bazel will pass to the target when it is executed either by the `run` command or as a test. These arguments are passed before the ones that are specified on the `bazel run` or `bazel test` command line. *NOTE: The arguments are not passed when you run the target outside of Bazel (for example, by manually executing the binary in `bazel-bin/`).* | -| `env` | Dictionary of strings; values are subject to [$(location)](/versions/7.7.1/reference/be/make-variables#predefined_label_variables) and ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution; default is `{}` Specifies additional environment variables to set when the target is executed by `bazel run`. This attribute only applies to native rules, like `cc_binary`, `py_binary`, and `sh_binary`. It does not apply to Starlark-defined executable rules. *NOTE: The environment variables are not set when you run the target outside of Bazel (for example, by manually executing the binary in `bazel-bin/`).* | +| `args` | List of strings; subject to [$(location)](/versions/7.7.3/reference/be/make-variables#predefined_label_variables) and ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution, and [Bourne shell tokenization](#sh-tokenization); [nonconfigurable](#configurable-attributes); default is `[]` Command line arguments that Bazel will pass to the target when it is executed either by the `run` command or as a test. These arguments are passed before the ones that are specified on the `bazel run` or `bazel test` command line. *NOTE: The arguments are not passed when you run the target outside of Bazel (for example, by manually executing the binary in `bazel-bin/`).* | +| `env` | Dictionary of strings; values are subject to [$(location)](/versions/7.7.3/reference/be/make-variables#predefined_label_variables) and ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution; default is `{}` Specifies additional environment variables to set when the target is executed by `bazel run`. This attribute only applies to native rules, like `cc_binary`, `py_binary`, and `sh_binary`. It does not apply to Starlark-defined executable rules. *NOTE: The environment variables are not set when you run the target outside of Bazel (for example, by manually executing the binary in `bazel-bin/`).* | | `output_licenses` | List of strings; default is `[]` The licenses of the output files that this binary generates. This is part of a deprecated licensing API that Bazel no longer uses. Don't use this. | ## Configurable attributes @@ -140,20 +140,20 @@ ) ``` -The [`select()`](/versions/7.7.1/reference/be/functions#select) function +The [`select()`](/versions/7.7.3/reference/be/functions#select) function chooses among different alternative values for a configurable attribute based -on which [`config_setting`](/versions/7.7.1/reference/be/general#config_setting) -or [`constraint_value`](/versions/7.7.1/reference/be/platforms-and-toolchains#constraint_value) +on which [`config_setting`](/versions/7.7.3/reference/be/general#config_setting) +or [`constraint_value`](/versions/7.7.3/reference/be/platforms-and-toolchains#constraint_value) criteria the target's configuration satisfies. Bazel evaluates configurable attributes after processing macros and before processing rules (technically, between the -[loading and analysis phases](https://bazel.build/versions/7.7.1/rules/concepts#evaluation-model)). +[loading and analysis phases](https://bazel.build/versions/7.7.3/rules/concepts#evaluation-model)). Any processing before `select()` evaluation doesn't know which branch the `select()` chooses. Macros, for example, can't change their behavior based on the chosen branch, and `bazel query` can only make conservative guesses about a target's configurable dependencies. See -[this FAQ](https://bazel.build/versions/7.7.1/docs/configurable-attributes#faq) +[this FAQ](https://bazel.build/versions/7.7.3/docs/configurable-attributes#faq) for more on using `select()` with rules and macros. Attributes marked `nonconfigurable` in their documentation cannot @@ -161,7 +161,7 @@ internally needs to know its value before it can determine how to resolve a `select()`. -See [Configurable Build Attributes](https://bazel.build/versions/7.7.1/docs/configurable-attributes) for a detailed overview. +See [Configurable Build Attributes](https://bazel.build/versions/7.7.3/docs/configurable-attributes) for a detailed overview. ## Implicit output targets @@ -193,7 +193,7 @@ An important but somewhat subtle distinction between the two namespaces used by the build system: -[labels](/versions/7.7.1/concepts/labels) identify *targets*, +[labels](/versions/7.7.3/concepts/labels) identify *targets*, which may be rules or files, and file targets may be divided into either source (or input) file targets and derived (or output) file targets. These are the things you can mention in BUILD files, @@ -206,4 +206,4 @@ cannot be referenced from within BUILD files or from the command line. In this way, the build tool may hide certain implementation details of how it does its job. This is explained more fully in -the [BUILD Concept Reference](/versions/7.7.1/concepts/build-ref). \ No newline at end of file +the [BUILD Concept Reference](/versions/7.7.3/concepts/build-ref). \ No newline at end of file
diff --git a/docs/versions/7.7.1/reference/be/extra-actions.mdx b/docs/versions/7.7.3/reference/be/extra-actions.mdx similarity index 83% rename from docs/versions/7.7.1/reference/be/extra-actions.mdx rename to docs/versions/7.7.3/reference/be/extra-actions.mdx index 4886a92..990c08c 100644 --- a/docs/versions/7.7.1/reference/be/extra-actions.mdx +++ b/docs/versions/7.7.3/reference/be/extra-actions.mdx
@@ -16,20 +16,20 @@ ``` **WARNING:** Extra actions are deprecated. Use -[aspects](https://bazel.build/versions/7.7.1/rules/aspects) +[aspects](https://bazel.build/versions/7.7.3/rules/aspects) instead. An `action_listener` rule doesn't produce any output itself. Instead, it allows tool developers to insert -[`extra_action`](/versions/7.7.1/reference/be/extra-actions#extra_action)s into the build system, -by providing a mapping from action to [`extra_action`](/versions/7.7.1/reference/be/extra-actions#extra_action). +[`extra_action`](/versions/7.7.3/reference/be/extra-actions#extra_action)s into the build system, +by providing a mapping from action to [`extra_action`](/versions/7.7.3/reference/be/extra-actions#extra_action). This rule's arguments map action mnemonics to -[`extra_action`](/versions/7.7.1/reference/be/extra-actions#extra_action) rules. +[`extra_action`](/versions/7.7.3/reference/be/extra-actions#extra_action) rules. -By specifying the option [`--experimental_action_listener=<label>`](/versions/7.7.1/docs/user-manual#flag--experimental_action_listener), +By specifying the option [`--experimental_action_listener=<label>`](/versions/7.7.3/docs/user-manual#flag--experimental_action_listener), the build will use the specified `action_listener` to insert -[`extra_action`](/versions/7.7.1/reference/be/extra-actions#extra_action)s into the build graph. +[`extra_action`](/versions/7.7.3/reference/be/extra-actions#extra_action)s into the build graph. #### Example @@ -62,8 +62,8 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `extra_actions` | List of [labels](/versions/7.7.1/concepts/labels); required A list of `extra_action` targets this `action_listener` should add to the build graph. E.g. `[ "//my/tools:analyzer" ]`. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `extra_actions` | List of [labels](/versions/7.7.3/concepts/labels); required A list of `extra_action` targets this `action_listener` should add to the build graph. E.g. `[ "//my/tools:analyzer" ]`. | | `mnemonics` | List of strings; required A list of action mnemonics this `action_listener` should listen for, e.g. `[ "Javac" ]`. Mnemonics are not a public interface. There's no guarantee that the mnemonics and their actions don't change. | ## extra\_action @@ -75,14 +75,14 @@ ``` **WARNING:** Extra actions are deprecated. Use -[aspects](https://bazel.build/versions/7.7.1/rules/aspects) +[aspects](https://bazel.build/versions/7.7.3/rules/aspects) instead. An `extra_action` rule doesn't produce any meaningful output when specified as a regular build target. Instead, it allows tool developers to insert additional actions into the build graph that shadow existing actions. -See [`action_listener`](/versions/7.7.1/reference/be/extra-actions#action_listener) for details +See [`action_listener`](/versions/7.7.3/reference/be/extra-actions#action_listener) for details on how to enable `extra_action`s. The `extra_action`s run as a command-line. The command-line tool gets @@ -99,8 +99,8 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. You may refer to this rule by `label` in the `extra_actions` argument of [`action_listener`](/versions/7.7.1/reference/be/extra-actions#action_listener) rules. | -| `cmd` | String; required The command to run. Like [genrule cmd attribute](/versions/7.7.1/reference/be/general#genrule.cmd) with the following differences: 1. No heuristic label expansion. Only labels using $(location ...) are expanded. 2. An additional pass is applied to the string to replace all occurrences of the outputs created from the `out_templates` attribute. All occurrences of `$(output out_template)` are replaced with the path to the file denoted by `label`. E.g. out\_template `$(ACTION_ID).analysis` can be matched with `$(output $(ACTION_ID).analysis)`. In effect, this is the same substitution as `$(location)` but with a different scope. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. You may refer to this rule by `label` in the `extra_actions` argument of [`action_listener`](/versions/7.7.3/reference/be/extra-actions#action_listener) rules. | +| `cmd` | String; required The command to run. Like [genrule cmd attribute](/versions/7.7.3/reference/be/general#genrule.cmd) with the following differences: 1. No heuristic label expansion. Only labels using $(location ...) are expanded. 2. An additional pass is applied to the string to replace all occurrences of the outputs created from the `out_templates` attribute. All occurrences of `$(output out_template)` are replaced with the path to the file denoted by `label`. E.g. out\_template `$(ACTION_ID).analysis` can be matched with `$(output $(ACTION_ID).analysis)`. In effect, this is the same substitution as `$(location)` but with a different scope. | | `out_templates` | List of strings; default is `[]` A list of templates for files generated by the `extra_action` command. The template can use the following variables: * $(ACTION\_ID), an id uniquely identifying this `extra_action`. Used to generate a unique output file. | | `requires_action_output` | Boolean; default is `False` Indicates this `extra_action` requires the output of the original action to be present as input to this `extra_action`. When true (default false), the extra\_action can assume that the original action outputs are available as part of its inputs. | -| `tools` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` A list of `tool` dependencies for this rule. See the definition of [dependencies](/versions/7.7.1/concepts/build-ref#deps) for more information. The build system ensures these prerequisites are built before running the `extra_action` command; they are built using the [`exec`configuration](/versions/7.7.1/docs/user-manual#configurations), since they must run as a tool during the build itself. The path of an individual `tools` target `//x:y` can be obtained using `$(location //x:y)`. All tools and their data dependencies are consolidated into a single tree within which the command can use relative paths. The working directory will be the root of that unified tree. | \ No newline at end of file +| `tools` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` A list of `tool` dependencies for this rule. See the definition of [dependencies](/versions/7.7.3/concepts/build-ref#deps) for more information. The build system ensures these prerequisites are built before running the `extra_action` command; they are built using the [`exec`configuration](/versions/7.7.3/docs/user-manual#configurations), since they must run as a tool during the build itself. The path of an individual `tools` target `//x:y` can be obtained using `$(location //x:y)`. All tools and their data dependencies are consolidated into a single tree within which the command can use relative paths. The working directory will be the root of that unified tree. | \ No newline at end of file
diff --git a/docs/versions/7.7.1/reference/be/functions.mdx b/docs/versions/7.7.3/reference/be/functions.mdx similarity index 95% rename from docs/versions/7.7.1/reference/be/functions.mdx rename to docs/versions/7.7.3/reference/be/functions.mdx index 9a92d81..694b023 100644 --- a/docs/versions/7.7.1/reference/be/functions.mdx +++ b/docs/versions/7.7.3/reference/be/functions.mdx
@@ -22,7 +22,7 @@ For the counterpart that declares metadata applying to every rule in the whole *repository*, use the `repo()` function in the -[`REPO.bazel` file](/versions/7.7.1/external/overview#repo.bazel) at the root of your repo. +[`REPO.bazel` file](/versions/7.7.3/external/overview#repo.bazel) at the root of your repo. The `repo()` function takes exactly the same arguments as `package()`. The package() function should be called right after all the load() statements at the top of the @@ -33,10 +33,10 @@ | Attribute | Description | | --- | --- | | `default_applicable_licenses` | Alias for [`default_package_metadata`](#package.default_package_metadata). | -| `default_visibility` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The default visibility of the rules in this package. Every rule in this package has the visibility specified in this attribute, unless otherwise specified in the `visibility` attribute of the rule. For detailed information about the syntax of this attribute, see the documentation of [visibility](/versions/7.7.1/concepts/visibility). The package default visibility does not apply to [exports\_files](#exports_files), which is public by default. | -| `default_deprecation` | String; default is `""` Sets the default [`deprecation`](/versions/7.7.1/reference/be/common-definitions#common.deprecation) message for all rules in this package. | -| `default_package_metadata` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Sets a default list of metadata targets which apply to all other targets in the package. These are typically targets related to OSS package and license declarations. See [rules\_license](https://github.com/bazelbuild/rules_license) for examples. | -| `default_testonly` | Boolean; default is `False` except as noted Sets the default [`testonly`](/versions/7.7.1/reference/be/common-definitions#common.testonly) property for all rules in this package. In packages under `javatests` the default value is `True`. | +| `default_visibility` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The default visibility of the rules in this package. Every rule in this package has the visibility specified in this attribute, unless otherwise specified in the `visibility` attribute of the rule. For detailed information about the syntax of this attribute, see the documentation of [visibility](/versions/7.7.3/concepts/visibility). The package default visibility does not apply to [exports\_files](#exports_files), which is public by default. | +| `default_deprecation` | String; default is `""` Sets the default [`deprecation`](/versions/7.7.3/reference/be/common-definitions#common.deprecation) message for all rules in this package. | +| `default_package_metadata` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Sets a default list of metadata targets which apply to all other targets in the package. These are typically targets related to OSS package and license declarations. See [rules\_license](https://github.com/bazelbuild/rules_license) for examples. | +| `default_testonly` | Boolean; default is `False` except as noted Sets the default [`testonly`](/versions/7.7.3/reference/be/common-definitions#common.testonly) property for all rules in this package. In packages under `javatests` the default value is `True`. | | `features` | List strings; default is `[]` Sets various flags that affect the semantics of this BUILD file. This feature is mainly used by the people working on the build system to tag packages that need some kind of special handling. Do not use this unless explicitly requested by someone working on the build system. | ### Examples @@ -56,7 +56,7 @@ package_group(name, packages, includes) ``` -This function defines a set of [packages](/versions/7.7.1/concepts/build-ref#packages) +This function defines a set of [packages](/versions/7.7.3/concepts/build-ref#packages) and associates a label with the set. The label can be referenced in `visibility` attributes. @@ -66,7 +66,7 @@ In between these extremes, a target may allow access to its own package plus any of the packages described by one or more package groups. For a more detailed explanation of the visibility system, see the -[visibility](/versions/7.7.1/reference/be/common-definitions#common.visibility) +[visibility](/versions/7.7.3/reference/be/common-definitions#common.visibility) attribute. A given package is considered to be in the group if it either matches the @@ -80,9 +80,9 @@ | Attribute | Description | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | | `packages` | List of strings; default is `[]` A list of zero or more package specifications. Each package specification string can have one of the following forms: 1. The full name of a package, without its repository, starting with a double slash. For example, `//foo/bar` specifies the package having that name and which lives in the same repository as the package group.- As above, but with a trailing `/...`. For example, `//foo/...` specifies the set of `//foo` and all its subpackages. `//...` specifies all packages in the current repository.- The strings `public` or `private`, which respectively specify every package or no package. (This form requires the flag `--incompatible_package_group_has_public_syntax` to be set.) In addition, the first two kinds of package specifications may also be prefixed with `-` to indicate that they are negated. The package group contains any package that matches at least one of its positive specifications and none of its negative specifications For instance, the value `[//foo/..., -//foo/tests/...]` includes all subpackages of `//foo` that are not also subpackages of `//foo/tests`. (`//foo` itself is included while //foo/tests itself is not.) Aside from public visibility, there is no way to directly specify packages outside the current repository. If this attribute is missing, it is the same as setting it to an empty list, which is also the same as setting it to a list containing only `private`. *Note:* Prior to Bazel 6.0, the specification `//...` had a legacy behavior of being the same as `public`. This behavior is fixed when `--incompatible_fix_package_group_reporoot_syntax` is enabled, which is the default after Bazel 6.0. *Note:* Prior to Bazel 6.0, when this attribute is serialized as part of `bazel query --output=proto` (or `--output=xml`), the leading slashes are omitted. For instance, `//pkg/foo/...` will output as `\"pkg/foo/...\"`. This behavior is fixed when `--incompatible_package_group_includes_double_slash` is enabled, which is the default after Bazel 6.0. | -| `includes` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Other package groups that are included in this one. The labels in this attribute must refer to other package groups. Packages in referenced package groups are taken to be part of this package group. This is transitive — if package group `a` includes package group `b`, and `b` includes package group `c`, then every package in `c` will also be a member of `a`. When used together with negated package specifications, note that the set of packages for each group is first computed independently and the results are then unioned together. This means that negated specifications in one group have no effect on the specifications in another group. | +| `includes` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Other package groups that are included in this one. The labels in this attribute must refer to other package groups. Packages in referenced package groups are taken to be part of this package group. This is transitive — if package group `a` includes package group `b`, and `b` includes package group `c`, then every package in `c` will also be a member of `a`. When used together with negated package specifications, note that the set of packages for each group is first computed independently and the results are then unioned together. This means that negated specifications in one group have no effect on the specifications in another group. | ### Examples @@ -144,7 +144,7 @@ The BUILD file for a package may only refer directly to source files belonging to another package if they are explicitly exported with an `exports_files()` statement. Read more about -[visibility of files](/versions/7.7.1/concepts/visibility#source-file-target-visibility). +[visibility of files](/versions/7.7.3/concepts/visibility#source-file-target-visibility). As a legacy behaviour, also files mentioned as input to a rule are exported with the default visibility until the flag @@ -159,7 +159,7 @@ visible to the targets specified. If no visibility is specified, the files will be visible to every package, even if a package default visibility was specified in the `package` -function. The [licenses](/versions/7.7.1/reference/be/common-definitions#common.licenses) +function. The [licenses](/versions/7.7.3/reference/be/common-definitions#common.licenses) can also be specified. ### Example @@ -264,7 +264,7 @@ existence of BUILD files — that is, the same glob expression would include `x/y/z.cc` if there was no package called `x/y` or it was marked as deleted using the - [--deleted\_packages](/versions/7.7.1/docs/user-manual#flag--deleted_packages) + [--deleted\_packages](/versions/7.7.3/docs/user-manual#flag--deleted_packages) flag. 5. The restriction above applies to all glob expressions, no matter which wildcards they use. @@ -396,7 +396,7 @@ ``` `select()` is the helper function that makes a rule attribute -[configurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes). +[configurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes). It can replace the right-hand side of *almost* any attribute assignment so its value depends on command-line Bazel flags.
diff --git a/docs/versions/7.7.1/reference/be/general.mdx b/docs/versions/7.7.3/reference/be/general.mdx similarity index 89% rename from docs/versions/7.7.1/reference/be/general.mdx rename to docs/versions/7.7.3/reference/be/general.mdx index 83aeea1..8ff918e 100644 --- a/docs/versions/7.7.1/reference/be/general.mdx +++ b/docs/versions/7.7.3/reference/be/general.mdx
@@ -27,7 +27,7 @@ Aliasing may be of help in large repositories where renaming a target would require making changes to lots of files. You can also use alias rule to store a -[select](/versions/7.7.1/reference/be/functions#select) function call if you want to reuse that logic for +[select](/versions/7.7.3/reference/be/functions#select) function call if you want to reuse that logic for multiple targets. The alias rule has its own visibility declaration. In all other respects, it behaves @@ -60,8 +60,8 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `actual` | [Label](/versions/7.7.1/concepts/labels); required The target this alias refers to. It does not need to be a rule, it can also be an input file. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `actual` | [Label](/versions/7.7.3/concepts/labels); required The target this alias refers to. It does not need to be a rule, it can also be an input file. | ## config\_setting @@ -72,8 +72,8 @@ ``` Matches an expected configuration state (expressed as build flags or platform constraints) for -the purpose of triggering configurable attributes. See [select](/versions/7.7.1/reference/be/functions#select) for -how to consume this rule and [Configurable attributes](/versions/7.7.1/reference/be/common-definitions#configurable-attributes) for an overview of the general feature. +the purpose of triggering configurable attributes. See [select](/versions/7.7.3/reference/be/functions#select) for +how to consume this rule and [Configurable attributes](/versions/7.7.3/reference/be/common-definitions#configurable-attributes) for an overview of the general feature. #### Examples @@ -101,7 +101,7 @@ ``` The following matches any build that sets -[user-defined flag](https://bazel.build/versions/7.7.1/rules/config#user-defined-build-settings) +[user-defined flag](https://bazel.build/versions/7.7.3/rules/config#user-defined-build-settings) `--//custom_flags:foo=1` (either explicitly at the command line or implicitly from .bazelrc files): @@ -134,13 +134,13 @@ #### Notes -* See [select](/versions/7.7.1/reference/be/functions#select) for what happens when multiple +* See [select](/versions/7.7.3/reference/be/functions#select) for what happens when multiple `config_setting`s match the current configuration state. * For flags that support shorthand forms (e.g. `--compilation_mode` vs. `-c`), `values` definitions must use the full form. These automatically match invocations using either form. * If a flag takes multiple values (like `--copt=-Da --copt=-Db` or a list-typed - [Starlark flag](https://bazel.build/versions/7.7.1/rules/config#user-defined-build-settings)), `values = { "flag": "a" }` matches if `"a"` is + [Starlark flag](https://bazel.build/versions/7.7.3/rules/config#user-defined-build-settings)), `values = { "flag": "a" }` matches if `"a"` is present *anywhere* in the actual list. `values = { "myflag": "a,b" }` works the same way: this matches @@ -153,14 +153,14 @@ *does*: `-ios_multi_cpus=a,b` and `ios_multi_cpus=a --ios_multi_cpus=b` both produce `["a", "b"]`. Check flag definitions and test your conditions carefully to verify exact expectations. * If you need to define conditions that aren't modeled by built-in build flags, use - [Starlark-defined flags](https://bazel.build/versions/7.7.1/rules/config#user-defined-build-settings). You can also use `--define`, but this offers weaker + [Starlark-defined flags](https://bazel.build/versions/7.7.3/rules/config#user-defined-build-settings). You can also use `--define`, but this offers weaker support and is not recommended. See - [here](/versions/7.7.1/reference/be/common-definitions#configurable-attributes) for more discussion. + [here](/versions/7.7.3/reference/be/common-definitions#configurable-attributes) for more discussion. * Avoid repeating identical `config_setting` definitions in different packages. Instead, reference a common `config_setting` that defined in a canonical package. -* [`values`](/versions/7.7.1/reference/be/general#config_setting.values), - [`define_values`](/versions/7.7.1/reference/be/general#config_setting.define_values), and - [`constraint_values`](/versions/7.7.1/reference/be/general#config_setting.constraint_values) +* [`values`](/versions/7.7.3/reference/be/general#config_setting.values), + [`define_values`](/versions/7.7.3/reference/be/general#config_setting.define_values), and + [`constraint_values`](/versions/7.7.3/reference/be/general#config_setting.constraint_values) can be used in any combination in the same `config_setting` but at least one must be set for any given `config_setting`. @@ -168,11 +168,11 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `constraint_values` | List of [labels](/versions/7.7.1/concepts/labels); [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `[]` The minimum set of `constraint_values` that the target platform must specify in order to match this `config_setting`. (The execution platform is not considered here.) Any additional constraint values that the platform has are ignored. See [Configurable Build Attributes](https://bazel.build/versions/7.7.1/docs/configurable-attributes#platforms) for details. In the case where two `config_setting`s both match in the same `select`, this attribute is not considered for the purpose of determining whether one of the `config_setting`s is a specialization of the other. In other words, one `config_setting` cannot match a platform more strongly than another. | -| `define_values` | Dictionary: String -> String; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `{}` The same as [`values`](/versions/7.7.1/reference/be/general#config_setting.values) but specifically for the `--define` flag. `--define` is special because its syntax (`--define KEY=VAL`) means `KEY=VAL` is a *value* from a Bazel flag perspective. That means: ``` config_setting( name = "a_and_b", values = { "define": "a=1", "define": "b=2", }) ``` doesn't work because the same key (`define`) appears twice in the dictionary. This attribute solves that problem: ``` config_setting( name = "a_and_b", define_values = { "a": "1", "b": "2", }) ``` correctly matches `bazel build //foo --define a=1 --define b=2`. `--define` can still appear in [`values`](/versions/7.7.1/reference/be/general#config_setting.values) with normal flag syntax, and can be mixed freely with this attribute as long as dictionary keys remain distinct. | -| `flag_values` | Dictionary: [label](/versions/7.7.1/concepts/labels) -> String; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `{}` The same as [`values`](/versions/7.7.1/reference/be/general#config_setting.values) but for [user-defined build flags](https://bazel.build/versions/7.7.1/rules/config#user-defined-build-settings). This is a distinct attribute because user-defined flags are referenced as labels while built-in flags are referenced as arbitrary strings. | -| `values` | Dictionary: String -> String; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `{}` The set of configuration values that match this rule (expressed as build flags) This rule inherits the configuration of the configured target that references it in a `select` statement. It is considered to "match" a Bazel invocation if, for every entry in the dictionary, its configuration matches the entry's expected value. For example `values = {"compilation_mode": "opt"}` matches the invocations `bazel build --compilation_mode=opt ...` and `bazel build -c opt ...` on target-configured rules. For convenience's sake, configuration values are specified as build flags (without the preceding `"--"`). But keep in mind that the two are not the same. This is because targets can be built in multiple configurations within the same build. For example, an exec configuration's "cpu" matches the value of `--host_cpu`, not `--cpu`. So different instances of the same `config_setting` may match the same invocation differently depending on the configuration of the rule using them. If a flag is not explicitly set at the command line, its default value is used. If a key appears multiple times in the dictionary, only the last instance is used. If a key references a flag that can be set multiple times on the command line (e.g. `bazel build --copt=foo --copt=bar --copt=baz ...`), a match occurs if *any* of those settings match. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `constraint_values` | List of [labels](/versions/7.7.3/concepts/labels); [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `[]` The minimum set of `constraint_values` that the target platform must specify in order to match this `config_setting`. (The execution platform is not considered here.) Any additional constraint values that the platform has are ignored. See [Configurable Build Attributes](https://bazel.build/versions/7.7.3/docs/configurable-attributes#platforms) for details. In the case where two `config_setting`s both match in the same `select`, this attribute is not considered for the purpose of determining whether one of the `config_setting`s is a specialization of the other. In other words, one `config_setting` cannot match a platform more strongly than another. | +| `define_values` | Dictionary: String -> String; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `{}` The same as [`values`](/versions/7.7.3/reference/be/general#config_setting.values) but specifically for the `--define` flag. `--define` is special because its syntax (`--define KEY=VAL`) means `KEY=VAL` is a *value* from a Bazel flag perspective. That means: ``` config_setting( name = "a_and_b", values = { "define": "a=1", "define": "b=2", }) ``` doesn't work because the same key (`define`) appears twice in the dictionary. This attribute solves that problem: ``` config_setting( name = "a_and_b", define_values = { "a": "1", "b": "2", }) ``` correctly matches `bazel build //foo --define a=1 --define b=2`. `--define` can still appear in [`values`](/versions/7.7.3/reference/be/general#config_setting.values) with normal flag syntax, and can be mixed freely with this attribute as long as dictionary keys remain distinct. | +| `flag_values` | Dictionary: [label](/versions/7.7.3/concepts/labels) -> String; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `{}` The same as [`values`](/versions/7.7.3/reference/be/general#config_setting.values) but for [user-defined build flags](https://bazel.build/versions/7.7.3/rules/config#user-defined-build-settings). This is a distinct attribute because user-defined flags are referenced as labels while built-in flags are referenced as arbitrary strings. | +| `values` | Dictionary: String -> String; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `{}` The set of configuration values that match this rule (expressed as build flags) This rule inherits the configuration of the configured target that references it in a `select` statement. It is considered to "match" a Bazel invocation if, for every entry in the dictionary, its configuration matches the entry's expected value. For example `values = {"compilation_mode": "opt"}` matches the invocations `bazel build --compilation_mode=opt ...` and `bazel build -c opt ...` on target-configured rules. For convenience's sake, configuration values are specified as build flags (without the preceding `"--"`). But keep in mind that the two are not the same. This is because targets can be built in multiple configurations within the same build. For example, an exec configuration's "cpu" matches the value of `--host_cpu`, not `--cpu`. So different instances of the same `config_setting` may match the same invocation differently depending on the configuration of the rule using them. If a flag is not explicitly set at the command line, its default value is used. If a key appears multiple times in the dictionary, only the last instance is used. If a key references a flag that can be set multiple times on the command line (e.g. `bazel build --copt=foo --copt=bar --copt=baz ...`), a match occurs if *any* of those settings match. | ## filegroup @@ -188,7 +188,7 @@ Using `filegroup` is encouraged instead of referencing directories directly. The latter is unsound since the build system does not have full knowledge of all files below the directory, so it may not rebuild when these files change. When combined with -[glob](/versions/7.7.1/reference/be/functions#glob), `filegroup` can ensure that all files are +[glob](/versions/7.7.3/reference/be/functions#glob), `filegroup` can ensure that all files are explicitly known to the build system. #### Examples @@ -234,9 +234,9 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of targets that are members of the file group. It is common to use the result of a [glob](/versions/7.7.1/reference/be/functions#glob) expression for the value of the `srcs` attribute. | -| `data` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of files needed by this rule at runtime. Targets named in the `data` attribute will be added to the `runfiles` of this `filegroup` rule. When the `filegroup` is referenced in the `data` attribute of another rule its `runfiles` will be added to the `runfiles` of the depending rule. See the [data dependencies](/versions/7.7.1/concepts/dependencies#data-dependencies) section and [general documentation of `data`](/versions/7.7.1/reference/be/common-definitions#common.data) for more information about how to depend on and use data files. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of targets that are members of the file group. It is common to use the result of a [glob](/versions/7.7.3/reference/be/functions#glob) expression for the value of the `srcs` attribute. | +| `data` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of files needed by this rule at runtime. Targets named in the `data` attribute will be added to the `runfiles` of this `filegroup` rule. When the `filegroup` is referenced in the `data` attribute of another rule its `runfiles` will be added to the `runfiles` of the depending rule. See the [data dependencies](/versions/7.7.3/concepts/dependencies#data-dependencies) section and [general documentation of `data`](/versions/7.7.3/reference/be/common-definitions#common.data) for more information about how to depend on and use data files. | | `output_group` | String; default is `""` The output group from which to gather artifacts from sources. If this attribute is specified, artifacts from the specified output group of the dependencies will be exported instead of the default output group. An "output group" is a category of output artifacts of a target, specified in that rule's implementation. | ## genquery @@ -248,7 +248,7 @@ ``` `genquery()` runs a query specified in the -[Blaze query language](/versions/7.7.1/reference/query) and dumps the result +[Blaze query language](/versions/7.7.3/reference/query) and dumps the result into a file. In order to keep the build consistent, the query is allowed only to visit @@ -291,11 +291,11 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | | `compressed_output` | Boolean; default is `False` If `True`, query output is written in GZIP file format. This setting can be used to avoid spikes in Bazel's memory use when the query output is expected to be large. Bazel already internally compresses query outputs greater than 220 bytes regardless of the value of this setting, so setting this to `True` may not reduce retained heap. However, it allows Bazel to skip *decompression* when writing the output file, which can be memory-intensive. | | `expression` | String; required The query to be executed. In contrast to the command line and other places in BUILD files, labels here are resolved relative to the root directory of the workspace. For example, the label `:b` in this attribute in the file `a/BUILD` will refer to the target `//:b`. | | `opts` | List of strings; default is `[]` The options that are passed to the query engine. These correspond to the command line options that can be passed to `bazel query`. Some query options are not allowed here: `--keep_going`, `--query_file`, `--universe_scope`, `--order_results` and `--order_output`. Options not specified here will have their default values just like on the command line of `bazel query`. | -| `scope` | List of [labels](/versions/7.7.1/concepts/labels); required The scope of the query. The query is not allowed to touch targets outside the transitive closure of these targets. | +| `scope` | List of [labels](/versions/7.7.3/concepts/labels); required The scope of the query. The query is not allowed to touch targets outside the transitive closure of these targets. | | `strict` | Boolean; default is `True` If true, targets whose queries escape the transitive closure of their scopes will fail to build. If false, Bazel will print a warning and skip whatever query path led it outside of the scope, while completing the rest of the query. | ## genrule @@ -324,11 +324,11 @@ results, including caching policies and environment variables. Tests generally need to be run after the build is complete and on the target architecture, whereas genrules are executed during the build and on the exec architecture (the two may be different). If you need a general purpose -testing rule, use [`sh_test`](/versions/7.7.1/reference/be/shell#sh_test). +testing rule, use [`sh_test`](/versions/7.7.3/reference/be/shell#sh_test). #### Cross-compilation Considerations -*See [the user manual](/versions/7.7.1/docs/user-manual#configurations) for more info about +*See [the user manual](/versions/7.7.3/docs/user-manual#configurations) for more info about cross-compilation.* While genrules run during a build, their outputs are often used after the build, for deployment or @@ -345,7 +345,7 @@ For genrules, the build system ensures that dependencies are built appropriately: `srcs` are built (if necessary) for the *target* configuration, `tools` are built for the *exec* configuration, and the output is considered to -be for the *target* configuration. It also provides ["Make" variables](/versions/7.7.1/reference/be/make-variables) that genrule commands can pass to the corresponding tools. +be for the *target* configuration. It also provides ["Make" variables](/versions/7.7.3/reference/be/make-variables) that genrule commands can pass to the corresponding tools. It is intentional that genrule defines no `deps` attribute: other built-in rules use language-dependent meta information passed between the rules to automatically determine how to @@ -360,11 +360,11 @@ exec configuration, because that's where the compiler will run in the other genrule. In this case, the build system does the right thing automatically: it builds the `srcs` and `outs` of the first genrule for the exec configuration instead of the target -configuration. See [the user manual](/versions/7.7.1/docs/user-manual#configurations) for more +configuration. See [the user manual](/versions/7.7.3/docs/user-manual#configurations) for more info. *JDK & C++ Tooling*: to use a tool from the JDK or the C++ compiler suite, the build system -provides a set of variables to use. See ["Make" variable](/versions/7.7.1/reference/be/make-variables) for +provides a set of variables to use. See ["Make" variable](/versions/7.7.3/reference/be/make-variables) for details. #### Genrule Environment @@ -430,7 +430,7 @@ ) ``` -The following example shows how to use a [`filegroup`](/versions/7.7.1/reference/be/general#filegroup) and the outputs of another `genrule`. Note that using `$(SRCS)` instead +The following example shows how to use a [`filegroup`](/versions/7.7.3/reference/be/general#filegroup) and the outputs of another `genrule`. Note that using `$(SRCS)` instead of explicit `$(location)` directives would also work; this example uses the latter for sake of demonstration. @@ -450,10 +450,10 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. You may refer to this rule by name in the `srcs` or `deps` section of other `BUILD` rules. If the rule generates source files, you should use the `srcs` attribute. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` A list of inputs for this rule, such as source files to process. *This attributes is not suitable to list tools executed by the `cmd`; use the [`tools`](/versions/7.7.1/reference/be/general#genrule.tools) attribute for them instead.* The build system ensures these prerequisites are built before running the genrule command; they are built using the same configuration as the original build request. The names of the files of these prerequisites are available to the command as a space-separated list in `$(SRCS)`; alternatively the path of an individual `srcs` target `//x:y` can be obtained using `$(location //x:y)`, or using `$<` provided it's the only entry in `srcs`. | -| `outs` | List of [filenames](/versions/7.7.1/concepts/build-ref#filename); [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); required A list of files generated by this rule. Output files must not cross package boundaries. Output filenames are interpreted as relative to the package. If the `executable` flag is set, `outs` must contain exactly one label. The genrule command is expected to create each output file at a predetermined location. The location is available in `cmd` using [genrule-specific "Make" variables](/versions/7.7.1/reference/be/make-variables#predefined_genrule_variables) (`$@`, `$(OUTS)`, `$(@D)` or `$(RULEDIR)`) or using [`$(location)`](/versions/7.7.1/reference/be/make-variables#predefined_label_variables) substitution. | -| `cmd` | String; default is `""` The command to run. Subject to [`$(location)`](/versions/7.7.1/reference/be/make-variables#predefined_label_variables) and ["Make" variable](/versions/7.7.1/reference/be/make-variables) substitution. 1. First [`$(location)`](/versions/7.7.1/reference/be/make-variables#predefined_label_variables) substitution is applied, replacing all occurrences of `$(location label)` and of `$(locations label)` (and similar constructions using related variables `execpath`, `execpaths`, `rootpath` and `rootpaths`). 2. Next, ["Make" variables](/versions/7.7.1/reference/be/make-variables) are expanded. Note that predefined variables `$(JAVA)`, `$(JAVAC)` and `$(JAVABASE)` expand under the *exec* configuration, so Java invocations that run as part of a build step can correctly load shared libraries and other dependencies. 3. Finally, the resulting command is executed using the Bash shell. If its exit code is non-zero the command is considered to have failed. This is the fallback of `cmd_bash`, `cmd_ps` and `cmd_bat`, if none of them are applicable. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. You may refer to this rule by name in the `srcs` or `deps` section of other `BUILD` rules. If the rule generates source files, you should use the `srcs` attribute. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` A list of inputs for this rule, such as source files to process. *This attributes is not suitable to list tools executed by the `cmd`; use the [`tools`](/versions/7.7.3/reference/be/general#genrule.tools) attribute for them instead.* The build system ensures these prerequisites are built before running the genrule command; they are built using the same configuration as the original build request. The names of the files of these prerequisites are available to the command as a space-separated list in `$(SRCS)`; alternatively the path of an individual `srcs` target `//x:y` can be obtained using `$(location //x:y)`, or using `$<` provided it's the only entry in `srcs`. | +| `outs` | List of [filenames](/versions/7.7.3/concepts/build-ref#filename); [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); required A list of files generated by this rule. Output files must not cross package boundaries. Output filenames are interpreted as relative to the package. If the `executable` flag is set, `outs` must contain exactly one label. The genrule command is expected to create each output file at a predetermined location. The location is available in `cmd` using [genrule-specific "Make" variables](/versions/7.7.3/reference/be/make-variables#predefined_genrule_variables) (`$@`, `$(OUTS)`, `$(@D)` or `$(RULEDIR)`) or using [`$(location)`](/versions/7.7.3/reference/be/make-variables#predefined_label_variables) substitution. | +| `cmd` | String; default is `""` The command to run. Subject to [`$(location)`](/versions/7.7.3/reference/be/make-variables#predefined_label_variables) and ["Make" variable](/versions/7.7.3/reference/be/make-variables) substitution. 1. First [`$(location)`](/versions/7.7.3/reference/be/make-variables#predefined_label_variables) substitution is applied, replacing all occurrences of `$(location label)` and of `$(locations label)` (and similar constructions using related variables `execpath`, `execpaths`, `rootpath` and `rootpaths`). 2. Next, ["Make" variables](/versions/7.7.3/reference/be/make-variables) are expanded. Note that predefined variables `$(JAVA)`, `$(JAVAC)` and `$(JAVABASE)` expand under the *exec* configuration, so Java invocations that run as part of a build step can correctly load shared libraries and other dependencies. 3. Finally, the resulting command is executed using the Bash shell. If its exit code is non-zero the command is considered to have failed. This is the fallback of `cmd_bash`, `cmd_ps` and `cmd_bat`, if none of them are applicable. | If the command line length exceeds the platform limit (64K on Linux/macOS, 8K on Windows), then genrule will write the command to a script and execute that script to work around. This @@ -461,14 +461,14 @@ `cmd_bat`). | `cmd_bash` | String; default is `""` The Bash command to run. This attribute has higher priority than `cmd`. The command is expanded and runs in the exact same way as the `cmd` attribute. | -| `cmd_bat` | String; default is `""` The Batch command to run on Windows. This attribute has higher priority than `cmd` and `cmd_bash`. The command runs in the similar way as the `cmd` attribute, with the following differences: * This attribute only applies on Windows. * The command runs with `cmd.exe /c` with the following default arguments: + `/S` - strip first and last quotes and execute everything else as is. + `/E:ON` - enable extended command set. + `/V:ON` - enable delayed variable expansion + `/D` - ignore AutoRun registry entries. * After [$(location)](/versions/7.7.1/reference/be/make-variables#predefined_label_variables) and ["Make" variable](/versions/7.7.1/reference/be/make-variables) substitution, the paths will be expanded to Windows style paths (with backslash). | +| `cmd_bat` | String; default is `""` The Batch command to run on Windows. This attribute has higher priority than `cmd` and `cmd_bash`. The command runs in the similar way as the `cmd` attribute, with the following differences: * This attribute only applies on Windows. * The command runs with `cmd.exe /c` with the following default arguments: + `/S` - strip first and last quotes and execute everything else as is. + `/E:ON` - enable extended command set. + `/V:ON` - enable delayed variable expansion + `/D` - ignore AutoRun registry entries. * After [$(location)](/versions/7.7.3/reference/be/make-variables#predefined_label_variables) and ["Make" variable](/versions/7.7.3/reference/be/make-variables) substitution, the paths will be expanded to Windows style paths (with backslash). | | `cmd_ps` | String; default is `""` The Powershell command to run on Windows. This attribute has higher priority than `cmd`, `cmd_bash` and `cmd_bat`. The command runs in the similar way as the `cmd` attribute, with the following differences: * This attribute only applies on Windows. * The command runs with `powershell.exe /c`. To make Powershell easier to use and less error-prone, we run the following commands to set up the environment before executing Powershell command in genrule. * `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned` - allow running unsigned scripts. * `$errorActionPreference='Stop'` - In case there are multiple commands separated by `;`, the action exits immediately if a Powershell CmdLet fails, but this does **NOT** work for external command. * `$PSDefaultParameterValues['*:Encoding'] = 'utf8'` - change the default encoding from utf-16 to utf-8. | -| `executable` | Boolean; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `False` Declare output to be executable. Setting this flag to True means the output is an executable file and can be run using the `run` command. The genrule must produce exactly one output in this case. If this attribute is set, `run` will try executing the file regardless of its content. Declaring data dependencies for the generated executable is not supported. | +| `executable` | Boolean; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `False` Declare output to be executable. Setting this flag to True means the output is an executable file and can be run using the `run` command. The genrule must produce exactly one output in this case. If this attribute is set, `run` will try executing the file regardless of its content. Declaring data dependencies for the generated executable is not supported. | | `local` | Boolean; default is `False` If set to True, this option forces this `genrule` to run using the "local" strategy, which means no remote execution, no sandboxing, no persistent workers. This is equivalent to providing 'local' as a tag (`tags=["local"]`). | | `message` | String; default is `""` A progress message. A progress message that will be printed as this build step is executed. By default, the message is "Generating *output*" (or something equally bland) but you may provide a more specific one. Use this attribute instead of `echo` or other print statements in your `cmd` command, as this allows the build tool to control whether such progress messages are printed or not. | -| `output_licenses` | Licence type; default is `["none"]` See [`common attributes`](/versions/7.7.1/reference/be/common-definitions#binary.output_licenses) | -| `output_to_bindir` | Boolean; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `False` If set to True, this option causes output files to be written into the `bin` directory instead of the `genfiles` directory. | -| `tools` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` A list of *tool* dependencies for this rule. See the definition of [dependencies](/versions/7.7.1/concepts/build-ref#deps) for more information. The build system ensures these prerequisites are built before running the genrule command; they are built using the [*exec* configuration](/versions/7.7.1/contribute/guide#configurations), since these tools are executed as part of the build. The path of an individual `tools` target `//x:y` can be obtained using `$(location //x:y)`. Any `*_binary` or tool to be executed by `cmd` must appear in this list, not in `srcs`, to ensure they are built in the correct configuration. | +| `output_licenses` | Licence type; default is `["none"]` See [`common attributes`](/versions/7.7.3/reference/be/common-definitions#binary.output_licenses) | +| `output_to_bindir` | Boolean; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `False` If set to True, this option causes output files to be written into the `bin` directory instead of the `genfiles` directory. | +| `tools` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` A list of *tool* dependencies for this rule. See the definition of [dependencies](/versions/7.7.3/concepts/build-ref#deps) for more information. The build system ensures these prerequisites are built before running the genrule command; they are built using the [*exec* configuration](/versions/7.7.3/contribute/guide#configurations), since these tools are executed as part of the build. The path of an individual `tools` target `//x:y` can be obtained using `$(location //x:y)`. Any `*_binary` or tool to be executed by `cmd` must appear in this list, not in `srcs`, to ensure they are built in the correct configuration. | ## starlark\_doc\_extract @@ -499,9 +499,9 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` A list of targets wrapping the Starlark files which are `load()`-ed by `src`. These targets *should* under normal usage be [`bzl_library`](https://github.com/bazelbuild/bazel-skylib/blob/main/bzl_library.bzl) targets, but the `starlark_doc_extract` rule does not enforce that, and accepts any target which provides Starlark files in its `DefaultInfo`. Note that the wrapped Starlark files must be files in the source tree; Bazel cannot `load()` generated files. | -| `src` | [Label](/versions/7.7.1/concepts/labels); required A Starlark file from which to extract documentation. Note that this must be a file in the source tree; Bazel cannot `load()` generated files. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` A list of targets wrapping the Starlark files which are `load()`-ed by `src`. These targets *should* under normal usage be [`bzl_library`](https://github.com/bazelbuild/bazel-skylib/blob/main/bzl_library.bzl) targets, but the `starlark_doc_extract` rule does not enforce that, and accepts any target which provides Starlark files in its `DefaultInfo`. Note that the wrapped Starlark files must be files in the source tree; Bazel cannot `load()` generated files. | +| `src` | [Label](/versions/7.7.3/concepts/labels); required A Starlark file from which to extract documentation. Note that this must be a file in the source tree; Bazel cannot `load()` generated files. | | `render_main_repo_name` | Boolean; default is `False` If true, render labels in the main repository in emitted documentation with a repo component (in other words, `//foo:bar.bzl` will be emitted as `@main_repo_name//foo:bar.bzl`). The name to use for the main repository is obtained from `module(name = ...)` in the main repository's `MODULE.bazel` file (if Bzlmod is enabled), or from `workspace(name = ...)` in the main repository's `WORKSPACE` file. This attribute should be set to `False` when generating documentation for Starlark files which are intended to be used only within the same repository, and to `True` when generating documentation for Starlark files which are intended to be used from other repositories. | | `symbol_names` | List of strings; default is `[]` An optional list of qualified names of exported functions, rules, providers, or aspects (or structs in which they are nested) for which to extract documentation. Here, a *qualified name* means the name under which an entity is made available to a user of the module, including any structs in which the entity is nested for namespacing. `starlark_doc_extract` emits documentation for an entity if and only if 1. each component of the entity's qualified name is public (in other words, the first character of each component of the qualified name is alphabetic, not `"_"`); *and* 2. 1. *either* the `symbol_names` list is empty (which is the default case), *or* 2. the entity's qualified name, or the qualified name of a struct in which the entity is nested, is in the `symbol_names` list. | @@ -556,6 +556,6 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `tags` | List of strings; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `[]` List of text tags such as "small" or "database" or "-flaky". Tags may be any valid string. Tags which begin with a "-" character are considered negative tags. The preceding "-" character is not considered part of the tag, so a suite tag of "-small" matches a test's "small" size. All other tags are considered positive tags. Optionally, to make positive tags more explicit, tags may also begin with the "+" character, which will not be evaluated as part of the text of the tag. It merely makes the positive and negative distinction easier to read. Only test rules that match **all** of the positive tags and **none** of the negative tags will be included in the test suite. Note that this does not mean that error checking for dependencies on tests that are filtered out is skipped; the dependencies on skipped tests still need to be legal (e.g. not blocked by visibility constraints). The `manual` tag keyword is treated differently than the above by the "test\_suite expansion" performed by the `blaze test` command on invocations involving wildcard [target patterns](https://bazel.build/versions/7.7.1/docs/build#specifying-build-targets). There, `test_suite` targets tagged "manual" are filtered out (and thus not expanded). This behavior is consistent with how `blaze build` and `blaze test` handle wildcard target patterns in general. Note that this is explicitly different from how `blaze query 'tests(E)'` behaves, as suites are always expanded by the `tests` query function, regardless of the `manual` tag. Note that a test's `size` is considered a tag for the purpose of filtering. If you need a `test_suite` that contains tests with mutually exclusive tags (e.g. all small and medium tests), you'll have to create three `test_suite` rules: one for all small tests, one for all medium tests, and one that includes the previous two. | -| `tests` | List of [labels](/versions/7.7.1/concepts/labels); [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `[]` A list of test suites and test targets of any language. Any `*_test` is accepted here, independent of the language. No `*_binary` targets are accepted however, even if they happen to run a test. Filtering by the specified `tags` is only done for tests listed directly in this attribute. If this attribute contains `test_suite`s, the tests inside those will not be filtered by this `test_suite` (they are considered to be filtered already). If the `tests` attribute is unspecified or empty, the rule will default to including all test rules in the current BUILD file that are not tagged as `manual`. These rules are still subject to `tag` filtering. | \ No newline at end of file +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `tags` | List of strings; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `[]` List of text tags such as "small" or "database" or "-flaky". Tags may be any valid string. Tags which begin with a "-" character are considered negative tags. The preceding "-" character is not considered part of the tag, so a suite tag of "-small" matches a test's "small" size. All other tags are considered positive tags. Optionally, to make positive tags more explicit, tags may also begin with the "+" character, which will not be evaluated as part of the text of the tag. It merely makes the positive and negative distinction easier to read. Only test rules that match **all** of the positive tags and **none** of the negative tags will be included in the test suite. Note that this does not mean that error checking for dependencies on tests that are filtered out is skipped; the dependencies on skipped tests still need to be legal (e.g. not blocked by visibility constraints). The `manual` tag keyword is treated differently than the above by the "test\_suite expansion" performed by the `blaze test` command on invocations involving wildcard [target patterns](https://bazel.build/versions/7.7.3/docs/build#specifying-build-targets). There, `test_suite` targets tagged "manual" are filtered out (and thus not expanded). This behavior is consistent with how `blaze build` and `blaze test` handle wildcard target patterns in general. Note that this is explicitly different from how `blaze query 'tests(E)'` behaves, as suites are always expanded by the `tests` query function, regardless of the `manual` tag. Note that a test's `size` is considered a tag for the purpose of filtering. If you need a `test_suite` that contains tests with mutually exclusive tags (e.g. all small and medium tests), you'll have to create three `test_suite` rules: one for all small tests, one for all medium tests, and one that includes the previous two. | +| `tests` | List of [labels](/versions/7.7.3/concepts/labels); [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `[]` A list of test suites and test targets of any language. Any `*_test` is accepted here, independent of the language. No `*_binary` targets are accepted however, even if they happen to run a test. Filtering by the specified `tags` is only done for tests listed directly in this attribute. If this attribute contains `test_suite`s, the tests inside those will not be filtered by this `test_suite` (they are considered to be filtered already). If the `tests` attribute is unspecified or empty, the rule will default to including all test rules in the current BUILD file that are not tagged as `manual`. These rules are still subject to `tag` filtering. | \ No newline at end of file
diff --git a/docs/versions/7.7.1/reference/be/java.mdx b/docs/versions/7.7.3/reference/be/java.mdx similarity index 86% rename from docs/versions/7.7.1/reference/be/java.mdx rename to docs/versions/7.7.3/reference/be/java.mdx index 6fcf056..78f606b 100644 --- a/docs/versions/7.7.1/reference/be/java.mdx +++ b/docs/versions/7.7.3/reference/be/java.mdx
@@ -46,7 +46,7 @@ creates a self-contained jar file with a manifest that allows it to be run with the `java -jar` command or with the wrapper script's `--singlejar` option. Using the wrapper script is preferred to `java -jar` because it - also passes the [JVM flags](/versions/7.7.1/reference/be/java#java_binary.jvm_flags) and the options + also passes the [JVM flags](/versions/7.7.3/reference/be/java#java_binary.jvm_flags) and the options to load native libraries. The deploy jar contains all the classes that would be found by a classloader that @@ -66,9 +66,9 @@ `deploy.jar` except where jars have no matching source jar. A `deps` attribute is not allowed in a `java_binary` rule without -[`srcs`](/versions/7.7.1/reference/be/java#java_binary.srcs); such a rule requires a -[`main_class`](/versions/7.7.1/reference/be/java#java_binary.main_class) provided by -[`runtime_deps`](/versions/7.7.1/reference/be/java#java_binary.runtime_deps). +[`srcs`](/versions/7.7.3/reference/be/java#java_binary.srcs); such a rule requires a +[`main_class`](/versions/7.7.3/reference/be/java#java_binary.main_class) provided by +[`runtime_deps`](/versions/7.7.3/reference/be/java#java_binary.runtime_deps). The following code snippet illustrates a common mistake: @@ -99,24 +99,24 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. It is good practice to use the name of the source file that is the main entry point of the application (minus the extension). For example, if your entry point is called `Main.java`, then your name could be `Main`. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of other libraries to be linked in to the target. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.1/reference/be/common-definitions#typical-attributes). | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of source files that are processed to create the target. This attribute is almost always required; see exceptions below. Source files of type `.java` are compiled. In case of generated `.java` files it is generally advisable to put the generating rule's name here instead of the name of the file itself. This not only improves readability but makes the rule more resilient to future changes: if the generating rule generates different files in the future, you only need to fix one place: the `outs` of the generating rule. You should not list the generating rule in `deps` because it is a no-op. Source files of type `.srcjar` are unpacked and compiled. (This is useful if you need to generate a set of `.java` files with a genrule.) Rules: if the rule (typically `genrule` or `filegroup`) generates any of the files listed above, they will be used the same way as described for source files. This argument is almost always required, except if a [`main_class`](#java_binary.main_class) attribute specifies a class on the runtime classpath or you specify the `runtime_deps` argument. | -| `resources` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` A list of data files to include in a Java jar. If resources are specified, they will be bundled in the jar along with the usual `.class` files produced by compilation. The location of the resources inside of the jar file is determined by the project structure. Bazel first looks for Maven's [standard directory layout](https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html), (a "src" directory followed by a "resources" directory grandchild). If that is not found, Bazel then looks for the topmost directory named "java" or "javatests" (so, for example, if a resource is at `<workspace root>/x/java/y/java/z`, the path of the resource will be `y/java/z`. This heuristic cannot be overridden, however, the `resource_strip_prefix` attribute can be used to specify a specific alternative directory for resource files. Resources may be source files or generated files. | -| `classpath_resources` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` *DO NOT USE THIS OPTION UNLESS THERE IS NO OTHER WAY)* A list of resources that must be located at the root of the java tree. This attribute's only purpose is to support third-party libraries that require that their resources be found on the classpath as exactly `"myconfig.xml"`. It is only allowed on binaries and not libraries, due to the danger of namespace conflicts. | -| `create_executable` | Boolean; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `True` Deprecated, use `java_single_jar` instead. | -| `deploy_env` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` A list of other `java_binary` targets which represent the deployment environment for this binary. Set this attribute when building a plugin which will be loaded by another `java_binary`. Setting this attribute excludes all dependencies from the runtime classpath (and the deploy jar) of this binary that are shared between this binary and the targets specified in `deploy_env`. | -| `deploy_manifest_lines` | List of strings; default is `[]` A list of lines to add to the `META-INF/manifest.mf` file generated for the `*_deploy.jar` target. The contents of this attribute are *not* subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution. | -| `javacopts` | List of strings; default is `[]` Extra compiler options for this library. Subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). These compiler options are passed to javac after the global compiler options. | -| `jvm_flags` | List of strings; default is `[]` A list of flags to embed in the wrapper script generated for running this binary. Subject to [$(location)](/versions/7.7.1/reference/be/make-variables#location) and ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution, and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). The wrapper script for a Java binary includes a CLASSPATH definition (to find all the dependent jars) and invokes the right Java interpreter. The command line generated by the wrapper script includes the name of the main class followed by a `"$@"` so you can pass along other arguments after the classname. However, arguments intended for parsing by the JVM must be specified *before* the classname on the command line. The contents of `jvm_flags` are added to the wrapper script before the classname is listed. Note that this attribute has *no effect* on `*_deploy.jar` outputs. | -| `launcher` | [Label](/versions/7.7.1/concepts/labels); default is `None` Specify a binary that will be used to run your Java program instead of the normal `bin/java` program included with the JDK. The target must be a `cc_binary`. Any `cc_binary` that implements the [Java Invocation API](http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/invocation.html) can be specified as a value for this attribute. By default, Bazel will use the normal JDK launcher (bin/java or java.exe). The related [`--java_launcher`](/versions/7.7.1/docs/user-manual#flag--java_launcher) Bazel flag affects only those `java_binary` and `java_test` targets that have *not* specified a `launcher` attribute. Note that your native (C++, SWIG, JNI) dependencies will be built differently depending on whether you are using the JDK launcher or another launcher: * If you are using the normal JDK launcher (the default), native dependencies are built as a shared library named `{name}_nativedeps.so`, where `{name}` is the `name` attribute of this java\_binary rule. Unused code is *not* removed by the linker in this configuration. * If you are using any other launcher, native (C++) dependencies are statically linked into a binary named `{name}_nativedeps`, where `{name}` is the `name` attribute of this java\_binary rule. In this case, the linker will remove any code it thinks is unused from the resulting binary, which means any C++ code accessed only via JNI may not be linked in unless that `cc_library` target specifies `alwayslink = 1`. When using any launcher other than the default JDK launcher, the format of the `*_deploy.jar` output changes. See the main [java\_binary](#java_binary) docs for details. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. It is good practice to use the name of the source file that is the main entry point of the application (minus the extension). For example, if your entry point is called `Main.java`, then your name could be `Main`. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of other libraries to be linked in to the target. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.3/reference/be/common-definitions#typical-attributes). | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of source files that are processed to create the target. This attribute is almost always required; see exceptions below. Source files of type `.java` are compiled. In case of generated `.java` files it is generally advisable to put the generating rule's name here instead of the name of the file itself. This not only improves readability but makes the rule more resilient to future changes: if the generating rule generates different files in the future, you only need to fix one place: the `outs` of the generating rule. You should not list the generating rule in `deps` because it is a no-op. Source files of type `.srcjar` are unpacked and compiled. (This is useful if you need to generate a set of `.java` files with a genrule.) Rules: if the rule (typically `genrule` or `filegroup`) generates any of the files listed above, they will be used the same way as described for source files. This argument is almost always required, except if a [`main_class`](#java_binary.main_class) attribute specifies a class on the runtime classpath or you specify the `runtime_deps` argument. | +| `resources` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` A list of data files to include in a Java jar. If resources are specified, they will be bundled in the jar along with the usual `.class` files produced by compilation. The location of the resources inside of the jar file is determined by the project structure. Bazel first looks for Maven's [standard directory layout](https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html), (a "src" directory followed by a "resources" directory grandchild). If that is not found, Bazel then looks for the topmost directory named "java" or "javatests" (so, for example, if a resource is at `<workspace root>/x/java/y/java/z`, the path of the resource will be `y/java/z`. This heuristic cannot be overridden, however, the `resource_strip_prefix` attribute can be used to specify a specific alternative directory for resource files. Resources may be source files or generated files. | +| `classpath_resources` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` *DO NOT USE THIS OPTION UNLESS THERE IS NO OTHER WAY)* A list of resources that must be located at the root of the java tree. This attribute's only purpose is to support third-party libraries that require that their resources be found on the classpath as exactly `"myconfig.xml"`. It is only allowed on binaries and not libraries, due to the danger of namespace conflicts. | +| `create_executable` | Boolean; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `True` Deprecated, use `java_single_jar` instead. | +| `deploy_env` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` A list of other `java_binary` targets which represent the deployment environment for this binary. Set this attribute when building a plugin which will be loaded by another `java_binary`. Setting this attribute excludes all dependencies from the runtime classpath (and the deploy jar) of this binary that are shared between this binary and the targets specified in `deploy_env`. | +| `deploy_manifest_lines` | List of strings; default is `[]` A list of lines to add to the `META-INF/manifest.mf` file generated for the `*_deploy.jar` target. The contents of this attribute are *not* subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution. | +| `javacopts` | List of strings; default is `[]` Extra compiler options for this library. Subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). These compiler options are passed to javac after the global compiler options. | +| `jvm_flags` | List of strings; default is `[]` A list of flags to embed in the wrapper script generated for running this binary. Subject to [$(location)](/versions/7.7.3/reference/be/make-variables#location) and ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution, and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). The wrapper script for a Java binary includes a CLASSPATH definition (to find all the dependent jars) and invokes the right Java interpreter. The command line generated by the wrapper script includes the name of the main class followed by a `"$@"` so you can pass along other arguments after the classname. However, arguments intended for parsing by the JVM must be specified *before* the classname on the command line. The contents of `jvm_flags` are added to the wrapper script before the classname is listed. Note that this attribute has *no effect* on `*_deploy.jar` outputs. | +| `launcher` | [Label](/versions/7.7.3/concepts/labels); default is `None` Specify a binary that will be used to run your Java program instead of the normal `bin/java` program included with the JDK. The target must be a `cc_binary`. Any `cc_binary` that implements the [Java Invocation API](http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/invocation.html) can be specified as a value for this attribute. By default, Bazel will use the normal JDK launcher (bin/java or java.exe). The related [`--java_launcher`](/versions/7.7.3/docs/user-manual#flag--java_launcher) Bazel flag affects only those `java_binary` and `java_test` targets that have *not* specified a `launcher` attribute. Note that your native (C++, SWIG, JNI) dependencies will be built differently depending on whether you are using the JDK launcher or another launcher: * If you are using the normal JDK launcher (the default), native dependencies are built as a shared library named `{name}_nativedeps.so`, where `{name}` is the `name` attribute of this java\_binary rule. Unused code is *not* removed by the linker in this configuration. * If you are using any other launcher, native (C++) dependencies are statically linked into a binary named `{name}_nativedeps`, where `{name}` is the `name` attribute of this java\_binary rule. In this case, the linker will remove any code it thinks is unused from the resulting binary, which means any C++ code accessed only via JNI may not be linked in unless that `cc_library` target specifies `alwayslink = 1`. When using any launcher other than the default JDK launcher, the format of the `*_deploy.jar` output changes. See the main [java\_binary](#java_binary) docs for details. | | `main_class` | String; default is `""` Name of class with `main()` method to use as entry point. If a rule uses this option, it does not need a `srcs=[...]` list. Thus, with this attribute one can make an executable from a Java library that already contains one or more `main()` methods. The value of this attribute is a class name, not a source file. The class must be available at runtime: it may be compiled by this rule (from `srcs`) or provided by direct or transitive dependencies (through `runtime_deps` or `deps`). If the class is unavailable, the binary will fail at runtime; there is no build-time check. | -| `plugins` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Java compiler plugins to run at compile-time. Every `java_plugin` specified in this attribute will be run whenever this rule is built. A library may also inherit plugins from dependencies that use `exported_plugins`. Resources generated by the plugin will be included in the resulting jar of this rule. | -| `resource_jars` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Deprecated: Use java\_import and deps or runtime\_deps instead. | +| `plugins` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Java compiler plugins to run at compile-time. Every `java_plugin` specified in this attribute will be run whenever this rule is built. A library may also inherit plugins from dependencies that use `exported_plugins`. Resources generated by the plugin will be included in the resulting jar of this rule. | +| `resource_jars` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Deprecated: Use java\_import and deps or runtime\_deps instead. | | `resource_strip_prefix` | String; default is `""` The path prefix to strip from Java resources. If specified, this path prefix is stripped from every file in the `resources` attribute. It is an error for a resource file not to be under this directory. If not specified (the default), the path of resource file is determined according to the same logic as the Java package of source files. For example, a source file at `stuff/java/foo/bar/a.txt` will be located at `foo/bar/a.txt`. | -| `runtime_deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Libraries to make available to the final binary or test at runtime only. Like ordinary `deps`, these will appear on the runtime classpath, but unlike them, not on the compile-time classpath. Dependencies needed only at runtime should be listed here. Dependency-analysis tools should ignore targets that appear in both `runtime_deps` and `deps`. | -| `stamp` | Integer; default is `-1` Whether to encode build information into the binary. Possible values: * `stamp = 1`: Always stamp the build information into the binary, even in [`--nostamp`](/versions/7.7.1/docs/user-manual#flag--stamp) builds. **This setting should be avoided**, since it potentially kills remote caching for the binary and any downstream actions that depend on it. * `stamp = 0`: Always replace build information by constant values. This gives good build result caching. * `stamp = -1`: Embedding of build information is controlled by the [`--[no]stamp`](/versions/7.7.1/docs/user-manual#flag--stamp) flag. Stamped binaries are *not* rebuilt unless their dependencies change. | -| `use_launcher` | Boolean; default is `True` Whether the binary should use a custom launcher. If this attribute is set to false, the [launcher](/versions/7.7.1/reference/be/java#java_binary.launcher) attribute and the related [`--java_launcher`](/versions/7.7.1/docs/user-manual#flag--java_launcher) flag will be ignored for this target. | +| `runtime_deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Libraries to make available to the final binary or test at runtime only. Like ordinary `deps`, these will appear on the runtime classpath, but unlike them, not on the compile-time classpath. Dependencies needed only at runtime should be listed here. Dependency-analysis tools should ignore targets that appear in both `runtime_deps` and `deps`. | +| `stamp` | Integer; default is `-1` Whether to encode build information into the binary. Possible values: * `stamp = 1`: Always stamp the build information into the binary, even in [`--nostamp`](/versions/7.7.3/docs/user-manual#flag--stamp) builds. **This setting should be avoided**, since it potentially kills remote caching for the binary and any downstream actions that depend on it. * `stamp = 0`: Always replace build information by constant values. This gives good build result caching. * `stamp = -1`: Embedding of build information is controlled by the [`--[no]stamp`](/versions/7.7.3/docs/user-manual#flag--stamp) flag. Stamped binaries are *not* rebuilt unless their dependencies change. | +| `use_launcher` | Boolean; default is `True` Whether the binary should use a custom launcher. If this attribute is set to false, the [launcher](/versions/7.7.3/reference/be/java#java_binary.launcher) attribute and the related [`--java_launcher`](/versions/7.7.3/docs/user-manual#flag--java_launcher) flag will be ignored for this target. | | `use_testrunner` | Boolean; default is `False` Use the test runner (by default `com.google.testing.junit.runner.BazelTestRunner`) class as the main entry point for a Java program, and provide the test class to the test runner as a value of `bazel.test_suite` system property. You can use this to override the default behavior, which is to use test runner for `java_test` rules, and not use it for `java_binary` rules. It is unlikely you will want to do this. One use is for `AllTest` rules that are invoked by another rule (to set up a database before running the tests, for example). The `AllTest` rule must be declared as a `java_binary`, but should still use the test runner as its main entry point. The name of a test runner class can be overridden with `main_class` attribute. | ## java\_import @@ -148,15 +148,15 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of other libraries to be linked in to the target. See [java\_library.deps](/versions/7.7.1/reference/be/java#java_library.deps). | -| `constraints` | List of strings; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `[]` Extra constraints imposed on this rule as a Java library. | -| `exports` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Targets to make available to users of this rule. See [java\_library.exports](/versions/7.7.1/reference/be/java#java_library.exports). | -| `jars` | List of [labels](/versions/7.7.1/concepts/labels); required The list of JAR files provided to Java targets that depend on this target. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of other libraries to be linked in to the target. See [java\_library.deps](/versions/7.7.3/reference/be/java#java_library.deps). | +| `constraints` | List of strings; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `[]` Extra constraints imposed on this rule as a Java library. | +| `exports` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Targets to make available to users of this rule. See [java\_library.exports](/versions/7.7.3/reference/be/java#java_library.exports). | +| `jars` | List of [labels](/versions/7.7.3/concepts/labels); required The list of JAR files provided to Java targets that depend on this target. | | `neverlink` | Boolean; default is `False` Only use this library for compilation and not at runtime. Useful if the library will be provided by the runtime environment during execution. Examples of libraries like this are IDE APIs for IDE plug-ins or `tools.jar` for anything running on a standard JDK. | -| `proguard_specs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Files to be used as Proguard specification. These will describe the set of specifications to be used by Proguard. If specified, they will be added to any `android_binary` target depending on this library. The files included here must only have idempotent rules, namely -dontnote, -dontwarn, assumenosideeffects, and rules that start with -keep. Other options can only appear in `android_binary`'s proguard\_specs, to ensure non-tautological merges. | -| `runtime_deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Libraries to make available to the final binary or test at runtime only. See [java\_library.runtime\_deps](/versions/7.7.1/reference/be/java#java_library.runtime_deps). | -| `srcjar` | [Label](/versions/7.7.1/concepts/labels); default is `None` A JAR file that contains source code for the compiled JAR files. | +| `proguard_specs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Files to be used as Proguard specification. These will describe the set of specifications to be used by Proguard. If specified, they will be added to any `android_binary` target depending on this library. The files included here must only have idempotent rules, namely -dontnote, -dontwarn, assumenosideeffects, and rules that start with -keep. Other options can only appear in `android_binary`'s proguard\_specs, to ensure non-tautological merges. | +| `runtime_deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Libraries to make available to the final binary or test at runtime only. See [java\_library.runtime\_deps](/versions/7.7.3/reference/be/java#java_library.runtime_deps). | +| `srcjar` | [Label](/versions/7.7.3/concepts/labels); default is `None` A JAR file that contains source code for the compiled JAR files. | ## java\_library @@ -178,20 +178,20 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of libraries to link into this library. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.1/reference/be/common-definitions#typical-attributes). The jars built by `java_library` rules listed in `deps` will be on the compile-time classpath of this rule. Furthermore the transitive closure of their `deps`, `runtime_deps` and `exports` will be on the runtime classpath. By contrast, targets in the `data` attribute are included in the runfiles but on neither the compile-time nor runtime classpath. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of source files that are processed to create the target. This attribute is almost always required; see exceptions below. Source files of type `.java` are compiled. In case of generated `.java` files it is generally advisable to put the generating rule's name here instead of the name of the file itself. This not only improves readability but makes the rule more resilient to future changes: if the generating rule generates different files in the future, you only need to fix one place: the `outs` of the generating rule. You should not list the generating rule in `deps` because it is a no-op. Source files of type `.srcjar` are unpacked and compiled. (This is useful if you need to generate a set of `.java` files with a genrule.) Rules: if the rule (typically `genrule` or `filegroup`) generates any of the files listed above, they will be used the same way as described for source files. This argument is almost always required, except if a [`main_class`](#java_binary.main_class) attribute specifies a class on the runtime classpath or you specify the `runtime_deps` argument. | -| `data` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of files needed by this library at runtime. See general comments about `data` at [Typical attributes defined by most build rules](/versions/7.7.1/reference/be/common-definitions#typical-attributes). When building a `java_library`, Bazel doesn't put these files anywhere; if the `data` files are generated files then Bazel generates them. When building a test that depends on this `java_library` Bazel copies or links the `data` files into the runfiles area. | -| `resources` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` A list of data files to include in a Java jar. If resources are specified, they will be bundled in the jar along with the usual `.class` files produced by compilation. The location of the resources inside of the jar file is determined by the project structure. Bazel first looks for Maven's [standard directory layout](https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html), (a "src" directory followed by a "resources" directory grandchild). If that is not found, Bazel then looks for the topmost directory named "java" or "javatests" (so, for example, if a resource is at `<workspace root>/x/java/y/java/z`, the path of the resource will be `y/java/z`. This heuristic cannot be overridden, however, the `resource_strip_prefix` attribute can be used to specify a specific alternative directory for resource files. Resources may be source files or generated files. | -| `exported_plugins` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of `java_plugin`s (e.g. annotation processors) to export to libraries that directly depend on this library. The specified list of `java_plugin`s will be applied to any library which directly depends on this library, just as if that library had explicitly declared these labels in `plugins`. | -| `exports` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Exported libraries. Listing rules here will make them available to parent rules, as if the parents explicitly depended on these rules. This is not true for regular (non-exported) `deps`. Summary: a rule *X* can access the code in *Y* if there exists a dependency path between them that begins with a `deps` edge followed by zero or more `exports` edges. Let's see some examples to illustrate this. Assume *A* depends on *B* and *B* depends on *C*. In this case C is a *transitive* dependency of A, so changing C's sources and rebuilding A will correctly rebuild everything. However A will not be able to use classes in C. To allow that, either A has to declare C in its `deps`, or B can make it easier for A (and anything that may depend on A) by declaring C in its (B's) `exports` attribute. The closure of exported libraries is available to all direct parent rules. Take a slightly different example: A depends on B, B depends on C and D, and also exports C but not D. Now A has access to C but not to D. Now, if C and D exported some libraries, C' and D' respectively, A could only access C' but not D'. Important: an exported rule is not a regular dependency. Sticking to the previous example, if B exports C and wants to also use C, it has to also list it in its own `deps`. | -| `javacopts` | List of strings; default is `[]` Extra compiler options for this library. Subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). These compiler options are passed to javac after the global compiler options. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of libraries to link into this library. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.3/reference/be/common-definitions#typical-attributes). The jars built by `java_library` rules listed in `deps` will be on the compile-time classpath of this rule. Furthermore the transitive closure of their `deps`, `runtime_deps` and `exports` will be on the runtime classpath. By contrast, targets in the `data` attribute are included in the runfiles but on neither the compile-time nor runtime classpath. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of source files that are processed to create the target. This attribute is almost always required; see exceptions below. Source files of type `.java` are compiled. In case of generated `.java` files it is generally advisable to put the generating rule's name here instead of the name of the file itself. This not only improves readability but makes the rule more resilient to future changes: if the generating rule generates different files in the future, you only need to fix one place: the `outs` of the generating rule. You should not list the generating rule in `deps` because it is a no-op. Source files of type `.srcjar` are unpacked and compiled. (This is useful if you need to generate a set of `.java` files with a genrule.) Rules: if the rule (typically `genrule` or `filegroup`) generates any of the files listed above, they will be used the same way as described for source files. This argument is almost always required, except if a [`main_class`](#java_binary.main_class) attribute specifies a class on the runtime classpath or you specify the `runtime_deps` argument. | +| `data` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of files needed by this library at runtime. See general comments about `data` at [Typical attributes defined by most build rules](/versions/7.7.3/reference/be/common-definitions#typical-attributes). When building a `java_library`, Bazel doesn't put these files anywhere; if the `data` files are generated files then Bazel generates them. When building a test that depends on this `java_library` Bazel copies or links the `data` files into the runfiles area. | +| `resources` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` A list of data files to include in a Java jar. If resources are specified, they will be bundled in the jar along with the usual `.class` files produced by compilation. The location of the resources inside of the jar file is determined by the project structure. Bazel first looks for Maven's [standard directory layout](https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html), (a "src" directory followed by a "resources" directory grandchild). If that is not found, Bazel then looks for the topmost directory named "java" or "javatests" (so, for example, if a resource is at `<workspace root>/x/java/y/java/z`, the path of the resource will be `y/java/z`. This heuristic cannot be overridden, however, the `resource_strip_prefix` attribute can be used to specify a specific alternative directory for resource files. Resources may be source files or generated files. | +| `exported_plugins` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of `java_plugin`s (e.g. annotation processors) to export to libraries that directly depend on this library. The specified list of `java_plugin`s will be applied to any library which directly depends on this library, just as if that library had explicitly declared these labels in `plugins`. | +| `exports` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Exported libraries. Listing rules here will make them available to parent rules, as if the parents explicitly depended on these rules. This is not true for regular (non-exported) `deps`. Summary: a rule *X* can access the code in *Y* if there exists a dependency path between them that begins with a `deps` edge followed by zero or more `exports` edges. Let's see some examples to illustrate this. Assume *A* depends on *B* and *B* depends on *C*. In this case C is a *transitive* dependency of A, so changing C's sources and rebuilding A will correctly rebuild everything. However A will not be able to use classes in C. To allow that, either A has to declare C in its `deps`, or B can make it easier for A (and anything that may depend on A) by declaring C in its (B's) `exports` attribute. The closure of exported libraries is available to all direct parent rules. Take a slightly different example: A depends on B, B depends on C and D, and also exports C but not D. Now A has access to C but not to D. Now, if C and D exported some libraries, C' and D' respectively, A could only access C' but not D'. Important: an exported rule is not a regular dependency. Sticking to the previous example, if B exports C and wants to also use C, it has to also list it in its own `deps`. | +| `javacopts` | List of strings; default is `[]` Extra compiler options for this library. Subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). These compiler options are passed to javac after the global compiler options. | | `neverlink` | Boolean; default is `False` Whether this library should only be used for compilation and not at runtime. Useful if the library will be provided by the runtime environment during execution. Examples of such libraries are the IDE APIs for IDE plug-ins or `tools.jar` for anything running on a standard JDK. Note that `neverlink = 1` does not prevent the compiler from inlining material from this library into compilation targets that depend on it, as permitted by the Java Language Specification (e.g., `static final` constants of `String` or of primitive types). The preferred use case is therefore when the runtime library is identical to the compilation library. If the runtime library differs from the compilation library then you must ensure that it differs only in places that the JLS forbids compilers to inline (and that must hold for all future versions of the JLS). | -| `plugins` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Java compiler plugins to run at compile-time. Every `java_plugin` specified in this attribute will be run whenever this rule is built. A library may also inherit plugins from dependencies that use `exported_plugins`. Resources generated by the plugin will be included in the resulting jar of this rule. | -| `proguard_specs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Files to be used as Proguard specification. These will describe the set of specifications to be used by Proguard. If specified, they will be added to any `android_binary` target depending on this library. The files included here must only have idempotent rules, namely -dontnote, -dontwarn, assumenosideeffects, and rules that start with -keep. Other options can only appear in `android_binary`'s proguard\_specs, to ensure non-tautological merges. | -| `resource_jars` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Deprecated: Use java\_import and deps or runtime\_deps instead. | +| `plugins` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Java compiler plugins to run at compile-time. Every `java_plugin` specified in this attribute will be run whenever this rule is built. A library may also inherit plugins from dependencies that use `exported_plugins`. Resources generated by the plugin will be included in the resulting jar of this rule. | +| `proguard_specs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Files to be used as Proguard specification. These will describe the set of specifications to be used by Proguard. If specified, they will be added to any `android_binary` target depending on this library. The files included here must only have idempotent rules, namely -dontnote, -dontwarn, assumenosideeffects, and rules that start with -keep. Other options can only appear in `android_binary`'s proguard\_specs, to ensure non-tautological merges. | +| `resource_jars` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Deprecated: Use java\_import and deps or runtime\_deps instead. | | `resource_strip_prefix` | String; default is `""` The path prefix to strip from Java resources. If specified, this path prefix is stripped from every file in the `resources` attribute. It is an error for a resource file not to be under this directory. If not specified (the default), the path of resource file is determined according to the same logic as the Java package of source files. For example, a source file at `stuff/java/foo/bar/a.txt` will be located at `foo/bar/a.txt`. | -| `runtime_deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Libraries to make available to the final binary or test at runtime only. Like ordinary `deps`, these will appear on the runtime classpath, but unlike them, not on the compile-time classpath. Dependencies needed only at runtime should be listed here. Dependency-analysis tools should ignore targets that appear in both `runtime_deps` and `deps`. | +| `runtime_deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Libraries to make available to the final binary or test at runtime only. Like ordinary `deps`, these will appear on the runtime classpath, but unlike them, not on the compile-time classpath. Dependencies needed only at runtime should be listed here. Dependency-analysis tools should ignore targets that appear in both `runtime_deps` and `deps`. | ## java\_lite\_proto\_library @@ -203,7 +203,7 @@ `java_lite_proto_library` generates Java code from `.proto` files. -`deps` must point to [`proto_library`](/versions/7.7.1/reference/be/protocol-buffer#proto_library) rules. +`deps` must point to [`proto_library`](/versions/7.7.3/reference/be/protocol-buffer#proto_library) rules. Example: @@ -227,8 +227,8 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of [`proto_library`](/versions/7.7.1/reference/be/protocol-buffer#proto_library) rules to generate Java code for. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of [`proto_library`](/versions/7.7.3/reference/be/protocol-buffer#proto_library) rules to generate Java code for. | ## java\_proto\_library @@ -240,7 +240,7 @@ `java_proto_library` generates Java code from `.proto` files. -`deps` must point to [`proto_library`](/versions/7.7.1/reference/be/protocol-buffer#proto_library) rules. +`deps` must point to [`proto_library`](/versions/7.7.3/reference/be/protocol-buffer#proto_library) rules. Example: @@ -264,8 +264,8 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of [`proto_library`](/versions/7.7.1/reference/be/protocol-buffer#proto_library) rules to generate Java code for. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of [`proto_library`](/versions/7.7.3/reference/be/protocol-buffer#proto_library) rules to generate Java code for. | ## java\_test @@ -286,8 +286,8 @@ `name_deploy.jar` output from [java\_binary](#java_binary) for more details. -See the section on [java\_binary()](/versions/7.7.1/reference/be/java#java_binary_args) arguments. This rule also -supports all [attributes common to all test rules (\*\_test)](/versions/7.7.1/reference/be/common-definitions#common-attributes-tests). +See the section on [java\_binary()](/versions/7.7.3/reference/be/java#java_binary_args) arguments. This rule also +supports all [attributes common to all test rules (\*\_test)](/versions/7.7.3/reference/be/common-definitions#common-attributes-tests). #### Examples @@ -315,24 +315,24 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of other libraries to be linked in to the target. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.1/reference/be/common-definitions#typical-attributes). | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of source files that are processed to create the target. This attribute is almost always required; see exceptions below. Source files of type `.java` are compiled. In case of generated `.java` files it is generally advisable to put the generating rule's name here instead of the name of the file itself. This not only improves readability but makes the rule more resilient to future changes: if the generating rule generates different files in the future, you only need to fix one place: the `outs` of the generating rule. You should not list the generating rule in `deps` because it is a no-op. Source files of type `.srcjar` are unpacked and compiled. (This is useful if you need to generate a set of `.java` files with a genrule.) Rules: if the rule (typically `genrule` or `filegroup`) generates any of the files listed above, they will be used the same way as described for source files. This argument is almost always required, except if a [`main_class`](#java_binary.main_class) attribute specifies a class on the runtime classpath or you specify the `runtime_deps` argument. | -| `resources` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` A list of data files to include in a Java jar. If resources are specified, they will be bundled in the jar along with the usual `.class` files produced by compilation. The location of the resources inside of the jar file is determined by the project structure. Bazel first looks for Maven's [standard directory layout](https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html), (a "src" directory followed by a "resources" directory grandchild). If that is not found, Bazel then looks for the topmost directory named "java" or "javatests" (so, for example, if a resource is at `<workspace root>/x/java/y/java/z`, the path of the resource will be `y/java/z`. This heuristic cannot be overridden, however, the `resource_strip_prefix` attribute can be used to specify a specific alternative directory for resource files. Resources may be source files or generated files. | -| `classpath_resources` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` *DO NOT USE THIS OPTION UNLESS THERE IS NO OTHER WAY)* A list of resources that must be located at the root of the java tree. This attribute's only purpose is to support third-party libraries that require that their resources be found on the classpath as exactly `"myconfig.xml"`. It is only allowed on binaries and not libraries, due to the danger of namespace conflicts. | -| `create_executable` | Boolean; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `True` Deprecated, use `java_single_jar` instead. | -| `deploy_manifest_lines` | List of strings; default is `[]` A list of lines to add to the `META-INF/manifest.mf` file generated for the `*_deploy.jar` target. The contents of this attribute are *not* subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution. | -| `javacopts` | List of strings; default is `[]` Extra compiler options for this library. Subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). These compiler options are passed to javac after the global compiler options. | -| `jvm_flags` | List of strings; default is `[]` A list of flags to embed in the wrapper script generated for running this binary. Subject to [$(location)](/versions/7.7.1/reference/be/make-variables#location) and ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution, and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). The wrapper script for a Java binary includes a CLASSPATH definition (to find all the dependent jars) and invokes the right Java interpreter. The command line generated by the wrapper script includes the name of the main class followed by a `"$@"` so you can pass along other arguments after the classname. However, arguments intended for parsing by the JVM must be specified *before* the classname on the command line. The contents of `jvm_flags` are added to the wrapper script before the classname is listed. Note that this attribute has *no effect* on `*_deploy.jar` outputs. | -| `launcher` | [Label](/versions/7.7.1/concepts/labels); default is `None` Specify a binary that will be used to run your Java program instead of the normal `bin/java` program included with the JDK. The target must be a `cc_binary`. Any `cc_binary` that implements the [Java Invocation API](http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/invocation.html) can be specified as a value for this attribute. By default, Bazel will use the normal JDK launcher (bin/java or java.exe). The related [`--java_launcher`](/versions/7.7.1/docs/user-manual#flag--java_launcher) Bazel flag affects only those `java_binary` and `java_test` targets that have *not* specified a `launcher` attribute. Note that your native (C++, SWIG, JNI) dependencies will be built differently depending on whether you are using the JDK launcher or another launcher: * If you are using the normal JDK launcher (the default), native dependencies are built as a shared library named `{name}_nativedeps.so`, where `{name}` is the `name` attribute of this java\_binary rule. Unused code is *not* removed by the linker in this configuration. * If you are using any other launcher, native (C++) dependencies are statically linked into a binary named `{name}_nativedeps`, where `{name}` is the `name` attribute of this java\_binary rule. In this case, the linker will remove any code it thinks is unused from the resulting binary, which means any C++ code accessed only via JNI may not be linked in unless that `cc_library` target specifies `alwayslink = 1`. When using any launcher other than the default JDK launcher, the format of the `*_deploy.jar` output changes. See the main [java\_binary](#java_binary) docs for details. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of other libraries to be linked in to the target. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.3/reference/be/common-definitions#typical-attributes). | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of source files that are processed to create the target. This attribute is almost always required; see exceptions below. Source files of type `.java` are compiled. In case of generated `.java` files it is generally advisable to put the generating rule's name here instead of the name of the file itself. This not only improves readability but makes the rule more resilient to future changes: if the generating rule generates different files in the future, you only need to fix one place: the `outs` of the generating rule. You should not list the generating rule in `deps` because it is a no-op. Source files of type `.srcjar` are unpacked and compiled. (This is useful if you need to generate a set of `.java` files with a genrule.) Rules: if the rule (typically `genrule` or `filegroup`) generates any of the files listed above, they will be used the same way as described for source files. This argument is almost always required, except if a [`main_class`](#java_binary.main_class) attribute specifies a class on the runtime classpath or you specify the `runtime_deps` argument. | +| `resources` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` A list of data files to include in a Java jar. If resources are specified, they will be bundled in the jar along with the usual `.class` files produced by compilation. The location of the resources inside of the jar file is determined by the project structure. Bazel first looks for Maven's [standard directory layout](https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html), (a "src" directory followed by a "resources" directory grandchild). If that is not found, Bazel then looks for the topmost directory named "java" or "javatests" (so, for example, if a resource is at `<workspace root>/x/java/y/java/z`, the path of the resource will be `y/java/z`. This heuristic cannot be overridden, however, the `resource_strip_prefix` attribute can be used to specify a specific alternative directory for resource files. Resources may be source files or generated files. | +| `classpath_resources` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` *DO NOT USE THIS OPTION UNLESS THERE IS NO OTHER WAY)* A list of resources that must be located at the root of the java tree. This attribute's only purpose is to support third-party libraries that require that their resources be found on the classpath as exactly `"myconfig.xml"`. It is only allowed on binaries and not libraries, due to the danger of namespace conflicts. | +| `create_executable` | Boolean; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `True` Deprecated, use `java_single_jar` instead. | +| `deploy_manifest_lines` | List of strings; default is `[]` A list of lines to add to the `META-INF/manifest.mf` file generated for the `*_deploy.jar` target. The contents of this attribute are *not* subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution. | +| `javacopts` | List of strings; default is `[]` Extra compiler options for this library. Subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). These compiler options are passed to javac after the global compiler options. | +| `jvm_flags` | List of strings; default is `[]` A list of flags to embed in the wrapper script generated for running this binary. Subject to [$(location)](/versions/7.7.3/reference/be/make-variables#location) and ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution, and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). The wrapper script for a Java binary includes a CLASSPATH definition (to find all the dependent jars) and invokes the right Java interpreter. The command line generated by the wrapper script includes the name of the main class followed by a `"$@"` so you can pass along other arguments after the classname. However, arguments intended for parsing by the JVM must be specified *before* the classname on the command line. The contents of `jvm_flags` are added to the wrapper script before the classname is listed. Note that this attribute has *no effect* on `*_deploy.jar` outputs. | +| `launcher` | [Label](/versions/7.7.3/concepts/labels); default is `None` Specify a binary that will be used to run your Java program instead of the normal `bin/java` program included with the JDK. The target must be a `cc_binary`. Any `cc_binary` that implements the [Java Invocation API](http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/invocation.html) can be specified as a value for this attribute. By default, Bazel will use the normal JDK launcher (bin/java or java.exe). The related [`--java_launcher`](/versions/7.7.3/docs/user-manual#flag--java_launcher) Bazel flag affects only those `java_binary` and `java_test` targets that have *not* specified a `launcher` attribute. Note that your native (C++, SWIG, JNI) dependencies will be built differently depending on whether you are using the JDK launcher or another launcher: * If you are using the normal JDK launcher (the default), native dependencies are built as a shared library named `{name}_nativedeps.so`, where `{name}` is the `name` attribute of this java\_binary rule. Unused code is *not* removed by the linker in this configuration. * If you are using any other launcher, native (C++) dependencies are statically linked into a binary named `{name}_nativedeps`, where `{name}` is the `name` attribute of this java\_binary rule. In this case, the linker will remove any code it thinks is unused from the resulting binary, which means any C++ code accessed only via JNI may not be linked in unless that `cc_library` target specifies `alwayslink = 1`. When using any launcher other than the default JDK launcher, the format of the `*_deploy.jar` output changes. See the main [java\_binary](#java_binary) docs for details. | | `main_class` | String; default is `""` Name of class with `main()` method to use as entry point. If a rule uses this option, it does not need a `srcs=[...]` list. Thus, with this attribute one can make an executable from a Java library that already contains one or more `main()` methods. The value of this attribute is a class name, not a source file. The class must be available at runtime: it may be compiled by this rule (from `srcs`) or provided by direct or transitive dependencies (through `runtime_deps` or `deps`). If the class is unavailable, the binary will fail at runtime; there is no build-time check. | -| `plugins` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Java compiler plugins to run at compile-time. Every `java_plugin` specified in this attribute will be run whenever this rule is built. A library may also inherit plugins from dependencies that use `exported_plugins`. Resources generated by the plugin will be included in the resulting jar of this rule. | -| `resource_jars` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Deprecated: Use java\_import and deps or runtime\_deps instead. | +| `plugins` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Java compiler plugins to run at compile-time. Every `java_plugin` specified in this attribute will be run whenever this rule is built. A library may also inherit plugins from dependencies that use `exported_plugins`. Resources generated by the plugin will be included in the resulting jar of this rule. | +| `resource_jars` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Deprecated: Use java\_import and deps or runtime\_deps instead. | | `resource_strip_prefix` | String; default is `""` The path prefix to strip from Java resources. If specified, this path prefix is stripped from every file in the `resources` attribute. It is an error for a resource file not to be under this directory. If not specified (the default), the path of resource file is determined according to the same logic as the Java package of source files. For example, a source file at `stuff/java/foo/bar/a.txt` will be located at `foo/bar/a.txt`. | -| `runtime_deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Libraries to make available to the final binary or test at runtime only. Like ordinary `deps`, these will appear on the runtime classpath, but unlike them, not on the compile-time classpath. Dependencies needed only at runtime should be listed here. Dependency-analysis tools should ignore targets that appear in both `runtime_deps` and `deps`. | -| `stamp` | Integer; default is `0` Whether to encode build information into the binary. Possible values: * `stamp = 1`: Always stamp the build information into the binary, even in [`--nostamp`](/versions/7.7.1/docs/user-manual#flag--stamp) builds. **This setting should be avoided**, since it potentially kills remote caching for the binary and any downstream actions that depend on it. * `stamp = 0`: Always replace build information by constant values. This gives good build result caching. * `stamp = -1`: Embedding of build information is controlled by the [`--[no]stamp`](/versions/7.7.1/docs/user-manual#flag--stamp) flag. Stamped binaries are *not* rebuilt unless their dependencies change. | +| `runtime_deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Libraries to make available to the final binary or test at runtime only. Like ordinary `deps`, these will appear on the runtime classpath, but unlike them, not on the compile-time classpath. Dependencies needed only at runtime should be listed here. Dependency-analysis tools should ignore targets that appear in both `runtime_deps` and `deps`. | +| `stamp` | Integer; default is `0` Whether to encode build information into the binary. Possible values: * `stamp = 1`: Always stamp the build information into the binary, even in [`--nostamp`](/versions/7.7.3/docs/user-manual#flag--stamp) builds. **This setting should be avoided**, since it potentially kills remote caching for the binary and any downstream actions that depend on it. * `stamp = 0`: Always replace build information by constant values. This gives good build result caching. * `stamp = -1`: Embedding of build information is controlled by the [`--[no]stamp`](/versions/7.7.3/docs/user-manual#flag--stamp) flag. Stamped binaries are *not* rebuilt unless their dependencies change. | | `test_class` | String; default is `""` The Java class to be loaded by the test runner. By default, if this argument is not defined then the legacy mode is used and the test arguments are used instead. Set the `--nolegacy_bazel_java_test` flag to not fallback on the first argument. This attribute specifies the name of a Java class to be run by this test. It is rare to need to set this. If this argument is omitted, it will be inferred using the target's `name` and its source-root-relative path. If the test is located outside a known source root, Bazel will report an error if `test_class` is unset. For JUnit3, the test class needs to either be a subclass of `junit.framework.TestCase` or it needs to have a public static `suite()` method that returns a `junit.framework.Test` (or a subclass of `Test`). For JUnit4, the class needs to be annotated with `org.junit.runner.RunWith`. This attribute allows several `java_test` rules to share the same `Test` (`TestCase`, `TestSuite`, ...). Typically additional information is passed to it (e.g. via `jvm_flags=['-Dkey=value']`) so that its behavior differs in each case, such as running a different subset of the tests. This attribute also enables the use of Java tests outside the `javatests` tree. | -| `use_launcher` | Boolean; default is `True` Whether the binary should use a custom launcher. If this attribute is set to false, the [launcher](/versions/7.7.1/reference/be/java#java_binary.launcher) attribute and the related [`--java_launcher`](/versions/7.7.1/docs/user-manual#flag--java_launcher) flag will be ignored for this target. | +| `use_launcher` | Boolean; default is `True` Whether the binary should use a custom launcher. If this attribute is set to false, the [launcher](/versions/7.7.3/reference/be/java#java_binary.launcher) attribute and the related [`--java_launcher`](/versions/7.7.3/docs/user-manual#flag--java_launcher) flag will be ignored for this target. | | `use_testrunner` | Boolean; default is `True` Use the test runner (by default `com.google.testing.junit.runner.BazelTestRunner`) class as the main entry point for a Java program, and provide the test class to the test runner as a value of `bazel.test_suite` system property. You can use this to override the default behavior, which is to use test runner for `java_test` rules, and not use it for `java_binary` rules. It is unlikely you will want to do this. One use is for `AllTest` rules that are invoked by another rule (to set up a database before running the tests, for example). The `AllTest` rule must be declared as a `java_binary`, but should still use the test runner as its main entry point. The name of a test runner class can be overridden with `main_class` attribute. | ## java\_package\_configuration @@ -376,10 +376,10 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `data` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of files needed by this configuration at runtime. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `data` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of files needed by this configuration at runtime. | | `javacopts` | List of strings; default is `[]` Java compiler flags. | -| `packages` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The set of `package_group`s the configuration should be applied to. | +| `packages` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The set of `package_group`s the configuration should be applied to. | ## java\_plugin @@ -400,26 +400,26 @@ * `libname.jar`: A Java archive. -Arguments are identical to [`java_library`](/versions/7.7.1/reference/be/java#java_library), except +Arguments are identical to [`java_library`](/versions/7.7.3/reference/be/java#java_library), except for the addition of the `processor_class` argument. ### Arguments | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of libraries to link into this library. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.1/reference/be/common-definitions#typical-attributes). The jars built by `java_library` rules listed in `deps` will be on the compile-time classpath of this rule. Furthermore the transitive closure of their `deps`, `runtime_deps` and `exports` will be on the runtime classpath. By contrast, targets in the `data` attribute are included in the runfiles but on neither the compile-time nor runtime classpath. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of source files that are processed to create the target. This attribute is almost always required; see exceptions below. Source files of type `.java` are compiled. In case of generated `.java` files it is generally advisable to put the generating rule's name here instead of the name of the file itself. This not only improves readability but makes the rule more resilient to future changes: if the generating rule generates different files in the future, you only need to fix one place: the `outs` of the generating rule. You should not list the generating rule in `deps` because it is a no-op. Source files of type `.srcjar` are unpacked and compiled. (This is useful if you need to generate a set of `.java` files with a genrule.) Rules: if the rule (typically `genrule` or `filegroup`) generates any of the files listed above, they will be used the same way as described for source files. This argument is almost always required, except if a [`main_class`](#java_binary.main_class) attribute specifies a class on the runtime classpath or you specify the `runtime_deps` argument. | -| `data` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of files needed by this library at runtime. See general comments about `data` at [Typical attributes defined by most build rules](/versions/7.7.1/reference/be/common-definitions#typical-attributes). When building a `java_library`, Bazel doesn't put these files anywhere; if the `data` files are generated files then Bazel generates them. When building a test that depends on this `java_library` Bazel copies or links the `data` files into the runfiles area. | -| `resources` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` A list of data files to include in a Java jar. If resources are specified, they will be bundled in the jar along with the usual `.class` files produced by compilation. The location of the resources inside of the jar file is determined by the project structure. Bazel first looks for Maven's [standard directory layout](https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html), (a "src" directory followed by a "resources" directory grandchild). If that is not found, Bazel then looks for the topmost directory named "java" or "javatests" (so, for example, if a resource is at `<workspace root>/x/java/y/java/z`, the path of the resource will be `y/java/z`. This heuristic cannot be overridden, however, the `resource_strip_prefix` attribute can be used to specify a specific alternative directory for resource files. Resources may be source files or generated files. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of libraries to link into this library. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.3/reference/be/common-definitions#typical-attributes). The jars built by `java_library` rules listed in `deps` will be on the compile-time classpath of this rule. Furthermore the transitive closure of their `deps`, `runtime_deps` and `exports` will be on the runtime classpath. By contrast, targets in the `data` attribute are included in the runfiles but on neither the compile-time nor runtime classpath. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of source files that are processed to create the target. This attribute is almost always required; see exceptions below. Source files of type `.java` are compiled. In case of generated `.java` files it is generally advisable to put the generating rule's name here instead of the name of the file itself. This not only improves readability but makes the rule more resilient to future changes: if the generating rule generates different files in the future, you only need to fix one place: the `outs` of the generating rule. You should not list the generating rule in `deps` because it is a no-op. Source files of type `.srcjar` are unpacked and compiled. (This is useful if you need to generate a set of `.java` files with a genrule.) Rules: if the rule (typically `genrule` or `filegroup`) generates any of the files listed above, they will be used the same way as described for source files. This argument is almost always required, except if a [`main_class`](#java_binary.main_class) attribute specifies a class on the runtime classpath or you specify the `runtime_deps` argument. | +| `data` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of files needed by this library at runtime. See general comments about `data` at [Typical attributes defined by most build rules](/versions/7.7.3/reference/be/common-definitions#typical-attributes). When building a `java_library`, Bazel doesn't put these files anywhere; if the `data` files are generated files then Bazel generates them. When building a test that depends on this `java_library` Bazel copies or links the `data` files into the runfiles area. | +| `resources` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` A list of data files to include in a Java jar. If resources are specified, they will be bundled in the jar along with the usual `.class` files produced by compilation. The location of the resources inside of the jar file is determined by the project structure. Bazel first looks for Maven's [standard directory layout](https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html), (a "src" directory followed by a "resources" directory grandchild). If that is not found, Bazel then looks for the topmost directory named "java" or "javatests" (so, for example, if a resource is at `<workspace root>/x/java/y/java/z`, the path of the resource will be `y/java/z`. This heuristic cannot be overridden, however, the `resource_strip_prefix` attribute can be used to specify a specific alternative directory for resource files. Resources may be source files or generated files. | | `generates_api` | Boolean; default is `False` This attribute marks annotation processors that generate API code. If a rule uses an API-generating annotation processor, other rules depending on it can refer to the generated code only if their compilation actions are scheduled after the generating rule. This attribute instructs Bazel to introduce scheduling constraints when --java\_header\_compilation is enabled. *WARNING: This attribute affects build performance, use it only if necessary.* | -| `javacopts` | List of strings; default is `[]` Extra compiler options for this library. Subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). These compiler options are passed to javac after the global compiler options. | +| `javacopts` | List of strings; default is `[]` Extra compiler options for this library. Subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). These compiler options are passed to javac after the global compiler options. | | `neverlink` | Boolean; default is `False` Whether this library should only be used for compilation and not at runtime. Useful if the library will be provided by the runtime environment during execution. Examples of such libraries are the IDE APIs for IDE plug-ins or `tools.jar` for anything running on a standard JDK. Note that `neverlink = 1` does not prevent the compiler from inlining material from this library into compilation targets that depend on it, as permitted by the Java Language Specification (e.g., `static final` constants of `String` or of primitive types). The preferred use case is therefore when the runtime library is identical to the compilation library. If the runtime library differs from the compilation library then you must ensure that it differs only in places that the JLS forbids compilers to inline (and that must hold for all future versions of the JLS). | -| `output_licenses` | Licence type; default is `["none"]` See [`common attributes`](/versions/7.7.1/reference/be/common-definitions#binary.output_licenses) | -| `plugins` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Java compiler plugins to run at compile-time. Every `java_plugin` specified in this attribute will be run whenever this rule is built. A library may also inherit plugins from dependencies that use `exported_plugins`. Resources generated by the plugin will be included in the resulting jar of this rule. | +| `output_licenses` | Licence type; default is `["none"]` See [`common attributes`](/versions/7.7.3/reference/be/common-definitions#binary.output_licenses) | +| `plugins` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Java compiler plugins to run at compile-time. Every `java_plugin` specified in this attribute will be run whenever this rule is built. A library may also inherit plugins from dependencies that use `exported_plugins`. Resources generated by the plugin will be included in the resulting jar of this rule. | | `processor_class` | String; default is `""` The processor class is the fully qualified type of the class that the Java compiler should use as entry point to the annotation processor. If not specified, this rule will not contribute an annotation processor to the Java compiler's annotation processing, but its runtime classpath will still be included on the compiler's annotation processor path. (This is primarily intended for use by [Error Prone plugins](https://errorprone.info/docs/plugins), which are loaded from the annotation processor path using [java.util.ServiceLoader](https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html).) | -| `proguard_specs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Files to be used as Proguard specification. These will describe the set of specifications to be used by Proguard. If specified, they will be added to any `android_binary` target depending on this library. The files included here must only have idempotent rules, namely -dontnote, -dontwarn, assumenosideeffects, and rules that start with -keep. Other options can only appear in `android_binary`'s proguard\_specs, to ensure non-tautological merges. | -| `resource_jars` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Deprecated: Use java\_import and deps or runtime\_deps instead. | +| `proguard_specs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Files to be used as Proguard specification. These will describe the set of specifications to be used by Proguard. If specified, they will be added to any `android_binary` target depending on this library. The files included here must only have idempotent rules, namely -dontnote, -dontwarn, assumenosideeffects, and rules that start with -keep. Other options can only appear in `android_binary`'s proguard\_specs, to ensure non-tautological merges. | +| `resource_jars` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Deprecated: Use java\_import and deps or runtime\_deps instead. | | `resource_strip_prefix` | String; default is `""` The path prefix to strip from Java resources. If specified, this path prefix is stripped from every file in the `resources` attribute. It is an error for a resource file not to be under this directory. If not specified (the default), the path of resource file is determined according to the same logic as the Java package of source files. For example, a source file at `stuff/java/foo/bar/a.txt` will be located at `foo/bar/a.txt`. | ## java\_runtime @@ -446,14 +446,14 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` All files in the runtime. | -| `default_cds` | [Label](/versions/7.7.1/concepts/labels); default is `None` Default CDS archive for hermetic `java_runtime`. When hermetic is enabled for a `java_binary` target and if the target does not provide its own CDS archive by specifying the [`classlist`](/versions/7.7.1/reference/be/java#java_binary.classlist) attribute, the `java_runtime` default CDS is packaged in the hermetic deploy JAR. | -| `hermetic_srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Files in the runtime needed for hermetic deployments. | -| `java` | [Label](/versions/7.7.1/concepts/labels); default is `None` The path to the java executable. | -| `java_home` | String; default is `""` The path to the root of the runtime. Subject to ["Make" variable](/versions/7.7.1/reference/be/make-variables) substitution. If this path is absolute, the rule denotes a non-hermetic Java runtime with a well-known path. In that case, the `srcs` and `java` attributes must be empty. | -| `lib_ct_sym` | [Label](/versions/7.7.1/concepts/labels); default is `None` The lib/ct.sym file needed for compilation with `--release`. If not specified and there is exactly one file in `srcs` whose path ends with `/lib/ct.sym`, that file is used. | -| `lib_modules` | [Label](/versions/7.7.1/concepts/labels); default is `None` The lib/modules file needed for hermetic deployments. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` All files in the runtime. | +| `default_cds` | [Label](/versions/7.7.3/concepts/labels); default is `None` Default CDS archive for hermetic `java_runtime`. When hermetic is enabled for a `java_binary` target and if the target does not provide its own CDS archive by specifying the [`classlist`](/versions/7.7.3/reference/be/java#java_binary.classlist) attribute, the `java_runtime` default CDS is packaged in the hermetic deploy JAR. | +| `hermetic_srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Files in the runtime needed for hermetic deployments. | +| `java` | [Label](/versions/7.7.3/concepts/labels); default is `None` The path to the java executable. | +| `java_home` | String; default is `""` The path to the root of the runtime. Subject to ["Make" variable](/versions/7.7.3/reference/be/make-variables) substitution. If this path is absolute, the rule denotes a non-hermetic Java runtime with a well-known path. In that case, the `srcs` and `java` attributes must be empty. | +| `lib_ct_sym` | [Label](/versions/7.7.3/concepts/labels); default is `None` The lib/ct.sym file needed for compilation with `--release`. If not specified and there is exactly one file in `srcs` whose path ends with `/lib/ct.sym`, that file is used. | +| `lib_modules` | [Label](/versions/7.7.3/concepts/labels); default is `None` The lib/modules file needed for hermetic deployments. | | `version` | Integer; default is `0` The feature version of the Java runtime. I.e., the integer returned by `Runtime.version().feature()`. | ## java\_toolchain @@ -488,40 +488,40 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `android_lint_data` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Labels of tools available for label-expansion in android\_lint\_jvm\_opts. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `android_lint_data` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Labels of tools available for label-expansion in android\_lint\_jvm\_opts. | | `android_lint_jvm_opts` | List of strings; default is `[]` The list of arguments for the JVM when invoking Android Lint. | | `android_lint_opts` | List of strings; default is `[]` The list of Android Lint arguments. | -| `android_lint_package_configuration` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Android Lint Configuration that should be applied to the specified package groups. | -| `android_lint_runner` | [Label](/versions/7.7.1/concepts/labels); default is `None` Label of the Android Lint runner, if any. | -| `bootclasspath` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The Java target bootclasspath entries. Corresponds to javac's -bootclasspath flag. | -| `deps_checker` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Label of the ImportDepsChecker deploy jar. | +| `android_lint_package_configuration` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Android Lint Configuration that should be applied to the specified package groups. | +| `android_lint_runner` | [Label](/versions/7.7.3/concepts/labels); default is `None` Label of the Android Lint runner, if any. | +| `bootclasspath` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The Java target bootclasspath entries. Corresponds to javac's -bootclasspath flag. | +| `deps_checker` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Label of the ImportDepsChecker deploy jar. | | `forcibly_disable_header_compilation` | Boolean; default is `False` Overrides --java\_header\_compilation to disable header compilation on platforms that do not support it, e.g. JDK 7 Bazel. | -| `genclass` | List of [labels](/versions/7.7.1/concepts/labels); required Label of the GenClass deploy jar. | -| `header_compiler` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Label of the header compiler. Required if --java\_header\_compilation is enabled. | -| `header_compiler_direct` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Optional label of the header compiler to use for direct classpath actions that do not include any API-generating annotation processors. This tool does not support annotation processing. | -| `ijar` | List of [labels](/versions/7.7.1/concepts/labels); required Label of the ijar executable. | -| `jacocorunner` | [Label](/versions/7.7.1/concepts/labels); default is `None` Label of the JacocoCoverageRunner deploy jar. | -| `java_runtime` | [Label](/versions/7.7.1/concepts/labels); required The java\_runtime to use with this toolchain. It defaults to java\_runtime in execution configuration. | -| `javabuilder` | List of [labels](/versions/7.7.1/concepts/labels); required Label of the JavaBuilder deploy jar. | -| `javabuilder_data` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Labels of data available for label-expansion in javabuilder\_jvm\_opts. | +| `genclass` | List of [labels](/versions/7.7.3/concepts/labels); required Label of the GenClass deploy jar. | +| `header_compiler` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Label of the header compiler. Required if --java\_header\_compilation is enabled. | +| `header_compiler_direct` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Optional label of the header compiler to use for direct classpath actions that do not include any API-generating annotation processors. This tool does not support annotation processing. | +| `ijar` | List of [labels](/versions/7.7.3/concepts/labels); required Label of the ijar executable. | +| `jacocorunner` | [Label](/versions/7.7.3/concepts/labels); default is `None` Label of the JacocoCoverageRunner deploy jar. | +| `java_runtime` | [Label](/versions/7.7.3/concepts/labels); required The java\_runtime to use with this toolchain. It defaults to java\_runtime in execution configuration. | +| `javabuilder` | List of [labels](/versions/7.7.3/concepts/labels); required Label of the JavaBuilder deploy jar. | +| `javabuilder_data` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Labels of data available for label-expansion in javabuilder\_jvm\_opts. | | `javabuilder_jvm_opts` | List of strings; default is `[]` The list of arguments for the JVM when invoking JavaBuilder. | | `javac_supports_multiplex_workers` | Boolean; default is `True` True if JavaBuilder supports running as a multiplex persistent worker, false if it doesn't. | | `javac_supports_worker_multiplex_sandboxing` | Boolean; default is `False` True if JavaBuilder supports multiplex sandboxing, false if it doesn't. | | `javac_supports_workers` | Boolean; default is `True` True if JavaBuilder supports running as a persistent worker, false if it doesn't. | | `javacopts` | List of strings; default is `[]` The list of extra arguments for the Java compiler. Please refer to the Java compiler documentation for the extensive list of possible Java compiler flags. | | `jvm_opts` | List of strings; default is `[]` The list of arguments for the JVM when invoking the Java compiler. Please refer to the Java virtual machine documentation for the extensive list of possible flags for this option. | -| `oneversion` | [Label](/versions/7.7.1/concepts/labels); default is `None` Label of the one-version enforcement binary. | -| `oneversion_allowlist_for_tests` | [Label](/versions/7.7.1/concepts/labels); default is `None` Label of the one-version allowlist for tests. | -| `oneversion_whitelist` | [Label](/versions/7.7.1/concepts/labels); default is `None` Label of the one-version whitelist. | -| `package_configuration` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Configuration that should be applied to the specified package groups. | -| `proguard_allowlister` | [Label](/versions/7.7.1/concepts/labels); default is `"@bazel_tools//tools/jdk:proguard_whitelister"` Label of the Proguard allowlister. | -| `resourcejar` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Label of the resource jar builder executable. | -| `singlejar` | List of [labels](/versions/7.7.1/concepts/labels); required Label of the SingleJar deploy jar. | +| `oneversion` | [Label](/versions/7.7.3/concepts/labels); default is `None` Label of the one-version enforcement binary. | +| `oneversion_allowlist_for_tests` | [Label](/versions/7.7.3/concepts/labels); default is `None` Label of the one-version allowlist for tests. | +| `oneversion_whitelist` | [Label](/versions/7.7.3/concepts/labels); default is `None` Label of the one-version whitelist. | +| `package_configuration` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Configuration that should be applied to the specified package groups. | +| `proguard_allowlister` | [Label](/versions/7.7.3/concepts/labels); default is `"@bazel_tools//tools/jdk:proguard_whitelister"` Label of the Proguard allowlister. | +| `resourcejar` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Label of the resource jar builder executable. | +| `singlejar` | List of [labels](/versions/7.7.3/concepts/labels); required Label of the SingleJar deploy jar. | | `source_version` | String; default is `""` The Java source version (e.g., '6' or '7'). It specifies which set of code structures are allowed in the Java source code. | | `target_version` | String; default is `""` The Java target version (e.g., '6' or '7'). It specifies for which Java runtime the class should be build. | -| `timezone_data` | [Label](/versions/7.7.1/concepts/labels); default is `None` Label of a resource jar containing timezone data. If set, the timezone data is added as an implicitly runtime dependency of all java\_binary rules. | -| `tools` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Labels of tools available for label-expansion in jvm\_opts. | -| `turbine_data` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` Labels of data available for label-expansion in turbine\_jvm\_opts. | +| `timezone_data` | [Label](/versions/7.7.3/concepts/labels); default is `None` Label of a resource jar containing timezone data. If set, the timezone data is added as an implicitly runtime dependency of all java\_binary rules. | +| `tools` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Labels of tools available for label-expansion in jvm\_opts. | +| `turbine_data` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` Labels of data available for label-expansion in turbine\_jvm\_opts. | | `turbine_jvm_opts` | List of strings; default is `[]` The list of arguments for the JVM when invoking turbine. | | `xlint` | List of strings; default is `[]` The list of warning to add or removes from default list. Precedes it with a dash to removes it. Please see the Javac documentation on the -Xlint options for more information. | \ No newline at end of file
diff --git a/docs/versions/7.7.1/reference/be/make-variables.mdx b/docs/versions/7.7.3/reference/be/make-variables.mdx similarity index 96% rename from docs/versions/7.7.1/reference/be/make-variables.mdx rename to docs/versions/7.7.3/reference/be/make-variables.mdx index 375443c..c99d77f 100644 --- a/docs/versions/7.7.1/reference/be/make-variables.mdx +++ b/docs/versions/7.7.3/reference/be/make-variables.mdx
@@ -63,7 +63,7 @@ **Toolchain option variables** * `COMPILATION_MODE`: - `fastbuild`, `dbg`, or `opt`. ([more details](https://bazel.build/versions/7.7.1/docs/user-manual#flag--compilation_mode)) + `fastbuild`, `dbg`, or `opt`. ([more details](https://bazel.build/versions/7.7.3/docs/user-manual#flag--compilation_mode)) **Path variables** @@ -109,7 +109,7 @@ `//my/pkg:my_genrule` this always ends in `my/pkg`, even if `//my/pkg:my_genrule`'s outputs are in subdirectories. * `@D`: The output directory. If - [outs](/versions/7.7.1/reference/be/general#genrule.outs) has one entry, + [outs](/versions/7.7.3/reference/be/general#genrule.outs) has one entry, this expands to the directory containing that file. If it has multiple entries, this expands to the package's root directory in the `genfiles` tree, *even if all output files are in the same @@ -141,7 +141,7 @@ [See an example of predefined path variables](https://github.com/bazelbuild/examples/tree/main/make-variables#predefined-path-variables). * `execpath`: Denotes the path beneath the - [execroot](/versions/7.7.1/docs/output_directories) + [execroot](/versions/7.7.3/docs/output_directories) where Bazel runs build actions. In the above example, Bazel runs all build actions in the directory linked @@ -169,7 +169,7 @@ * `rootpath`: Denotes the path that a built binary can use to find a dependency at runtime relative to the subdirectory of its runfiles directory corresponding to the main repository. - **Note:** This only works if [`--enable_runfiles`](/versions/7.7.1/reference/command-line-reference#flag--enable_runfiles) is enabled, which is not the case on + **Note:** This only works if [`--enable_runfiles`](/versions/7.7.3/reference/command-line-reference#flag--enable_runfiles) is enabled, which is not the case on Windows by default. Use `rlocationpath` instead for cross-platform support. @@ -251,7 +251,7 @@ on each of potentially multiple internally generated actions. These variables are a fallback mechanism to be used by language experts in -rare cases. If you are tempted to use them, please [contact the Bazel devs](https://bazel.build/versions/7.7.1/help) first. +rare cases. If you are tempted to use them, please [contact the Bazel devs](https://bazel.build/versions/7.7.3/help) first. * `ABI`: The C++ ABI version. * `AR`: The "ar" command from crosstool. @@ -285,7 +285,7 @@ Jars, and highly optimized Jar packaging and merging implementations. These variables are a fallback mechanism to be used by language experts in -rare cases. If you are tempted to use them, please [contact the Bazel devs](https://bazel.build/versions/7.7.1/help) first. +rare cases. If you are tempted to use them, please [contact the Bazel devs](https://bazel.build/versions/7.7.3/help) first. * `JAVA`: The "java" command (a Java virtual machine). Avoid this, and use a `java_binary` rule @@ -298,9 +298,9 @@ **Starlark-defined variables** -Rule and [toolchain](/versions/7.7.1/docs/toolchains) writers can define +Rule and [toolchain](/versions/7.7.3/docs/toolchains) writers can define completely custom variables by returning a -[TemplateVariableInfo](/versions/7.7.1/rules/lib/providers/TemplateVariableInfo) +[TemplateVariableInfo](/versions/7.7.3/rules/lib/providers/TemplateVariableInfo) provider. Any rules depending on these through the `toolchains` attribute can then read their values:
diff --git a/docs/versions/7.7.1/reference/be/objective-c.mdx b/docs/versions/7.7.3/reference/be/objective-c.mdx similarity index 87% rename from docs/versions/7.7.1/reference/be/objective-c.mdx rename to docs/versions/7.7.3/reference/be/objective-c.mdx index 49220ee..b33b219 100644 --- a/docs/versions/7.7.1/reference/be/objective-c.mdx +++ b/docs/versions/7.7.3/reference/be/objective-c.mdx
@@ -39,10 +39,10 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` A list of `j2objc_library`, `java_library`, `java_import` and `java_proto_library` targets that contain Java files to be transpiled to Objective-C. All `java_library` and `java_import` targets that can be reached transitively through `exports`, `deps` and `runtime_deps` will be translated and compiled, including files generated by Java annotation processing. There is no support for code>java\_import targets with no `srcjar` specified. The J2ObjC translation works differently depending on the type of source Java source files included in the transitive closure. For each .java source files included in `srcs` of `java_library`, a corresponding .h and .m source file will be generated. For each source jar included in `srcs` of `java_library` or `srcjar` of `java_import`, a corresponding .h and .m source file will be generated with all the code for that jar. Users can import the J2ObjC-generated header files in their code. The import paths for these files are the root-relative path of the original Java artifacts. For example, `//some/package/foo.java` has an import path of `some/package/foo.h` and `//some/package/bar.srcjar` has `some/package/bar.h` If proto\_library rules are in the transitive closure of this rule, J2ObjC protos will also be generated, compiled and linked-in at the binary level. For proto `//some/proto/foo.proto`, users can reference the generated code using import path `some/proto/foo.j2objc.pb.h`. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` A list of `j2objc_library`, `java_library`, `java_import` and `java_proto_library` targets that contain Java files to be transpiled to Objective-C. All `java_library` and `java_import` targets that can be reached transitively through `exports`, `deps` and `runtime_deps` will be translated and compiled, including files generated by Java annotation processing. There is no support for code>java\_import targets with no `srcjar` specified. The J2ObjC translation works differently depending on the type of source Java source files included in the transitive closure. For each .java source files included in `srcs` of `java_library`, a corresponding .h and .m source file will be generated. For each source jar included in `srcs` of `java_library` or `srcjar` of `java_import`, a corresponding .h and .m source file will be generated with all the code for that jar. Users can import the J2ObjC-generated header files in their code. The import paths for these files are the root-relative path of the original Java artifacts. For example, `//some/package/foo.java` has an import path of `some/package/foo.h` and `//some/package/bar.srcjar` has `some/package/bar.h` If proto\_library rules are in the transitive closure of this rule, J2ObjC protos will also be generated, compiled and linked-in at the binary level. For proto `//some/proto/foo.proto`, users can reference the generated code using import path `some/proto/foo.j2objc.pb.h`. | | `entry_classes` | List of strings; default is `[]` The list of Java classes whose translated ObjC counterparts will be referenced directly by user ObjC code. This attribute is required if flag `--j2objc_dead_code_removal` is on. The Java classes should be specified in their canonical names as defined by [the Java Language Specification.](http://docs.oracle.com/javase/specs/jls/se8/html/jls-6.html#jls-6.7) When flag `--j2objc_dead_code_removal` is specified, the list of entry classes will be collected transitively and used as entry points to perform dead code analysis. Unused classes will then be removed from the final ObjC app bundle. | -| `jre_deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of additional JRE emulation libraries required by all Java code translated by this `j2objc_library` rule. Only core JRE functionality is linked by default. | +| `jre_deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of additional JRE emulation libraries required by all Java code translated by this `j2objc_library` rule. Only core JRE functionality is linked by default. | ## objc\_import @@ -60,16 +60,16 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of targets that this target depend on. | -| `hdrs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of C, C++, Objective-C, and Objective-C++ header files published by this library to be included by sources in dependent rules. These headers describe the public interface for the library and will be made available for inclusion by sources in this rule or in dependent rules. Headers not meant to be included by a client of this library should be listed in the srcs attribute instead. These will be compiled separately from the source if modules are enabled. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of targets that this target depend on. | +| `hdrs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of C, C++, Objective-C, and Objective-C++ header files published by this library to be included by sources in dependent rules. These headers describe the public interface for the library and will be made available for inclusion by sources in this rule or in dependent rules. Headers not meant to be included by a client of this library should be listed in the srcs attribute instead. These will be compiled separately from the source if modules are enabled. | | `alwayslink` | Boolean; default is `False` If 1, any bundle or binary that depends (directly or indirectly) on this library will link in all the object files for the files listed in `srcs` and `non_arc_srcs`, even if some contain no symbols referenced by the binary. This is useful if your code isn't explicitly called by code in the binary, e.g., if your code registers to receive some callback provided by some service. | -| `archives` | List of [labels](/versions/7.7.1/concepts/labels); required The list of `.a` files provided to Objective-C targets that depend on this target. | -| `includes` | List of strings; default is `[]` List of `#include/#import` search paths to add to this target and all depending targets. This is to support third party and open-sourced libraries that do not specify the entire workspace path in their `#import/#include` statements. The paths are interpreted relative to the package directory, and the genfiles and bin roots (e.g. `blaze-genfiles/pkg/includedir` and `blaze-out/pkg/includedir`) are included in addition to the actual client root. Unlike [COPTS](/versions/7.7.1/reference/be/objective-c#objc_library.copts), these flags are added for this rule and every rule that depends on it. (Note: not the rules it depends upon!) Be very careful, since this may have far-reaching effects. When in doubt, add "-iquote" flags to [COPTS](/versions/7.7.1/reference/be/objective-c#objc_library.copts) instead. | +| `archives` | List of [labels](/versions/7.7.3/concepts/labels); required The list of `.a` files provided to Objective-C targets that depend on this target. | +| `includes` | List of strings; default is `[]` List of `#include/#import` search paths to add to this target and all depending targets. This is to support third party and open-sourced libraries that do not specify the entire workspace path in their `#import/#include` statements. The paths are interpreted relative to the package directory, and the genfiles and bin roots (e.g. `blaze-genfiles/pkg/includedir` and `blaze-out/pkg/includedir`) are included in addition to the actual client root. Unlike [COPTS](/versions/7.7.3/reference/be/objective-c#objc_library.copts), these flags are added for this rule and every rule that depends on it. (Note: not the rules it depends upon!) Be very careful, since this may have far-reaching effects. When in doubt, add "-iquote" flags to [COPTS](/versions/7.7.3/reference/be/objective-c#objc_library.copts) instead. | | `sdk_dylibs` | List of strings; default is `[]` Names of SDK .dylib libraries to link with. For instance, "libz" or "libarchive". "libc++" is included automatically if the binary has any C++ or Objective-C++ sources in its dependency tree. When linking a binary, all libraries named in that binary's transitive dependency graph are used. | | `sdk_frameworks` | List of strings; default is `[]` Names of SDK frameworks to link with (e.g. "AddressBook", "QuartzCore"). "UIKit" and "Foundation" are always included when building for the iOS, tvOS, visionOS, and watchOS platforms. For macOS, only "Foundation" is always included. When linking a top level Apple binary, all SDK frameworks listed in that binary's transitive dependency graph are linked. | | `sdk_includes` | List of strings; default is `[]` List of `#include/#import` search paths to add to this target and all depending targets, where each path is relative to `$(SDKROOT)/usr/include`. | -| `textual_hdrs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of C, C++, Objective-C, and Objective-C++ files that are included as headers by source files in this rule or by users of this library. Unlike hdrs, these will not be compiled separately from the sources. | +| `textual_hdrs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of C, C++, Objective-C, and Objective-C++ files that are included as headers by source files in this rule or by users of this library. Unlike hdrs, these will not be compiled separately from the sources. | | `weak_sdk_frameworks` | List of strings; default is `[]` 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. | ## objc\_library @@ -86,25 +86,25 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of targets that are linked together to form the final bundle. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of C, C++, Objective-C, and Objective-C++ source and header files, and/or (`.s`, `.S`, or `.asm`) assembly source files, that are processed to create the library target. These are your checked-in files, plus any generated files. Source files are compiled into .o files with Clang. Header files may be included/imported by any source or header in the srcs attribute of this target, but not by headers in hdrs or any targets that depend on this rule. Additionally, precompiled .o files may be given as srcs. Be careful to ensure consistency in the architecture of provided .o files and that of the build to avoid missing symbol linker errors. | -| `hdrs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of C, C++, Objective-C, and Objective-C++ header files published by this library to be included by sources in dependent rules. These headers describe the public interface for the library and will be made available for inclusion by sources in this rule or in dependent rules. Headers not meant to be included by a client of this library should be listed in the srcs attribute instead. These will be compiled separately from the source if modules are enabled. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of targets that are linked together to form the final bundle. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of C, C++, Objective-C, and Objective-C++ source and header files, and/or (`.s`, `.S`, or `.asm`) assembly source files, that are processed to create the library target. These are your checked-in files, plus any generated files. Source files are compiled into .o files with Clang. Header files may be included/imported by any source or header in the srcs attribute of this target, but not by headers in hdrs or any targets that depend on this rule. Additionally, precompiled .o files may be given as srcs. Be careful to ensure consistency in the architecture of provided .o files and that of the build to avoid missing symbol linker errors. | +| `hdrs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of C, C++, Objective-C, and Objective-C++ header files published by this library to be included by sources in dependent rules. These headers describe the public interface for the library and will be made available for inclusion by sources in this rule or in dependent rules. Headers not meant to be included by a client of this library should be listed in the srcs attribute instead. These will be compiled separately from the source if modules are enabled. | | `alwayslink` | Boolean; default is `False` If 1, any bundle or binary that depends (directly or indirectly) on this library will link in all the object files for the files listed in `srcs` and `non_arc_srcs`, even if some contain no symbols referenced by the binary. This is useful if your code isn't explicitly called by code in the binary, e.g., if your code registers to receive some callback provided by some service. | -| `copts` | List of strings; default is `[]` Extra flags to pass to the compiler. Subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). These flags will only apply to this target, and not those upon which it depends, or those which depend on it. Note that for the generated Xcode project, directory paths specified using "-I" flags in copts are parsed out, prepended with "$(WORKSPACE\_ROOT)/" if they are relative paths, and added to the header search paths for the associated Xcode target. | -| `defines` | List of strings; default is `[]` Extra `-D` flags to pass to the compiler. They should be in the form `KEY=VALUE` or simply `KEY` and are passed not only to the compiler for this target (as `copts` are) but also to all `objc_` dependers of this target. Subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.1/reference/be/common-definitions#sh-tokenization). | +| `copts` | List of strings; default is `[]` Extra flags to pass to the compiler. Subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). These flags will only apply to this target, and not those upon which it depends, or those which depend on it. Note that for the generated Xcode project, directory paths specified using "-I" flags in copts are parsed out, prepended with "$(WORKSPACE\_ROOT)/" if they are relative paths, and added to the header search paths for the associated Xcode target. | +| `defines` | List of strings; default is `[]` Extra `-D` flags to pass to the compiler. They should be in the form `KEY=VALUE` or simply `KEY` and are passed not only to the compiler for this target (as `copts` are) but also to all `objc_` dependers of this target. Subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution and [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization). | | `enable_modules` | Boolean; default is `False` Enables clang module support (via -fmodules). Setting this to 1 will allow you to @import system headers and other targets: @import UIKit; @import path\_to\_package\_target; | -| `implementation_deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of other libraries that the library target depends on. Unlike with `deps`, the headers and include paths of these libraries (and all their transitive deps) are only used for compilation of this library, and not libraries that depend on it. Libraries specified with `implementation_deps` are still linked in binary targets that depend on this library. | -| `includes` | List of strings; default is `[]` List of `#include/#import` search paths to add to this target and all depending targets. This is to support third party and open-sourced libraries that do not specify the entire workspace path in their `#import/#include` statements. The paths are interpreted relative to the package directory, and the genfiles and bin roots (e.g. `blaze-genfiles/pkg/includedir` and `blaze-out/pkg/includedir`) are included in addition to the actual client root. Unlike [COPTS](/versions/7.7.1/reference/be/objective-c#objc_library.copts), these flags are added for this rule and every rule that depends on it. (Note: not the rules it depends upon!) Be very careful, since this may have far-reaching effects. When in doubt, add "-iquote" flags to [COPTS](/versions/7.7.1/reference/be/objective-c#objc_library.copts) instead. | +| `implementation_deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of other libraries that the library target depends on. Unlike with `deps`, the headers and include paths of these libraries (and all their transitive deps) are only used for compilation of this library, and not libraries that depend on it. Libraries specified with `implementation_deps` are still linked in binary targets that depend on this library. | +| `includes` | List of strings; default is `[]` List of `#include/#import` search paths to add to this target and all depending targets. This is to support third party and open-sourced libraries that do not specify the entire workspace path in their `#import/#include` statements. The paths are interpreted relative to the package directory, and the genfiles and bin roots (e.g. `blaze-genfiles/pkg/includedir` and `blaze-out/pkg/includedir`) are included in addition to the actual client root. Unlike [COPTS](/versions/7.7.3/reference/be/objective-c#objc_library.copts), these flags are added for this rule and every rule that depends on it. (Note: not the rules it depends upon!) Be very careful, since this may have far-reaching effects. When in doubt, add "-iquote" flags to [COPTS](/versions/7.7.3/reference/be/objective-c#objc_library.copts) instead. | | `linkopts` | List of strings; default is `[]` Extra flags to pass to the linker. | -| `module_map` | [Label](/versions/7.7.1/concepts/labels); default is `None` A custom Clang module map for this target. Use of a custom module map is discouraged. Most users should use module maps generated by Bazel. If specified, Bazel will not generate a module map for this target, but will pass the provided module map to the compiler. | +| `module_map` | [Label](/versions/7.7.3/concepts/labels); default is `None` A custom Clang module map for this target. Use of a custom module map is discouraged. Most users should use module maps generated by Bazel. If specified, Bazel will not generate a module map for this target, but will pass the provided module map to the compiler. | | `module_name` | String; default is `""` Sets the module name for this target. By default the module name is the target path with all special symbols replaced by \_, e.g. //foo/baz:bar can be imported as foo\_baz\_bar. | -| `non_arc_srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of Objective-C files that are processed to create the library target that DO NOT use ARC. The files in this attribute are treated very similar to those in the srcs attribute, but are compiled without ARC enabled. | -| `pch` | [Label](/versions/7.7.1/concepts/labels); default is `None` Header file to prepend to every source file being compiled (both arc and non-arc). Use of pch files is actively discouraged in BUILD files, and this should be considered deprecated. Since pch files are not actually precompiled this is not a build-speed enhancement, and instead is just a global dependency. From a build efficiency point of view you are actually better including what you need directly in your sources where you need it. | +| `non_arc_srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of Objective-C files that are processed to create the library target that DO NOT use ARC. The files in this attribute are treated very similar to those in the srcs attribute, but are compiled without ARC enabled. | +| `pch` | [Label](/versions/7.7.3/concepts/labels); default is `None` Header file to prepend to every source file being compiled (both arc and non-arc). Use of pch files is actively discouraged in BUILD files, and this should be considered deprecated. Since pch files are not actually precompiled this is not a build-speed enhancement, and instead is just a global dependency. From a build efficiency point of view you are actually better including what you need directly in your sources where you need it. | | `sdk_dylibs` | List of strings; default is `[]` Names of SDK .dylib libraries to link with. For instance, "libz" or "libarchive". "libc++" is included automatically if the binary has any C++ or Objective-C++ sources in its dependency tree. When linking a binary, all libraries named in that binary's transitive dependency graph are used. | | `sdk_frameworks` | List of strings; default is `[]` Names of SDK frameworks to link with (e.g. "AddressBook", "QuartzCore"). "UIKit" and "Foundation" are always included when building for the iOS, tvOS, visionOS, and watchOS platforms. For macOS, only "Foundation" is always included. When linking a top level Apple binary, all SDK frameworks listed in that binary's transitive dependency graph are linked. | | `sdk_includes` | List of strings; default is `[]` List of `#include/#import` search paths to add to this target and all depending targets, where each path is relative to `$(SDKROOT)/usr/include`. | -| `textual_hdrs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of C, C++, Objective-C, and Objective-C++ files that are included as headers by source files in this rule or by users of this library. Unlike hdrs, these will not be compiled separately from the sources. | +| `textual_hdrs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of C, C++, Objective-C, and Objective-C++ files that are included as headers by source files in this rule or by users of this library. Unlike hdrs, these will not be compiled separately from the sources. | | `weak_sdk_frameworks` | List of strings; default is `[]` 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. | ## available\_xcodes @@ -123,9 +123,9 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `default` | [Label](/versions/7.7.1/concepts/labels); [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); required The default xcode version for this platform. | -| `versions` | List of [labels](/versions/7.7.1/concepts/labels); [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `[]` The xcode versions that are available on this platform. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `default` | [Label](/versions/7.7.3/concepts/labels); [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); required The default xcode version for this platform. | +| `versions` | List of [labels](/versions/7.7.3/concepts/labels); [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `[]` The xcode versions that are available on this platform. | ## xcode\_config @@ -143,11 +143,11 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `default` | [Label](/versions/7.7.1/concepts/labels); [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `None` The default official version of xcode to use. The version specified by the provided `xcode_version` target is to be used if no `xcode_version` build flag is specified. This is required if any `versions` are set. This may not be set if `remote_versions` or `local_versions` is set. | -| `local_versions` | [Label](/versions/7.7.1/concepts/labels); [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `None` The `xcode_version` targets that are available locally. These are used along with `local_versions` to select a mutually available version. This may not be set if `versions` is set. | -| `remote_versions` | [Label](/versions/7.7.1/concepts/labels); [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `None` The `xcode_version` targets that are available remotely. These are used along with `remote_versions` to select a mutually available version. This may not be set if `versions` is set. | -| `versions` | List of [labels](/versions/7.7.1/concepts/labels); [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `[]` Accepted `xcode_version` targets that may be used. If the value of the `xcode_version` build flag matches one of the aliases or version number of any of the given `xcode_version` targets, the matching target will be used. This may not be set if `remote_versions` or `local_versions` is set. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `default` | [Label](/versions/7.7.3/concepts/labels); [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `None` The default official version of xcode to use. The version specified by the provided `xcode_version` target is to be used if no `xcode_version` build flag is specified. This is required if any `versions` are set. This may not be set if `remote_versions` or `local_versions` is set. | +| `local_versions` | [Label](/versions/7.7.3/concepts/labels); [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `None` The `xcode_version` targets that are available locally. These are used along with `local_versions` to select a mutually available version. This may not be set if `versions` is set. | +| `remote_versions` | [Label](/versions/7.7.3/concepts/labels); [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `None` The `xcode_version` targets that are available remotely. These are used along with `remote_versions` to select a mutually available version. This may not be set if `versions` is set. | +| `versions` | List of [labels](/versions/7.7.3/concepts/labels); [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `[]` Accepted `xcode_version` targets that may be used. If the value of the `xcode_version` build flag matches one of the aliases or version number of any of the given `xcode_version` targets, the matching target will be used. This may not be set if `remote_versions` or `local_versions` is set. | ## xcode\_version @@ -164,10 +164,10 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `default_ios_sdk_version` | String; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `""` 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. | -| `default_macos_sdk_version` | String; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `""` The macosx 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. | -| `default_tvos_sdk_version` | String; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `""` 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. | -| `default_visionos_sdk_version` | String; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `""` The visionos sdk version that is used by default when this version of xcode is being used. The `visionos_sdk_version` build flag will override the value specified here. | -| `default_watchos_sdk_version` | String; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `""` 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. | -| `version` | String; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); required The official version number of a version of Xcode. | \ No newline at end of file +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `default_ios_sdk_version` | String; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `""` 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. | +| `default_macos_sdk_version` | String; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `""` The macosx 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. | +| `default_tvos_sdk_version` | String; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `""` 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. | +| `default_visionos_sdk_version` | String; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `""` The visionos sdk version that is used by default when this version of xcode is being used. The `visionos_sdk_version` build flag will override the value specified here. | +| `default_watchos_sdk_version` | String; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `""` 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. | +| `version` | String; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); required The official version number of a version of Xcode. | \ No newline at end of file
diff --git a/docs/versions/7.7.3/reference/be/overview.mdx b/docs/versions/7.7.3/reference/be/overview.mdx new file mode 100644 index 0000000..bd44f26 --- /dev/null +++ b/docs/versions/7.7.3/reference/be/overview.mdx
@@ -0,0 +1,55 @@ +--- +title: 'Bazel BUILD Encyclopedia of Functions' +--- + +## Concepts and terminology + +* [Common definitions](/versions/7.7.3/reference/be/common-definitions) + + [Bourne shell tokenization](/versions/7.7.3/reference/be/common-definitions#sh-tokenization) + + [Label expansion](/versions/7.7.3/reference/be/common-definitions#label-expansion) + + [Typical attributes for most rules](/versions/7.7.3/reference/be/common-definitions#typical-attributes) + + [Common attributes for all rules](/versions/7.7.3/reference/be/common-definitions#common-attributes) + + [Common attributes for tests](/versions/7.7.3/reference/be/common-definitions#common-attributes-tests) + + [Common attributes for binaries](/versions/7.7.3/reference/be/common-definitions#common-attributes-binaries) + + [Configurable attributes](/versions/7.7.3/reference/be/common-definitions#configurable-attributes) + + [Implicit output targets](/versions/7.7.3/reference/be/common-definitions#implicit-outputs) +* ["Make" variables](/versions/7.7.3/reference/be/make-variables) + + [Use](/versions/7.7.3/reference/be/make-variables#use) + +## Functions + +* [package](/versions/7.7.3/reference/be/functions#package) +* [package\_group](/versions/7.7.3/reference/be/functions#package_group) +* [exports\_files](/versions/7.7.3/reference/be/functions#exports_files) +* [glob](/versions/7.7.3/reference/be/functions#glob) +* [select](/versions/7.7.3/reference/be/functions#select) +* [workspace](/versions/7.7.3/rules/lib/globals/workspace#workspace) + +## Rules + +Native rules ship with the Bazel binary and do not require a `load` statement. +Native rules are available globally in BUILD files. In .bzl files, you can find them in +the `native` module. +For non-native Starlark rules that ship separately from Bazel, see the list of +[recommended rules](/versions/7.7.3/rules/rules#recommended-rules). + +### Language-specific native rules + +| Language | Binary rules | Library rules | Test rules | Other rules | +| --- | --- | --- | --- | --- | +| Android | [android\_binary](/versions/7.7.3/reference/be/android#android_binary) | [aar\_import](/versions/7.7.3/reference/be/android#aar_import) [android\_library](/versions/7.7.3/reference/be/android#android_library) | [android\_instrumentation\_test](/versions/7.7.3/reference/be/android#android_instrumentation_test) [android\_local\_test](/versions/7.7.3/reference/be/android#android_local_test) | [android\_device](/versions/7.7.3/reference/be/android#android_device) [android\_ndk\_repository](/versions/7.7.3/reference/be/android#android_ndk_repository) [android\_sdk\_repository](/versions/7.7.3/reference/be/android#android_sdk_repository) | +| C / C++ | [cc\_binary](/versions/7.7.3/reference/be/c-cpp#cc_binary) | [cc\_import](/versions/7.7.3/reference/be/c-cpp#cc_import) [cc\_library](/versions/7.7.3/reference/be/c-cpp#cc_library) [cc\_proto\_library](/versions/7.7.3/reference/be/c-cpp#cc_proto_library) [cc\_shared\_library](/versions/7.7.3/reference/be/c-cpp#cc_shared_library) [cc\_static\_library](/versions/7.7.3/reference/be/c-cpp#cc_static_library) [fdo\_prefetch\_hints](/versions/7.7.3/reference/be/c-cpp#fdo_prefetch_hints) [fdo\_profile](/versions/7.7.3/reference/be/c-cpp#fdo_profile) [memprof\_profile](/versions/7.7.3/reference/be/c-cpp#memprof_profile) [propeller\_optimize](/versions/7.7.3/reference/be/c-cpp#propeller_optimize) | [cc\_test](/versions/7.7.3/reference/be/c-cpp#cc_test) | [cc\_toolchain](/versions/7.7.3/reference/be/c-cpp#cc_toolchain) [cc\_toolchain\_suite](/versions/7.7.3/reference/be/c-cpp#cc_toolchain_suite) | +| Java | [java\_binary](/versions/7.7.3/reference/be/java#java_binary) | [java\_import](/versions/7.7.3/reference/be/java#java_import) [java\_library](/versions/7.7.3/reference/be/java#java_library) [java\_lite\_proto\_library](/versions/7.7.3/reference/be/java#java_lite_proto_library) [java\_proto\_library](/versions/7.7.3/reference/be/java#java_proto_library) | [java\_test](/versions/7.7.3/reference/be/java#java_test) | [java\_package\_configuration](/versions/7.7.3/reference/be/java#java_package_configuration) [java\_plugin](/versions/7.7.3/reference/be/java#java_plugin) [java\_runtime](/versions/7.7.3/reference/be/java#java_runtime) [java\_toolchain](/versions/7.7.3/reference/be/java#java_toolchain) | +| Objective-C | | [j2objc\_library](/versions/7.7.3/reference/be/objective-c#j2objc_library) [objc\_import](/versions/7.7.3/reference/be/objective-c#objc_import) [objc\_library](/versions/7.7.3/reference/be/objective-c#objc_library) | | [available\_xcodes](/versions/7.7.3/reference/be/objective-c#available_xcodes) [xcode\_config](/versions/7.7.3/reference/be/objective-c#xcode_config) [xcode\_version](/versions/7.7.3/reference/be/objective-c#xcode_version) | +| Protocol Buffer | | [proto\_lang\_toolchain](/versions/7.7.3/reference/be/protocol-buffer#proto_lang_toolchain) [proto\_library](/versions/7.7.3/reference/be/protocol-buffer#proto_library) | | | +| Python | [py\_binary](/versions/7.7.3/reference/be/python#py_binary) | [py\_library](/versions/7.7.3/reference/be/python#py_library) | [py\_test](/versions/7.7.3/reference/be/python#py_test) | [py\_runtime](/versions/7.7.3/reference/be/python#py_runtime) | +| Shell | [sh\_binary](/versions/7.7.3/reference/be/shell#sh_binary) | [sh\_library](/versions/7.7.3/reference/be/shell#sh_library) | [sh\_test](/versions/7.7.3/reference/be/shell#sh_test) | | + +### Language-agnostic native rules + +| Family | Rules | +| --- | --- | +| Extra Actions | * [action\_listener](/versions/7.7.3/reference/be/extra-actions#action_listener)* [extra\_action](/versions/7.7.3/reference/be/extra-actions#extra_action) | +| General | * [alias](/versions/7.7.3/reference/be/general#alias)* [config\_setting](/versions/7.7.3/reference/be/general#config_setting)* [filegroup](/versions/7.7.3/reference/be/general#filegroup)* [genquery](/versions/7.7.3/reference/be/general#genquery)* [genrule](/versions/7.7.3/reference/be/general#genrule)* [starlark\_doc\_extract](/versions/7.7.3/reference/be/general#starlark_doc_extract)* [test\_suite](/versions/7.7.3/reference/be/general#test_suite) | +| Platforms and Toolchains | * [constraint\_setting](/versions/7.7.3/reference/be/platforms-and-toolchains#constraint_setting)* [constraint\_value](/versions/7.7.3/reference/be/platforms-and-toolchains#constraint_value)* [platform](/versions/7.7.3/reference/be/platforms-and-toolchains#platform)* [toolchain](/versions/7.7.3/reference/be/platforms-and-toolchains#toolchain)* [toolchain\_type](/versions/7.7.3/reference/be/platforms-and-toolchains#toolchain_type) | +| Workspace | * [bind](/versions/7.7.3/reference/be/workspace#bind)* [local\_repository](/versions/7.7.3/reference/be/workspace#local_repository)* [new\_local\_repository](/versions/7.7.3/reference/be/workspace#new_local_repository) | \ No newline at end of file
diff --git a/docs/versions/7.7.1/reference/be/platforms-and-toolchains.mdx b/docs/versions/7.7.3/reference/be/platforms-and-toolchains.mdx similarity index 87% rename from docs/versions/7.7.1/reference/be/platforms-and-toolchains.mdx rename to docs/versions/7.7.3/reference/be/platforms-and-toolchains.mdx index 0789a0c..355a7ac 100644 --- a/docs/versions/7.7.1/reference/be/platforms-and-toolchains.mdx +++ b/docs/versions/7.7.3/reference/be/platforms-and-toolchains.mdx
@@ -4,7 +4,7 @@ This set of rules exists to allow you to model specific hardware platforms you are building for and specify the specific tools you may need to compile code for those platforms. -The user should be familiar with the concepts explained [here](/versions/7.7.1/extending/platforms). +The user should be familiar with the concepts explained [here](/versions/7.7.3/extending/platforms). ## Rules @@ -26,7 +26,7 @@ For instance, you might define a `constraint_setting` named "glibc\_version" to represent the capability for platforms to have different versions of the glibc library installed. For more details, see the -[Platforms](https://bazel.build/versions/7.7.1/docs/platforms) page. +[Platforms](https://bazel.build/versions/7.7.3/docs/platforms) page. Each `constraint_setting` has an extensible set of associated `constraint_value`s. Usually these are defined in the same package, but sometimes a @@ -38,8 +38,8 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `default_constraint_value` | [Name](/versions/7.7.1/concepts/labels#target-names); [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `None` The label of the default value for this setting, to be used if no value is given. If this attribute is present, the `constraint_value` it points to must be defined in the same package as this `constraint_setting`. If a constraint setting has a default value, then whenever a platform does not include any constraint value for that setting, it is the same as if the platform had specified the default value. Otherwise, if there is no default value, the constraint setting is considered to be unspecified by that platform. In that case, the platform would not match against any constraint list (such as for a `config_setting`) that requires a particular value for that setting. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `default_constraint_value` | [Name](/versions/7.7.3/concepts/labels#target-names); [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `None` The label of the default value for this setting, to be used if no value is given. If this attribute is present, the `constraint_value` it points to must be defined in the same package as this `constraint_setting`. If a constraint setting has a default value, then whenever a platform does not include any constraint value for that setting, it is the same as if the platform had specified the default value. Otherwise, if there is no default value, the constraint setting is considered to be unspecified by that platform. In that case, the platform would not match against any constraint list (such as for a `config_setting`) that requires a particular value for that setting. | ## constraint\_value @@ -51,7 +51,7 @@ This rule introduces a new value for a given constraint type. For more details, see the -[Platforms](https://bazel.build/versions/7.7.1/docs/platforms) page. +[Platforms](https://bazel.build/versions/7.7.3/docs/platforms) page. #### Example @@ -72,8 +72,8 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `constraint_setting` | [Label](/versions/7.7.1/concepts/labels); [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); required The `constraint_setting` for which this `constraint_value` is a possible choice. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `constraint_setting` | [Label](/versions/7.7.3/concepts/labels); [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); required The `constraint_setting` for which this `constraint_value` is a possible choice. | ## platform @@ -86,7 +86,7 @@ This rule defines a new platform -- a named collection of constraint choices (such as cpu architecture or compiler version) describing an environment in which part of the build may run. -For more details, see the [Platforms](/versions/7.7.1//extending/platforms) page. +For more details, see the [Platforms](/versions/7.7.3//extending/platforms) page. #### Example @@ -225,11 +225,11 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `constraint_values` | List of [labels](/versions/7.7.1/concepts/labels); [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `[]` The combination of constraint choices that this platform comprises. In order for a platform to apply to a given environment, the environment must have at least the values in this list. Each `constraint_value` in this list must be for a different `constraint_setting`. For example, you cannot define a platform that requires the cpu architecture to be both `@platforms//cpu:x86_64` and `@platforms//cpu:arm`. | -| `exec_properties` | Dictionary: String -> String; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `{}` A map of strings that affect the way actions are executed remotely. Bazel makes no attempt to interpret this, it is treated as opaque data that's forwarded via the Platform field of the [remote execution protocol](https://github.com/bazelbuild/remote-apis). This includes any data from the parent platform's `exec_properties` attributes. If the child and parent platform define the same keys, the child's values are kept. Any keys associated with a value that is an empty string are removed from the dictionary. This attribute is a full replacement for the deprecated `remote_execution_properties`. | -| `parents` | List of [labels](/versions/7.7.1/concepts/labels); [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `[]` The label of a `platform` target that this platform should inherit from. Although the attribute takes a list, there should be no more than one platform present. Any constraint\_settings not set directly on this platform will be found in the parent platform. See the section on [Platform Inheritance](#platform_inheritance) for details. | -| `remote_execution_properties` | String; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `""` DEPRECATED. Please use exec\_properties attribute instead. A string used to configure a remote execution platform. Actual builds make no attempt to interpret this, it is treated as opaque data that can be used by a specific SpawnRunner. This can include data from the parent platform's "remote\_execution\_properties" attribute, by using the macro "\{PARENT\_REMOTE\_EXECUTION\_PROPERTIES\}". See the section on [Platform Inheritance](#platform_inheritance) for details. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `constraint_values` | List of [labels](/versions/7.7.3/concepts/labels); [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `[]` The combination of constraint choices that this platform comprises. In order for a platform to apply to a given environment, the environment must have at least the values in this list. Each `constraint_value` in this list must be for a different `constraint_setting`. For example, you cannot define a platform that requires the cpu architecture to be both `@platforms//cpu:x86_64` and `@platforms//cpu:arm`. | +| `exec_properties` | Dictionary: String -> String; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `{}` A map of strings that affect the way actions are executed remotely. Bazel makes no attempt to interpret this, it is treated as opaque data that's forwarded via the Platform field of the [remote execution protocol](https://github.com/bazelbuild/remote-apis). This includes any data from the parent platform's `exec_properties` attributes. If the child and parent platform define the same keys, the child's values are kept. Any keys associated with a value that is an empty string are removed from the dictionary. This attribute is a full replacement for the deprecated `remote_execution_properties`. | +| `parents` | List of [labels](/versions/7.7.3/concepts/labels); [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `[]` The label of a `platform` target that this platform should inherit from. Although the attribute takes a list, there should be no more than one platform present. Any constraint\_settings not set directly on this platform will be found in the parent platform. See the section on [Platform Inheritance](#platform_inheritance) for details. | +| `remote_execution_properties` | String; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `""` DEPRECATED. Please use exec\_properties attribute instead. A string used to configure a remote execution platform. Actual builds make no attempt to interpret this, it is treated as opaque data that can be used by a specific SpawnRunner. This can include data from the parent platform's "remote\_execution\_properties" attribute, by using the macro "\{PARENT\_REMOTE\_EXECUTION\_PROPERTIES\}". See the section on [Platform Inheritance](#platform_inheritance) for details. | ## toolchain @@ -241,19 +241,19 @@ This rule declares a specific toolchain's type and constraints so that it can be selected during toolchain resolution. See the -[Toolchains](https://bazel.build/versions/7.7.1/docs/toolchains) page for more +[Toolchains](https://bazel.build/versions/7.7.3/docs/toolchains) page for more details. ### Arguments | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `exec_compatible_with` | List of [labels](/versions/7.7.1/concepts/labels); [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `[]` A list of `constraint_value`s that must be satisfied by an execution platform in order for this toolchain to be selected for a target building on that platform. | -| `target_compatible_with` | List of [labels](/versions/7.7.1/concepts/labels); [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `[]` A list of `constraint_value`s that must be satisfied by the target platform in order for this toolchain to be selected for a target building for that platform. | -| `target_settings` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` A list of `config_setting`s that must be satisfied by the target configuration in order for this toolchain to be selected during toolchain resolution. | -| `toolchain` | [Name](/versions/7.7.1/concepts/labels#target-names); required The target representing the actual tool or tool suite that is made available when this toolchain is selected. | -| `toolchain_type` | [Label](/versions/7.7.1/concepts/labels); [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); required The label of a `toolchain_type` target that represents the role that this toolchain serves. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `exec_compatible_with` | List of [labels](/versions/7.7.3/concepts/labels); [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `[]` A list of `constraint_value`s that must be satisfied by an execution platform in order for this toolchain to be selected for a target building on that platform. | +| `target_compatible_with` | List of [labels](/versions/7.7.3/concepts/labels); [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `[]` A list of `constraint_value`s that must be satisfied by the target platform in order for this toolchain to be selected for a target building for that platform. | +| `target_settings` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` A list of `config_setting`s that must be satisfied by the target configuration in order for this toolchain to be selected during toolchain resolution. | +| `toolchain` | [Name](/versions/7.7.3/concepts/labels#target-names); required The target representing the actual tool or tool suite that is made available when this toolchain is selected. | +| `toolchain_type` | [Label](/versions/7.7.3/concepts/labels); [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); required The label of a `toolchain_type` target that represents the role that this toolchain serves. | ## toolchain\_type @@ -266,7 +266,7 @@ This rule defines a new type of toolchain -- a simple target that represents a class of tools that serve the same role for different platforms. -See the [Toolchains](/versions/7.7.1/docs/toolchains) page for more details. +See the [Toolchains](/versions/7.7.3/docs/toolchains) page for more details. #### Example @@ -296,4 +296,4 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | \ No newline at end of file +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | \ No newline at end of file
diff --git a/docs/versions/7.7.1/reference/be/protocol-buffer.mdx b/docs/versions/7.7.3/reference/be/protocol-buffer.mdx similarity index 91% rename from docs/versions/7.7.1/reference/be/protocol-buffer.mdx rename to docs/versions/7.7.3/reference/be/protocol-buffer.mdx index 38b2f18..ab17507 100644 --- a/docs/versions/7.7.1/reference/be/protocol-buffer.mdx +++ b/docs/versions/7.7.3/reference/be/protocol-buffer.mdx
@@ -48,16 +48,16 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `blacklisted_protos` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` No code will be generated for files in the `srcs` attribute of `blacklisted_protos`. This is used for .proto files that are already linked into proto runtimes, such as `any.proto`. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `blacklisted_protos` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` No code will be generated for files in the `srcs` attribute of `blacklisted_protos`. This is used for .proto files that are already linked into proto runtimes, such as `any.proto`. | | `command_line` | String; required This value will be passed to proto-compiler to generate the code. Only include the parts specific to this code-generator/plugin (e.g., do not include -I parameters) * `$(OUT)` is LANG\_proto\_library-specific. The rules are expected to define how they interpret this variable. For Java, for example, $(OUT) will be replaced with the src-jar filename to create. | | `mnemonic` | String; default is `"GenProto"` This value will be set as the mnemonic on protoc action. | | `output_files` | String; default is `"legacy"` Controls how `$(OUT)` in `command_line` is formatted, either by a path to a single file or output directory in case of multiple files. Possible values are: "single", "multiple". | -| `plugin` | [Label](/versions/7.7.1/concepts/labels); default is `None` If provided, will be made available to the action that calls the proto-compiler, and will be passed to the proto-compiler: `--plugin=protoc-gen-PLUGIN=<executable>.` | +| `plugin` | [Label](/versions/7.7.3/concepts/labels); default is `None` If provided, will be made available to the action that calls the proto-compiler, and will be passed to the proto-compiler: `--plugin=protoc-gen-PLUGIN=<executable>.` | | `plugin_format_flag` | String; default is `""` If provided, this value will be passed to proto-compiler to use the plugin. The value must contain a single %s which is replaced with plugin executable. `--plugin=protoc-gen-PLUGIN=<executable>.` | | `progress_message` | String; default is `"Generating proto_library %{label}"` This value will be set as the progress message on protoc action. | -| `proto_compiler` | [Label](/versions/7.7.1/concepts/labels); default is `None` The proto compiler executable. If provided, this target will be used as a proto-compiler to generate the code. | -| `runtime` | [Label](/versions/7.7.1/concepts/labels); default is `None` A language-specific library that the generated code is compiled against. The exact behavior is LANG\_proto\_library-specific. Java, for example, should compile against the runtime. | +| `proto_compiler` | [Label](/versions/7.7.3/concepts/labels); default is `None` The proto compiler executable. If provided, this target will be used as a proto-compiler to generate the code. | +| `runtime` | [Label](/versions/7.7.3/concepts/labels); default is `None` A language-specific library that the generated code is compiled against. The exact behavior is LANG\_proto\_library-specific. Java, for example, should compile against the runtime. | ## proto\_library @@ -95,10 +95,10 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of other `proto_library` rules that the target depends upon. A `proto_library` may only depend on other `proto_library` targets. It may not depend on language-specific libraries. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of `.proto` and `.protodevel` files that are processed to create the target. This is usually a non empty list. One usecase where `srcs` can be empty is an *alias-library*. This is a proto\_library rule having one or more other proto\_library in `deps`. This pattern can be used to e.g. export a public api under a persistent name. | -| `allow_exports` | [Label](/versions/7.7.1/concepts/labels); default is `None` An optional allowlist that prevents proto library to be reexported or used in lang\_proto\_library that is not in one of the listed packages. | -| `exports` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` List of proto\_library targets that can be referenced via "import public" in the proto source. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of other `proto_library` rules that the target depends upon. A `proto_library` may only depend on other `proto_library` targets. It may not depend on language-specific libraries. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of `.proto` and `.protodevel` files that are processed to create the target. This is usually a non empty list. One usecase where `srcs` can be empty is an *alias-library*. This is a proto\_library rule having one or more other proto\_library in `deps`. This pattern can be used to e.g. export a public api under a persistent name. | +| `allow_exports` | [Label](/versions/7.7.3/concepts/labels); default is `None` An optional allowlist that prevents proto library to be reexported or used in lang\_proto\_library that is not in one of the listed packages. | +| `exports` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` List of proto\_library targets that can be referenced via "import public" in the proto source. | | `import_prefix` | String; default is `""` The prefix to add to the paths of the .proto files in this rule. When set, the .proto source files in the `srcs` attribute of this rule are accessible at is the value of this attribute prepended to their repository-relative path. The prefix in the `strip_import_prefix` attribute is removed before this prefix is added. | | `strip_import_prefix` | String; default is `""` The prefix to strip from the paths of the .proto files in this rule. When set, .proto source files in the `srcs` attribute of this rule are accessible at their path with this prefix cut off. If it's a relative path (not starting with a slash), it's taken as a package-relative one. If it's an absolute one, it's understood as a repository-relative path. The prefix in the `import_prefix` attribute is added after this prefix is stripped. | \ No newline at end of file
diff --git a/docs/versions/7.7.1/reference/be/python.mdx b/docs/versions/7.7.3/reference/be/python.mdx similarity index 89% rename from docs/versions/7.7.1/reference/be/python.mdx rename to docs/versions/7.7.3/reference/be/python.mdx index 4181084..f5087fc 100644 --- a/docs/versions/7.7.1/reference/be/python.mdx +++ b/docs/versions/7.7.3/reference/be/python.mdx
@@ -62,15 +62,15 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. If `main` is unspecified, this should be the same as the name of the source file that is the main entry point of the application, minus the extension. For example, if your entry point is called `main.py`, then your name should be `main`. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of other libraries to be linked in to the binary target. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.1/reference/be/common-definitions#typical-attributes). These are generally [`py_library`](/versions/7.7.1/reference/be/python#py_library) rules. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); required The list of source (`.py`) files that are processed to create the target. This includes all your checked-in code and any generated source files. Library targets belong in `deps` instead, while other binary files needed at runtime belong in `data`. | -| `imports` | List of strings; default is `[]` List of import directories to be added to the `PYTHONPATH`. Subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution. These import directories will be added for this rule and all rules that depend on it (note: not the rules this rule depends on. Each directory will be added to `PYTHONPATH` by [`py_binary`](/versions/7.7.1/reference/be/python#py_binary) rules that depend on this rule. Absolute paths (paths that start with `/`) and paths that references a path above the execution root are not allowed and will result in an error. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. If `main` is unspecified, this should be the same as the name of the source file that is the main entry point of the application, minus the extension. For example, if your entry point is called `main.py`, then your name should be `main`. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of other libraries to be linked in to the binary target. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.3/reference/be/common-definitions#typical-attributes). These are generally [`py_library`](/versions/7.7.3/reference/be/python#py_library) rules. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); required The list of source (`.py`) files that are processed to create the target. This includes all your checked-in code and any generated source files. Library targets belong in `deps` instead, while other binary files needed at runtime belong in `data`. | +| `imports` | List of strings; default is `[]` List of import directories to be added to the `PYTHONPATH`. Subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution. These import directories will be added for this rule and all rules that depend on it (note: not the rules this rule depends on. Each directory will be added to `PYTHONPATH` by [`py_binary`](/versions/7.7.3/reference/be/python#py_binary) rules that depend on this rule. Absolute paths (paths that start with `/`) and paths that references a path above the execution root are not allowed and will result in an error. | | `legacy_create_init` | Integer; default is `-1` Whether to implicitly create empty \_\_init\_\_.py files in the runfiles tree. These are created in every directory containing Python source code or shared libraries, and every parent directory of those directories, excluding the repo root directory. The default, auto, means true unless `--incompatible_default_to_explicit_init_py` is used. If false, the user is responsible for creating (possibly empty) \_\_init\_\_.py files and adding them to the `srcs` of Python targets as required. | -| `main` | [Label](/versions/7.7.1/concepts/labels); default is `None` The name of the source file that is the main entry point of the application. This file must also be listed in `srcs`. If left unspecified, `name` is used instead (see above). If `name` does not match any filename in `srcs`, `main` must be specified. | -| `python_version` | String; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `"_INTERNAL_SENTINEL"` Whether to build this target (and its transitive `deps`) for Python 2 or Python 3. Valid values are `"PY2"` and `"PY3"` (the default). The Python version is always reset (possibly by default) to whatever version is specified by this attribute, regardless of the version specified on the command line or by other higher targets that depend on this one. If you want to `select()` on the current Python version, you can inspect the value of `@rules_python//python:python_version`. See [here](https://github.com/bazelbuild/rules_python/blob/120590e2f2b66e5590bf4dc8ebef9c5338984775/python/BUILD#L43) for more information. **Bug warning:** This attribute sets the version for which Bazel builds your target, but due to [#4815](https://github.com/bazelbuild/bazel/issues/4815), the resulting stub script may still invoke the wrong interpreter version at runtime. See [this workaround](https://github.com/bazelbuild/bazel/issues/4815#issuecomment-460777113), which involves defining a `py_runtime` target that points to either Python version as needed, and activating this `py_runtime` by setting `--python_top`. | -| `srcs_version` | String; default is `"PY2AND3"` This attribute declares the target's `srcs` to be compatible with either Python 2, Python 3, or both. To actually set the Python runtime version, use the [`python_version`](/versions/7.7.1/reference/be/python#py_binary.python_version) attribute of an executable Python rule (`py_binary` or `py_test`). Allowed values are: `"PY2AND3"`, `"PY2"`, and `"PY3"`. The values `"PY2ONLY"` and `"PY3ONLY"` are also allowed for historic reasons, but they are essentially the same as `"PY2"` and `"PY3"` and should be avoided. Note that only the executable rules (`py_binary` and `py_library`) actually verify the current Python version against the value of this attribute. (This is a feature; since `py_library` does not change the current Python version, if it did the validation, it'd be impossible to build both `PY2ONLY` and `PY3ONLY` libraries in the same invocation.) Furthermore, if there is a version mismatch, the error is only reported in the execution phase. In particular, the error will not appear in a `bazel build --nobuild` invocation.) To get diagnostic information about which dependencies introduce version requirements, you can run the `find_requirements` aspect on your target: ``` bazel build <your target> \ --aspects=@rules_python//python:defs.bzl%find_requirements \ --output_groups=pyversioninfo ``` This will build a file with the suffix `-pyversioninfo.txt` giving information about why your target requires one Python version or another. Note that it works even if the given target failed to build due to a version conflict. | -| `stamp` | Integer; default is `-1` Whether to encode build information into the binary. Possible values: * `stamp = 1`: Always stamp the build information into the binary, even in [`--nostamp`](/versions/7.7.1/docs/user-manual#flag--stamp) builds. **This setting should be avoided**, since it potentially kills remote caching for the binary and any downstream actions that depend on it. * `stamp = 0`: Always replace build information by constant values. This gives good build result caching. * `stamp = -1`: Embedding of build information is controlled by the [`--[no]stamp`](/versions/7.7.1/docs/user-manual#flag--stamp) flag. Stamped binaries are *not* rebuilt unless their dependencies change. | +| `main` | [Label](/versions/7.7.3/concepts/labels); default is `None` The name of the source file that is the main entry point of the application. This file must also be listed in `srcs`. If left unspecified, `name` is used instead (see above). If `name` does not match any filename in `srcs`, `main` must be specified. | +| `python_version` | String; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `"_INTERNAL_SENTINEL"` Whether to build this target (and its transitive `deps`) for Python 2 or Python 3. Valid values are `"PY2"` and `"PY3"` (the default). The Python version is always reset (possibly by default) to whatever version is specified by this attribute, regardless of the version specified on the command line or by other higher targets that depend on this one. If you want to `select()` on the current Python version, you can inspect the value of `@rules_python//python:python_version`. See [here](https://github.com/bazelbuild/rules_python/blob/120590e2f2b66e5590bf4dc8ebef9c5338984775/python/BUILD#L43) for more information. **Bug warning:** This attribute sets the version for which Bazel builds your target, but due to [#4815](https://github.com/bazelbuild/bazel/issues/4815), the resulting stub script may still invoke the wrong interpreter version at runtime. See [this workaround](https://github.com/bazelbuild/bazel/issues/4815#issuecomment-460777113), which involves defining a `py_runtime` target that points to either Python version as needed, and activating this `py_runtime` by setting `--python_top`. | +| `srcs_version` | String; default is `"PY2AND3"` This attribute declares the target's `srcs` to be compatible with either Python 2, Python 3, or both. To actually set the Python runtime version, use the [`python_version`](/versions/7.7.3/reference/be/python#py_binary.python_version) attribute of an executable Python rule (`py_binary` or `py_test`). Allowed values are: `"PY2AND3"`, `"PY2"`, and `"PY3"`. The values `"PY2ONLY"` and `"PY3ONLY"` are also allowed for historic reasons, but they are essentially the same as `"PY2"` and `"PY3"` and should be avoided. Note that only the executable rules (`py_binary` and `py_library`) actually verify the current Python version against the value of this attribute. (This is a feature; since `py_library` does not change the current Python version, if it did the validation, it'd be impossible to build both `PY2ONLY` and `PY3ONLY` libraries in the same invocation.) Furthermore, if there is a version mismatch, the error is only reported in the execution phase. In particular, the error will not appear in a `bazel build --nobuild` invocation.) To get diagnostic information about which dependencies introduce version requirements, you can run the `find_requirements` aspect on your target: ``` bazel build <your target> \ --aspects=@rules_python//python:defs.bzl%find_requirements \ --output_groups=pyversioninfo ``` This will build a file with the suffix `-pyversioninfo.txt` giving information about why your target requires one Python version or another. Note that it works even if the given target failed to build due to a version conflict. | +| `stamp` | Integer; default is `-1` Whether to encode build information into the binary. Possible values: * `stamp = 1`: Always stamp the build information into the binary, even in [`--nostamp`](/versions/7.7.3/docs/user-manual#flag--stamp) builds. **This setting should be avoided**, since it potentially kills remote caching for the binary and any downstream actions that depend on it. * `stamp = 0`: Always replace build information by constant values. This gives good build result caching. * `stamp = -1`: Embedding of build information is controlled by the [`--[no]stamp`](/versions/7.7.3/docs/user-manual#flag--stamp) flag. Stamped binaries are *not* rebuilt unless their dependencies change. | ## py\_library @@ -84,11 +84,11 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of other libraries to be linked in to the binary target. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.1/reference/be/common-definitions#typical-attributes). These are generally [`py_library`](/versions/7.7.1/reference/be/python#py_library) rules. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of source (`.py`) files that are processed to create the target. This includes all your checked-in code and any generated source files. | -| `imports` | List of strings; default is `[]` List of import directories to be added to the `PYTHONPATH`. Subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution. These import directories will be added for this rule and all rules that depend on it (note: not the rules this rule depends on. Each directory will be added to `PYTHONPATH` by [`py_binary`](/versions/7.7.1/reference/be/python#py_binary) rules that depend on this rule. Absolute paths (paths that start with `/`) and paths that references a path above the execution root are not allowed and will result in an error. | -| `srcs_version` | String; default is `"PY2AND3"` This attribute declares the target's `srcs` to be compatible with either Python 2, Python 3, or both. To actually set the Python runtime version, use the [`python_version`](/versions/7.7.1/reference/be/python#py_binary.python_version) attribute of an executable Python rule (`py_binary` or `py_test`). Allowed values are: `"PY2AND3"`, `"PY2"`, and `"PY3"`. The values `"PY2ONLY"` and `"PY3ONLY"` are also allowed for historic reasons, but they are essentially the same as `"PY2"` and `"PY3"` and should be avoided. Note that only the executable rules (`py_binary` and `py_library`) actually verify the current Python version against the value of this attribute. (This is a feature; since `py_library` does not change the current Python version, if it did the validation, it'd be impossible to build both `PY2ONLY` and `PY3ONLY` libraries in the same invocation.) Furthermore, if there is a version mismatch, the error is only reported in the execution phase. In particular, the error will not appear in a `bazel build --nobuild` invocation.) To get diagnostic information about which dependencies introduce version requirements, you can run the `find_requirements` aspect on your target: ``` bazel build <your target> \ --aspects=@rules_python//python:defs.bzl%find_requirements \ --output_groups=pyversioninfo ``` This will build a file with the suffix `-pyversioninfo.txt` giving information about why your target requires one Python version or another. Note that it works even if the given target failed to build due to a version conflict. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of other libraries to be linked in to the binary target. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.3/reference/be/common-definitions#typical-attributes). These are generally [`py_library`](/versions/7.7.3/reference/be/python#py_library) rules. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of source (`.py`) files that are processed to create the target. This includes all your checked-in code and any generated source files. | +| `imports` | List of strings; default is `[]` List of import directories to be added to the `PYTHONPATH`. Subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution. These import directories will be added for this rule and all rules that depend on it (note: not the rules this rule depends on. Each directory will be added to `PYTHONPATH` by [`py_binary`](/versions/7.7.3/reference/be/python#py_binary) rules that depend on this rule. Absolute paths (paths that start with `/`) and paths that references a path above the execution root are not allowed and will result in an error. | +| `srcs_version` | String; default is `"PY2AND3"` This attribute declares the target's `srcs` to be compatible with either Python 2, Python 3, or both. To actually set the Python runtime version, use the [`python_version`](/versions/7.7.3/reference/be/python#py_binary.python_version) attribute of an executable Python rule (`py_binary` or `py_test`). Allowed values are: `"PY2AND3"`, `"PY2"`, and `"PY3"`. The values `"PY2ONLY"` and `"PY3ONLY"` are also allowed for historic reasons, but they are essentially the same as `"PY2"` and `"PY3"` and should be avoided. Note that only the executable rules (`py_binary` and `py_library`) actually verify the current Python version against the value of this attribute. (This is a feature; since `py_library` does not change the current Python version, if it did the validation, it'd be impossible to build both `PY2ONLY` and `PY3ONLY` libraries in the same invocation.) Furthermore, if there is a version mismatch, the error is only reported in the execution phase. In particular, the error will not appear in a `bazel build --nobuild` invocation.) To get diagnostic information about which dependencies introduce version requirements, you can run the `find_requirements` aspect on your target: ``` bazel build <your target> \ --aspects=@rules_python//python:defs.bzl%find_requirements \ --output_groups=pyversioninfo ``` This will build a file with the suffix `-pyversioninfo.txt` giving information about why your target requires one Python version or another. Note that it works even if the given target failed to build due to a version conflict. | ## py\_test @@ -130,15 +130,15 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of other libraries to be linked in to the binary target. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.1/reference/be/common-definitions#typical-attributes). These are generally [`py_library`](/versions/7.7.1/reference/be/python#py_library) rules. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); required The list of source (`.py`) files that are processed to create the target. This includes all your checked-in code and any generated source files. Library targets belong in `deps` instead, while other binary files needed at runtime belong in `data`. | -| `imports` | List of strings; default is `[]` List of import directories to be added to the `PYTHONPATH`. Subject to ["Make variable"](/versions/7.7.1/reference/be/make-variables) substitution. These import directories will be added for this rule and all rules that depend on it (note: not the rules this rule depends on. Each directory will be added to `PYTHONPATH` by [`py_binary`](/versions/7.7.1/reference/be/python#py_binary) rules that depend on this rule. Absolute paths (paths that start with `/`) and paths that references a path above the execution root are not allowed and will result in an error. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of other libraries to be linked in to the binary target. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.3/reference/be/common-definitions#typical-attributes). These are generally [`py_library`](/versions/7.7.3/reference/be/python#py_library) rules. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); required The list of source (`.py`) files that are processed to create the target. This includes all your checked-in code and any generated source files. Library targets belong in `deps` instead, while other binary files needed at runtime belong in `data`. | +| `imports` | List of strings; default is `[]` List of import directories to be added to the `PYTHONPATH`. Subject to ["Make variable"](/versions/7.7.3/reference/be/make-variables) substitution. These import directories will be added for this rule and all rules that depend on it (note: not the rules this rule depends on. Each directory will be added to `PYTHONPATH` by [`py_binary`](/versions/7.7.3/reference/be/python#py_binary) rules that depend on this rule. Absolute paths (paths that start with `/`) and paths that references a path above the execution root are not allowed and will result in an error. | | `legacy_create_init` | Integer; default is `-1` Whether to implicitly create empty \_\_init\_\_.py files in the runfiles tree. These are created in every directory containing Python source code or shared libraries, and every parent directory of those directories, excluding the repo root directory. The default, auto, means true unless `--incompatible_default_to_explicit_init_py` is used. If false, the user is responsible for creating (possibly empty) \_\_init\_\_.py files and adding them to the `srcs` of Python targets as required. | -| `main` | [Label](/versions/7.7.1/concepts/labels); default is `None` The name of the source file that is the main entry point of the application. This file must also be listed in `srcs`. If left unspecified, `name` is used instead (see above). If `name` does not match any filename in `srcs`, `main` must be specified. | -| `python_version` | String; [nonconfigurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes); default is `"_INTERNAL_SENTINEL"` Whether to build this target (and its transitive `deps`) for Python 2 or Python 3. Valid values are `"PY2"` and `"PY3"` (the default). The Python version is always reset (possibly by default) to whatever version is specified by this attribute, regardless of the version specified on the command line or by other higher targets that depend on this one. If you want to `select()` on the current Python version, you can inspect the value of `@rules_python//python:python_version`. See [here](https://github.com/bazelbuild/rules_python/blob/120590e2f2b66e5590bf4dc8ebef9c5338984775/python/BUILD#L43) for more information. **Bug warning:** This attribute sets the version for which Bazel builds your target, but due to [#4815](https://github.com/bazelbuild/bazel/issues/4815), the resulting stub script may still invoke the wrong interpreter version at runtime. See [this workaround](https://github.com/bazelbuild/bazel/issues/4815#issuecomment-460777113), which involves defining a `py_runtime` target that points to either Python version as needed, and activating this `py_runtime` by setting `--python_top`. | -| `srcs_version` | String; default is `"PY2AND3"` This attribute declares the target's `srcs` to be compatible with either Python 2, Python 3, or both. To actually set the Python runtime version, use the [`python_version`](/versions/7.7.1/reference/be/python#py_binary.python_version) attribute of an executable Python rule (`py_binary` or `py_test`). Allowed values are: `"PY2AND3"`, `"PY2"`, and `"PY3"`. The values `"PY2ONLY"` and `"PY3ONLY"` are also allowed for historic reasons, but they are essentially the same as `"PY2"` and `"PY3"` and should be avoided. Note that only the executable rules (`py_binary` and `py_library`) actually verify the current Python version against the value of this attribute. (This is a feature; since `py_library` does not change the current Python version, if it did the validation, it'd be impossible to build both `PY2ONLY` and `PY3ONLY` libraries in the same invocation.) Furthermore, if there is a version mismatch, the error is only reported in the execution phase. In particular, the error will not appear in a `bazel build --nobuild` invocation.) To get diagnostic information about which dependencies introduce version requirements, you can run the `find_requirements` aspect on your target: ``` bazel build <your target> \ --aspects=@rules_python//python:defs.bzl%find_requirements \ --output_groups=pyversioninfo ``` This will build a file with the suffix `-pyversioninfo.txt` giving information about why your target requires one Python version or another. Note that it works even if the given target failed to build due to a version conflict. | -| `stamp` | Integer; default is `0` See the section on [py\_binary()](/versions/7.7.1/reference/be/python#py_binary_args) arguments, except that the stamp argument is set to 0 by default for tests. | +| `main` | [Label](/versions/7.7.3/concepts/labels); default is `None` The name of the source file that is the main entry point of the application. This file must also be listed in `srcs`. If left unspecified, `name` is used instead (see above). If `name` does not match any filename in `srcs`, `main` must be specified. | +| `python_version` | String; [nonconfigurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes); default is `"_INTERNAL_SENTINEL"` Whether to build this target (and its transitive `deps`) for Python 2 or Python 3. Valid values are `"PY2"` and `"PY3"` (the default). The Python version is always reset (possibly by default) to whatever version is specified by this attribute, regardless of the version specified on the command line or by other higher targets that depend on this one. If you want to `select()` on the current Python version, you can inspect the value of `@rules_python//python:python_version`. See [here](https://github.com/bazelbuild/rules_python/blob/120590e2f2b66e5590bf4dc8ebef9c5338984775/python/BUILD#L43) for more information. **Bug warning:** This attribute sets the version for which Bazel builds your target, but due to [#4815](https://github.com/bazelbuild/bazel/issues/4815), the resulting stub script may still invoke the wrong interpreter version at runtime. See [this workaround](https://github.com/bazelbuild/bazel/issues/4815#issuecomment-460777113), which involves defining a `py_runtime` target that points to either Python version as needed, and activating this `py_runtime` by setting `--python_top`. | +| `srcs_version` | String; default is `"PY2AND3"` This attribute declares the target's `srcs` to be compatible with either Python 2, Python 3, or both. To actually set the Python runtime version, use the [`python_version`](/versions/7.7.3/reference/be/python#py_binary.python_version) attribute of an executable Python rule (`py_binary` or `py_test`). Allowed values are: `"PY2AND3"`, `"PY2"`, and `"PY3"`. The values `"PY2ONLY"` and `"PY3ONLY"` are also allowed for historic reasons, but they are essentially the same as `"PY2"` and `"PY3"` and should be avoided. Note that only the executable rules (`py_binary` and `py_library`) actually verify the current Python version against the value of this attribute. (This is a feature; since `py_library` does not change the current Python version, if it did the validation, it'd be impossible to build both `PY2ONLY` and `PY3ONLY` libraries in the same invocation.) Furthermore, if there is a version mismatch, the error is only reported in the execution phase. In particular, the error will not appear in a `bazel build --nobuild` invocation.) To get diagnostic information about which dependencies introduce version requirements, you can run the `find_requirements` aspect on your target: ``` bazel build <your target> \ --aspects=@rules_python//python:defs.bzl%find_requirements \ --output_groups=pyversioninfo ``` This will build a file with the suffix `-pyversioninfo.txt` giving information about why your target requires one Python version or another. Note that it works even if the given target failed to build due to a version conflict. | +| `stamp` | Integer; default is `0` See the section on [py\_binary()](/versions/7.7.3/reference/be/python#py_binary_args) arguments, except that the stamp argument is set to 0 by default for tests. | ## py\_runtime @@ -181,11 +181,11 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `bootstrap_template` | [Label](/versions/7.7.1/concepts/labels); default is `"@bazel_tools//tools/python:python_bootstrap_template.txt"` Previously referred to as the "Python stub script", this is the entrypoint to every Python executable target. | -| `coverage_tool` | [Label](/versions/7.7.1/concepts/labels); default is `None` This is a target to use for collecting code coverage information from `py_binary` and `py_test` targets. If set, the target must either produce a single file or be and executable target. The path to the single file, or the executable if the target is executable, determines the entry point for the python coverage tool. The target and its runfiles will be added to the runfiles when coverage is enabled. The entry point for the tool must be loadable by a python interpreter (e.g. a `.py` or `.pyc` file). It must accept the command line arguments of [coverage.py](https://coverage.readthedocs.io/), at least including the `run` and `lcov` subcommands. | -| `files` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` For an in-build runtime, this is the set of files comprising this runtime. These files will be added to the runfiles of Python binaries that use this runtime. For a platform runtime this attribute must not be set. | -| `interpreter` | [Label](/versions/7.7.1/concepts/labels); default is `None` For an in-build runtime, this is the target to invoke as the interpreter. For a platform runtime this attribute must not be set. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `bootstrap_template` | [Label](/versions/7.7.3/concepts/labels); default is `"@bazel_tools//tools/python:python_bootstrap_template.txt"` Previously referred to as the "Python stub script", this is the entrypoint to every Python executable target. | +| `coverage_tool` | [Label](/versions/7.7.3/concepts/labels); default is `None` This is a target to use for collecting code coverage information from `py_binary` and `py_test` targets. If set, the target must either produce a single file or be and executable target. The path to the single file, or the executable if the target is executable, determines the entry point for the python coverage tool. The target and its runfiles will be added to the runfiles when coverage is enabled. The entry point for the tool must be loadable by a python interpreter (e.g. a `.py` or `.pyc` file). It must accept the command line arguments of [coverage.py](https://coverage.readthedocs.io/), at least including the `run` and `lcov` subcommands. | +| `files` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` For an in-build runtime, this is the set of files comprising this runtime. These files will be added to the runfiles of Python binaries that use this runtime. For a platform runtime this attribute must not be set. | +| `interpreter` | [Label](/versions/7.7.3/concepts/labels); default is `None` For an in-build runtime, this is the target to invoke as the interpreter. For a platform runtime this attribute must not be set. | | `interpreter_path` | String; default is `""` For a platform runtime, this is the absolute path of a Python interpreter on the target platform. For an in-build runtime this attribute must not be set. | | `python_version` | String; default is `"_INTERNAL_SENTINEL"` Whether this runtime is for Python major version 2 or 3. Valid values are `"PY2"` and `"PY3"`. The default value is controlled by the `--incompatible_py3_is_default` flag. However, in the future this attribute will be mandatory and have no default value. | | `stub_shebang` | String; default is `"#!/usr/bin/env python3"` "Shebang" expression prepended to the bootstrapping Python script used when executing `py_binary` targets. See [issue 8685](https://github.com/bazelbuild/bazel/issues/8685) for motivation. Does not apply to Windows. | \ No newline at end of file
diff --git a/docs/versions/7.7.1/reference/be/shell.mdx b/docs/versions/7.7.3/reference/be/shell.mdx similarity index 86% rename from docs/versions/7.7.1/reference/be/shell.mdx rename to docs/versions/7.7.3/reference/be/shell.mdx index c64855f..c4e4cae 100644 --- a/docs/versions/7.7.1/reference/be/shell.mdx +++ b/docs/versions/7.7.3/reference/be/shell.mdx
@@ -40,9 +40,9 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of "library" targets to be aggregated into this target. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.1/reference/be/common-definitions#typical.deps). This attribute should be used to list other `sh_library` rules that provide interpreted program source code depended on by the code in `srcs`. The files provided by these rules will be present among the `runfiles` of this target. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); required The file containing the shell script. This attribute must be a singleton list, whose element is the shell script. This script must be executable, and may be a source file or a generated file. All other files required at runtime (whether scripts or data) belong in the `data` attribute. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of "library" targets to be aggregated into this target. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.3/reference/be/common-definitions#typical.deps). This attribute should be used to list other `sh_library` rules that provide interpreted program source code depended on by the code in `srcs`. The files provided by these rules will be present among the `runfiles` of this target. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); required The file containing the shell script. This attribute must be a singleton list, whose element is the shell script. This script must be executable, and may be a source file or a generated file. All other files required at runtime (whether scripts or data) belong in the `data` attribute. | ## sh\_library @@ -60,7 +60,7 @@ the `data` attribute of one or more `sh_binary` rules. -You can use the [`filegroup`](/versions/7.7.1/reference/be/general#filegroup) rule to aggregate data +You can use the [`filegroup`](/versions/7.7.3/reference/be/general#filegroup) rule to aggregate data files. In interpreted programming languages, there's not always a clear @@ -88,9 +88,9 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of "library" targets to be aggregated into this target. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.1/reference/be/common-definitions#typical.deps). This attribute should be used to list other `sh_library` rules that provide interpreted program source code depended on by the code in `srcs`. The files provided by these rules will be present among the `runfiles` of this target. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of input files. This attribute should be used to list shell script source files that belong to this library. Scripts can load other scripts using the shell's `source` or `.` command. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of "library" targets to be aggregated into this target. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.3/reference/be/common-definitions#typical.deps). This attribute should be used to list other `sh_library` rules that provide interpreted program source code depended on by the code in `srcs`. The files provided by these rules will be present among the `runfiles` of this target. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of input files. This attribute should be used to list shell script source files that belong to this library. Scripts can load other scripts using the shell's `source` or `.` command. | ## sh\_test @@ -102,7 +102,7 @@ A `sh_test()` rule creates a test written as a Bourne shell script. -See the [attributes common to all test rules (\*\_test)](/versions/7.7.1/reference/be/common-definitions#common-attributes-tests). +See the [attributes common to all test rules (\*\_test)](/versions/7.7.3/reference/be/common-definitions#common-attributes-tests). #### Examples @@ -120,6 +120,6 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `deps` | List of [labels](/versions/7.7.1/concepts/labels); default is `[]` The list of "library" targets to be aggregated into this target. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.1/reference/be/common-definitions#typical.deps). This attribute should be used to list other `sh_library` rules that provide interpreted program source code depended on by the code in `srcs`. The files provided by these rules will be present among the `runfiles` of this target. | -| `srcs` | List of [labels](/versions/7.7.1/concepts/labels); required The file containing the shell script. This attribute must be a singleton list, whose element is the shell script. This script must be executable, and may be a source file or a generated file. All other files required at runtime (whether scripts or data) belong in the `data` attribute. | \ No newline at end of file +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `deps` | List of [labels](/versions/7.7.3/concepts/labels); default is `[]` The list of "library" targets to be aggregated into this target. See general comments about `deps` at [Typical attributes defined by most build rules](/versions/7.7.3/reference/be/common-definitions#typical.deps). This attribute should be used to list other `sh_library` rules that provide interpreted program source code depended on by the code in `srcs`. The files provided by these rules will be present among the `runfiles` of this target. | +| `srcs` | List of [labels](/versions/7.7.3/concepts/labels); required The file containing the shell script. This attribute must be a singleton list, whose element is the shell script. This script must be executable, and may be a source file or a generated file. All other files required at runtime (whether scripts or data) belong in the `data` attribute. | \ No newline at end of file
diff --git a/docs/versions/7.7.1/reference/be/workspace.mdx b/docs/versions/7.7.3/reference/be/workspace.mdx similarity index 93% rename from docs/versions/7.7.1/reference/be/workspace.mdx rename to docs/versions/7.7.3/reference/be/workspace.mdx index 7134279..f20d30a 100644 --- a/docs/versions/7.7.1/reference/be/workspace.mdx +++ b/docs/versions/7.7.3/reference/be/workspace.mdx
@@ -2,11 +2,11 @@ title: 'Workspace Rules' --- -Workspace rules are used to pull in [external dependencies](/versions/7.7.1/docs/external), typically +Workspace rules are used to pull in [external dependencies](/versions/7.7.3/docs/external), typically source code located outside the main repository. *Note:* besides the native workspace rules, Bazel also embeds various -[Starlark workspace rules](/versions/7.7.1/rules/lib/repo/index), in particular those to deal +[Starlark workspace rules](/versions/7.7.3/rules/lib/repo/index), in particular those to deal with git repositories or archives hosted on the web. ## Rules @@ -25,9 +25,9 @@ *Warning: use of `bind()` is not recommended. See "[Consider removing bind](https://github.com/bazelbuild/bazel/issues/1952)" for a long discussion of its issues and alternatives. In particular, consider the use of -[`repo_mapping` repository attributes](https://bazel.build/versions/7.7.1/rules/repository_rules#attributes).* +[`repo_mapping` repository attributes](https://bazel.build/versions/7.7.3/rules/repository_rules#attributes).* -*Warning: `select()` cannot be used in `bind()`. See the [Configurable Attributes FAQ](/versions/7.7.1/docs/configurable-attributes#bind-select) for +*Warning: `select()` cannot be used in `bind()`. See the [Configurable Attributes FAQ](/versions/7.7.3/docs/configurable-attributes#bind-select) for details.* Gives a target an alias in the `//external` package. @@ -101,8 +101,8 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `actual` | [Label](/versions/7.7.1/concepts/labels); default is `None` The target to be aliased. This target must exist, but can be any type of rule (including bind). If this attribute is omitted, rules referring to this target in `//external` will simply not see this dependency edge. Note that this is different from omitting the `bind` rule completely: it is an error if an `//external` dependency does not have an associated `bind` rule. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `actual` | [Label](/versions/7.7.3/concepts/labels); default is `None` The target to be aliased. This target must exist, but can be any type of rule (including bind). If this attribute is omitted, rules referring to this target in `//external` will simply not see this dependency edge. Note that this is different from omitting the `bind` rule completely: it is an error if an `//external` dependency does not have an associated `bind` rule. | ## local\_repository @@ -113,7 +113,7 @@ ``` Allows targets from a local directory to be bound. This means that the current repository can -use targets defined in this other directory. See the [bind section](/versions/7.7.1/reference/be/workspace#bind_examples) for more details. +use targets defined in this other directory. See the [bind section](/versions/7.7.3/reference/be/workspace#bind_examples) for more details. #### Examples @@ -138,7 +138,7 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | | `path` | String; required The path to the local repository's directory. This must be a path to the directory containing the repository's *WORKSPACE* file. The path can be either absolute or relative to the main repository's *WORKSPACE* file. | | `repo_mapping` | Dictionary: String -> String; default is `{}` A dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository. For example, an entry `"@foo": "@bar"` declares that, for any time this repository depends on `"@foo"` (such as a dependency on `"@foo//some:target"`), it should actually resolve that dependency within globally-declared `"@bar"` (`"@bar//some:target"`). | @@ -216,10 +216,10 @@ | Attributes | | | --- | --- | -| `name` | [Name](/versions/7.7.1/concepts/labels#target-names); required A unique name for this target. | -| `build_file` | [Name](/versions/7.7.1/concepts/labels#target-names); default is `None` A file to use as a BUILD file for this directory. Either build\_file or build\_file\_content must be specified. This attribute is a label relative to the main workspace. The file does not need to be named BUILD, but can be. (Something like BUILD.new-repo-name may work well for distinguishing it from the repository's actual BUILD files.) | +| `name` | [Name](/versions/7.7.3/concepts/labels#target-names); required A unique name for this target. | +| `build_file` | [Name](/versions/7.7.3/concepts/labels#target-names); default is `None` A file to use as a BUILD file for this directory. Either build\_file or build\_file\_content must be specified. This attribute is a label relative to the main workspace. The file does not need to be named BUILD, but can be. (Something like BUILD.new-repo-name may work well for distinguishing it from the repository's actual BUILD files.) | | `build_file_content` | String; default is `""` The content for the BUILD file for this repository. Either build\_file or build\_file\_content must be specified. | | `path` | String; required A path on the local filesystem. This can be either absolute or relative to the main repository's WORKSPACE file. | | `repo_mapping` | Dictionary: String -> String; default is `{}` A dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository. For example, an entry `"@foo": "@bar"` declares that, for any time this repository depends on `"@foo"` (such as a dependency on `"@foo//some:target"`), it should actually resolve that dependency within globally-declared `"@bar"` (`"@bar//some:target"`). | -| `workspace_file` | [Name](/versions/7.7.1/concepts/labels#target-names); default is `None` The file to use as the WORKSPACE file for this repository. Either workspace\_file or workspace\_file\_content can be specified, but not both. This attribute is a label relative to the main workspace. The file does not need to be named WORKSPACE, but can be. (Something like WORKSPACE.new-repo-name may work well for distinguishing it from the repository's actual WORKSPACE files.) | +| `workspace_file` | [Name](/versions/7.7.3/concepts/labels#target-names); default is `None` The file to use as the WORKSPACE file for this repository. Either workspace\_file or workspace\_file\_content can be specified, but not both. This attribute is a label relative to the main workspace. The file does not need to be named WORKSPACE, but can be. (Something like WORKSPACE.new-repo-name may work well for distinguishing it from the repository's actual WORKSPACE files.) | | `workspace_file_content` | String; default is `""` The content for the WORKSPACE file for this repository. Either workspace\_file or workspace\_file\_content can be specified, but not both. | \ No newline at end of file
diff --git a/docs/versions/7.7.1/reference/command-line-reference.mdx b/docs/versions/7.7.3/reference/command-line-reference.mdx similarity index 99% rename from docs/versions/7.7.1/reference/command-line-reference.mdx rename to docs/versions/7.7.3/reference/command-line-reference.mdx index e8fdaae..e2a0bf3 100644 --- a/docs/versions/7.7.1/reference/command-line-reference.mdx +++ b/docs/versions/7.7.3/reference/command-line-reference.mdx
@@ -12,7 +12,7 @@ bazel [<startup options>] <command> [<args>] -- [<target patterns>] ``` -See the [User's Guide](/versions/7.7.1/docs/build#specifying-build-targets) for the +See the [User's Guide](/versions/7.7.3/docs/build#specifying-build-targets) for the target patterns syntax. ## Option Syntax @@ -429,7 +429,7 @@ [`loading_and_analysis`](#effect_tag_LOADING_AND_ANALYSIS), [`experimental`](#metadata_tag_EXPERIMENTAL) `--[no]experimental_isolated_extension_usages` default: "false" -: If true, enables the <code>isolate</code> parameter in the <a href="https://bazel.build/versions/7.7.1/rules/lib/globals/module#use\_extension"><code>use\_extension</code></a> function. +: If true, enables the <code>isolate</code> parameter in the <a href="https://bazel.build/versions/7.7.3/rules/lib/globals/module#use\_extension"><code>use\_extension</code></a> function. Tags: [`loading_and_analysis`](#effect_tag_LOADING_AND_ANALYSIS)
diff --git a/docs/versions/7.7.1/reference/glossary.mdx b/docs/versions/7.7.3/reference/glossary.mdx similarity index 94% rename from docs/versions/7.7.1/reference/glossary.mdx rename to docs/versions/7.7.3/reference/glossary.mdx index 8a607d0..2d9d988 100644 --- a/docs/versions/7.7.1/reference/glossary.mdx +++ b/docs/versions/7.7.3/reference/glossary.mdx
@@ -8,7 +8,7 @@ Includes metadata like the command line arguments, action key, environment variables, and declared input/output artifacts. -**See also:** [Rules documentation](/versions/7.7.1/extending/rules#actions) +**See also:** [Rules documentation](/versions/7.7.3/extending/rules#actions) ### Action cache {#action-cache} An on-disk cache that stores a mapping of executed [actions](#action) to the @@ -59,7 +59,7 @@ `aspect()` Starlark Build API function. Can be used, for example, to generate metadata for IDEs, and create actions for linting. -**See also:** [Aspects documentation](/versions/7.7.1/extending/aspects) +**See also:** [Aspects documentation](/versions/7.7.3/extending/aspects) ### Aspect-on-aspect {#aspect-on-aspect} A composition mechanism whereby aspects can be applied to the results @@ -68,8 +68,8 @@ proto. For an aspect `A` to apply on top of aspect `B`, the [providers](#provider) that -`B` advertises in its [`provides`](/versions/7.7.1/rules/lib/globals#aspect.provides) attribute -must match what `A` declares it wants in its [`required_aspect_providers`](/versions/7.7.1/rules/lib/globals#aspect.required_aspect_providers) +`B` advertises in its [`provides`](/versions/7.7.3/rules/lib/globals#aspect.provides) attribute +must match what `A` declares it wants in its [`required_aspect_providers`](/versions/7.7.3/rules/lib/globals#aspect.required_aspect_providers) attribute. ### Attribute {#attribute} @@ -156,7 +156,7 @@ target platform, action environment variables, and command-line [build flags](#command-flags). [Transitions](#transition) may create additional configurations, such as for host tools or cross-compilation. -**See also:** [Configurations](/versions/7.7.1/extending/rules#configurations) +**See also:** [Configurations](/versions/7.7.3/extending/rules#configurations) {/* TODO: ### Configuration fragment */} @@ -172,7 +172,7 @@ completes). This means `select()` and [build flags](#command-flags) (such as `--platforms`) are accurately reflected in the results. -**See also:** [cquery documentation](/versions/7.7.1/query/cquery) +**See also:** [cquery documentation](/versions/7.7.3/query/cquery) ### Configured target {#configured-target} The result of evaluating a [target](#target) with a @@ -207,7 +207,7 @@ huge memory consumption. Also known as *nested sets* in Bazel's internal implementation. -**See also:** [Depset documentation](/versions/7.7.1/extending/depsets) +**See also:** [Depset documentation](/versions/7.7.3/extending/depsets) ### Disk cache {#disk-cache} A local on-disk blob store for the remote caching feature. Can be used in @@ -270,7 +270,7 @@ is the name of the target itself. Depending on the situation, parts of this syntax may be omitted. -**See also**: [Labels](/versions/7.7.1/concepts/labels) +**See also**: [Labels](/versions/7.7.3/concepts/labels) ### Loading phase {#loading-phase} The first phase of a build where Bazel executes [`BUILD` files](#build-file) to @@ -284,7 +284,7 @@ patterns across `BUILD` files. Expanded to the underlying rule target declarations during the [loading phase](#loading-phase). -**See also:** [Macro documentation](/versions/7.7.1/extending/macros) +**See also:** [Macro documentation](/versions/7.7.3/extending/macros) ### Mnemonic {#mnemonic} A short, human-readable string selected by a rule author to quickly understand @@ -307,14 +307,14 @@ Module metadata is hosted in Bazel registries. -**See also:** [Bazel modules](/versions/7.7.1/external/module) +**See also:** [Bazel modules](/versions/7.7.3/external/module) ### Module Extension {#module-extension} A piece of logic that can be run to generate [repos](#repository) by reading inputs from across the [module](#module) dependency graph and invoking [repo rules](#repository-rule). Module extensions have capabilities similar to repo rules, allowing them to access the internet, perform file I/O, and so on. -**See also:** [Module extensions](/versions/7.7.1/external/extension) +**See also:** [Module extensions](/versions/7.7.3/external/extension) ### Native rules {#native-rules} [Rules](#rule) that are built into Bazel and implemented in Java. Such rules @@ -370,7 +370,7 @@ referred to as a "provider instance", although sometimes this is conflated with "provider". -**See also:** [Provider documentation](/versions/7.7.1/extending/rules#providers) +**See also:** [Provider documentation](/versions/7.7.3/extending/rules#providers) ### Query (concept) {#query-concept} The process of analyzing a [build graph](#build-graph) to understand @@ -383,7 +383,7 @@ but can't analyze the effects of `select()`, [build flags](#command-flags), [artifacts](#artifact), or build [actions](#action). -**See also:** [Query how-to](/versions/7.7.1/query/guide), [Query reference](/versions/7.7.1/query/language) +**See also:** [Query how-to](/versions/7.7.3/query/guide), [Query reference](/versions/7.7.3/query/language) ### Repository {#repository} A directory tree with a boundary marker file at its root, containing source @@ -403,7 +403,7 @@ Each repo has a unique, constant *canonical* name, and potentially different *apparent* names when viewed from other repos. -**See also**: [External dependencies overview](/versions/7.7.1/external/overview) +**See also**: [External dependencies overview](/versions/7.7.3/external/overview) ### Repository cache {#repo-cache} A shared content-addressable cache of files downloaded by Bazel for builds, @@ -421,7 +421,7 @@ rule is `http_archive` to download an archive containing source files from the internet. -**See also:** [Repo rule documentation](/versions/7.7.1/extending/repo) +**See also:** [Repo rule documentation](/versions/7.7.3/extending/repo) ### Reproducibility {#reproducibility} The property of a build or test that a set of inputs to the build or test will @@ -448,7 +448,7 @@ This usage was inherited from tools like Make, but causes confusion and should be avoided for Bazel. -**See also:** [Rules documentation](/versions/7.7.1/extending/rules) +**See also:** [Rules documentation](/versions/7.7.3/extending/rules) ### Rule target {#rule-target} A [target](#target) that is an instance of a rule. Contrasts with file targets @@ -461,7 +461,7 @@ bazel test), Bazel prepares the tree of runfiles alongside the test executable according to their source directory structure. -**See also:** [Runfiles documentation](/versions/7.7.1/extending/rules#runfiles) +**See also:** [Runfiles documentation](/versions/7.7.3/extending/rules#runfiles) ### Sandboxing {#sandboxing} A technique to isolate a running [action](#action) inside a restricted and @@ -472,7 +472,7 @@ On Linux, it's not significant, but on macOS it can make sandboxing unusable. ### Skyframe {#skyframe} -[Skyframe](/versions/7.7.1/reference/skyframe) is the core parallel, functional, and incremental evaluation framework of Bazel. +[Skyframe](/versions/7.7.3/reference/skyframe) is the core parallel, functional, and incremental evaluation framework of Bazel. {/* TODO: ### Spawn strategy */} @@ -480,17 +480,17 @@ A feature to embed additional information into Bazel-built [artifacts](#artifact). For example, this can be used for source control, build time and other workspace or environment-related information for release builds. -Enable through the `--workspace_status_command` flag and [rules](/versions/7.7.1/extending/rules) that +Enable through the `--workspace_status_command` flag and [rules](/versions/7.7.3/extending/rules) that support the stamp attribute. ### Starlark {#starlark} -The extension language for writing [rules](/versions/7.7.1/extending/rules) and [macros](#macro). A +The extension language for writing [rules](/versions/7.7.3/extending/rules) and [macros](#macro). A restricted subset of Python (syntactically and grammatically) aimed for the purpose of configuration, and for better performance. Uses the [`.bzl` file](#bzl-file) extension. [`BUILD` files](#build-file) use an even more restricted version of Starlark (such as no `def` function definitions), formerly known as Skylark. -**See also:** [Starlark language documentation](/versions/7.7.1/rules/language) +**See also:** [Starlark language documentation](/versions/7.7.3/rules/language) {/* TODO: ### Starlark rules */} @@ -536,7 +536,7 @@ Rule [targets](#target) instantiated from test rules, and therefore contains a test executable. A return code of zero from the completion of the executable indicates test success. The exact contract between Bazel and tests (such as test -environment variables, test result collection methods) is specified in the [Test Encyclopedia](/versions/7.7.1/reference/test-encyclopedia). +environment variables, test result collection methods) is specified in the [Test Encyclopedia](/versions/7.7.3/reference/test-encyclopedia). ### Toolchain {#toolchain} A set of tools to build outputs for a language. Typically, a toolchain includes @@ -564,7 +564,7 @@ each fork. For example, one can build an Android APK with native binaries compiled for ARM and x86 using split transitions in a single build. -**See also:** [User-defined transitions](/versions/7.7.1/extending/config#user-defined-transitions) +**See also:** [User-defined transitions](/versions/7.7.3/extending/config#user-defined-transitions) ### Tree artifact {#tree-artifact} An [artifact](#artifact) that represents a collection of files. Since these @@ -578,7 +578,7 @@ or `.bzl` file may load a given `.bzl` file. Without context, usually "visibility" refers to target visibility. -**See also:** [Visibility documentation](/versions/7.7.1/concepts/visibility) +**See also:** [Visibility documentation](/versions/7.7.3/concepts/visibility) ### Workspace {#workspace} The environment shared by all Bazel commands run from the same [main repository](#repository).
diff --git a/docs/versions/7.7.1/reference/skyframe.mdx b/docs/versions/7.7.3/reference/skyframe.mdx similarity index 100% rename from docs/versions/7.7.1/reference/skyframe.mdx rename to docs/versions/7.7.3/reference/skyframe.mdx
diff --git a/docs/versions/7.7.1/reference/skyframe.png b/docs/versions/7.7.3/reference/skyframe.png similarity index 100% rename from docs/versions/7.7.1/reference/skyframe.png rename to docs/versions/7.7.3/reference/skyframe.png Binary files differ
diff --git a/docs/versions/7.7.1/reference/test-encyclopedia.mdx b/docs/versions/7.7.3/reference/test-encyclopedia.mdx similarity index 97% rename from docs/versions/7.7.1/reference/test-encyclopedia.mdx rename to docs/versions/7.7.3/reference/test-encyclopedia.mdx index 3606e37..54e30e3 100644 --- a/docs/versions/7.7.1/reference/test-encyclopedia.mdx +++ b/docs/versions/7.7.3/reference/test-encyclopedia.mdx
@@ -8,7 +8,7 @@ The Bazel BUILD language includes rules which can be used to define automated test programs in many languages. -Tests are run using [`bazel test`](/versions/7.7.1/docs/user-manual#test). +Tests are run using [`bazel test`](/versions/7.7.3/docs/user-manual#test). Users may also execute test binaries directly. This is allowed but not endorsed, as such an invocation will not adhere to the mandates described below. @@ -93,7 +93,7 @@ The whole test target (not individual methods or tests) is given a limited amount of time to run to completion. The time limit for a test is based on its -[`timeout`](/versions/7.7.1/reference/be/common-definitions#test.timeout) attribute according +[`timeout`](/versions/7.7.3/reference/be/common-definitions#test.timeout) attribute according to the following table: <table> @@ -120,7 +120,7 @@ </table> Tests which do not explicitly specify a timeout have one implied based on the -test's [`size`](/versions/7.7.1/reference/be/common-definitions#test.size) as follows: +test's [`size`](/versions/7.7.3/reference/be/common-definitions#test.size) as follows: <table> <tr> @@ -151,7 +151,7 @@ Unlike `timeout`, the `size` additionally determines the assumed peak usage of other resources (like RAM) when running the test locally, as described in -[Common definitions](/versions/7.7.1/reference/be/common-definitions#common-attributes-tests). +[Common definitions](/versions/7.7.3/reference/be/common-definitions#common-attributes-tests). All combinations of `size` and `timeout` labels are legal, so an "enormous" test may be declared to have a timeout of "short". Presumably it would do some really @@ -196,7 +196,7 @@ command line option will show the tests whose specified size is too big. Test sizes and timeouts are specified in the BUILD file according to the -specification [here](/versions/7.7.1/reference/be/common-definitions#common-attributes-tests). If +specification [here](/versions/7.7.3/reference/be/common-definitions#common-attributes-tests). If unspecified, a test's size will default to "medium". If the main process of a test exits, but some of its children are still running, @@ -206,8 +206,8 @@ ## Test sharding {#test-sharding} Tests can be parallelized via test sharding. See -[`--test_sharding_strategy`](/versions/7.7.1/reference/command-line-reference#flag--test_sharding_strategy) -and [`shard_count`](/versions/7.7.1/reference/be/common-definitions#common-attributes-tests) to +[`--test_sharding_strategy`](/versions/7.7.3/reference/command-line-reference#flag--test_sharding_strategy) +and [`shard_count`](/versions/7.7.3/reference/be/common-definitions#common-attributes-tests) to enable test sharding. When sharding is enabled, the test runner is launched once per shard. The environment variable [`TEST_TOTAL_SHARDS`](#initial-conditions) is the number of shards, and [`TEST_SHARD_INDEX`](#initial-conditions) is the @@ -216,7 +216,7 @@ sharding. If a runner supports sharding, it must create or update the last modified date of the file specified by [`TEST_SHARD_STATUS_FILE`](#initial-conditions). Otherwise, if -[`--incompatible_check_sharding_support`](/versions/7.7.1/reference/command-line-reference#flag--incompatible_check_sharding_support) +[`--incompatible_check_sharding_support`](/versions/7.7.3/reference/command-line-reference#flag--incompatible_check_sharding_support) is enabled, Bazel will fail the test if it is sharded. ## Initial conditions {#initial-conditions} @@ -387,7 +387,7 @@ <tr> <td><code>TEST_TOTAL_SHARDS</code></td> <td>total - <a href="/versions/7.7.1/reference/be/common-definitions#test.shard_count"><code>shard count</code></a>, + <a href="/versions/7.7.3/reference/be/common-definitions#test.shard_count"><code>shard count</code></a>, if <a href="#test-sharding"><code>sharding</code></a> is used</td> <td>optional</td> </tr> @@ -426,7 +426,7 @@ <tr> <td><code>TESTBRIDGE_TEST_ONLY</code></td> <td>value of - <a href="/versions/7.7.1/docs/user-manual#flag--test_filter"><code>--test_filter</code></a>, + <a href="/versions/7.7.3/docs/user-manual#flag--test_filter"><code>--test_filter</code></a>, if specified</td> <td>optional</td> </tr> @@ -678,7 +678,7 @@ ## Tag conventions {#tag-conventions} Some tags in the test rules have a special meaning. See also the -[Bazel Build Encyclopedia on the `tags` attribute](/versions/7.7.1/reference/be/common-definitions#common.tags). +[Bazel Build Encyclopedia on the `tags` attribute](/versions/7.7.3/reference/be/common-definitions#common.tags). <table> <tr>
diff --git a/docs/versions/7.7.1/release/backward-compatibility.mdx b/docs/versions/7.7.3/release/backward-compatibility.mdx similarity index 92% rename from docs/versions/7.7.1/release/backward-compatibility.mdx rename to docs/versions/7.7.3/release/backward-compatibility.mdx index d5a2024..02d6ad9 100644 --- a/docs/versions/7.7.1/release/backward-compatibility.mdx +++ b/docs/versions/7.7.3/release/backward-compatibility.mdx
@@ -6,9 +6,9 @@ including migrating from one release to another and how to communicate incompatible changes. -Bazel is evolving. Minor versions released as part of an [LTS major version](/versions/7.7.1/release#bazel-versioning) are fully backward-compatible. New major LTS +Bazel is evolving. Minor versions released as part of an [LTS major version](/versions/7.7.3/release#bazel-versioning) are fully backward-compatible. New major LTS releases may contain incompatible changes that require some migration effort. -For more information about Bazel's release model, please check out the [Release Model](/versions/7.7.1/release) page. +For more information about Bazel's release model, please check out the [Release Model](/versions/7.7.3/release) page. ## Summary {#summary} @@ -24,8 +24,8 @@ ## How to follow this policy {#policy} -* [For Bazel users - how to update Bazel](/versions/7.7.1/install/bazelisk) -* [For contributors - best practices for incompatible changes](/versions/7.7.1/contribute/breaking-changes) +* [For Bazel users - how to update Bazel](/versions/7.7.3/install/bazelisk) +* [For contributors - best practices for incompatible changes](/versions/7.7.3/contribute/breaking-changes) * [For release managers - how to update issue labels and release](https://github.com/bazelbuild/continuous-integration/tree/master/docs/release-playbook.%6D%64) ## What is stable functionality? {#stable-functionality}
diff --git a/docs/versions/7.7.1/release/index.mdx b/docs/versions/7.7.3/release/index.mdx similarity index 98% rename from docs/versions/7.7.1/release/index.mdx rename to docs/versions/7.7.3/release/index.mdx index f07c147..41d408a 100644 --- a/docs/versions/7.7.1/release/index.mdx +++ b/docs/versions/7.7.3/release/index.mdx
@@ -52,7 +52,7 @@ release. * Rolling releases can ship incompatible changes. Incompatible flags are recommended for major breaking changes, rolling out incompatible changes - should follow our [backward compatibility policy](/versions/7.7.1/release/backward-compatibility). + should follow our [backward compatibility policy](/versions/7.7.3/release/backward-compatibility). ### LTS releases {#lts-releases} @@ -164,4 +164,4 @@ ## Rule compatibility {#rule-compatibility} If you are a rule authors and want to maintain compatibility with different -Bazel versions, please check out the [Rule Compatibility](/versions/7.7.1/release/rule-compatibility) page. \ No newline at end of file +Bazel versions, please check out the [Rule Compatibility](/versions/7.7.3/release/rule-compatibility) page. \ No newline at end of file
diff --git a/docs/versions/7.7.1/release/rule-compatibility.mdx b/docs/versions/7.7.3/release/rule-compatibility.mdx similarity index 98% rename from docs/versions/7.7.1/release/rule-compatibility.mdx rename to docs/versions/7.7.3/release/rule-compatibility.mdx index 91a192d..f824fc3 100644 --- a/docs/versions/7.7.1/release/rule-compatibility.mdx +++ b/docs/versions/7.7.3/release/rule-compatibility.mdx
@@ -75,7 +75,7 @@ Bazel LTS release, rules authors can: * Request backward-compatible features to be back-ported to the latest LTS - release, check out [release process](/versions/7.7.1/release#release-procedure-policies) + release, check out [release process](/versions/7.7.3/release#release-procedure-policies) for more details. * Use [bazel_features](https://github.com/bazel-contrib/bazel_features) to do Bazel feature detection.
diff --git a/docs/versions/7.7.1/remote/bep-examples.mdx b/docs/versions/7.7.3/remote/bep-examples.mdx similarity index 96% rename from docs/versions/7.7.1/remote/bep-examples.mdx rename to docs/versions/7.7.3/remote/bep-examples.mdx index 1e2242c..c75ae4c 100644 --- a/docs/versions/7.7.1/remote/bep-examples.mdx +++ b/docs/versions/7.7.3/remote/bep-examples.mdx
@@ -27,7 +27,7 @@ aforementioned parent and child relationship. Note that some build events and most fields have been omitted for brevity. - + **Figure 1.** BEP graph. @@ -101,7 +101,7 @@ ## Aspect Results in BEP {#aspect-results} Ordinary builds evaluate actions associated with `(target, configuration)` -pairs. When building with [aspects](/versions/7.7.1/extending/aspects) enabled, Bazel +pairs. When building with [aspects](/versions/7.7.3/extending/aspects) enabled, Bazel additionally evaluates targets associated with `(target, configuration, aspect)` triples, for each target affected by a given enabled aspect. @@ -145,14 +145,14 @@ Determining the artifacts produced by a given target (or aspect) is a common BEP use-case that can be done efficiently with some preparation. This section discusses the recursive, shared structure offered by the `NamedSetOfFiles` -event, which matches the structure of a Starlark [Depset](/versions/7.7.1/extending/depsets). +event, which matches the structure of a Starlark [Depset](/versions/7.7.3/extending/depsets). Consumers must take care to avoid quadratic algorithms when processing `NamedSetOfFiles` events because large builds can contain tens of thousands of such events, requiring hundreds of millions operations in a traversal with quadratic complexity. - + **Figure 2.** `NamedSetOfFiles` BEP graph.
diff --git a/docs/versions/7.7.1/remote/bep-glossary.mdx b/docs/versions/7.7.3/remote/bep-glossary.mdx similarity index 96% rename from docs/versions/7.7.1/remote/bep-glossary.mdx rename to docs/versions/7.7.3/remote/bep-glossary.mdx index 0b6f138..9f1208c 100644 --- a/docs/versions/7.7.1/remote/bep-glossary.mdx +++ b/docs/versions/7.7.3/remote/bep-glossary.mdx
@@ -36,7 +36,7 @@ ## ActionExecuted {#actionexecuted} Provides details about the execution of a specific -[Action](/versions/7.7.1/rules/lib/builtins/actions) in a build. By default, this event is +[Action](/versions/7.7.3/rules/lib/builtins/actions) in a build. By default, this event is included in the BEP only for failed actions, to support identifying the root cause of build failures. Users may set the `--build_event_publish_all_actions` flag to include all `ActionExecuted` events. @@ -145,7 +145,7 @@ ## Configuration {#configuration} -A `Configuration` event is sent for every [`configuration`](/versions/7.7.1/extending/config) +A `Configuration` event is sent for every [`configuration`](/versions/7.7.3/extending/config) used in the top-level targets in a build. At least one configuration event is always be present. The `id` is reused by the `TargetConfigured` and `TargetComplete` event IDs and is necessary to disambiguate those events in @@ -216,17 +216,17 @@ ## NamedSetOfFiles {#namedsetoffiles} `NamedSetOfFiles` events report a structure matching a -[`depset`](/versions/7.7.1/extending/depsets) of files produced during command evaluation. +[`depset`](/versions/7.7.3/extending/depsets) of files produced during command evaluation. Transitively included depsets are identified by `NamedSetOfFilesId`. For more information on interpreting a stream's `NamedSetOfFiles` events, see the -[BEP examples page](/versions/7.7.1/remote/bep-examples#consuming-namedsetoffiles). +[BEP examples page](/versions/7.7.3/remote/bep-examples#consuming-namedsetoffiles). ## OptionsParsed {#optionsparsed} A single `OptionsParsed` event lists all options applied to the command, separating startup options from command options. It also includes the -[InvocationPolicy](/versions/7.7.1/reference/command-line-reference#flag--invocation_policy), if any. +[InvocationPolicy](/versions/7.7.3/reference/command-line-reference#flag--invocation_policy), if any. ```json { @@ -398,7 +398,7 @@ Unlike [CommandLine](#commandline), this event carries the unparsed commandline flags in string form as encountered by the build tool after expanding all -[`.bazelrc`](/versions/7.7.1/run/bazelrc) files and +[`.bazelrc`](/versions/7.7.3/run/bazelrc) files and considering the `--config` flag. The `UnstructuredCommandLine` event may be relied upon to precisely reproduce a @@ -411,4 +411,4 @@ ## WorkspaceStatus {#workspacestatus} -A single `WorkspaceStatus` event contains the result of the [workspace status command](/versions/7.7.1/docs/user-manual#workspace-status). +A single `WorkspaceStatus` event contains the result of the [workspace status command](/versions/7.7.3/docs/user-manual#workspace-status).
diff --git a/docs/versions/7.7.1/remote/bep.mdx b/docs/versions/7.7.3/remote/bep.mdx similarity index 94% rename from docs/versions/7.7.1/remote/bep.mdx rename to docs/versions/7.7.3/remote/bep.mdx index 641b2e7..0ef2fe9 100644 --- a/docs/versions/7.7.1/remote/bep.mdx +++ b/docs/versions/7.7.3/remote/bep.mdx
@@ -46,14 +46,14 @@ The event graph's structure reflects the lifecycle of a command. Every BEP graph has the following characteristic shape: -1. The root event is always a [`BuildStarted`](/versions/7.7.1/remote/bep-glossary#buildstarted) +1. The root event is always a [`BuildStarted`](/versions/7.7.3/remote/bep-glossary#buildstarted) event. All other events are its descendants. 1. Immediate children of the BuildStarted event contain metadata about the command. 1. Events containing data produced by the command, such as files built and test - results, appear before the [`BuildFinished`](/versions/7.7.1/remote/bep-glossary#buildfinished) + results, appear before the [`BuildFinished`](/versions/7.7.3/remote/bep-glossary#buildfinished) event. -1. The [`BuildFinished`](/versions/7.7.1/remote/bep-glossary#buildfinished) event *may* be followed +1. The [`BuildFinished`](/versions/7.7.3/remote/bep-glossary#buildfinished) event *may* be followed by events containing summary information about the build (for example, metric or profiling data). @@ -107,7 +107,7 @@ * `--project_id` For a description of each of these flags, see the -[Command-Line Reference](/versions/7.7.1/reference/command-line-reference). +[Command-Line Reference](/versions/7.7.3/reference/command-line-reference). ### Authentication and security {#authentication-security} @@ -124,14 +124,14 @@ * `--[no]tls_enabled` For a description of each of these flags, see the -[Command-Line Reference](/versions/7.7.1/reference/command-line-reference). +[Command-Line Reference](/versions/7.7.3/reference/command-line-reference). ### Build Event Service and remote caching {#bes-remote-caching} The BEP typically contains many references to log files (test.log, test.xml, etc. ) stored on the machine where Bazel is running. A remote BES server typically can't access these files as they are on different machines. A way to -work around this issue is to use Bazel with [remote caching](/versions/7.7.1/remote/caching). +work around this issue is to use Bazel with [remote caching](/versions/7.7.3/remote/caching). Bazel will upload all output files to the remote cache (including files referenced in the BEP) and the BES server can then fetch the referenced files from the cache.
diff --git a/docs/versions/7.7.1/remote/cache-local.mdx b/docs/versions/7.7.3/remote/cache-local.mdx similarity index 93% rename from docs/versions/7.7.1/remote/cache-local.mdx rename to docs/versions/7.7.3/remote/cache-local.mdx index 7332f9d..96d46ae 100644 --- a/docs/versions/7.7.1/remote/cache-local.mdx +++ b/docs/versions/7.7.3/remote/cache-local.mdx
@@ -11,14 +11,14 @@ For tips on how to check your cache hit rate and how to compare the execution logs between two Bazel invocations, see -[Debugging Remote Cache Hits for Remote Execution](/versions/7.7.1/remote/cache-remote). +[Debugging Remote Cache Hits for Remote Execution](/versions/7.7.3/remote/cache-remote). Everything presented in that guide also applies to remote caching with local execution. However, local execution presents some additional challenges. ## Checking your cache hit rate {#cache-hits} Successful remote cache hits will show up in the status line, similar to -[Cache Hits rate with Remote Execution](/versions/7.7.1/remote/cache-remote#check-cache-hits). +[Cache Hits rate with Remote Execution](/versions/7.7.3/remote/cache-remote#check-cache-hits). In the standard output of your Bazel run, you will see something like the following: @@ -65,7 +65,7 @@ message you see does not give you enough information, try adding `--verbose_failures`. -2. Follow the steps from [Troubleshooting cache hits for remote execution](/versions/7.7.1/remote/cache-remote#troubleshooting_cache_hits) to +2. Follow the steps from [Troubleshooting cache hits for remote execution](/versions/7.7.3/remote/cache-remote#troubleshooting_cache_hits) to ensure that your cache-writing Bazel invocations are able to get cache hits on the same machine and across machines. @@ -79,6 +79,6 @@ b. Ensure your cache-reading Bazel invocations build the same targets as the cache-writing Bazel invocations. - c. Follow the same steps as to [ensure caching across machines](/versions/7.7.1/remote/cache-remote#caching-across-machines), + c. Follow the same steps as to [ensure caching across machines](/versions/7.7.3/remote/cache-remote#caching-across-machines), to ensure caching from your cache-writing Bazel invocation to your cache-reading Bazel invocation.
diff --git a/docs/versions/7.7.1/remote/cache-remote.mdx b/docs/versions/7.7.3/remote/cache-remote.mdx similarity index 98% rename from docs/versions/7.7.1/remote/cache-remote.mdx rename to docs/versions/7.7.3/remote/cache-remote.mdx index b3d4f33..67aa93b 100644 --- a/docs/versions/7.7.1/remote/cache-remote.mdx +++ b/docs/versions/7.7.3/remote/cache-remote.mdx
@@ -90,7 +90,7 @@ If figuring out the actual command line is difficult, use the canonical command line from the - [Build Event Protocol](/versions/7.7.1/remote/bep) + [Build Event Protocol](/versions/7.7.3/remote/bep) as follows: a. Add `--build_event_text_file=/tmp/bep.txt` to your Bazel command to get @@ -104,7 +104,7 @@ d. If `remote_accept_cached` is `false`, determine where it is being set to `false`: either at the command line or in a - [bazelrc](/versions/7.7.1/run/bazelrc#bazelrc-file-locations) file. + [bazelrc](/versions/7.7.3/run/bazelrc#bazelrc-file-locations) file. ### Ensure caching across machines {#caching-across-machines}
diff --git a/docs/versions/7.7.1/remote/caching.mdx b/docs/versions/7.7.3/remote/caching.mdx similarity index 98% rename from docs/versions/7.7.1/remote/caching.mdx rename to docs/versions/7.7.3/remote/caching.mdx index 00cdaa5..95fa56c 100644 --- a/docs/versions/7.7.1/remote/caching.mdx +++ b/docs/versions/7.7.3/remote/caching.mdx
@@ -34,7 +34,7 @@ Note that the remote cache additionally stores the stdout and stderr for every action. Inspecting the stdout/stderr of Bazel thus is not a good signal for -[estimating cache hits](/versions/7.7.1/remote/cache-local). +[estimating cache hits](/versions/7.7.3/remote/cache-local). ### How a build uses remote caching {#remote-caching} @@ -354,8 +354,8 @@ * **Faster Bazel builds with remote caching: a benchmark:** Nicolò Valigi wrote a [blog post](https://nicolovaligi.com/faster-bazel-remote-caching-benchmark.html) in which he benchmarks remote caching in Bazel. -* [Adapting Rules for Remote Execution](/versions/7.7.1/remote/rules) -* [Troubleshooting Remote Execution](/versions/7.7.1/remote/sandbox) +* [Adapting Rules for Remote Execution](/versions/7.7.3/remote/rules) +* [Troubleshooting Remote Execution](/versions/7.7.3/remote/sandbox) * [WebDAV module](https://nginx.org/en/docs/http/ngx_http_dav_module.html) * [Docker image](https://hub.docker.com/r/buchgr/bazel-remote-cache/) * [bazel-remote](https://github.com/buchgr/bazel-remote/)
diff --git a/docs/versions/7.7.1/remote/ci.mdx b/docs/versions/7.7.3/remote/ci.mdx similarity index 96% rename from docs/versions/7.7.1/remote/ci.mdx rename to docs/versions/7.7.3/remote/ci.mdx index 7430b1d..92485b9 100644 --- a/docs/versions/7.7.1/remote/ci.mdx +++ b/docs/versions/7.7.3/remote/ci.mdx
@@ -47,14 +47,14 @@ have run. (See [example results](https://source.cloud.google.com/results/invocations/375e325c-0a05-47af-87bd-fed1363e0333).) -  +  5. (Optional) Set the **bazel test (RBE (Ubuntu 16.04))** check as a test required to pass before merging in your branch protection rule. The setting is located in GitHub in **Settings > Branches > Branch protection rules**, as shown in the following figure. -  +  ## Troubleshooting failed builds and tests {#troubleshooting-failed-builds} @@ -71,7 +71,7 @@ * **Build or test targets are using rules that are incompatible with remote execution.** See - [Adapting Bazel Rules for Remote Execution](/versions/7.7.1/remote/rules) for + [Adapting Bazel Rules for Remote Execution](/versions/7.7.3/remote/rules) for details about compatibility with remote execution. ## Using a custom container in the rbe_ubuntu1604 CI config {#custom-container} @@ -192,7 +192,7 @@ ### Specifying the build platform definition {#platform-definition} -You must include a [Bazel platform](/versions/7.7.1/extending/platforms) configuration in your +You must include a [Bazel platform](/versions/7.7.3/extending/platforms) configuration in your custom toolchain configuration, which allows Bazel to select a toolchain appropriate to the desired hardware/software platform. To generate automatically a valid platform, you can add to your `WORKSPACE` an
diff --git a/docs/versions/7.7.1/remote/creating.mdx b/docs/versions/7.7.3/remote/creating.mdx similarity index 98% rename from docs/versions/7.7.1/remote/creating.mdx rename to docs/versions/7.7.3/remote/creating.mdx index 3b8392f..5dfa732 100644 --- a/docs/versions/7.7.1/remote/creating.mdx +++ b/docs/versions/7.7.3/remote/creating.mdx
@@ -2,7 +2,7 @@ title: 'Creating Persistent Workers' --- -[Persistent workers](/versions/7.7.1/remote/persistent) can make your build faster. If +[Persistent workers](/versions/7.7.3/remote/persistent) can make your build faster. If you have repeated actions in your build that have a high startup cost or would benefit from cross-action caching, you may want to implement your own persistent worker to perform these actions. @@ -62,7 +62,7 @@ manually for different amounts of output. The optional `sandbox_dir` field is used only by workers that support -[multiplex sandboxing](/versions/7.7.1/remote/multiplex). +[multiplex sandboxing](/versions/7.7.3/remote/multiplex). ### Work responses {#work-responses} @@ -234,7 +234,7 @@ ``` For another example, see -[Implementing persistent workers](/versions/7.7.1/remote/persistent#implementation). +[Implementing persistent workers](/versions/7.7.3/remote/persistent#implementation). ## Examples {#examples}
diff --git a/docs/versions/7.7.1/remote/dynamic.mdx b/docs/versions/7.7.3/remote/dynamic.mdx similarity index 92% rename from docs/versions/7.7.1/remote/dynamic.mdx rename to docs/versions/7.7.3/remote/dynamic.mdx index 7500c53..db64852 100644 --- a/docs/versions/7.7.1/remote/dynamic.mdx +++ b/docs/versions/7.7.3/remote/dynamic.mdx
@@ -12,7 +12,7 @@ This page describes how to enable, tune, and debug dynamic execution. If you have both local and remote execution set up and are trying to adjust Bazel settings for better performance, this page is for you. If you don't already have -remote execution set up, go to the Bazel [Remote Execution Overview](/versions/7.7.1/remote/rbe) first. +remote execution set up, go to the Bazel [Remote Execution Overview](/versions/7.7.3/remote/rbe) first. ## Enabling dynamic execution? {#enabling-dynamic-execution} @@ -43,12 +43,12 @@ longer than cache hits usually take. The actual time depends both on the remote system and on how long a round-trip takes. Usually, the value will be the same for all users of a given remote system, unless some of them are far enough away -to add roundtrip latency. You can use the [Bazel profiling features](/versions/7.7.1/rules/performance#performance-profiling) to look at how long typical +to add roundtrip latency. You can use the [Bazel profiling features](/versions/7.7.3/rules/performance#performance-profiling) to look at how long typical cache hits take. Dynamic execution can be used with local sandboxed strategy as well as with -[persistent workers](/versions/7.7.1/remote/persistent). Persistent workers will automatically -run with sandboxing when used with dynamic execution, and cannot use [multiplex workers](/versions/7.7.1/remote/multiplex). On Darwin and Windows systems, the sandboxed +[persistent workers](/versions/7.7.3/remote/persistent). Persistent workers will automatically +run with sandboxing when used with dynamic execution, and cannot use [multiplex workers](/versions/7.7.3/remote/multiplex). On Darwin and Windows systems, the sandboxed strategy can be slow; you can pass `--reuse_sandbox_directories` to reduce overhead of creating sandboxes on these systems. @@ -68,13 +68,13 @@ ## When should I use dynamic execution? {#when-to-use} -Dynamic execution requires some form of [remote execution system](/versions/7.7.1/remote/rbe). +Dynamic execution requires some form of [remote execution system](/versions/7.7.3/remote/rbe). It is not currently possible to use a cache-only remote system, as a cache miss would be considered a failed action. Not all types of actions are well suited for remote execution. The best candidates are those that are inherently faster locally, for instance through -the use of [persistent workers](/versions/7.7.1/remote/persistent), or those that run fast +the use of [persistent workers](/versions/7.7.3/remote/persistent), or those that run fast enough that the overhead of remote execution dominates execution time. Since each locally executed action locks some amount of CPU and memory resources, running actions that don't fall into those categories merely delays execution @@ -82,7 +82,7 @@ As of release [5.0.0-pre.20210708.4](https://github.com/bazelbuild/bazel/releases/tag/5.0.0-pre.20210708.4), -[performance profiling](/versions/7.7.1/rules/performance#performance-profiling) contains data +[performance profiling](/versions/7.7.3/rules/performance#performance-profiling) contains data about worker execution, including time spent finishing a work request after losing a dynamic execution race. If you see dynamic execution worker threads spending significant time acquiring resources, or a lot of time in the @@ -91,7 +91,7 @@ <p align="center"> <img width="596px" alt="Profiling data with poor dynamic execution performance" - src="/versions/7.7.1/docs/images/dyn-trace-alldynamic.png" /> + src="/versions/7.7.3/docs/images/dyn-trace-alldynamic.png" /> </p> In the profile above, which uses 8 Javac workers, we see many Javac workers @@ -101,7 +101,7 @@ <p align="center"> <img width="596px" alt="Profiling data with better dynamic execution performance" - src="/versions/7.7.1/docs/images/dyn-trace-javaconly.png" /> + src="/versions/7.7.3/docs/images/dyn-trace-javaconly.png" /> </p> When only Javac is run with dynamic execution, only about half of the started @@ -149,13 +149,13 @@ `--experimental_dynamic_ignore_local_signals` can be used to let the remote branch take over when a local spawn exits due to a given signal. This is is mainly useful together with worker resource limits (see -[`--experimental_worker_memory_limit_mb`](https://bazel.build/versions/7.7.1/reference/command-line-reference#flag--experimental_worker_memory_limit_mb), -[`--experimental_worker_sandbox_hardening`](https://bazel.build/versions/7.7.1/reference/command-line-reference#flag--experimental_worker_sandbox_hardening), +[`--experimental_worker_memory_limit_mb`](https://bazel.build/versions/7.7.3/reference/command-line-reference#flag--experimental_worker_memory_limit_mb), +[`--experimental_worker_sandbox_hardening`](https://bazel.build/versions/7.7.3/reference/command-line-reference#flag--experimental_worker_sandbox_hardening), and -[`--experimental_sandbox_memory_limit_mb`)](https://bazel.build/versions/7.7.1/reference/command-line-reference#flag--experimental_sandbox_memory_limit_mb)), +[`--experimental_sandbox_memory_limit_mb`)](https://bazel.build/versions/7.7.3/reference/command-line-reference#flag--experimental_sandbox_memory_limit_mb)), where worker processes may be killed when they use too many resources. -The [JSON trace profile](/versions/7.7.1/advanced/performance/json-trace-profile) contains a +The [JSON trace profile](/versions/7.7.3/advanced/performance/json-trace-profile) contains a number of performance-related graphs that can help identify ways to improve the trade-off of performance and resource usage.
diff --git a/docs/versions/7.7.1/remote/multiplex.mdx b/docs/versions/7.7.3/remote/multiplex.mdx similarity index 98% rename from docs/versions/7.7.1/remote/multiplex.mdx rename to docs/versions/7.7.3/remote/multiplex.mdx index 6ce4461..48ce845 100644 --- a/docs/versions/7.7.1/remote/multiplex.mdx +++ b/docs/versions/7.7.3/remote/multiplex.mdx
@@ -74,7 +74,7 @@ A ruleset is encouraged to use multiplex workers if possible, to reduce memory pressure and improve performance. However, multiplex workers are not currently -compatible with [dynamic execution](/versions/7.7.1/remote/dynamic) unless they +compatible with [dynamic execution](/versions/7.7.3/remote/dynamic) unless they implement multiplex sandboxing. Attempting to run non-sandboxed multiplex workers with dynamic execution will silently use sandboxed singleplex workers instead.
diff --git a/docs/versions/7.7.1/remote/output-directories.mdx b/docs/versions/7.7.3/remote/output-directories.mdx similarity index 99% rename from docs/versions/7.7.1/remote/output-directories.mdx rename to docs/versions/7.7.3/remote/output-directories.mdx index 7f4389f..f317f30 100644 --- a/docs/versions/7.7.1/remote/output-directories.mdx +++ b/docs/versions/7.7.3/remote/output-directories.mdx
@@ -25,7 +25,7 @@ * Bazel must be invoked from a directory containing a repo boundary file, or a subdirectory thereof. In other words, Bazel must be invoked from inside a - [repository](/versions/7.7.1/external/overview#repository). Otherwise, an error is + [repository](/versions/7.7.3/external/overview#repository). Otherwise, an error is reported. * The _outputRoot_ directory defaults to `${XDG_CACHE_HOME}/bazel` (or `~/.cache/bazel`, if the `XDG_CACHE_HOME` environment variable is not set) on
diff --git a/docs/versions/7.7.1/remote/persistent.mdx b/docs/versions/7.7.3/remote/persistent.mdx similarity index 92% rename from docs/versions/7.7.1/remote/persistent.mdx rename to docs/versions/7.7.3/remote/persistent.mdx index da1394f..d92e7c9 100644 --- a/docs/versions/7.7.1/remote/persistent.mdx +++ b/docs/versions/7.7.3/remote/persistent.mdx
@@ -17,7 +17,7 @@ `<outputBase>/bazel-workers`. Using persistent workers is an -[execution strategy](/versions/7.7.1/docs/user-manual#execution-strategy) that decreases +[execution strategy](/versions/7.7.3/docs/user-manual#execution-strategy) that decreases start-up overhead, allows more JIT compilation, and enables caching of for example the abstract syntax trees in the action execution. This strategy achieves these improvements by sending multiple requests to a long-running @@ -38,7 +38,7 @@ execution takes precedence. For actions that do not support persistent workers, Bazel falls back to starting a tool instance for each action. You can explicitly set your build to use persistent workers by setting the `worker` -[strategy](/versions/7.7.1/docs/user-manual#execution-strategy) for the applicable tool +[strategy](/versions/7.7.3/docs/user-manual#execution-strategy) for the applicable tool mnemonics. As a best practice, this example includes specifying `local` as a fallback to the `worker` strategy: @@ -57,7 +57,7 @@ [*dynamic* strategy](https://blog.bazel.build/2019/02/01/dynamic-spawn-scheduler.html), which races a remote execution and a worker execution. To enable the dynamic strategy, pass the -[--experimental_spawn_scheduler](/versions/7.7.1/reference/command-line-reference#flag--experimental_spawn_scheduler) +[--experimental_spawn_scheduler](/versions/7.7.3/reference/command-line-reference#flag--experimental_spawn_scheduler) flag. This strategy automatically enables workers, so there is no need to specify the `worker` strategy, but you can still use `local` or `sandboxed` as fallbacks. @@ -66,7 +66,7 @@ The default number of worker instances per mnemonic is 4, but can be adjusted with the -[`worker_max_instances`](/versions/7.7.1/reference/command-line-reference#flag--worker_max_instances) +[`worker_max_instances`](/versions/7.7.3/reference/command-line-reference#flag--worker_max_instances) flag. There is a trade-off between making good use of the available CPUs and the amount of JIT compilation and cache hits you get. With more workers, more targets will pay start-up costs of running non-JITted code and hitting cold @@ -83,7 +83,7 @@ with 64 GB of RAM. For each worker configuration, five clean builds are run and the average of the last four are taken. - + **Figure 1.** Graph of performance improvements of clean builds. @@ -103,7 +103,7 @@ gives a 3x speed-up (average of 20 incremental builds with one warmup build discarded): - + **Figure 2.** Graph of performance improvements of incremental builds. @@ -113,7 +113,7 @@ ## Modifying persistent workers {#options} You can pass the -[`--worker_extra_flag`](/versions/7.7.1/reference/command-line-reference#flag--worker_extra_flag) +[`--worker_extra_flag`](/versions/7.7.3/reference/command-line-reference#flag--worker_extra_flag) flag to specify start-up flags to workers, keyed by mnemonic. For instance, passing `--worker_extra_flag=javac=--debug` turns on debugging for Javac only. Only one worker flag can be set per use of this flag, and only for one mnemonic. @@ -124,23 +124,23 @@ action configuration can also specify set-up flags. You can use the -[`--high_priority_workers`](/versions/7.7.1/reference/command-line-reference#flag--high_priority_workers) +[`--high_priority_workers`](/versions/7.7.3/reference/command-line-reference#flag--high_priority_workers) flag to specify a mnemonic that should be run in preference to normal-priority mnemonics. This can help prioritize actions that are always in the critical path. If there are two or more high priority workers executing requests, all other workers are prevented from running. This flag can be used multiple times. Passing the -[`--worker_sandboxing`](/versions/7.7.1/reference/command-line-reference#flag--worker_sandboxing) +[`--worker_sandboxing`](/versions/7.7.3/reference/command-line-reference#flag--worker_sandboxing) flag makes each worker request use a separate sandbox directory for all its -inputs. Setting up the [sandbox](/versions/7.7.1/docs/sandboxing) takes some extra time, +inputs. Setting up the [sandbox](/versions/7.7.3/docs/sandboxing) takes some extra time, especially on macOS, but gives a better correctness guarantee. The -[`--worker_quit_after_build`](/versions/7.7.1/reference/command-line-reference#flag--worker_quit_after_build) +[`--worker_quit_after_build`](/versions/7.7.3/reference/command-line-reference#flag--worker_quit_after_build) flag is mainly useful for debugging and profiling. This flag forces all workers to quit once a build is done. You can also pass -[`--worker_verbose`](/versions/7.7.1/reference/command-line-reference#flag--worker_verbose) to +[`--worker_verbose`](/versions/7.7.3/reference/command-line-reference#flag--worker_verbose) to get more output about what the workers are doing. This flag is reflected in the `verbosity` field in `WorkRequest`, allowing worker implementations to also be more verbose. @@ -153,11 +153,11 @@ log files for a given mnemonic. For Android builds, see details at the -[Android Build Performance page](/versions/7.7.1/docs/android-build-performance). +[Android Build Performance page](/versions/7.7.3/docs/android-build-performance). ## Implementing persistent workers {#implementation} -See the [creating persistent workers](/versions/7.7.1/remote/creating) page for more +See the [creating persistent workers](/versions/7.7.3/remote/creating) page for more information on how to make a worker. This example shows a Starlark configuration for a worker that uses JSON: @@ -221,7 +221,7 @@ too many variations are used. Each worker can currently only process one request at a time. The experimental -[multiplex workers](/versions/7.7.1/remote/multiplex) feature allows using multiple +[multiplex workers](/versions/7.7.3/remote/multiplex) feature allows using multiple threads, if the underlying tool is multithreaded and the wrapper is set up to understand this. @@ -237,7 +237,7 @@ ## How do workers affect sandboxing? {#sandboxing} Using the `worker` strategy by default does not run the action in a -[sandbox](/versions/7.7.1/docs/sandboxing), similar to the `local` strategy. You can set the +[sandbox](/versions/7.7.3/docs/sandboxing), similar to the `local` strategy. You can set the `--worker_sandboxing` flag to run all workers inside sandboxes, making sure each execution of the tool only sees the input files it's supposed to have. The tool may still leak information between requests internally, for instance through a
diff --git a/docs/versions/7.7.1/remote/rbe.mdx b/docs/versions/7.7.3/remote/rbe.mdx similarity index 94% rename from docs/versions/7.7.1/remote/rbe.mdx rename to docs/versions/7.7.3/remote/rbe.mdx index 01d1e41..55fea2b 100644 --- a/docs/versions/7.7.1/remote/rbe.mdx +++ b/docs/versions/7.7.3/remote/rbe.mdx
@@ -28,4 +28,4 @@ Remote execution of Bazel builds imposes a set of mandatory configuration constraints on the build. For more information, see -[Adapting Bazel Rules for Remote Execution](/versions/7.7.1/remote/rules). +[Adapting Bazel Rules for Remote Execution](/versions/7.7.3/remote/rules).
diff --git a/docs/versions/7.7.1/remote/rules.mdx b/docs/versions/7.7.3/remote/rules.mdx similarity index 97% rename from docs/versions/7.7.1/remote/rules.mdx rename to docs/versions/7.7.3/remote/rules.mdx index e437731..3ec9b9a 100644 --- a/docs/versions/7.7.1/remote/rules.mdx +++ b/docs/versions/7.7.3/remote/rules.mdx
@@ -60,7 +60,7 @@ and new toolchain rules are under way for other languages and tools such as [bash](https://docs.google.com/document/d/e/2PACX-1vRCSB_n3vctL6bKiPkIa_RN_ybzoAccSe0ic8mxdFNZGNBJ3QGhcKjsL7YKf-ngVyjRZwCmhi_5KhcX/pub). If a toolchain rule does not exist for the tool your rule uses, consider -[creating a toolchain rule](/versions/7.7.1/extending/toolchains#creating-a-toolchain-rule). +[creating a toolchain rule](/versions/7.7.3/extending/toolchains#creating-a-toolchain-rule). ## Managing implicit dependencies {#manage-dependencies} @@ -83,7 +83,7 @@ To help detect and eliminate these dependency problems, Bazel 0.14.1 offers the local Docker sandbox, which has the same restrictions for dependencies as remote execution. Use the sandbox to prepare your build for remote execution by -identifying and resolving dependency-related build errors. See [Troubleshooting Bazel Remote Execution with Docker Sandbox](/versions/7.7.1/remote/sandbox) +identifying and resolving dependency-related build errors. See [Troubleshooting Bazel Remote Execution with Docker Sandbox](/versions/7.7.3/remote/sandbox) for more information. ## Managing platform-dependent binaries {#manage-binaries} @@ -132,14 +132,14 @@ build to fail on the remote execution platform as Bazel will not be able to locate them. Instead, create symlinks using standard build actions so that the symlinked tools and libraries are accessible from Bazel's `runfiles` - tree. Do not use [`repository_ctx.symlink`](/versions/7.7.1/rules/lib/builtins/repository_ctx#symlink) + tree. Do not use [`repository_ctx.symlink`](/versions/7.7.3/rules/lib/builtins/repository_ctx#symlink) to symlink target files outside of the external repo directory. * **Mutating the host platform.** Avoid creating files outside of the Bazel `runfiles` tree, creating environment variables, and similar actions, as they may behave unexpectedly on the remote execution platform. -To help find potential non-hermetic behavior you can use [Workspace rules log](/versions/7.7.1/remote/workspace). +To help find potential non-hermetic behavior you can use [Workspace rules log](/versions/7.7.3/remote/workspace). If an external dependency executes specific operations dependent on the host platform, you should split those operations between `WORKSPACE` and build
diff --git a/docs/versions/7.7.1/remote/sandbox.mdx b/docs/versions/7.7.3/remote/sandbox.mdx similarity index 95% rename from docs/versions/7.7.1/remote/sandbox.mdx rename to docs/versions/7.7.3/remote/sandbox.mdx index a23079a..6aa4821 100644 --- a/docs/versions/7.7.1/remote/sandbox.mdx +++ b/docs/versions/7.7.3/remote/sandbox.mdx
@@ -4,7 +4,7 @@ Bazel builds that succeed locally may fail when executed remotely due to restrictions and requirements that do not affect local builds. The most common -causes of such failures are described in [Adapting Bazel Rules for Remote Execution](/versions/7.7.1/remote/rules). +causes of such failures are described in [Adapting Bazel Rules for Remote Execution](/versions/7.7.3/remote/rules). This page describes how to identify and resolve the most common issues that arise with remote execution using the Docker sandbox feature, which imposes @@ -93,7 +93,7 @@ executed remotely. However, with this method, locally installed tools, binaries, and data may leak -into into your build, especially if it uses [configure-style WORKSPACE rules](/versions/7.7.1/remote/rules#manage-workspace-rules). +into into your build, especially if it uses [configure-style WORKSPACE rules](/versions/7.7.3/remote/rules#manage-workspace-rules). Such leaks will cause problems with remote execution; to detect them, [troubleshoot in a Docker container](#troubleshooting-docker-container) in addition to troubleshooting natively. @@ -127,26 +127,26 @@ * **A file, tool, binary, or resource referenced by the Bazel runfiles tree is missing.**. Confirm that all dependencies of the affected targets have been - [explicitly declared](/versions/7.7.1/concepts/dependencies). See - [Managing implicit dependencies](/versions/7.7.1/remote/rules#manage-dependencies) + [explicitly declared](/versions/7.7.3/concepts/dependencies). See + [Managing implicit dependencies](/versions/7.7.3/remote/rules#manage-dependencies) for more information. * **A file, tool, binary, or resource referenced by an absolute path or the `PATH` variable is missing.** Confirm that all required tools are installed within - the toolchain container and use [toolchain rules](/versions/7.7.1/extending/toolchains) to properly + the toolchain container and use [toolchain rules](/versions/7.7.3/extending/toolchains) to properly declare dependencies pointing to the missing resource. See - [Invoking build tools through toolchain rules](/versions/7.7.1/remote/rules#invoking-build-tools-through-toolchain-rules) + [Invoking build tools through toolchain rules](/versions/7.7.3/remote/rules#invoking-build-tools-through-toolchain-rules) for more information. * **A binary execution fails.** One of the build rules is referencing a binary incompatible with the execution environment (the Docker container). See - [Managing platform-dependent binaries](/versions/7.7.1/remote/rules#manage-binaries) + [Managing platform-dependent binaries](/versions/7.7.3/remote/rules#manage-binaries) for more information. If you cannot resolve the issue, contact [bazel-discuss@google.com](mailto:bazel-discuss@google.com) for help. * **A file from `@local-jdk` is missing or causing errors.** The Java binaries on your local machine are leaking into the build while being incompatible with - it. Use [`java_toolchain`](/versions/7.7.1/reference/be/java#java_toolchain) + it. Use [`java_toolchain`](/versions/7.7.3/reference/be/java#java_toolchain) in your rules and targets instead of `@local_jdk`. Contact [bazel-discuss@google.com](mailto:bazel-discuss@google.com) if you need further help. * **Other errors.** Contact [bazel-discuss@google.com](mailto:bazel-discuss@google.com) for help. @@ -251,7 +251,7 @@ * If the build fails during the analysis or loading phases, one or more of your build rules declared in the WORKSPACE file are not compatible with - remote execution. See [Adapting Bazel Rules for Remote Execution](/versions/7.7.1/remote/rules) + remote execution. See [Adapting Bazel Rules for Remote Execution](/versions/7.7.3/remote/rules) for possible causes and workarounds. * If the build fails for any other reason, see the troubleshooting steps in [Step 2: Resolve detected issues](#start-container).
diff --git a/docs/versions/7.7.1/remote/workspace.mdx b/docs/versions/7.7.3/remote/workspace.mdx similarity index 95% rename from docs/versions/7.7.1/remote/workspace.mdx rename to docs/versions/7.7.3/remote/workspace.mdx index 4d7649f..e84249b 100644 --- a/docs/versions/7.7.1/remote/workspace.mdx +++ b/docs/versions/7.7.3/remote/workspace.mdx
@@ -11,18 +11,18 @@ host machine for use during execution, your build is likely to break due to incompatibilities between the environments. -As part of [adapting Bazel rules for remote execution](/versions/7.7.1/remote/rules), you need to find such workspace rules +As part of [adapting Bazel rules for remote execution](/versions/7.7.3/remote/rules), you need to find such workspace rules and fix them. This page describes how to find potentially problematic workspace rules using the workspace log. ## Finding non-hermetic rules {#nonhermetic-rules} -[Workspace rules](/versions/7.7.1/reference/be/workspace) allow the developer to add dependencies to +[Workspace rules](/versions/7.7.3/reference/be/workspace) allow the developer to add dependencies to external workspaces, but they are rich enough to allow arbitrary processing to happen in the process. All related commands are happening locally and can be a potential source of non-hermeticity. Usually non-hermetic behavior is introduced through -[`repository_ctx`](/versions/7.7.1/rules/lib/builtins/repository_ctx) which allows interacting +[`repository_ctx`](/versions/7.7.3/rules/lib/builtins/repository_ctx) which allows interacting with the host machine. Starting with Bazel 0.18, you can get a log of some potentially non-hermetic @@ -93,7 +93,7 @@ The log consists of [WorkspaceEvent](https://source.bazel.build/bazel/+/master:src/main/java/com/google/devtools/build/lib/bazel/debug/workspace_log.proto?q=WorkspaceEvent) messages outlining certain potentially non-hermetic actions performed on a -[`repository_ctx`](/versions/7.7.1/rules/lib/builtins/repository_ctx). +[`repository_ctx`](/versions/7.7.3/rules/lib/builtins/repository_ctx). The actions that have been highlighted as potentially non-hermetic are as follows:
diff --git a/docs/versions/7.7.1/rules/build-graph-aspects.png b/docs/versions/7.7.3/rules/build-graph-aspects.png similarity index 100% rename from docs/versions/7.7.1/rules/build-graph-aspects.png rename to docs/versions/7.7.3/rules/build-graph-aspects.png Binary files differ
diff --git a/docs/versions/7.7.1/rules/build-graph.png b/docs/versions/7.7.3/rules/build-graph.png similarity index 100% rename from docs/versions/7.7.1/rules/build-graph.png rename to docs/versions/7.7.3/rules/build-graph.png Binary files differ
diff --git a/docs/versions/7.7.1/rules/bzl-style.mdx b/docs/versions/7.7.3/rules/bzl-style.mdx similarity index 96% rename from docs/versions/7.7.1/rules/bzl-style.mdx rename to docs/versions/7.7.3/rules/bzl-style.mdx index 8385cd3..9fd9ffa 100644 --- a/docs/versions/7.7.1/rules/bzl-style.mdx +++ b/docs/versions/7.7.3/rules/bzl-style.mdx
@@ -5,7 +5,7 @@ This page covers basic style guidelines for Starlark and also includes information on macros and rules. -[Starlark](/versions/7.7.1/rules/language) is a +[Starlark](/versions/7.7.3/rules/language) is a language that defines how software is built, and as such it is both a programming and a configuration language. @@ -41,7 +41,7 @@ * Use [Buildifier](https://github.com/bazelbuild/buildtools/tree/master/buildifier#linter) as a formatter and linter. -* Follow [testing guidelines](/versions/7.7.1/rules/testing). +* Follow [testing guidelines](/versions/7.7.3/rules/testing). ## Style {#style} @@ -53,7 +53,7 @@ Python convention. Since -[Starlark is not Python](/versions/7.7.1/rules/language#differences-with-python), +[Starlark is not Python](/versions/7.7.3/rules/language#differences-with-python), some aspects of Python style do not apply. For example, PEP 8 advises that comparisons to singletons be done with `is`, which is not an operator in Starlark. @@ -165,7 +165,7 @@ As a rule of thumb, the more macros resemble the rules, the better. -See also [macros](/versions/7.7.1/extending/macros#conventions). +See also [macros](/versions/7.7.3/extending/macros#conventions). ## Rules {#rules} @@ -200,9 +200,9 @@ (named with a leading underscore). A common style is to give the implementation function for `myrule` the name `_myrule_impl`. * Pass information between your rules using a well-defined - [provider](/versions/7.7.1/extending/rules#providers) interface. Declare and document provider + [provider](/versions/7.7.3/extending/rules#providers) interface. Declare and document provider fields. * Design your rule with extensibility in mind. Consider that other rules might want to interact with your rule, access your providers, and reuse the actions you create. -* Follow [performance guidelines](/versions/7.7.1/rules/performance) in your rules. +* Follow [performance guidelines](/versions/7.7.3/rules/performance) in your rules.
diff --git a/docs/versions/7.7.1/rules/challenges.mdx b/docs/versions/7.7.3/rules/challenges.mdx similarity index 98% rename from docs/versions/7.7.1/rules/challenges.mdx rename to docs/versions/7.7.3/rules/challenges.mdx index 883741a..9a65209 100644 --- a/docs/versions/7.7.1/rules/challenges.mdx +++ b/docs/versions/7.7.3/rules/challenges.mdx
@@ -33,7 +33,7 @@ input that goes into a given build step, such that it can rerun that step if any of the inputs change. There are limits to how correct Bazel can get, as it leaks some information such as date / time of the build, and ignores certain types of -changes such as changes to file attributes. [Sandboxing](/versions/7.7.1/docs/sandboxing) +changes such as changes to file attributes. [Sandboxing](/versions/7.7.3/docs/sandboxing) helps ensure correctness by preventing reads to undeclared input files. Besides the intrinsic limits of the system, there are a few known correctness issues, most of which are related to Fileset or the C++ rules, which are both hard @@ -126,7 +126,7 @@ Above, we argued that in order to be correct, Bazel needs to know all the input files that go into a build step in order to detect whether that build step is still up-to-date. The same is true for package loading and rule analysis, and we -have designed [Skyframe](/versions/7.7.1/reference/skyframe) to handle this +have designed [Skyframe](/versions/7.7.3/reference/skyframe) to handle this in general. Skyframe is a graph library and evaluation framework that takes a goal node (such as 'build //foo with these options'), and breaks it down into its constituent parts, which are then evaluated and combined to yield this @@ -208,7 +208,7 @@ custom collection classes that effectively compress the information in memory by avoiding the copy at each step. Almost all of these data structures have set semantics, so we called it -[depset](/versions/7.7.1/rules/lib/builtins/depset) +[depset](/versions/7.7.3/rules/lib/builtins/depset) (also known as `NestedSet` in the internal implementation). The majority of changes to reduce Bazel's memory consumption over the past several years were changes to use depsets instead of whatever was previously used.
diff --git a/docs/versions/7.7.1/rules/deploying.mdx b/docs/versions/7.7.3/rules/deploying.mdx similarity index 98% rename from docs/versions/7.7.1/rules/deploying.mdx rename to docs/versions/7.7.3/rules/deploying.mdx index d98f701..e946922 100644 --- a/docs/versions/7.7.1/rules/deploying.mdx +++ b/docs/versions/7.7.3/rules/deploying.mdx
@@ -130,7 +130,7 @@ ### Constraints If your rule defines -[toolchain](/versions/7.7.1/extending/toolchains) rules, +[toolchain](/versions/7.7.3/extending/toolchains) rules, it's possible that you'll need to define custom `constraint_setting`s and/or `constraint_value`s. Put these into a `//<LANG>/constraints` package. Your directory structure will look like this: @@ -150,7 +150,7 @@ consider contributing your constraints there if they are language independent. Be mindful of introducing custom constraints, all users of your rules will use them to perform platform specific logic in their `BUILD` files (for example, -using [selects](/versions/7.7.1/reference/be/functions#select)). +using [selects](/versions/7.7.3/reference/be/functions#select)). With custom constraints, you define a language that the whole Bazel ecosystem will speak.
diff --git a/docs/versions/7.7.1/rules/errors/read-only-variable.mdx b/docs/versions/7.7.3/rules/errors/read-only-variable.mdx similarity index 100% rename from docs/versions/7.7.1/rules/errors/read-only-variable.mdx rename to docs/versions/7.7.3/rules/errors/read-only-variable.mdx
diff --git a/docs/versions/7.7.1/rules/faq.mdx b/docs/versions/7.7.3/rules/faq.mdx similarity index 86% rename from docs/versions/7.7.1/rules/faq.mdx rename to docs/versions/7.7.3/rules/faq.mdx index 64bffa3..960cfa8 100644 --- a/docs/versions/7.7.1/rules/faq.mdx +++ b/docs/versions/7.7.3/rules/faq.mdx
@@ -17,9 +17,9 @@ * If you want the file to be built automatically whenever your target is mentioned on the command line, add it to your rule's default outputs by - returning a [`DefaultInfo`](/versions/7.7.1/rules/lib/globals#DefaultInfo) provider. + returning a [`DefaultInfo`](/versions/7.7.3/rules/lib/globals#DefaultInfo) provider. -See the [Rules page](/versions/7.7.1/extending/rules#requesting-output-files) for more information. +See the [Rules page](/versions/7.7.3/extending/rules#requesting-output-files) for more information. ## Why is my implementation function not executed? @@ -35,24 +35,24 @@ For actions, you declare inputs by passing them to the `ctx.actions.*` function that creates the action. The proper path for the file can be obtained using -[`File.path`](/versions/7.7.1/rules/lib/builtins/File#path). +[`File.path`](/versions/7.7.3/rules/lib/builtins/File#path). For binaries (the executable outputs run by a `bazel run` or `bazel test` command), you declare inputs by including them in the -[runfiles](/versions/7.7.1/extending/rules#runfiles). Instead of using the `path` field, use -[`File.short_path`](/versions/7.7.1/rules/lib/builtins/File#short_path), which is file's path relative to +[runfiles](/versions/7.7.3/extending/rules#runfiles). Instead of using the `path` field, use +[`File.short_path`](/versions/7.7.3/rules/lib/builtins/File#short_path), which is file's path relative to the runfiles directory in which the binary executes. ## How can I control which files are built by `bazel build //pkg:mytarget`? -Use the [`DefaultInfo`](/versions/7.7.1/rules/lib/globals#DefaultInfo) provider to -[set the default outputs](/versions/7.7.1/extending/rules#requesting-output-files). +Use the [`DefaultInfo`](/versions/7.7.3/rules/lib/globals#DefaultInfo) provider to +[set the default outputs](/versions/7.7.3/extending/rules#requesting-output-files). ## How can I run a program or do file I/O as part of my build? A tool can be declared as a target, just like any other part of your build, and run during the execution phase to help build other targets. To create an action -that runs a tool, use [`ctx.actions.run`](/versions/7.7.1/rules/lib/builtins/actions#run) and pass in the +that runs a tool, use [`ctx.actions.run`](/versions/7.7.3/rules/lib/builtins/actions#run) and pass in the tool as the `executable` parameter. During the loading and analysis phases, a tool *cannot* run, nor can you perform
diff --git a/docs/versions/7.7.3/rules/index.mdx b/docs/versions/7.7.3/rules/index.mdx new file mode 100644 index 0000000..99fc526 --- /dev/null +++ b/docs/versions/7.7.3/rules/index.mdx
@@ -0,0 +1,83 @@ +--- +title: 'Rules' +--- + +The Bazel ecosystem has a growing and evolving set of rules to support popular +languages and packages. Much of Bazel's strength comes from the ability to +[define new rules](/versions/7.7.3/extending/concepts) that can be used by others. + +This page describes the recommended, native, and non-native Bazel rules. + +## Recommended rules {#recommended-rules} + +Here is a selection of recommended rules: + +* [Android](/versions/7.7.3/docs/bazel-and-android) +* [C / C++](/versions/7.7.3/docs/bazel-and-cpp) +* [Docker/OCI](https://github.com/bazel-contrib/rules_oci) +* [Go](https://github.com/bazelbuild/rules_go) +* [Haskell](https://github.com/tweag/rules_haskell) +* [Java](/versions/7.7.3/docs/bazel-and-java) +* [JavaScript / NodeJS](https://github.com/bazelbuild/rules_nodejs) +* [Kubernetes](https://github.com/bazelbuild/rules_k8s) +* [Maven dependency management](https://github.com/bazelbuild/rules_jvm_external) +* [Objective-C](/versions/7.7.3/docs/bazel-and-apple) +* [Package building](https://github.com/bazelbuild/rules_pkg) +* [Protocol Buffers](https://github.com/bazelbuild/rules_proto#protobuf-rules-for-bazel) +* [Python](https://github.com/bazelbuild/rules_python) +* [Scala](https://github.com/bazelbuild/rules_scala) +* [Shell](/versions/7.7.3/reference/be/shell) +* [Webtesting](https://github.com/bazelbuild/rules_webtesting) (Webdriver) + +The repository [Skylib](https://github.com/bazelbuild/bazel-skylib) contains +additional functions that can be useful when writing new rules and new +macros. + +The rules above were reviewed and follow our +[requirements for recommended rules](/versions/7.7.3/community/recommended-rules). +Contact the respective rule set's maintainers regarding issues and feature +requests. + +To find more Bazel rules, use a search engine, take a look on +[awesomebazel.com](https://awesomebazel.com/), or search on +[GitHub](https://github.com/search?o=desc&q=bazel+rules&s=stars&type=Repositories). + +## Native rules that do not apply to a specific programming language + +Native rules are shipped with the Bazel binary, they are always available in +BUILD files without a `load` statement. + +* Extra actions + - [`extra_action`](/versions/7.7.3/reference/be/extra-actions#extra_action) + - [`action_listener`](/versions/7.7.3/reference/be/extra-actions#action_listener) +* General + - [`filegroup`](/versions/7.7.3/reference/be/general#filegroup) + - [`genquery`](/versions/7.7.3/reference/be/general#genquery) + - [`test_suite`](/versions/7.7.3/reference/be/general#test_suite) + - [`alias`](/versions/7.7.3/reference/be/general#alias) + - [`config_setting`](/versions/7.7.3/reference/be/general#config_setting) + - [`genrule`](/versions/7.7.3/reference/be/general#genrule) +* Platform + - [`constraint_setting`](/versions/7.7.3/reference/be/platforms-and-toolchains#constraint_setting) + - [`constraint_value`](/versions/7.7.3/reference/be/platforms-and-toolchains#constraint_value) + - [`platform`](/versions/7.7.3/reference/be/platforms-and-toolchains#platform) + - [`toolchain`](/versions/7.7.3/reference/be/platforms-and-toolchains#toolchain) + - [`toolchain_type`](/versions/7.7.3/reference/be/platforms-and-toolchains#toolchain_type) +* Workspace + - [`bind`](/versions/7.7.3/reference/be/workspace#bind) + - [`local_repository`](/versions/7.7.3/reference/be/workspace#local_repository) + - [`new_local_repository`](/versions/7.7.3/reference/be/workspace#new_local_repository) + - [`xcode_config`](/versions/7.7.3/reference/be/objective-c#xcode_config) + - [`xcode_version`](/versions/7.7.3/reference/be/objective-c#xcode_version) + +## Embedded non-native rules {#embedded-rules} + +Bazel also embeds additional rules written in [Starlark](/versions/7.7.3/rules/language). Those can be loaded from +the `@bazel_tools` built-in external repository. + +* Repository rules + - [`git_repository`](/versions/7.7.3/rules/lib/repo/git#git_repository) + - [`http_archive`](/versions/7.7.3/rules/lib/repo/http#http_archive) + - [`http_file`](/versions/7.7.3/rules/lib/repo/http#http_archive) + - [`http_jar`](/versions/7.7.3/rules/lib/repo/http#http_jar) + - [Utility functions on patching](/versions/7.7.3/rules/lib/repo/utils)
diff --git a/docs/versions/7.7.1/rules/language.mdx b/docs/versions/7.7.3/rules/language.mdx similarity index 83% rename from docs/versions/7.7.1/rules/language.mdx rename to docs/versions/7.7.3/rules/language.mdx index 199e7d2..947cf2f 100644 --- a/docs/versions/7.7.1/rules/language.mdx +++ b/docs/versions/7.7.3/rules/language.mdx
@@ -5,7 +5,7 @@ This page is an overview of [Starlark](https://github.com/bazelbuild/starlark), formerly known as Skylark, the language used in Bazel. For a complete list of -functions and types, see the [Bazel API reference](/versions/7.7.1/rules/lib/overview). +functions and types, see the [Bazel API reference](/versions/7.7.3/rules/lib/overview). For more information about the language, see [Starlark's GitHub repo](https://github.com/bazelbuild/starlark/). @@ -34,19 +34,19 @@ rare, except for cases where Starlark raises an error. The following Python types are supported: -* [None](/versions/7.7.1/rules/lib/globals#None) -* [bool](/versions/7.7.1/rules/lib/core/bool) -* [dict](/versions/7.7.1/rules/lib/core/dict) -* [tuple](/versions/7.7.1/rules/lib/core/tuple) -* [function](/versions/7.7.1/rules/lib/core/function) -* [int](/versions/7.7.1/rules/lib/core/int) -* [list](/versions/7.7.1/rules/lib/core/list) -* [string](/versions/7.7.1/rules/lib/core/string) +* [None](/versions/7.7.3/rules/lib/globals#None) +* [bool](/versions/7.7.3/rules/lib/core/bool) +* [dict](/versions/7.7.3/rules/lib/core/dict) +* [tuple](/versions/7.7.3/rules/lib/core/tuple) +* [function](/versions/7.7.3/rules/lib/core/function) +* [int](/versions/7.7.3/rules/lib/core/int) +* [list](/versions/7.7.3/rules/lib/core/list) +* [string](/versions/7.7.3/rules/lib/core/string) ## Mutability Starlark favors immutability. Two mutable data structures are available: -[lists](/versions/7.7.1/rules/lib/core/list) and [dicts](/versions/7.7.1/rules/lib/core/dict). Changes to mutable +[lists](/versions/7.7.3/rules/lib/core/list) and [dicts](/versions/7.7.3/rules/lib/core/dict). Changes to mutable data-structures, such as appending a value to a list or deleting an entry in a dictionary are valid only for objects created in the current context. After a context finishes, its values become immutable. @@ -93,8 +93,8 @@ `BUILD` files register targets via making calls to rules. `.bzl` files provide definitions for constants, rules, macros, and functions. -[Native functions](/versions/7.7.1/reference/be/functions) and [native rules](/versions/7.7.1/reference/be/overview#language-specific-native-rules) are global symbols in -`BUILD` files. `bzl` files need to load them using the [`native` module](/versions/7.7.1/rules/lib/toplevel/native). +[Native functions](/versions/7.7.3/reference/be/functions) and [native rules](/versions/7.7.3/reference/be/overview#language-specific-native-rules) are global symbols in +`BUILD` files. `bzl` files need to load them using the [`native` module](/versions/7.7.3/rules/lib/toplevel/native). There are two syntactic restrictions in `BUILD` files: 1) declaring functions is illegal, and 2) `*args` and `**kwargs` arguments are not allowed. @@ -128,7 +128,7 @@ error: `{"a": 4, "b": 7, "a": 1}`. * Strings are represented with double-quotes (such as when you call - [repr](/versions/7.7.1/rules/lib/globals#repr)). + [repr](/versions/7.7.3/rules/lib/globals#repr)). * Strings aren't iterable. @@ -136,12 +136,12 @@ * implicit string concatenation (use explicit `+` operator). * Chained comparisons (such as `1 < x < 5`). -* `class` (see [`struct`](/versions/7.7.1/rules/lib/builtins/struct#struct) function). -* `import` (see [`load`](/versions/7.7.1/extending/concepts#loading-an-extension) statement). +* `class` (see [`struct`](/versions/7.7.3/rules/lib/builtins/struct#struct) function). +* `import` (see [`load`](/versions/7.7.3/extending/concepts#loading-an-extension) statement). * `while`, `yield`. * float and set types. * generators and generator expressions. * `is` (use `==` instead). -* `try`, `raise`, `except`, `finally` (see [`fail`](/versions/7.7.1/rules/lib/globals#fail) for fatal errors). +* `try`, `raise`, `except`, `finally` (see [`fail`](/versions/7.7.3/rules/lib/globals#fail) for fatal errors). * `global`, `nonlocal`. * most builtin functions, most methods.
diff --git a/docs/versions/7.7.3/rules/lib/builtins.mdx b/docs/versions/7.7.3/rules/lib/builtins.mdx new file mode 100644 index 0000000..ce439e4 --- /dev/null +++ b/docs/versions/7.7.3/rules/lib/builtins.mdx
@@ -0,0 +1,62 @@ +--- +title: 'Built-in Types' +--- + +This section lists types of Starlark objects. With some exceptions, these type names are not valid Starlark symbols; instances of them may be acquired through different means. + +* [Action](/versions/7.7.3/rules/lib/builtins/Action) +* [actions](/versions/7.7.3/rules/lib/builtins/actions) +* [apple\_platform](/versions/7.7.3/rules/lib/builtins/apple_platform) +* [apple\_platform\_type](/versions/7.7.3/rules/lib/builtins/apple_platform_type) +* [apple\_toolchain](/versions/7.7.3/rules/lib/builtins/apple_toolchain) +* [Args](/versions/7.7.3/rules/lib/builtins/Args) +* [Aspect](/versions/7.7.3/rules/lib/builtins/Aspect) +* [Attribute](/versions/7.7.3/rules/lib/builtins/Attribute) +* [bazel\_module](/versions/7.7.3/rules/lib/builtins/bazel_module) +* [bazel\_module\_tags](/versions/7.7.3/rules/lib/builtins/bazel_module_tags) +* [BuildSetting](/versions/7.7.3/rules/lib/builtins/BuildSetting) +* [CcCompilationOutputs](/versions/7.7.3/rules/lib/builtins/CcCompilationOutputs) +* [CcLinkingOutputs](/versions/7.7.3/rules/lib/builtins/CcLinkingOutputs) +* [CompilationContext](/versions/7.7.3/rules/lib/builtins/CompilationContext) +* [configuration](/versions/7.7.3/rules/lib/builtins/configuration) +* [ctx](/versions/7.7.3/rules/lib/builtins/ctx) +* [depset](/versions/7.7.3/rules/lib/builtins/depset) +* [DirectoryExpander](/versions/7.7.3/rules/lib/builtins/DirectoryExpander) +* [DottedVersion](/versions/7.7.3/rules/lib/builtins/DottedVersion) +* [exec\_result](/versions/7.7.3/rules/lib/builtins/exec_result) +* [ExecGroupCollection](/versions/7.7.3/rules/lib/builtins/ExecGroupCollection) +* [ExecGroupContext](/versions/7.7.3/rules/lib/builtins/ExecGroupContext) +* [ExecTransitionFactory](/versions/7.7.3/rules/lib/builtins/ExecTransitionFactory) +* [extension\_metadata](/versions/7.7.3/rules/lib/builtins/extension_metadata) +* [FeatureConfiguration](/versions/7.7.3/rules/lib/builtins/FeatureConfiguration) +* [File](/versions/7.7.3/rules/lib/builtins/File) +* [fragments](/versions/7.7.3/rules/lib/builtins/fragments) +* [java\_annotation\_processing](/versions/7.7.3/rules/lib/builtins/java_annotation_processing) +* [Label](/versions/7.7.3/rules/lib/builtins/Label) +* [LateBoundDefault](/versions/7.7.3/rules/lib/builtins/LateBoundDefault) +* [LibraryToLink](/versions/7.7.3/rules/lib/builtins/LibraryToLink) +* [License](/versions/7.7.3/rules/lib/builtins/License) +* [LinkerInput](/versions/7.7.3/rules/lib/builtins/LinkerInput) +* [LinkingContext](/versions/7.7.3/rules/lib/builtins/LinkingContext) +* [mapped\_root](/versions/7.7.3/rules/lib/builtins/mapped_root) +* [module\_ctx](/versions/7.7.3/rules/lib/builtins/module_ctx) +* [native\_rule\_transition](/versions/7.7.3/rules/lib/builtins/native_rule_transition) +* [path](/versions/7.7.3/rules/lib/builtins/path) +* [Provider](/versions/7.7.3/rules/lib/builtins/Provider) +* [repository\_ctx](/versions/7.7.3/rules/lib/builtins/repository_ctx) +* [repository\_os](/versions/7.7.3/rules/lib/builtins/repository_os) +* [repository\_rule](/versions/7.7.3/rules/lib/builtins/repository_rule) +* [root](/versions/7.7.3/rules/lib/builtins/root) +* [rule](/versions/7.7.3/rules/lib/builtins/rule) +* [rule\_attributes](/versions/7.7.3/rules/lib/builtins/rule_attributes) +* [runfiles](/versions/7.7.3/rules/lib/builtins/runfiles) +* [struct](/versions/7.7.3/rules/lib/builtins/struct) +* [Subrule](/versions/7.7.3/rules/lib/builtins/Subrule) +* [subrule\_ctx](/versions/7.7.3/rules/lib/builtins/subrule_ctx) +* [SymlinkEntry](/versions/7.7.3/rules/lib/builtins/SymlinkEntry) +* [tag\_class](/versions/7.7.3/rules/lib/builtins/tag_class) +* [Target](/versions/7.7.3/rules/lib/builtins/Target) +* [TemplateDict](/versions/7.7.3/rules/lib/builtins/TemplateDict) +* [toolchain\_type](/versions/7.7.3/rules/lib/builtins/toolchain_type) +* [ToolchainContext](/versions/7.7.3/rules/lib/builtins/ToolchainContext) +* [transition](/versions/7.7.3/rules/lib/builtins/transition) \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/builtins/Action.mdx b/docs/versions/7.7.3/rules/lib/builtins/Action.mdx similarity index 79% rename from docs/versions/7.7.1/rules/lib/builtins/Action.mdx rename to docs/versions/7.7.3/rules/lib/builtins/Action.mdx index c745c19..0ffbd54 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/Action.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/Action.mdx
@@ -4,7 +4,7 @@ An action created during rule analysis. -This object is visible for the purpose of testing, and may be obtained from an `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](https://bazel.build/versions/7.7.1/extending/rules#actions) for a general discussion of how to use actions when defining custom rules, or the [API reference](/versions/7.7.1/rules/lib/builtins/actions) for creating actions. +This object is visible for the purpose of testing, and may be obtained from an `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](https://bazel.build/versions/7.7.3/extending/rules#actions) for a general discussion of how to use actions when defining custom rules, or the [API reference](/versions/7.7.3/rules/lib/builtins/actions) for creating actions. Some fields of this object are only applicable for certain kinds of actions. Fields that are inapplicable are set to `None`. @@ -25,7 +25,7 @@ sequence Action.args ``` -A list of frozen [Args](/versions/7.7.1/rules/lib/builtins/Args) objects containing information about the action arguments. These objects contain accurate argument information, including arguments involving expanded action output directories. However, [Args](/versions/7.7.1/rules/lib/builtins/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](#argv). +A list of frozen [Args](/versions/7.7.3/rules/lib/builtins/Args) objects containing information about the action arguments. These objects contain accurate argument information, including arguments involving expanded action output directories. However, [Args](/versions/7.7.3/rules/lib/builtins/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](#argv). Note that some types of actions do not yet support exposure of this field. For such action types, this is `None`. May return `None`. @@ -36,7 +36,7 @@ sequence Action.argv ``` -For actions created by [ctx.actions.run()](/versions/7.7.1/rules/lib/builtins/actions#run) or [ctx.actions.run\_shell()](/versions/7.7.1/rules/lib/builtins/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"`. +For actions created by [ctx.actions.run()](/versions/7.7.3/rules/lib/builtins/actions#run) or [ctx.actions.run\_shell()](/versions/7.7.3/rules/lib/builtins/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"`. May return `None`. ## content @@ -45,7 +45,7 @@ string Action.content ``` -For actions created by [ctx.actions.write()](/versions/7.7.1/rules/lib/builtins/actions#write) or [ctx.actions.expand\_template()](/versions/7.7.1/rules/lib/builtins/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](/versions/7.7.1/rules/lib/builtins/Args) object needs to be expanded. +For actions created by [ctx.actions.write()](/versions/7.7.3/rules/lib/builtins/actions#write) or [ctx.actions.expand\_template()](/versions/7.7.3/rules/lib/builtins/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](/versions/7.7.3/rules/lib/builtins/Args) object needs to be expanded. May return `None`. ## env @@ -86,5 +86,5 @@ dict Action.substitutions ``` -For actions created by [ctx.actions.expand\_template()](/versions/7.7.1/rules/lib/builtins/actions#expand_template), an immutable dict holding the substitution mapping. +For actions created by [ctx.actions.expand\_template()](/versions/7.7.3/rules/lib/builtins/actions#expand_template), an immutable dict holding the substitution mapping. May return `None`. \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/builtins/Args.mdx b/docs/versions/7.7.3/rules/lib/builtins/Args.mdx similarity index 91% rename from docs/versions/7.7.1/rules/lib/builtins/Args.mdx rename to docs/versions/7.7.3/rules/lib/builtins/Args.mdx index bda9cdb..893afae 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/Args.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/Args.mdx
@@ -4,15 +4,15 @@ An object that encapsulates, in a memory-efficient way, the data needed to build part or all of a command line. -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 [`depset`](/versions/7.7.1/rules/lib/builtins/depset)s, 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. +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 [`depset`](/versions/7.7.3/rules/lib/builtins/depset)s, 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. -For this reason, the action-constructing functions accept `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](https://bazel.build/versions/7.7.1/rules/performance) page for more information. +For this reason, the action-constructing functions accept `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](https://bazel.build/versions/7.7.3/rules/performance) page for more information. -`Args` are constructed by calling [`ctx.actions.args()`](/versions/7.7.1/rules/lib/builtins/actions#args). They can be passed as the `arguments` parameter of [`ctx.actions.run()`](/versions/7.7.1/rules/lib/builtins/actions#run) or [`ctx.actions.run_shell()`](/versions/7.7.1/rules/lib/builtins/actions#run_shell). Each mutation of an `Args` object appends values to the eventual command line. +`Args` are constructed by calling [`ctx.actions.args()`](/versions/7.7.3/rules/lib/builtins/actions#args). They can be passed as the `arguments` parameter of [`ctx.actions.run()`](/versions/7.7.3/rules/lib/builtins/actions#run) or [`ctx.actions.run_shell()`](/versions/7.7.3/rules/lib/builtins/actions#run_shell). Each mutation of an `Args` object appends values to the eventual command line. The `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: -* Values that are already strings are left as-is.* [`File`](/versions/7.7.1/rules/lib/builtins/File) objects are turned into their `File.path` values.* [`Label`](/versions/7.7.1/rules/lib/builtins/Label) objects are turned into a string representation that resolves back to the same object when resolved in the context of the main repository. If possible, the string representation uses the apparent name of a repository in favor of the repository's canonical name, which makes this representation suited for use in BUILD files. While the exact form of the representation is not guaranteed, typical examples are `//foo:bar`, `@repo//foo:bar` and `@@canonical_name~//foo:bar.bzl`.* All other types are turned into strings in an *unspecified* manner. For this reason, you should avoid passing values that are not of string or `File` type to `add()`, and if you pass them to `add_all()` or `add_joined()` then you should provide a `map_each` function. +* Values that are already strings are left as-is.* [`File`](/versions/7.7.3/rules/lib/builtins/File) objects are turned into their `File.path` values.* [`Label`](/versions/7.7.3/rules/lib/builtins/Label) objects are turned into a string representation that resolves back to the same object when resolved in the context of the main repository. If possible, the string representation uses the apparent name of a repository in favor of the repository's canonical name, which makes this representation suited for use in BUILD files. While the exact form of the representation is not guaranteed, typical examples are `//foo:bar`, `@repo//foo:bar` and `@@canonical_name~//foo:bar.bzl`.* All other types are turned into strings in an *unspecified* manner. For this reason, you should avoid passing values that are not of string or `File` type to `add()`, and if you pass them to `add_all()` or `add_joined()` then you should provide a `map_each` function. When using string formatting (`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. @@ -64,7 +64,7 @@ | --- | --- | | `arg_name_or_value` | required If two positional parameters are passed this is interpreted as the arg name. The arg name is added before the value without any processing. If only one positional parameter is passed, it is interpreted as `value` (see below). | | `value` | default is `unbound` 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()`](#add_joined) instead of this method.](#add_all) | -| `format` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A format string pattern, to be applied to the stringified version of `value`. | +| `format` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A format string pattern, to be applied to the stringified version of `value`. | ## add\_all @@ -86,14 +86,14 @@ | Parameter | Description | | --- | --- | | `arg_name_or_values` | required 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). | -| `values` | [sequence](/versions/7.7.1/rules/lib/core/list); or [depset](/versions/7.7.1/rules/lib/builtins/depset); default is `unbound` The list, tuple, or depset whose items will be appended. | -| `map_each` | callable; or `None`; default is `None` 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. The function is passed either one or two positional arguments: the item to convert, followed by an optional [`DirectoryExpander`](/versions/7.7.1/rules/lib/builtins/DirectoryExpander). The second argument will be passed only if the supplied function is user-defined (not built-in) and declares more than one parameter. The return value's type depends on how many arguments are to be produced for the item: * In the common case when each item turns into one string, the function should return that string.* If the item is to be filtered out entirely, the function should return `None`.* If the item turns into multiple strings, the function returns a list of those strings. Returning a single string or `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. Ordinarily, items that are directories are automatically expanded to their contents when `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. To avoid unintended retention of large analysis-phase data structures into the execution phase, the `map_each` function must be declared by a top-level `def` statement; it may not be a nested function closure by default. *Warning:* [`print()`](/versions/7.7.1/rules/lib/globals/all#print) statements that are executed during the call to `map_each` will not produce any visible output. | -| `format_each` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` An optional format string pattern, applied to each string returned by the `map_each` function. The format string must have exactly one '%s' placeholder. | -| `before_each` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` An optional argument to append before each argument derived from `values` is appended. | +| `values` | [sequence](/versions/7.7.3/rules/lib/core/list); or [depset](/versions/7.7.3/rules/lib/builtins/depset); default is `unbound` The list, tuple, or depset whose items will be appended. | +| `map_each` | callable; or `None`; default is `None` 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. The function is passed either one or two positional arguments: the item to convert, followed by an optional [`DirectoryExpander`](/versions/7.7.3/rules/lib/builtins/DirectoryExpander). The second argument will be passed only if the supplied function is user-defined (not built-in) and declares more than one parameter. The return value's type depends on how many arguments are to be produced for the item: * In the common case when each item turns into one string, the function should return that string.* If the item is to be filtered out entirely, the function should return `None`.* If the item turns into multiple strings, the function returns a list of those strings. Returning a single string or `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. Ordinarily, items that are directories are automatically expanded to their contents when `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. To avoid unintended retention of large analysis-phase data structures into the execution phase, the `map_each` function must be declared by a top-level `def` statement; it may not be a nested function closure by default. *Warning:* [`print()`](/versions/7.7.3/rules/lib/globals/all#print) statements that are executed during the call to `map_each` will not produce any visible output. | +| `format_each` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` An optional format string pattern, applied to each string returned by the `map_each` function. The format string must have exactly one '%s' placeholder. | +| `before_each` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` An optional argument to append before each argument derived from `values` is appended. | | `omit_if_empty` | default is `True` 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. | | `uniquify` | default is `False` 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. | | `expand_directories` | default is `True` If true, any directories in `values` will be expanded to a flat list of files. This happens before `map_each` is applied. | -| `terminate_with` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` 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). | +| `terminate_with` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` 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). | | `allow_closure` | default is `False` 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. | ## add\_joined @@ -113,11 +113,11 @@ | Parameter | Description | | --- | --- | | `arg_name_or_values` | required If two positional parameters are passed this is interpreted as the arg name. The arg name is added before `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). | -| `values` | [sequence](/versions/7.7.1/rules/lib/core/list); or [depset](/versions/7.7.1/rules/lib/builtins/depset); default is `unbound` The list, tuple, or depset whose items will be joined. | -| `join_with` | required A delimiter string used to join together the strings obtained from applying `map_each` and `format_each`, in the same manner as [`string.join()`](/versions/7.7.1/rules/lib/core/string#join). | +| `values` | [sequence](/versions/7.7.3/rules/lib/core/list); or [depset](/versions/7.7.3/rules/lib/builtins/depset); default is `unbound` The list, tuple, or depset whose items will be joined. | +| `join_with` | required A delimiter string used to join together the strings obtained from applying `map_each` and `format_each`, in the same manner as [`string.join()`](/versions/7.7.3/rules/lib/core/string#join). | | `map_each` | callable; or `None`; default is `None` Same as for [`add_all`](#add_all.map_each). | -| `format_each` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` Same as for [`add_all`](#add_all.format_each). | -| `format_joined` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` An optional format string pattern applied to the joined string. The format string must have exactly one '%s' placeholder. | +| `format_each` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` Same as for [`add_all`](#add_all.format_each). | +| `format_joined` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` An optional format string pattern applied to the joined string. The format string must have exactly one '%s' placeholder. | | `omit_if_empty` | default is `True` 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). | | `uniquify` | default is `False` Same as for [`add_all`](#add_all.uniquify). | | `expand_directories` | default is `True` Same as for [`add_all`](#add_all.expand_directories). |
diff --git a/docs/versions/7.7.1/rules/lib/builtins/Aspect.mdx b/docs/versions/7.7.3/rules/lib/builtins/Aspect.mdx similarity index 61% rename from docs/versions/7.7.1/rules/lib/builtins/Aspect.mdx rename to docs/versions/7.7.3/rules/lib/builtins/Aspect.mdx index bda09dd..c02e746 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/Aspect.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/Aspect.mdx
@@ -2,4 +2,4 @@ title: 'Aspect' --- -For more information about Aspects, please consult the [documentation of the aspect function](/versions/7.7.1/rules/lib/globals/bzl#aspect) or the [introduction to Aspects](https://bazel.build/versions/7.7.1/rules/aspects). \ No newline at end of file +For more information about Aspects, please consult the [documentation of the aspect function](/versions/7.7.3/rules/lib/globals/bzl#aspect) or the [introduction to Aspects](https://bazel.build/versions/7.7.3/rules/aspects). \ No newline at end of file
diff --git a/docs/versions/7.7.3/rules/lib/builtins/Attribute.mdx b/docs/versions/7.7.3/rules/lib/builtins/Attribute.mdx new file mode 100644 index 0000000..94de7a0 --- /dev/null +++ b/docs/versions/7.7.3/rules/lib/builtins/Attribute.mdx
@@ -0,0 +1,5 @@ +--- +title: 'Attribute' +--- + +Representation of a definition of an attribute. Use the [attr](/versions/7.7.3/rules/lib/toplevel/attr) module to create an Attribute. They are only for use with a [rule](/versions/7.7.3/rules/lib/globals/bzl#rule) or an [aspect](/versions/7.7.3/rules/lib/globals/bzl#aspect). \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/builtins/BuildSetting.mdx b/docs/versions/7.7.3/rules/lib/builtins/BuildSetting.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/BuildSetting.mdx rename to docs/versions/7.7.3/rules/lib/builtins/BuildSetting.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/CcCompilationOutputs.mdx b/docs/versions/7.7.3/rules/lib/builtins/CcCompilationOutputs.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/CcCompilationOutputs.mdx rename to docs/versions/7.7.3/rules/lib/builtins/CcCompilationOutputs.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/CcLinkingOutputs.mdx b/docs/versions/7.7.3/rules/lib/builtins/CcLinkingOutputs.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/CcLinkingOutputs.mdx rename to docs/versions/7.7.3/rules/lib/builtins/CcLinkingOutputs.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/CompilationContext.mdx b/docs/versions/7.7.3/rules/lib/builtins/CompilationContext.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/CompilationContext.mdx rename to docs/versions/7.7.3/rules/lib/builtins/CompilationContext.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/DirectoryExpander.mdx b/docs/versions/7.7.3/rules/lib/builtins/DirectoryExpander.mdx similarity index 81% rename from docs/versions/7.7.1/rules/lib/builtins/DirectoryExpander.mdx rename to docs/versions/7.7.3/rules/lib/builtins/DirectoryExpander.mdx index 93881f4..42a06de 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/DirectoryExpander.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/DirectoryExpander.mdx
@@ -2,7 +2,7 @@ title: 'DirectoryExpander' --- -Expands directories created by [`ctx.actions.declare_directory`](/versions/7.7.1/rules/lib/builtins/actions#declare_directory) during the execution phase. This is useful to expand directories in [`map_each`](/versions/7.7.1/rules/lib/builtins/Args#add_all.map_each). +Expands directories created by [`ctx.actions.declare_directory`](/versions/7.7.3/rules/lib/builtins/actions#declare_directory) during the execution phase. This is useful to expand directories in [`map_each`](/versions/7.7.3/rules/lib/builtins/Args#add_all.map_each). ## Members
diff --git a/docs/versions/7.7.1/rules/lib/builtins/DottedVersion.mdx b/docs/versions/7.7.3/rules/lib/builtins/DottedVersion.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/DottedVersion.mdx rename to docs/versions/7.7.3/rules/lib/builtins/DottedVersion.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/ExecGroupCollection.mdx b/docs/versions/7.7.3/rules/lib/builtins/ExecGroupCollection.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/ExecGroupCollection.mdx rename to docs/versions/7.7.3/rules/lib/builtins/ExecGroupCollection.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/ExecGroupContext.mdx b/docs/versions/7.7.3/rules/lib/builtins/ExecGroupContext.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/ExecGroupContext.mdx rename to docs/versions/7.7.3/rules/lib/builtins/ExecGroupContext.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/ExecTransitionFactory.mdx b/docs/versions/7.7.3/rules/lib/builtins/ExecTransitionFactory.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/ExecTransitionFactory.mdx rename to docs/versions/7.7.3/rules/lib/builtins/ExecTransitionFactory.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/FeatureConfiguration.mdx b/docs/versions/7.7.3/rules/lib/builtins/FeatureConfiguration.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/FeatureConfiguration.mdx rename to docs/versions/7.7.3/rules/lib/builtins/FeatureConfiguration.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/File.mdx b/docs/versions/7.7.3/rules/lib/builtins/File.mdx similarity index 91% rename from docs/versions/7.7.1/rules/lib/builtins/File.mdx rename to docs/versions/7.7.3/rules/lib/builtins/File.mdx index 637074f..d2ec161 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/File.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/File.mdx
@@ -2,9 +2,9 @@ title: 'File' --- -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](https://bazel.build/versions/7.7.1/extending/rules#files) for more information. +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](https://bazel.build/versions/7.7.3/extending/rules#files) for more information. -When a `File` is passed to an [`Args`](/versions/7.7.1/rules/lib/builtins/Args) object without using a `map_each` function, it is converted to a string by taking the value of its `path` field. +When a `File` is passed to an [`Args`](/versions/7.7.3/rules/lib/builtins/Args) object without using a `map_each` function, it is converted to a string by taking the value of its `path` field. ## Members @@ -74,7 +74,7 @@ string File.path ``` -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](/versions/7.7.1/rules/lib/builtins/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. +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](/versions/7.7.3/rules/lib/builtins/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. ## root @@ -98,4 +98,4 @@ string File.tree_relative_path ``` -The path of this file relative to the root of the ancestor's tree, if the ancestor's [is\_directory](#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()](/versions/7.7.1/rules/lib/builtins/Args#add_all). For other types of files, it is an error to access this field. \ No newline at end of file +The path of this file relative to the root of the ancestor's tree, if the ancestor's [is\_directory](#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()](/versions/7.7.3/rules/lib/builtins/Args#add_all). For other types of files, it is an error to access this field. \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/builtins/Label.mdx b/docs/versions/7.7.3/rules/lib/builtins/Label.mdx similarity index 94% rename from docs/versions/7.7.1/rules/lib/builtins/Label.mdx rename to docs/versions/7.7.3/rules/lib/builtins/Label.mdx index 4ea18d3..b1a46cc 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/Label.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/Label.mdx
@@ -6,7 +6,7 @@ For every `Label` instance `l`, the string representation `str(l)` has the property that `Label(str(l)) == l`, regardless of where the `Label()` call occurs. -When passed as positional arguments to `print()` or `fail()`, `Label` use a string representation optimized for human readability instead. This representation uses an [apparent repository name](/versions/7.7.1/external/overview#apparent-repo-name) from the perspective of the main repository if possible. +When passed as positional arguments to `print()` or `fail()`, `Label` use a string representation optimized for human readability instead. This representation uses an [apparent repository name](/versions/7.7.3/external/overview#apparent-repo-name) from the perspective of the main repository if possible. ## Members @@ -33,7 +33,7 @@ | Parameter | Description | | --- | --- | -| `input` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); required The input label string or Label object. If a Label object is passed, it's returned as is. | +| `input` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); required The input label string or Label object. If a Label object is passed, it's returned as is. | ## name @@ -66,7 +66,7 @@ ``` **Experimental**. This API is experimental and may change at any time. Please do not depend on it. It may be enabled on an experimental basis by setting `--+incompatible_enable_deprecated_label_apis` -**Deprecated.** This method behaves surprisingly when used with an argument containing an apparent repo name. Prefer [`Label.same_package_label()`](#local_target_label), [`native.package_relative_label()`](/versions/7.7.1/rules/lib/toplevel/native#package_relative_label), or [`Label()`](#Label) instead. +**Deprecated.** This method behaves surprisingly when used with an argument containing an apparent repo name. Prefer [`Label.same_package_label()`](#local_target_label), [`native.package_relative_label()`](/versions/7.7.3/rules/lib/toplevel/native#package_relative_label), or [`Label()`](#Label) instead. 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:
diff --git a/docs/versions/7.7.1/rules/lib/builtins/LateBoundDefault.mdx b/docs/versions/7.7.3/rules/lib/builtins/LateBoundDefault.mdx similarity index 86% rename from docs/versions/7.7.1/rules/lib/builtins/LateBoundDefault.mdx rename to docs/versions/7.7.3/rules/lib/builtins/LateBoundDefault.mdx index 4931160..d977717 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/LateBoundDefault.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/LateBoundDefault.mdx
@@ -4,4 +4,4 @@ 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. -See [configuration\_field](/versions/7.7.1/rules/lib/globals/bzl#configuration_field) for example usage. \ No newline at end of file +See [configuration\_field](/versions/7.7.3/rules/lib/globals/bzl#configuration_field) for example usage. \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/builtins/LibraryToLink.mdx b/docs/versions/7.7.3/rules/lib/builtins/LibraryToLink.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/LibraryToLink.mdx rename to docs/versions/7.7.3/rules/lib/builtins/LibraryToLink.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/License.mdx b/docs/versions/7.7.3/rules/lib/builtins/License.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/License.mdx rename to docs/versions/7.7.3/rules/lib/builtins/License.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/LinkerInput.mdx b/docs/versions/7.7.3/rules/lib/builtins/LinkerInput.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/LinkerInput.mdx rename to docs/versions/7.7.3/rules/lib/builtins/LinkerInput.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/LinkingContext.mdx b/docs/versions/7.7.3/rules/lib/builtins/LinkingContext.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/LinkingContext.mdx rename to docs/versions/7.7.3/rules/lib/builtins/LinkingContext.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/Provider.mdx b/docs/versions/7.7.3/rules/lib/builtins/Provider.mdx similarity index 84% rename from docs/versions/7.7.1/rules/lib/builtins/Provider.mdx rename to docs/versions/7.7.3/rules/lib/builtins/Provider.mdx index d703947..fe8b6bd 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/Provider.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/Provider.mdx
@@ -14,7 +14,7 @@ ``` Note: Some providers, defined internally, do not allow instance creation -* It is a *key* to access a provider instance on a [Target](/versions/7.7.1/rules/lib/builtins/Target) +* It is a *key* to access a provider instance on a [Target](/versions/7.7.3/rules/lib/builtins/Target) ``` DataInfo = provider() @@ -22,4 +22,4 @@ ... ctx.attr.dep[DataInfo] ``` -Create a new `Provider` using the [provider](/versions/7.7.1/rules/lib/globals/bzl#provider) function. \ No newline at end of file +Create a new `Provider` using the [provider](/versions/7.7.3/rules/lib/globals/bzl#provider) function. \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/builtins/Subrule.mdx b/docs/versions/7.7.3/rules/lib/builtins/Subrule.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/Subrule.mdx rename to docs/versions/7.7.3/rules/lib/builtins/Subrule.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/SymlinkEntry.mdx b/docs/versions/7.7.3/rules/lib/builtins/SymlinkEntry.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/SymlinkEntry.mdx rename to docs/versions/7.7.3/rules/lib/builtins/SymlinkEntry.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/Target.mdx b/docs/versions/7.7.3/rules/lib/builtins/Target.mdx similarity index 83% rename from docs/versions/7.7.1/rules/lib/builtins/Target.mdx rename to docs/versions/7.7.3/rules/lib/builtins/Target.mdx index c760e2d..e8340cf 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/Target.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/Target.mdx
@@ -2,7 +2,7 @@ title: 'Target' --- -The BUILD target for a dependency. Appears in the fields of `ctx.attr` corresponding to [dependency attributes](https://bazel.build/versions/7.7.1/extending/rules#dependency_attributes) (`label` or `label_list`). Has the following fields: +The BUILD target for a dependency. Appears in the fields of `ctx.attr` corresponding to [dependency attributes](https://bazel.build/versions/7.7.3/extending/rules#dependency_attributes) (`label` or `label_list`). Has the following fields: * ### label @@ -18,6 +18,6 @@ The list of `aspect_ids` applied to this target. * ### Providers - The [providers](https://bazel.build/versions/7.7.1/extending/rules#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`). + The [providers](https://bazel.build/versions/7.7.3/extending/rules#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`). - If 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](https://bazel.build/versions/7.7.1/extending/rules#migrating_from_legacy_providers). \ No newline at end of file + If 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](https://bazel.build/versions/7.7.3/extending/rules#migrating_from_legacy_providers). \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/builtins/TemplateDict.mdx b/docs/versions/7.7.3/rules/lib/builtins/TemplateDict.mdx similarity index 90% rename from docs/versions/7.7.1/rules/lib/builtins/TemplateDict.mdx rename to docs/versions/7.7.3/rules/lib/builtins/TemplateDict.mdx index 6016da1..4fc6381 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/TemplateDict.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/TemplateDict.mdx
@@ -37,9 +37,9 @@ | Parameter | Description | | --- | --- | | `key` | required A String key | -| `values` | [depset](/versions/7.7.1/rules/lib/builtins/depset); required The depset whose items will be joined. | -| `join_with` | required A delimiter string used to join together the strings obtained from applying `map_each`, in the same manner as [`string.join()`](/versions/7.7.1/rules/lib/core/string#join). | +| `values` | [depset](/versions/7.7.3/rules/lib/builtins/depset); required The depset whose items will be joined. | +| `join_with` | required A delimiter string used to join together the strings obtained from applying `map_each`, in the same manner as [`string.join()`](/versions/7.7.3/rules/lib/core/string#join). | | `map_each` | callable; required 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 | | `uniquify` | default is `False` 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. | -| `format_joined` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` An optional format string pattern applied to the joined string. The format string must have exactly one '%s' placeholder. | +| `format_joined` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` An optional format string pattern applied to the joined string. The format string must have exactly one '%s' placeholder. | | `allow_closure` | default is `False` 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. | \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/builtins/ToolchainContext.mdx b/docs/versions/7.7.3/rules/lib/builtins/ToolchainContext.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/ToolchainContext.mdx rename to docs/versions/7.7.3/rules/lib/builtins/ToolchainContext.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/actions.mdx b/docs/versions/7.7.3/rules/lib/builtins/actions.mdx similarity index 80% rename from docs/versions/7.7.1/rules/lib/builtins/actions.mdx rename to docs/versions/7.7.3/rules/lib/builtins/actions.mdx index 7b2d548..962b8b9 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/actions.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/actions.mdx
@@ -2,7 +2,7 @@ title: 'actions' --- -Module providing functions to create actions. Access this module using [`ctx.actions`](/versions/7.7.1/rules/lib/builtins/ctx#actions). +Module providing functions to create actions. Access this module using [`ctx.actions`](/versions/7.7.3/rules/lib/builtins/ctx#actions). ## Members @@ -32,14 +32,14 @@ File actions.declare_directory(filename, *, sibling=None) ``` -Declares that the rule or aspect creates a directory with the given name, in the current package. You must create an action that generates the directory. The contents of the directory are not directly accessible from Starlark, but can be expanded in an action command with [`Args.add_all()`](/versions/7.7.1/rules/lib/builtins/Args#add_all). Only regular files and directories can be in the expanded contents of a declare\_directory. +Declares that the rule or aspect creates a directory with the given name, in the current package. You must create an action that generates the directory. The contents of the directory are not directly accessible from Starlark, but can be expanded in an action command with [`Args.add_all()`](/versions/7.7.3/rules/lib/builtins/Args#add_all). Only regular files and directories can be in the expanded contents of a declare\_directory. ### Parameters | Parameter | Description | | --- | --- | | `filename` | required 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). | -| `sibling` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` A file that lives in the same directory as the newly declared directory. The file must be in the current package. | +| `sibling` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` A file that lives in the same directory as the newly declared directory. The file must be in the current package. | ## declare\_file @@ -51,14 +51,14 @@ 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 `File` object to the action's construction function. -Note that [predeclared output files](https://bazel.build/versions/7.7.1/extending/rules#files) do not need to be (and cannot be) declared using this function. You can obtain their `File` objects from [`ctx.outputs`](/versions/7.7.1/rules/lib/builtins/ctx#outputs) instead. [See example of use](https://github.com/bazelbuild/examples/tree/main/rules/computed_dependencies/hash.bzl). +Note that [predeclared output files](https://bazel.build/versions/7.7.3/extending/rules#files) do not need to be (and cannot be) declared using this function. You can obtain their `File` objects from [`ctx.outputs`](/versions/7.7.3/rules/lib/builtins/ctx#outputs) instead. [See example of use](https://github.com/bazelbuild/examples/tree/main/rules/computed_dependencies/hash.bzl). ### Parameters | Parameter | Description | | --- | --- | | `filename` | required 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). | -| `sibling` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` A file that lives in the same directory as the newly created file. The file must be in the current package. | +| `sibling` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` A file that lives in the same directory as the newly created file. The file must be in the current package. | ## declare\_symlink @@ -73,7 +73,7 @@ | Parameter | Description | | --- | --- | | `filename` | required 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). | -| `sibling` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` A file that lives in the same directory as the newly declared symlink. | +| `sibling` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` A file that lives in the same directory as the newly declared symlink. | ## do\_nothing @@ -88,7 +88,7 @@ | Parameter | Description | | --- | --- | | `mnemonic` | required A one-word description of the action, for example, CppCompile or GoLink. | -| `inputs` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; or [depset](/versions/7.7.1/rules/lib/builtins/depset); default is `[]` List of the input files of the action. | +| `inputs` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; or [depset](/versions/7.7.3/rules/lib/builtins/depset); default is `[]` List of the input files of the action. | ## expand\_template @@ -106,7 +106,7 @@ | `output` | required The output file, which is a UTF-8 encoded text file. | | `substitutions` | default is `{}` Substitutions to make when expanding the template. | | `is_executable` | default is `False` Whether the output file should be executable. | -| `computed_substitutions` | [TemplateDict](/versions/7.7.1/rules/lib/builtins/TemplateDict); default is `unbound` Substitutions to make when expanding the template. | +| `computed_substitutions` | [TemplateDict](/versions/7.7.3/rules/lib/builtins/TemplateDict); default is `unbound` Substitutions to make when expanding the template. | ## run @@ -120,22 +120,22 @@ | Parameter | Description | | --- | --- | -| `outputs` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; required List of the output files of the action. | -| `inputs` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; or [depset](/versions/7.7.1/rules/lib/builtins/depset); default is `[]` List or depset of the input files of the action. | -| `unused_inputs_list` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` File containing list of inputs unused by the action. 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. | -| `executable` | [File](/versions/7.7.1/rules/lib/builtins/File); or [string](/versions/7.7.1/rules/lib/core/string); or [FilesToRunProvider](/versions/7.7.1/rules/lib/providers/FilesToRunProvider); required The executable file to be called by the action. | -| `tools` | [sequence](/versions/7.7.1/rules/lib/core/list); or [depset](/versions/7.7.1/rules/lib/builtins/depset); default is `unbound` 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. | -| `arguments` | [sequence](/versions/7.7.1/rules/lib/core/list); default is `[]` Command line arguments of the action. Must be a list of strings or [`actions.args()`](#args) objects. | -| `mnemonic` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A one-word description of the action, for example, CppCompile or GoLink. | -| `progress_message` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` 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. | -| `use_default_shell_env` | default is `False` 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`](/versions/7.7.1/reference/command-line-reference#flag--action_env). If both `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`](/versions/7.7.1/reference/command-line-reference#flag--incompatible_merge_fixed_and_default_shell_env) is enabled (default). If the flag is not enabled, `env` is ignored. | -| `env` | [dict](/versions/7.7.1/rules/lib/core/dict); or `None`; default is `None` Sets the dictionary of environment variables. If both `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`](/versions/7.7.1/reference/command-line-reference#flag--incompatible_merge_fixed_and_default_shell_env) is enabled (default). If the flag is not enabled, `env` is ignored. | -| `execution_requirements` | [dict](/versions/7.7.1/rules/lib/core/dict); or `None`; default is `None` Information for scheduling the action. See [tags](/versions/7.7.1/reference/be/common-definitions#common.tags) for useful keys. | -| `input_manifests` | [sequence](/versions/7.7.1/rules/lib/core/list); or `None`; default is `None` (Experimental) sets the input runfiles metadata; they are typically generated by resolve\_command. | -| `exec_group` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` Runs the action on the given exec group's execution platform. If none, uses the target's default execution platform. | -| `shadowed_action` | [Action](/versions/7.7.1/rules/lib/builtins/Action); default is `None` 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. | +| `outputs` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; required List of the output files of the action. | +| `inputs` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; or [depset](/versions/7.7.3/rules/lib/builtins/depset); default is `[]` List or depset of the input files of the action. | +| `unused_inputs_list` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` File containing list of inputs unused by the action. 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. | +| `executable` | [File](/versions/7.7.3/rules/lib/builtins/File); or [string](/versions/7.7.3/rules/lib/core/string); or [FilesToRunProvider](/versions/7.7.3/rules/lib/providers/FilesToRunProvider); required The executable file to be called by the action. | +| `tools` | [sequence](/versions/7.7.3/rules/lib/core/list); or [depset](/versions/7.7.3/rules/lib/builtins/depset); default is `unbound` 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. | +| `arguments` | [sequence](/versions/7.7.3/rules/lib/core/list); default is `[]` Command line arguments of the action. Must be a list of strings or [`actions.args()`](#args) objects. | +| `mnemonic` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A one-word description of the action, for example, CppCompile or GoLink. | +| `progress_message` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` 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. | +| `use_default_shell_env` | default is `False` 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`](/versions/7.7.3/reference/command-line-reference#flag--action_env). If both `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`](/versions/7.7.3/reference/command-line-reference#flag--incompatible_merge_fixed_and_default_shell_env) is enabled (default). If the flag is not enabled, `env` is ignored. | +| `env` | [dict](/versions/7.7.3/rules/lib/core/dict); or `None`; default is `None` Sets the dictionary of environment variables. If both `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`](/versions/7.7.3/reference/command-line-reference#flag--incompatible_merge_fixed_and_default_shell_env) is enabled (default). If the flag is not enabled, `env` is ignored. | +| `execution_requirements` | [dict](/versions/7.7.3/rules/lib/core/dict); or `None`; default is `None` Information for scheduling the action. See [tags](/versions/7.7.3/reference/be/common-definitions#common.tags) for useful keys. | +| `input_manifests` | [sequence](/versions/7.7.3/rules/lib/core/list); or `None`; default is `None` (Experimental) sets the input runfiles metadata; they are typically generated by resolve\_command. | +| `exec_group` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` Runs the action on the given exec group's execution platform. If none, uses the target's default execution platform. | +| `shadowed_action` | [Action](/versions/7.7.3/rules/lib/builtins/Action); default is `None` 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. | | `resource_set` | callable; or `None`; default is `None` A callback function that returns a resource set dictionary, used to estimate resource usage at execution time if this action is run locally. 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: * "cpu": number of CPUs; default 1* "memory": in MB; default 250* "local\_test": number of local tests; default 1 If this parameter is set to `None` , the default values are used. The callback must be top-level (lambda and nested functions aren't allowed). | -| `toolchain` | [Label](/versions/7.7.1/rules/lib/builtins/Label); or [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `unbound` 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` | [Label](/versions/7.7.3/rules/lib/builtins/Label); or [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `unbound` 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. | ## run\_shell @@ -149,21 +149,21 @@ | Parameter | Description | | --- | --- | -| `outputs` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; required List of the output files of the action. | -| `inputs` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; or [depset](/versions/7.7.1/rules/lib/builtins/depset); default is `[]` List or depset of the input files of the action. | -| `tools` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; or [depset](/versions/7.7.1/rules/lib/builtins/depset); default is `unbound` 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. | -| `arguments` | [sequence](/versions/7.7.1/rules/lib/core/list); default is `[]` Command line arguments of the action. Must be a list of strings or [`actions.args()`](#args) objects. Bazel passes the elements in this attribute as arguments to the command.The command can access these arguments using shell variable substitutions such as `$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. In the case where `command` is a list of strings, this parameter may not be used. | -| `mnemonic` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A one-word description of the action, for example, CppCompile or GoLink. | -| `command` | [string](/versions/7.7.1/rules/lib/core/string); or [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; required Shell command to execute. This may either be a string (preferred) or a sequence of strings **(deprecated)**. If `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()`](#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. **(Deprecated)** If `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.* Bazel uses the same shell to execute the command as it does for genrules. | -| `progress_message` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` 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. | -| `use_default_shell_env` | default is `False` 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`](/versions/7.7.1/reference/command-line-reference#flag--action_env). If both `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`](/versions/7.7.1/reference/command-line-reference#flag--incompatible_merge_fixed_and_default_shell_env) is enabled (default). If the flag is not enabled, `env` is ignored. | -| `env` | [dict](/versions/7.7.1/rules/lib/core/dict); or `None`; default is `None` Sets the dictionary of environment variables. If both `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`](/versions/7.7.1/reference/command-line-reference#flag--incompatible_merge_fixed_and_default_shell_env) is enabled (default). If the flag is not enabled, `env` is ignored. | -| `execution_requirements` | [dict](/versions/7.7.1/rules/lib/core/dict); or `None`; default is `None` Information for scheduling the action. See [tags](/versions/7.7.1/reference/be/common-definitions#common.tags) for useful keys. | -| `input_manifests` | [sequence](/versions/7.7.1/rules/lib/core/list); or `None`; default is `None` (Experimental) sets the input runfiles metadata; they are typically generated by resolve\_command. | -| `exec_group` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` Runs the action on the given exec group's execution platform. If none, uses the target's default execution platform. | -| `shadowed_action` | [Action](/versions/7.7.1/rules/lib/builtins/Action); default is `None` 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. | +| `outputs` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; required List of the output files of the action. | +| `inputs` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; or [depset](/versions/7.7.3/rules/lib/builtins/depset); default is `[]` List or depset of the input files of the action. | +| `tools` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; or [depset](/versions/7.7.3/rules/lib/builtins/depset); default is `unbound` 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. | +| `arguments` | [sequence](/versions/7.7.3/rules/lib/core/list); default is `[]` Command line arguments of the action. Must be a list of strings or [`actions.args()`](#args) objects. Bazel passes the elements in this attribute as arguments to the command.The command can access these arguments using shell variable substitutions such as `$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. In the case where `command` is a list of strings, this parameter may not be used. | +| `mnemonic` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A one-word description of the action, for example, CppCompile or GoLink. | +| `command` | [string](/versions/7.7.3/rules/lib/core/string); or [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; required Shell command to execute. This may either be a string (preferred) or a sequence of strings **(deprecated)**. If `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()`](#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. **(Deprecated)** If `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.* Bazel uses the same shell to execute the command as it does for genrules. | +| `progress_message` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` 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. | +| `use_default_shell_env` | default is `False` 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`](/versions/7.7.3/reference/command-line-reference#flag--action_env). If both `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`](/versions/7.7.3/reference/command-line-reference#flag--incompatible_merge_fixed_and_default_shell_env) is enabled (default). If the flag is not enabled, `env` is ignored. | +| `env` | [dict](/versions/7.7.3/rules/lib/core/dict); or `None`; default is `None` Sets the dictionary of environment variables. If both `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`](/versions/7.7.3/reference/command-line-reference#flag--incompatible_merge_fixed_and_default_shell_env) is enabled (default). If the flag is not enabled, `env` is ignored. | +| `execution_requirements` | [dict](/versions/7.7.3/rules/lib/core/dict); or `None`; default is `None` Information for scheduling the action. See [tags](/versions/7.7.3/reference/be/common-definitions#common.tags) for useful keys. | +| `input_manifests` | [sequence](/versions/7.7.3/rules/lib/core/list); or `None`; default is `None` (Experimental) sets the input runfiles metadata; they are typically generated by resolve\_command. | +| `exec_group` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` Runs the action on the given exec group's execution platform. If none, uses the target's default execution platform. | +| `shadowed_action` | [Action](/versions/7.7.3/rules/lib/builtins/Action); default is `None` 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. | | `resource_set` | callable; or `None`; default is `None` A callback function for estimating resource usage if run locally. See[`ctx.actions.run()`](#run.resource_set). | -| `toolchain` | [Label](/versions/7.7.1/rules/lib/builtins/Label); or [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `unbound` 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. | +| `toolchain` | [Label](/versions/7.7.3/rules/lib/builtins/Label); or [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `unbound` 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. | ## symlink @@ -184,10 +184,10 @@ | Parameter | Description | | --- | --- | | `output` | required The output of this action. | -| `target_file` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` The File that the output symlink will point to. | -| `target_path` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` The exact path that the output symlink will point to. No normalization or other processing is applied. | +| `target_file` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` The File that the output symlink will point to. | +| `target_path` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` The exact path that the output symlink will point to. No normalization or other processing is applied. | | `is_executable` | default is `False` 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. This feature does not make sense for `target_path` because dangling symlinks might not exist at build time. | -| `progress_message` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` Progress message to show to the user during the build. | +| `progress_message` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` Progress message to show to the user during the build. | ## template\_dict @@ -210,5 +210,5 @@ | Parameter | Description | | --- | --- | | `output` | required The output file. | -| `content` | [string](/versions/7.7.1/rules/lib/core/string); or [Args](/versions/7.7.1/rules/lib/builtins/Args); required the contents of the file. May be a either a string or an [`actions.args()`](#args) object. | +| `content` | [string](/versions/7.7.3/rules/lib/core/string); or [Args](/versions/7.7.3/rules/lib/builtins/Args); required the contents of the file. May be a either a string or an [`actions.args()`](#args) object. | | `is_executable` | default is `False` Whether the output file should be executable. | \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/builtins/apple_platform.mdx b/docs/versions/7.7.3/rules/lib/builtins/apple_platform.mdx similarity index 93% rename from docs/versions/7.7.1/rules/lib/builtins/apple_platform.mdx rename to docs/versions/7.7.3/rules/lib/builtins/apple_platform.mdx index b9c2559..4ee7415 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/apple_platform.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/apple_platform.mdx
@@ -4,7 +4,7 @@ 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. -Specific instances of this type can be retrieved from the fields of the [apple\_common.platform](/versions/7.7.1/rules/lib/toplevel/apple_common#platform) struct: +Specific instances of this type can be retrieved from the fields of the [apple\_common.platform](/versions/7.7.3/rules/lib/toplevel/apple_common#platform) struct: * `apple_common.platform.ios_device` * `apple_common.platform.ios_simulator` @@ -14,7 +14,7 @@ * `apple_common.platform.watchos_device` * `apple_common.platform.watchos_simulator` -More commonly, however, the [apple](/versions/7.7.1/rules/lib/fragments/apple) configuration fragment has fields/methods that allow rules to determine the platform for which a target is being built. +More commonly, however, the [apple](/versions/7.7.3/rules/lib/fragments/apple) configuration fragment has fields/methods that allow rules to determine the platform for which a target is being built. Example:
diff --git a/docs/versions/7.7.1/rules/lib/builtins/apple_platform_type.mdx b/docs/versions/7.7.3/rules/lib/builtins/apple_platform_type.mdx similarity index 84% rename from docs/versions/7.7.1/rules/lib/builtins/apple_platform_type.mdx rename to docs/versions/7.7.3/rules/lib/builtins/apple_platform_type.mdx index b25eb05..5cc1fb4 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/apple_platform_type.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/apple_platform_type.mdx
@@ -4,7 +4,7 @@ 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. -Specific instances of this type can be retrieved by accessing the fields of the [apple\_common.platform\_type](/versions/7.7.1/rules/lib/toplevel/apple_common#platform_type): +Specific instances of this type can be retrieved by accessing the fields of the [apple\_common.platform\_type](/versions/7.7.3/rules/lib/toplevel/apple_common#platform_type): * `apple_common.platform_type.ios` * `apple_common.platform_type.macos` @@ -13,4 +13,4 @@ Likewise, the platform type of an existing platform value can be retrieved using its `platform_type` field. -Platform types can be converted to a lowercase string (e.g., `ios` or `macos`) using the [str](/versions/7.7.1/rules/lib/globals/all#str) function. \ No newline at end of file +Platform types can be converted to a lowercase string (e.g., `ios` or `macos`) using the [str](/versions/7.7.3/rules/lib/globals/all#str) function. \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/builtins/apple_toolchain.mdx b/docs/versions/7.7.3/rules/lib/builtins/apple_toolchain.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/apple_toolchain.mdx rename to docs/versions/7.7.3/rules/lib/builtins/apple_toolchain.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/bazel_module.mdx b/docs/versions/7.7.3/rules/lib/builtins/bazel_module.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/bazel_module.mdx rename to docs/versions/7.7.3/rules/lib/builtins/bazel_module.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/bazel_module_tags.mdx b/docs/versions/7.7.3/rules/lib/builtins/bazel_module_tags.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/bazel_module_tags.mdx rename to docs/versions/7.7.3/rules/lib/builtins/bazel_module_tags.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/configuration.mdx b/docs/versions/7.7.3/rules/lib/builtins/configuration.mdx similarity index 93% rename from docs/versions/7.7.1/rules/lib/builtins/configuration.mdx rename to docs/versions/7.7.3/rules/lib/builtins/configuration.mdx index 5553a4c..1fc055b 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/configuration.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/configuration.mdx
@@ -2,7 +2,7 @@ title: 'configuration' --- -This object holds information about the environment in which the build is running. See the [Rules page](https://bazel.build/versions/7.7.1/extending/rules#configurations) for more on the general concept of configurations. +This object holds information about the environment in which the build is running. See the [Rules page](https://bazel.build/versions/7.7.3/extending/rules#configurations) for more on the general concept of configurations. ## Members @@ -18,7 +18,7 @@ bool configuration.coverage_enabled ``` -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`](/versions/7.7.1/rules/lib/builtins/ctx#coverage_instrumented) function. +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`](/versions/7.7.3/rules/lib/builtins/ctx#coverage_instrumented) function. ## default\_shell\_env
diff --git a/docs/versions/7.7.1/rules/lib/builtins/ctx.mdx b/docs/versions/7.7.3/rules/lib/builtins/ctx.mdx similarity index 82% rename from docs/versions/7.7.1/rules/lib/builtins/ctx.mdx rename to docs/versions/7.7.3/rules/lib/builtins/ctx.mdx index f60c364..0d924ff 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/ctx.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/ctx.mdx
@@ -6,7 +6,7 @@ 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](https://bazel.build/versions/7.7.1/extending/rules#implementation_function) for more information. +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](https://bazel.build/versions/7.7.3/extending/rules#implementation_function) for more information. ## Members @@ -66,7 +66,7 @@ struct ctx.attr ``` -A struct to access the values of the [attributes](https://bazel.build/versions/7.7.1/extending/rules#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](/versions/7.7.1/rules/lib/globals/bzl#rule.attrs) provided to the [`rule` function](/versions/7.7.1/rules/lib/globals/bzl#rule). [See example of use](https://github.com/bazelbuild/examples/blob/main/rules/attributes/printer.bzl). +A struct to access the values of the [attributes](https://bazel.build/versions/7.7.3/extending/rules#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](/versions/7.7.3/rules/lib/globals/bzl#rule.attrs) provided to the [`rule` function](/versions/7.7.3/rules/lib/globals/bzl#rule). [See example of use](https://github.com/bazelbuild/examples/blob/main/rules/attributes/printer.bzl). ## bin\_dir @@ -90,7 +90,7 @@ unknown ctx.build_setting_value ``` -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`](https://bazel.build/versions/7.7.1/extending/config#rule-parameter) attribute, reading this is an error. +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`](https://bazel.build/versions/7.7.3/extending/config#rule-parameter) attribute, reading this is an error. ## configuration @@ -98,7 +98,7 @@ configuration ctx.configuration ``` -The default configuration. See the [configuration](/versions/7.7.1/rules/lib/builtins/configuration) type for more details. +The default configuration. See the [configuration](/versions/7.7.3/rules/lib/builtins/configuration) type for more details. ## coverage\_instrumented @@ -106,13 +106,13 @@ bool ctx.coverage_instrumented(target=None) ``` -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](/versions/7.7.1/rules/lib/builtins/configuration), which notes whether coverage data collection is enabled for the entire run, but not whether a specific target should be instrumented. +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](/versions/7.7.3/rules/lib/builtins/configuration), which notes whether coverage data collection is enabled for the entire run, but not whether a specific target should be instrumented. ### Parameters | Parameter | Description | | --- | --- | -| `target` | [Target](/versions/7.7.1/rules/lib/builtins/Target); or `None`; default is `None` A Target specifying a rule. If not provided, defaults to the current rule. | +| `target` | [Target](/versions/7.7.3/rules/lib/builtins/Target); or `None`; default is `None` A Target specifying a rule. If not provided, defaults to the current rule. | ## created\_actions @@ -120,7 +120,7 @@ StarlarkValue ctx.created_actions() ``` -For rules with [\_skylark\_testable](/versions/7.7.1/rules/lib/globals/bzl#rule._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. +For rules with [\_skylark\_testable](/versions/7.7.3/rules/lib/globals/bzl#rule._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. @@ -146,7 +146,7 @@ struct ctx.executable ``` -A `struct` containing executable files defined in [label type attributes](/versions/7.7.1/rules/lib/toplevel/attr#label) marked as [`executable=True`](/versions/7.7.1/rules/lib/toplevel/attr#label.executable). The struct fields correspond to the attribute names. Each value in the struct is either a [`File`](/versions/7.7.1/rules/lib/builtins/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](https://github.com/bazelbuild/examples/blob/main/rules/actions_run/execute.bzl). +A `struct` containing executable files defined in [label type attributes](/versions/7.7.3/rules/lib/toplevel/attr#label) marked as [`executable=True`](/versions/7.7.3/rules/lib/toplevel/attr#label.executable). The struct fields correspond to the attribute names. Each value in the struct is either a [`File`](/versions/7.7.3/rules/lib/builtins/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](https://github.com/bazelbuild/examples/blob/main/rules/actions_run/execute.bzl). ## expand\_location @@ -165,7 +165,7 @@ | Parameter | Description | | --- | --- | | `input` | required String to be expanded. | -| `targets` | [sequence](/versions/7.7.1/rules/lib/core/list) of [Target](/versions/7.7.1/rules/lib/builtins/Target)s; default is `[]` List of targets for additional lookup information. | +| `targets` | [sequence](/versions/7.7.3/rules/lib/core/list) of [Target](/versions/7.7.3/rules/lib/builtins/Target)s; default is `[]` List of targets for additional lookup information. | May return `None`. @@ -175,7 +175,7 @@ string ctx.expand_make_variables(attribute_name, command, additional_substitutions) ``` -**Deprecated.** Use [ctx.var](/versions/7.7.1/rules/lib/builtins/ctx#var) to access the variables instead. +**Deprecated.** Use [ctx.var](/versions/7.7.3/rules/lib/builtins/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: ``` @@ -207,13 +207,13 @@ struct ctx.file ``` -A `struct` containing files defined in [label type attributes](/versions/7.7.1/rules/lib/toplevel/attr#label) marked as [`allow_single_file`](/versions/7.7.1/rules/lib/toplevel/attr#label.allow_single_file). The struct fields correspond to the attribute names. The struct value is always a [`File`](/versions/7.7.1/rules/lib/builtins/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: +A `struct` containing files defined in [label type attributes](/versions/7.7.3/rules/lib/toplevel/attr#label) marked as [`allow_single_file`](/versions/7.7.3/rules/lib/toplevel/attr#label.allow_single_file). The struct fields correspond to the attribute names. The struct value is always a [`File`](/versions/7.7.3/rules/lib/builtins/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](https://bazel.build/versions/7.7.1/extending/rules#requesting_output_files) of a dependency. [See example of use](https://github.com/bazelbuild/examples/blob/main/rules/expand_template/hello.bzl). +In other words, use `file` to access the (singular) [default output](https://bazel.build/versions/7.7.3/extending/rules#requesting_output_files) of a dependency. [See example of use](https://github.com/bazelbuild/examples/blob/main/rules/expand_template/hello.bzl). ## files @@ -221,13 +221,13 @@ struct ctx.files ``` -A `struct` containing files defined in [label](/versions/7.7.1/rules/lib/toplevel/attr#label) or [label list](/versions/7.7.1/rules/lib/toplevel/attr#label_list) type attributes. The struct fields correspond to the attribute names. The struct values are `list` of [`File`](/versions/7.7.1/rules/lib/builtins/File)s. It is a shortcut for: +A `struct` containing files defined in [label](/versions/7.7.3/rules/lib/toplevel/attr#label) or [label list](/versions/7.7.3/rules/lib/toplevel/attr#label_list) type attributes. The struct fields correspond to the attribute names. The struct values are `list` of [`File`](/versions/7.7.3/rules/lib/builtins/File)s. 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](https://bazel.build/versions/7.7.1/extending/rules#requesting_output_files) of a dependency. [See example of use](https://github.com/bazelbuild/examples/blob/main/rules/depsets/foo.bzl). +In other words, use `files` to access the [default outputs](https://bazel.build/versions/7.7.3/extending/rules#requesting_output_files) of a dependency. [See example of use](https://github.com/bazelbuild/examples/blob/main/rules/depsets/foo.bzl). ## fragments @@ -267,13 +267,13 @@ structure ctx.outputs ``` -A pseudo-struct containing all the predeclared output files, represented by [`File`](/versions/7.7.1/rules/lib/builtins/File) objects. See the [Rules page](https://bazel.build/versions/7.7.1/extending/rules#files) for more information and examples. +A pseudo-struct containing all the predeclared output files, represented by [`File`](/versions/7.7.3/rules/lib/builtins/File) objects. See the [Rules page](https://bazel.build/versions/7.7.3/extending/rules#files) for more information and examples. 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. -* If the rule declares an [`outputs`](/versions/7.7.1/rules/lib/globals/bzl#rule.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`.* For every attribute of type [`attr.output`](/versions/7.7.1/rules/lib/toplevel/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`.* For every attribute of type [`attr.output_list`](/versions/7.7.1/rules/lib/toplevel/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.* **(Deprecated)** If the rule is marked [`executable`](/versions/7.7.1/rules/lib/globals/bzl#rule.executable) or [`test`](/versions/7.7.1/rules/lib/globals/bzl#rule.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`](/versions/7.7.1/rules/lib/providers/DefaultInfo). +* If the rule declares an [`outputs`](/versions/7.7.3/rules/lib/globals/bzl#rule.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`.* For every attribute of type [`attr.output`](/versions/7.7.3/rules/lib/toplevel/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`.* For every attribute of type [`attr.output_list`](/versions/7.7.3/rules/lib/toplevel/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.* **(Deprecated)** If the rule is marked [`executable`](/versions/7.7.3/rules/lib/globals/bzl#rule.executable) or [`test`](/versions/7.7.3/rules/lib/globals/bzl#rule.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`](/versions/7.7.3/rules/lib/providers/DefaultInfo). ## resolve\_command @@ -289,12 +289,12 @@ | Parameter | Description | | --- | --- | | `command` | default is `''` Command to resolve. | -| `attribute` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` Name of the associated attribute for which to issue an error, or None. | +| `attribute` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` Name of the associated attribute for which to issue an error, or None. | | `expand_locations` | default is `False` Shall we expand $(location) variables? See [ctx.expand\_location()](#expand_location) for more details. | -| `make_variables` | [dict](/versions/7.7.1/rules/lib/core/dict); or `None`; default is `None` Make variables to expand, or None. | -| `tools` | [sequence](/versions/7.7.1/rules/lib/core/list) of [Target](/versions/7.7.1/rules/lib/builtins/Target)s; default is `[]` List of tools (list of targets). | +| `make_variables` | [dict](/versions/7.7.3/rules/lib/core/dict); or `None`; default is `None` Make variables to expand, or None. | +| `tools` | [sequence](/versions/7.7.3/rules/lib/core/list) of [Target](/versions/7.7.3/rules/lib/builtins/Target)s; default is `[]` List of tools (list of targets). | | `label_dict` | default is `{}` Dictionary of resolved labels and the corresponding list of Files (a dict of Label : list of Files). | -| `execution_requirements` | default is `{}` Information for scheduling the action to resolve this command. See [tags](/versions/7.7.1/reference/be/common-definitions#common.tags) for useful keys. | +| `execution_requirements` | default is `{}` Information for scheduling the action to resolve this command. See [tags](/versions/7.7.3/reference/be/common-definitions#common.tags) for useful keys. | ## resolve\_tools @@ -310,7 +310,7 @@ | Parameter | Description | | --- | --- | -| `tools` | [sequence](/versions/7.7.1/rules/lib/core/list) of [Target](/versions/7.7.1/rules/lib/builtins/Target)s; default is `[]` List of tools (list of targets). | +| `tools` | [sequence](/versions/7.7.3/rules/lib/core/list) of [Target](/versions/7.7.3/rules/lib/builtins/Target)s; default is `[]` List of tools (list of targets). | ## rule @@ -332,12 +332,12 @@ | Parameter | Description | | --- | --- | -| `files` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; default is `[]` The list of files to be added to the runfiles. | -| `transitive_files` | [depset](/versions/7.7.1/rules/lib/builtins/depset) of [File](/versions/7.7.1/rules/lib/builtins/File)s; or `None`; default is `None` 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). | -| `collect_data` | default is `False` **Use of this parameter is not recommended. See [runfiles guide](https://bazel.build/versions/7.7.1/extending/rules#runfiles)**. Whether to collect the data runfiles from the dependencies in srcs, data and deps attributes. | -| `collect_default` | default is `False` **Use of this parameter is not recommended. See [runfiles guide](https://bazel.build/versions/7.7.1/extending/rules#runfiles)**. Whether to collect the default runfiles from the dependencies in srcs, data and deps attributes. | -| `symlinks` | [dict](/versions/7.7.1/rules/lib/core/dict); or [depset](/versions/7.7.1/rules/lib/builtins/depset) of [SymlinkEntry](/versions/7.7.1/rules/lib/builtins/SymlinkEntry)s; default is `{}` 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. `<runfiles_root>/_main/<symlink_path>`, **not** the directory corresponding to the current target's repository. See [Runfiles symlinks](https://bazel.build/versions/7.7.1/extending/rules#runfiles_symlinks) in the rules guide. | -| `root_symlinks` | [dict](/versions/7.7.1/rules/lib/core/dict); or [depset](/versions/7.7.1/rules/lib/builtins/depset) of [SymlinkEntry](/versions/7.7.1/rules/lib/builtins/SymlinkEntry)s; default is `{}` Either a SymlinkEntry depset or a map of symlinks to be added to the runfiles. See [Runfiles symlinks](https://bazel.build/versions/7.7.1/extending/rules#runfiles_symlinks) in the rules guide. | +| `files` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; default is `[]` The list of files to be added to the runfiles. | +| `transitive_files` | [depset](/versions/7.7.3/rules/lib/builtins/depset) of [File](/versions/7.7.3/rules/lib/builtins/File)s; or `None`; default is `None` 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). | +| `collect_data` | default is `False` **Use of this parameter is not recommended. See [runfiles guide](https://bazel.build/versions/7.7.3/extending/rules#runfiles)**. Whether to collect the data runfiles from the dependencies in srcs, data and deps attributes. | +| `collect_default` | default is `False` **Use of this parameter is not recommended. See [runfiles guide](https://bazel.build/versions/7.7.3/extending/rules#runfiles)**. Whether to collect the default runfiles from the dependencies in srcs, data and deps attributes. | +| `symlinks` | [dict](/versions/7.7.3/rules/lib/core/dict); or [depset](/versions/7.7.3/rules/lib/builtins/depset) of [SymlinkEntry](/versions/7.7.3/rules/lib/builtins/SymlinkEntry)s; default is `{}` 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. `<runfiles_root>/_main/<symlink_path>`, **not** the directory corresponding to the current target's repository. See [Runfiles symlinks](https://bazel.build/versions/7.7.3/extending/rules#runfiles_symlinks) in the rules guide. | +| `root_symlinks` | [dict](/versions/7.7.3/rules/lib/core/dict); or [depset](/versions/7.7.3/rules/lib/builtins/depset) of [SymlinkEntry](/versions/7.7.3/rules/lib/builtins/SymlinkEntry)s; default is `{}` Either a SymlinkEntry depset or a map of symlinks to be added to the runfiles. See [Runfiles symlinks](https://bazel.build/versions/7.7.3/extending/rules#runfiles_symlinks) in the rules guide. | ## split\_attr
diff --git a/docs/versions/7.7.1/rules/lib/builtins/depset.mdx b/docs/versions/7.7.3/rules/lib/builtins/depset.mdx similarity index 94% rename from docs/versions/7.7.1/rules/lib/builtins/depset.mdx rename to docs/versions/7.7.3/rules/lib/builtins/depset.mdx index 6bad232..93b7154 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/depset.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/depset.mdx
@@ -2,11 +2,11 @@ title: 'depset' --- -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](/versions/7.7.1/extending/depsets). +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](/versions/7.7.3/extending/depsets). 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 `True`. -Depsets are immutable. They should be created using their [constructor function](/versions/7.7.1/rules/lib/globals/bzl#depset) and merged or augmented with other depsets via the `transitive` argument. +Depsets are immutable. They should be created using their [constructor function](/versions/7.7.3/rules/lib/globals/bzl#depset) and merged or augmented with other depsets via the `transitive` argument. The `order` parameter determines the kind of traversal that is done to convert the depset to an iterable. There are four possible values:
diff --git a/docs/versions/7.7.1/rules/lib/builtins/exec_result.mdx b/docs/versions/7.7.3/rules/lib/builtins/exec_result.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/exec_result.mdx rename to docs/versions/7.7.3/rules/lib/builtins/exec_result.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/extension_metadata.mdx b/docs/versions/7.7.3/rules/lib/builtins/extension_metadata.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/extension_metadata.mdx rename to docs/versions/7.7.3/rules/lib/builtins/extension_metadata.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/fragments.mdx b/docs/versions/7.7.3/rules/lib/builtins/fragments.mdx similarity index 76% rename from docs/versions/7.7.1/rules/lib/builtins/fragments.mdx rename to docs/versions/7.7.3/rules/lib/builtins/fragments.mdx index a117ff8..f131a83 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/fragments.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/fragments.mdx
@@ -6,4 +6,4 @@ Only configuration fragments which are declared in the rule definition may be accessed in this collection. -See the [configuration fragment reference](/versions/7.7.1/rules/lib/fragments) for a list of available fragments and the [rules documentation](https://bazel.build/versions/7.7.1/extending/rules#configuration_fragments) for how to use them. \ No newline at end of file +See the [configuration fragment reference](/versions/7.7.3/rules/lib/fragments) for a list of available fragments and the [rules documentation](https://bazel.build/versions/7.7.3/extending/rules#configuration_fragments) for how to use them. \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/builtins/java_annotation_processing.mdx b/docs/versions/7.7.3/rules/lib/builtins/java_annotation_processing.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/java_annotation_processing.mdx rename to docs/versions/7.7.3/rules/lib/builtins/java_annotation_processing.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/mapped_root.mdx b/docs/versions/7.7.3/rules/lib/builtins/mapped_root.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/mapped_root.mdx rename to docs/versions/7.7.3/rules/lib/builtins/mapped_root.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/module_ctx.mdx b/docs/versions/7.7.3/rules/lib/builtins/module_ctx.mdx similarity index 85% rename from docs/versions/7.7.1/rules/lib/builtins/module_ctx.mdx rename to docs/versions/7.7.3/rules/lib/builtins/module_ctx.mdx index d9f8c44..8a56ffe 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/module_ctx.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/module_ctx.mdx
@@ -29,14 +29,14 @@ unknown module_ctx.download(url, output='', sha256='', executable=False, allow_fail=False, canonical_id='', auth={}, headers={}, *, integrity='', block=True) ``` -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`. When `sha256` or `integrity` is user specified, setting an explicit `canonical_id` is highly recommended. e.g. [`get_default_canonical_id`](/versions/7.7.1/rules/lib/repo/cache#get_default_canonical_id) +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`. When `sha256` or `integrity` is user specified, setting an explicit `canonical_id` is highly recommended. e.g. [`get_default_canonical_id`](/versions/7.7.3/rules/lib/repo/cache#get_default_canonical_id) ### Parameters | Parameter | Description | | --- | --- | -| `url` | [string](/versions/7.7.1/rules/lib/core/string); or Iterable of [string](/versions/7.7.1/rules/lib/core/string)s; required List of mirror URLs referencing the same file. | -| `output` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); default is `''` path to the output file, relative to the repository directory. | +| `url` | [string](/versions/7.7.3/rules/lib/core/string); or Iterable of [string](/versions/7.7.3/rules/lib/core/string)s; required List of mirror URLs referencing the same file. | +| `output` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); default is `''` path to the output file, relative to the repository directory. | | `sha256` | default is `''` 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. | | `executable` | default is `False` Set the executable flag on the created file, false by default. | | `allow_fail` | default is `False` If set, indicate the error in the return value instead of raising an error for failed downloads. | @@ -52,14 +52,14 @@ struct module_ctx.download_and_extract(url, output='', sha256='', type='', stripPrefix='', allow_fail=False, canonical_id='', auth={}, headers={}, *, integrity='', rename_files={}) ``` -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`. When `sha256` or `integrity` is user specified, setting an explicit `canonical_id` is highly recommended. e.g. [`get_default_canonical_id`](/versions/7.7.1/rules/lib/repo/cache#get_default_canonical_id) +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`. When `sha256` or `integrity` is user specified, setting an explicit `canonical_id` is highly recommended. e.g. [`get_default_canonical_id`](/versions/7.7.3/rules/lib/repo/cache#get_default_canonical_id) ### Parameters | Parameter | Description | | --- | --- | -| `url` | [string](/versions/7.7.1/rules/lib/core/string); or Iterable of [string](/versions/7.7.1/rules/lib/core/string)s; required List of mirror URLs referencing the same file. | -| `output` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); default is `''` Path to the directory where the archive will be unpacked, relative to the repository directory. | +| `url` | [string](/versions/7.7.3/rules/lib/core/string); or Iterable of [string](/versions/7.7.3/rules/lib/core/string)s; required List of mirror URLs referencing the same file. | +| `output` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); default is `''` Path to the directory where the archive will be unpacked, relative to the repository directory. | | `sha256` | default is `''` 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. | | `type` | default is `''` 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", "nupkg", "tar", "tar.gz", "tgz", "tar.xz", "txz", ".tar.zst", ".tzst", "tar.bz2", ".tbz", ".ar", or ".deb" here. | | `stripPrefix` | default is `''` A directory prefix to strip from the extracted files. Many 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. | @@ -100,9 +100,9 @@ | Parameter | Description | | --- | --- | -| `root_module_direct_deps` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; or [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` 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`](/versions/7.7.1/rules/lib/globals/module#use_repo), Bazel will print a warning when the extension is evaluated, instructing the user to run `bazel mod tidy` to fix the `use_repo` calls automatically. If one of `root_module_direct_deps` and will print a warning and a fixup command when the extension is evaluated. If one of `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. Exactly one of `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. | -| `root_module_direct_dev_deps` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; or [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` 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`](/versions/7.7.1/rules/lib/globals/module#use_repo) on an extension proxy created with `use_extension(..., dev_dependency = True)`, Bazel will print a warning when the extension is evaluated, instructing the user to run `bazel mod tidy` to fix the `use_repo` calls automatically. If one of `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. Exactly one of `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. | -| `reproducible` | [bool](/versions/7.7.1/rules/lib/core/bool); default is `False` States that this module extension ensures complete reproducibility, thereby it should not be stored in the lockfile. | +| `root_module_direct_deps` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; or [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` 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`](/versions/7.7.3/rules/lib/globals/module#use_repo), Bazel will print a warning when the extension is evaluated, instructing the user to run `bazel mod tidy` to fix the `use_repo` calls automatically. If one of `root_module_direct_deps` and will print a warning and a fixup command when the extension is evaluated. If one of `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. Exactly one of `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. | +| `root_module_direct_dev_deps` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; or [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` 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`](/versions/7.7.3/rules/lib/globals/module#use_repo) on an extension proxy created with `use_extension(..., dev_dependency = True)`, Bazel will print a warning when the extension is evaluated, instructing the user to run `bazel mod tidy` to fix the `use_repo` calls automatically. If one of `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. Exactly one of `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. | +| `reproducible` | [bool](/versions/7.7.3/rules/lib/core/bool); default is `False` States that this module extension ensures complete reproducibility, thereby it should not be stored in the lockfile. | ## extract @@ -116,8 +116,8 @@ | Parameter | Description | | --- | --- | -| `archive` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); required path to the archive that will be unpacked, relative to the repository directory. | -| `output` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); default is `''` path to the directory where the archive will be unpacked, relative to the repository directory. | +| `archive` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); required path to the archive that will be unpacked, relative to the repository directory. | +| `output` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); default is `''` path to the directory where the archive will be unpacked, relative to the repository directory. | | `stripPrefix` | default is `''` a directory prefix to strip from the extracted files. Many 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. | | `rename_files` | default is `{}` 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. | | `watch_archive` | default is `'auto'` whether to [watch](#watch) the archive file. Can be the string 'yes', 'no', or 'auto'. Passing 'yes' is equivalent to immediately invoking the [`watch()`](#watch) method; passing 'no' does not attempt to watch the file; passing 'auto' will only attempt to watch the file when it is legal to do so (see `watch()` docs for more information. | @@ -134,7 +134,7 @@ | Parameter | Description | | --- | --- | -| `path` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); required Path of the file to create, relative to the repository directory. | +| `path` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); required Path of the file to create, relative to the repository directory. | | `content` | default is `''` The content of the file to create, empty by default. | | `executable` | default is `True` Set the executable flag on the created file, true by default. | | `legacy_utf8` | default is `True` Encode file content to UTF-8, true by default. Future versions will change the default and remove this parameter. | @@ -153,8 +153,8 @@ | Parameter | Description | | --- | --- | -| `name` | [string](/versions/7.7.1/rules/lib/core/string); required Name of desired environment variable. | -| `default` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` Default value to return if `name` is not found. | +| `name` | [string](/versions/7.7.3/rules/lib/core/string); required Name of desired environment variable. | +| `default` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` Default value to return if `name` is not found. | May return `None`. @@ -164,13 +164,13 @@ bool module_ctx.is_dev_dependency(tag) ``` -Returns whether the given tag was specified on the result of a [use\_extension](/versions/7.7.1/rules/lib/globals/module#use_extension) call with `devDependency = True`. +Returns whether the given tag was specified on the result of a [use\_extension](/versions/7.7.3/rules/lib/globals/module#use_extension) call with `devDependency = True`. ### Parameters | Parameter | Description | | --- | --- | -| `tag` | bazel\_module\_tag; required A tag obtained from [bazel\_module.tags](/versions/7.7.1/rules/lib/builtins/bazel_module#tags). | +| `tag` | bazel\_module\_tag; required A tag obtained from [bazel\_module.tags](/versions/7.7.3/rules/lib/builtins/bazel_module#tags). | ## modules @@ -178,7 +178,7 @@ list module_ctx.modules ``` -A list of all the Bazel modules in the external dependency graph that use this module extension, each of which is a [bazel\_module](/versions/7.7.1/rules/lib/builtins/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. +A list of all the Bazel modules in the external dependency graph that use this module extension, each of which is a [bazel\_module](/versions/7.7.3/rules/lib/builtins/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. ## os @@ -200,7 +200,7 @@ | Parameter | Description | | --- | --- | -| `path` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); required `string`, `Label` or `path` from which to create a path from. | +| `path` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); required `string`, `Label` or `path` from which to create a path from. | ## read @@ -214,7 +214,7 @@ | Parameter | Description | | --- | --- | -| `path` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); required Path of the file to read from. | +| `path` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); required Path of the file to read from. | | `watch` | default is `'auto'` Whether to [watch](#watch) the file. Can be the string 'yes', 'no', or 'auto'. Passing 'yes' is equivalent to immediately invoking the [`watch()`](#watch) method; passing 'no' does not attempt to watch the file; passing 'auto' will only attempt to watch the file when it is legal to do so (see `watch()` docs for more information. | ## report\_progress @@ -229,7 +229,7 @@ | Parameter | Description | | --- | --- | -| `status` | [string](/versions/7.7.1/rules/lib/core/string); default is `''` `string` describing the current status of the fetch progress. | +| `status` | [string](/versions/7.7.3/rules/lib/core/string); default is `''` `string` describing the current status of the fetch progress. | ## root\_module\_has\_non\_dev\_dependency @@ -247,7 +247,7 @@ Tells Bazel to watch for changes to the given path, whether or not it exists, or whether it's a file or a directory. Any changes to the file or directory will invalidate this repository or module extension, and cause it to be refetched or re-evaluated next time. -"Changes" include changes to the contents of the file (if the path is a file); if the path was a file but is now a directory, or vice versa; and if the path starts or stops existing. Notably, this does *not* include changes to any files under the directory if the path is a directory. For that, use [`path.readdir()`](/versions/7.7.1/rules/lib/builtins/path#readdir) instead. +"Changes" include changes to the contents of the file (if the path is a file); if the path was a file but is now a directory, or vice versa; and if the path starts or stops existing. Notably, this does *not* include changes to any files under the directory if the path is a directory. For that, use [`path.readdir()`](/versions/7.7.3/rules/lib/builtins/path#readdir) instead. Note that attempting to watch paths inside the repo currently being fetched, or inside the working directory of the current module extension, will result in an error. A module extension attempting to watch a path outside the current Bazel workspace will also result in an error. @@ -255,7 +255,7 @@ | Parameter | Description | | --- | --- | -| `path` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); required Path of the file to watch. | +| `path` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); required Path of the file to watch. | ## which
diff --git a/docs/versions/7.7.1/rules/lib/builtins/native_rule_transition.mdx b/docs/versions/7.7.3/rules/lib/builtins/native_rule_transition.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/native_rule_transition.mdx rename to docs/versions/7.7.3/rules/lib/builtins/native_rule_transition.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/path.mdx b/docs/versions/7.7.3/rules/lib/builtins/path.mdx similarity index 97% rename from docs/versions/7.7.1/rules/lib/builtins/path.mdx rename to docs/versions/7.7.3/rules/lib/builtins/path.mdx index 7fe09937..6d86148 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/path.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/path.mdx
@@ -77,7 +77,7 @@ | Parameter | Description | | --- | --- | -| `watch` | default is `'auto'` whether Bazel should watch the list of entries in this directory and refetch the repository or re-evaluate the module extension next time when any changes are detected. Changes to detect include entry creation, deletion, and renaming. Note that this doesn't watch the *contents* of any entries in the directory. Can be the string 'yes', 'no', or 'auto'. If set to 'auto', Bazel will only watch this directory when it is legal to do so (see [`repository_ctx.watch()`](/versions/7.7.1/rules/lib/builtins/repository_ctx#watch) docs for more information). | +| `watch` | default is `'auto'` whether Bazel should watch the list of entries in this directory and refetch the repository or re-evaluate the module extension next time when any changes are detected. Changes to detect include entry creation, deletion, and renaming. Note that this doesn't watch the *contents* of any entries in the directory. Can be the string 'yes', 'no', or 'auto'. If set to 'auto', Bazel will only watch this directory when it is legal to do so (see [`repository_ctx.watch()`](/versions/7.7.3/rules/lib/builtins/repository_ctx#watch) docs for more information). | ## realpath
diff --git a/docs/versions/7.7.1/rules/lib/builtins/repository_ctx.mdx b/docs/versions/7.7.3/rules/lib/builtins/repository_ctx.mdx similarity index 83% rename from docs/versions/7.7.1/rules/lib/builtins/repository_ctx.mdx rename to docs/versions/7.7.3/rules/lib/builtins/repository_ctx.mdx index abde5a6..9479fff 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/repository_ctx.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/repository_ctx.mdx
@@ -48,7 +48,7 @@ | Parameter | Description | | --- | --- | -| `path` | [string](/versions/7.7.1/rules/lib/core/string); or [path](/versions/7.7.1/rules/lib/builtins/path); required Path of the file to delete, relative to the repository directory, or absolute. Can be a path or a string. | +| `path` | [string](/versions/7.7.3/rules/lib/core/string); or [path](/versions/7.7.3/rules/lib/builtins/path); required Path of the file to delete, relative to the repository directory, or absolute. Can be a path or a string. | ## download @@ -56,14 +56,14 @@ unknown repository_ctx.download(url, output='', sha256='', executable=False, allow_fail=False, canonical_id='', auth={}, headers={}, *, integrity='', block=True) ``` -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`. When `sha256` or `integrity` is user specified, setting an explicit `canonical_id` is highly recommended. e.g. [`get_default_canonical_id`](/versions/7.7.1/rules/lib/repo/cache#get_default_canonical_id) +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`. When `sha256` or `integrity` is user specified, setting an explicit `canonical_id` is highly recommended. e.g. [`get_default_canonical_id`](/versions/7.7.3/rules/lib/repo/cache#get_default_canonical_id) ### Parameters | Parameter | Description | | --- | --- | -| `url` | [string](/versions/7.7.1/rules/lib/core/string); or Iterable of [string](/versions/7.7.1/rules/lib/core/string)s; required List of mirror URLs referencing the same file. | -| `output` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); default is `''` path to the output file, relative to the repository directory. | +| `url` | [string](/versions/7.7.3/rules/lib/core/string); or Iterable of [string](/versions/7.7.3/rules/lib/core/string)s; required List of mirror URLs referencing the same file. | +| `output` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); default is `''` path to the output file, relative to the repository directory. | | `sha256` | default is `''` 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. | | `executable` | default is `False` Set the executable flag on the created file, false by default. | | `allow_fail` | default is `False` If set, indicate the error in the return value instead of raising an error for failed downloads. | @@ -79,14 +79,14 @@ struct repository_ctx.download_and_extract(url, output='', sha256='', type='', stripPrefix='', allow_fail=False, canonical_id='', auth={}, headers={}, *, integrity='', rename_files={}) ``` -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`. When `sha256` or `integrity` is user specified, setting an explicit `canonical_id` is highly recommended. e.g. [`get_default_canonical_id`](/versions/7.7.1/rules/lib/repo/cache#get_default_canonical_id) +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`. When `sha256` or `integrity` is user specified, setting an explicit `canonical_id` is highly recommended. e.g. [`get_default_canonical_id`](/versions/7.7.3/rules/lib/repo/cache#get_default_canonical_id) ### Parameters | Parameter | Description | | --- | --- | -| `url` | [string](/versions/7.7.1/rules/lib/core/string); or Iterable of [string](/versions/7.7.1/rules/lib/core/string)s; required List of mirror URLs referencing the same file. | -| `output` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); default is `''` Path to the directory where the archive will be unpacked, relative to the repository directory. | +| `url` | [string](/versions/7.7.3/rules/lib/core/string); or Iterable of [string](/versions/7.7.3/rules/lib/core/string)s; required List of mirror URLs referencing the same file. | +| `output` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); default is `''` Path to the directory where the archive will be unpacked, relative to the repository directory. | | `sha256` | default is `''` 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. | | `type` | default is `''` 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", "nupkg", "tar", "tar.gz", "tgz", "tar.xz", "txz", ".tar.zst", ".tzst", "tar.bz2", ".tbz", ".ar", or ".deb" here. | | `stripPrefix` | default is `''` A directory prefix to strip from the extracted files. Many 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. | @@ -127,8 +127,8 @@ | Parameter | Description | | --- | --- | -| `archive` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); required path to the archive that will be unpacked, relative to the repository directory. | -| `output` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); default is `''` path to the directory where the archive will be unpacked, relative to the repository directory. | +| `archive` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); required path to the archive that will be unpacked, relative to the repository directory. | +| `output` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); default is `''` path to the directory where the archive will be unpacked, relative to the repository directory. | | `stripPrefix` | default is `''` a directory prefix to strip from the extracted files. Many 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. | | `rename_files` | default is `{}` 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. | | `watch_archive` | default is `'auto'` whether to [watch](#watch) the archive file. Can be the string 'yes', 'no', or 'auto'. Passing 'yes' is equivalent to immediately invoking the [`watch()`](#watch) method; passing 'no' does not attempt to watch the file; passing 'auto' will only attempt to watch the file when it is legal to do so (see `watch()` docs for more information. | @@ -145,7 +145,7 @@ | Parameter | Description | | --- | --- | -| `path` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); required Path of the file to create, relative to the repository directory. | +| `path` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); required Path of the file to create, relative to the repository directory. | | `content` | default is `''` The content of the file to create, empty by default. | | `executable` | default is `True` Set the executable flag on the created file, true by default. | | `legacy_utf8` | default is `True` Encode file content to UTF-8, true by default. Future versions will change the default and remove this parameter. | @@ -164,8 +164,8 @@ | Parameter | Description | | --- | --- | -| `name` | [string](/versions/7.7.1/rules/lib/core/string); required Name of desired environment variable. | -| `default` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` Default value to return if `name` is not found. | +| `name` | [string](/versions/7.7.3/rules/lib/core/string); required Name of desired environment variable. | +| `default` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` Default value to return if `name` is not found. | May return `None`. @@ -205,7 +205,7 @@ | Parameter | Description | | --- | --- | -| `patch_file` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); required 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. | +| `patch_file` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); required 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. | | `strip` | default is `0` Strip the specified number of leading components from file names. | | `watch_patch` | default is `'auto'` Whether to [watch](#watch) the patch file. Can be the string 'yes', 'no', or 'auto'. Passing 'yes' is equivalent to immediately invoking the [`watch()`](#watch) method; passing 'no' does not attempt to watch the file; passing 'auto' will only attempt to watch the file when it is legal to do so (see `watch()` docs for more information. | @@ -221,7 +221,7 @@ | Parameter | Description | | --- | --- | -| `path` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); required `string`, `Label` or `path` from which to create a path from. | +| `path` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); required `string`, `Label` or `path` from which to create a path from. | ## read @@ -235,7 +235,7 @@ | Parameter | Description | | --- | --- | -| `path` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); required Path of the file to read from. | +| `path` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); required Path of the file to read from. | | `watch` | default is `'auto'` Whether to [watch](#watch) the file. Can be the string 'yes', 'no', or 'auto'. Passing 'yes' is equivalent to immediately invoking the [`watch()`](#watch) method; passing 'no' does not attempt to watch the file; passing 'auto' will only attempt to watch the file when it is legal to do so (see `watch()` docs for more information. | ## report\_progress @@ -250,7 +250,7 @@ | Parameter | Description | | --- | --- | -| `status` | [string](/versions/7.7.1/rules/lib/core/string); default is `''` `string` describing the current status of the fetch progress. | +| `status` | [string](/versions/7.7.3/rules/lib/core/string); default is `''` `string` describing the current status of the fetch progress. | ## symlink @@ -264,8 +264,8 @@ | Parameter | Description | | --- | --- | -| `target` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); required The path that the symlink should point to. | -| `link_name` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); required The path of the symlink to create. | +| `target` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); required The path that the symlink should point to. | +| `link_name` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); required The path of the symlink to create. | ## template @@ -279,8 +279,8 @@ | Parameter | Description | | --- | --- | -| `path` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); required Path of the file to create, relative to the repository directory. | -| `template` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); required Path to the template file. | +| `path` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); required Path of the file to create, relative to the repository directory. | +| `template` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); required Path to the template file. | | `substitutions` | default is `{}` Substitutions to make when expanding the template. | | `executable` | default is `True` Set the executable flag on the created file, true by default. | | `watch_template` | default is `'auto'` Whether to [watch](#watch) the template file. Can be the string 'yes', 'no', or 'auto'. Passing 'yes' is equivalent to immediately invoking the [`watch()`](#watch) method; passing 'no' does not attempt to watch the file; passing 'auto' will only attempt to watch the file when it is legal to do so (see `watch()` docs for more information. | @@ -293,7 +293,7 @@ Tells Bazel to watch for changes to the given path, whether or not it exists, or whether it's a file or a directory. Any changes to the file or directory will invalidate this repository or module extension, and cause it to be refetched or re-evaluated next time. -"Changes" include changes to the contents of the file (if the path is a file); if the path was a file but is now a directory, or vice versa; and if the path starts or stops existing. Notably, this does *not* include changes to any files under the directory if the path is a directory. For that, use [`path.readdir()`](/versions/7.7.1/rules/lib/builtins/path#readdir) instead. +"Changes" include changes to the contents of the file (if the path is a file); if the path was a file but is now a directory, or vice versa; and if the path starts or stops existing. Notably, this does *not* include changes to any files under the directory if the path is a directory. For that, use [`path.readdir()`](/versions/7.7.3/rules/lib/builtins/path#readdir) instead. Note that attempting to watch paths inside the repo currently being fetched, or inside the working directory of the current module extension, will result in an error. A module extension attempting to watch a path outside the current Bazel workspace will also result in an error. @@ -301,7 +301,7 @@ | Parameter | Description | | --- | --- | -| `path` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); required Path of the file to watch. | +| `path` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); required Path of the file to watch. | ## watch\_tree @@ -317,7 +317,7 @@ | Parameter | Description | | --- | --- | -| `path` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [path](/versions/7.7.1/rules/lib/builtins/path); required Path of the directory tree to watch. | +| `path` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [path](/versions/7.7.3/rules/lib/builtins/path); required Path of the directory tree to watch. | ## which
diff --git a/docs/versions/7.7.1/rules/lib/builtins/repository_os.mdx b/docs/versions/7.7.3/rules/lib/builtins/repository_os.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/repository_os.mdx rename to docs/versions/7.7.3/rules/lib/builtins/repository_os.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/repository_rule.mdx b/docs/versions/7.7.3/rules/lib/builtins/repository_rule.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/repository_rule.mdx rename to docs/versions/7.7.3/rules/lib/builtins/repository_rule.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/root.mdx b/docs/versions/7.7.3/rules/lib/builtins/root.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/root.mdx rename to docs/versions/7.7.3/rules/lib/builtins/root.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/rule.mdx b/docs/versions/7.7.3/rules/lib/builtins/rule.mdx similarity index 84% rename from docs/versions/7.7.1/rules/lib/builtins/rule.mdx rename to docs/versions/7.7.3/rules/lib/builtins/rule.mdx index 28427bb..d67cf8b 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/rule.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/rule.mdx
@@ -2,4 +2,4 @@ title: 'rule' --- -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 about[Rules](https://bazel.build/versions/7.7.1/extending/rules). \ No newline at end of file +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 about[Rules](https://bazel.build/versions/7.7.3/extending/rules). \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/builtins/rule_attributes.mdx b/docs/versions/7.7.3/rules/lib/builtins/rule_attributes.mdx similarity index 72% rename from docs/versions/7.7.1/rules/lib/builtins/rule_attributes.mdx rename to docs/versions/7.7.3/rules/lib/builtins/rule_attributes.mdx index 8d3a1ff..416384f 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/rule_attributes.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/rule_attributes.mdx
@@ -18,7 +18,7 @@ struct rule_attributes.attr ``` -A struct to access the values of the [attributes](https://bazel.build/versions/7.7.1/extending/rules#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](/versions/7.7.1/rules/lib/globals/bzl#rule.attrs) provided to the [`rule` function](/versions/7.7.1/rules/lib/globals/bzl#rule). [See example of use](https://github.com/bazelbuild/examples/blob/main/rules/attributes/printer.bzl). +A struct to access the values of the [attributes](https://bazel.build/versions/7.7.3/extending/rules#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](/versions/7.7.3/rules/lib/globals/bzl#rule.attrs) provided to the [`rule` function](/versions/7.7.3/rules/lib/globals/bzl#rule). [See example of use](https://github.com/bazelbuild/examples/blob/main/rules/attributes/printer.bzl). ## executable @@ -26,7 +26,7 @@ struct rule_attributes.executable ``` -A `struct` containing executable files defined in [label type attributes](/versions/7.7.1/rules/lib/toplevel/attr#label) marked as [`executable=True`](/versions/7.7.1/rules/lib/toplevel/attr#label.executable). The struct fields correspond to the attribute names. Each value in the struct is either a [`File`](/versions/7.7.1/rules/lib/builtins/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](https://github.com/bazelbuild/examples/blob/main/rules/actions_run/execute.bzl). +A `struct` containing executable files defined in [label type attributes](/versions/7.7.3/rules/lib/toplevel/attr#label) marked as [`executable=True`](/versions/7.7.3/rules/lib/toplevel/attr#label.executable). The struct fields correspond to the attribute names. Each value in the struct is either a [`File`](/versions/7.7.3/rules/lib/builtins/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](https://github.com/bazelbuild/examples/blob/main/rules/actions_run/execute.bzl). ## file @@ -34,13 +34,13 @@ struct rule_attributes.file ``` -A `struct` containing files defined in [label type attributes](/versions/7.7.1/rules/lib/toplevel/attr#label) marked as [`allow_single_file`](/versions/7.7.1/rules/lib/toplevel/attr#label.allow_single_file). The struct fields correspond to the attribute names. The struct value is always a [`File`](/versions/7.7.1/rules/lib/builtins/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: +A `struct` containing files defined in [label type attributes](/versions/7.7.3/rules/lib/toplevel/attr#label) marked as [`allow_single_file`](/versions/7.7.3/rules/lib/toplevel/attr#label.allow_single_file). The struct fields correspond to the attribute names. The struct value is always a [`File`](/versions/7.7.3/rules/lib/builtins/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](https://bazel.build/versions/7.7.1/extending/rules#requesting_output_files) of a dependency. [See example of use](https://github.com/bazelbuild/examples/blob/main/rules/expand_template/hello.bzl). +In other words, use `file` to access the (singular) [default output](https://bazel.build/versions/7.7.3/extending/rules#requesting_output_files) of a dependency. [See example of use](https://github.com/bazelbuild/examples/blob/main/rules/expand_template/hello.bzl). ## files @@ -48,13 +48,13 @@ struct rule_attributes.files ``` -A `struct` containing files defined in [label](/versions/7.7.1/rules/lib/toplevel/attr#label) or [label list](/versions/7.7.1/rules/lib/toplevel/attr#label_list) type attributes. The struct fields correspond to the attribute names. The struct values are `list` of [`File`](/versions/7.7.1/rules/lib/builtins/File)s. It is a shortcut for: +A `struct` containing files defined in [label](/versions/7.7.3/rules/lib/toplevel/attr#label) or [label list](/versions/7.7.3/rules/lib/toplevel/attr#label_list) type attributes. The struct fields correspond to the attribute names. The struct values are `list` of [`File`](/versions/7.7.3/rules/lib/builtins/File)s. 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](https://bazel.build/versions/7.7.1/extending/rules#requesting_output_files) of a dependency. [See example of use](https://github.com/bazelbuild/examples/blob/main/rules/depsets/foo.bzl). +In other words, use `files` to access the [default outputs](https://bazel.build/versions/7.7.3/extending/rules#requesting_output_files) of a dependency. [See example of use](https://github.com/bazelbuild/examples/blob/main/rules/depsets/foo.bzl). ## kind
diff --git a/docs/versions/7.7.1/rules/lib/builtins/runfiles.mdx b/docs/versions/7.7.3/rules/lib/builtins/runfiles.mdx similarity index 85% rename from docs/versions/7.7.1/rules/lib/builtins/runfiles.mdx rename to docs/versions/7.7.3/rules/lib/builtins/runfiles.mdx index c113915..02867ac 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/runfiles.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/runfiles.mdx
@@ -2,9 +2,9 @@ title: 'runfiles' --- -A container of information regarding a set of files required at runtime execution. This object should be passed via [DefaultInfo](/versions/7.7.1/rules/lib/providers/DefaultInfo) in order to tell the build system about the runfiles needed by the outputs produced by the rule. +A container of information regarding a set of files required at runtime execution. This object should be passed via [DefaultInfo](/versions/7.7.3/rules/lib/providers/DefaultInfo) in order to tell the build system about the runfiles needed by the outputs produced by the rule. -See [runfiles guide](https://bazel.build/versions/7.7.1/extending/rules#runfiles) for details. +See [runfiles guide](https://bazel.build/versions/7.7.3/extending/rules#runfiles) for details. ## Members @@ -59,7 +59,7 @@ | Parameter | Description | | --- | --- | -| `other` | [sequence](/versions/7.7.1/rules/lib/core/list) of [runfiles](/versions/7.7.1/rules/lib/builtins/runfiles)s; required The sequence of runfiles objects to merge into this. | +| `other` | [sequence](/versions/7.7.3/rules/lib/core/list) of [runfiles](/versions/7.7.3/rules/lib/builtins/runfiles)s; required The sequence of runfiles objects to merge into this. | ## root\_symlinks
diff --git a/docs/versions/7.7.1/rules/lib/builtins/struct.mdx b/docs/versions/7.7.3/rules/lib/builtins/struct.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/struct.mdx rename to docs/versions/7.7.3/rules/lib/builtins/struct.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/subrule_ctx.mdx b/docs/versions/7.7.3/rules/lib/builtins/subrule_ctx.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/subrule_ctx.mdx rename to docs/versions/7.7.3/rules/lib/builtins/subrule_ctx.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/tag_class.mdx b/docs/versions/7.7.3/rules/lib/builtins/tag_class.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/tag_class.mdx rename to docs/versions/7.7.3/rules/lib/builtins/tag_class.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/toolchain_type.mdx b/docs/versions/7.7.3/rules/lib/builtins/toolchain_type.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/builtins/toolchain_type.mdx rename to docs/versions/7.7.3/rules/lib/builtins/toolchain_type.mdx
diff --git a/docs/versions/7.7.1/rules/lib/builtins/transition.mdx b/docs/versions/7.7.3/rules/lib/builtins/transition.mdx similarity index 88% rename from docs/versions/7.7.1/rules/lib/builtins/transition.mdx rename to docs/versions/7.7.3/rules/lib/builtins/transition.mdx index 84b604b..aeea153 100644 --- a/docs/versions/7.7.1/rules/lib/builtins/transition.mdx +++ b/docs/versions/7.7.3/rules/lib/builtins/transition.mdx
@@ -32,12 +32,12 @@ ) ``` -For more details see [here](https://bazel.build/versions/7.7.1/rules/config#user-defined-transitions). +For more details see [here](https://bazel.build/versions/7.7.3/rules/config#user-defined-transitions). ### Parameters | Parameter | Description | | --- | --- | | `implementation` | required 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'`. The `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. This function must return a `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 `dict`s or a `dict` of `dict`s in the case of a split transition. | -| `inputs` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; required 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. | -| `outputs` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; required 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. | \ No newline at end of file +| `inputs` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; required 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. | +| `outputs` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; required 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. | \ No newline at end of file
diff --git a/docs/versions/7.7.3/rules/lib/core.mdx b/docs/versions/7.7.3/rules/lib/core.mdx new file mode 100644 index 0000000..27ea188 --- /dev/null +++ b/docs/versions/7.7.3/rules/lib/core.mdx
@@ -0,0 +1,17 @@ +--- +title: 'Core Starlark data types' +--- + +This section lists the data types of the [Starlark core language](https://github.com/bazelbuild/starlark/blob/master/spec.md#built-in-constants-and-functions). With some exceptions, these type names are not valid Starlark symbols; instances of them may be acquired through different means. + +* [bool](/versions/7.7.3/rules/lib/core/bool) +* [builtin\_function\_or\_method](/versions/7.7.3/rules/lib/core/builtin_function_or_method) +* [dict](/versions/7.7.3/rules/lib/core/dict) +* [float](/versions/7.7.3/rules/lib/core/float) +* [function](/versions/7.7.3/rules/lib/core/function) +* [int](/versions/7.7.3/rules/lib/core/int) +* [json](/versions/7.7.3/rules/lib/core/json) +* [list](/versions/7.7.3/rules/lib/core/list) +* [range](/versions/7.7.3/rules/lib/core/range) +* [string](/versions/7.7.3/rules/lib/core/string) +* [tuple](/versions/7.7.3/rules/lib/core/tuple) \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/core/bool.mdx b/docs/versions/7.7.3/rules/lib/core/bool.mdx similarity index 70% rename from docs/versions/7.7.1/rules/lib/core/bool.mdx rename to docs/versions/7.7.3/rules/lib/core/bool.mdx index e679fea..ebf7d13 100644 --- a/docs/versions/7.7.1/rules/lib/core/bool.mdx +++ b/docs/versions/7.7.3/rules/lib/core/bool.mdx
@@ -2,4 +2,4 @@ title: 'bool' --- -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](/versions/7.7.1/rules/lib/globals/all#bool) function. \ No newline at end of file +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](/versions/7.7.3/rules/lib/globals/all#bool) function. \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/core/builtin_function_or_method.mdx b/docs/versions/7.7.3/rules/lib/core/builtin_function_or_method.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/core/builtin_function_or_method.mdx rename to docs/versions/7.7.3/rules/lib/core/builtin_function_or_method.mdx
diff --git a/docs/versions/7.7.1/rules/lib/core/dict.mdx b/docs/versions/7.7.3/rules/lib/core/dict.mdx similarity index 98% rename from docs/versions/7.7.1/rules/lib/core/dict.mdx rename to docs/versions/7.7.3/rules/lib/core/dict.mdx index cdf26d8..e85381d 100644 --- a/docs/versions/7.7.1/rules/lib/core/dict.mdx +++ b/docs/versions/7.7.3/rules/lib/core/dict.mdx
@@ -22,7 +22,7 @@ {i: 2*i for i in range(3)} # {0: 0, 1: 2, 2: 4} ``` - - A call to the built-in [dict](/versions/7.7.1/rules/lib/globals/all#dict) function returns a dictionary containing the specified entries, which are inserted in argument order, positional arguments before named. As with comprehensions, duplicate keys are permitted.- The union expression `x | 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: + - A call to the built-in [dict](/versions/7.7.3/rules/lib/globals/all#dict) function returns a dictionary containing the specified entries, which are inserted in argument order, positional arguments before named. As with comprehensions, duplicate keys are permitted.- The union expression `x | 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"}
diff --git a/docs/versions/7.7.1/rules/lib/core/float.mdx b/docs/versions/7.7.3/rules/lib/core/float.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/core/float.mdx rename to docs/versions/7.7.3/rules/lib/core/float.mdx
diff --git a/docs/versions/7.7.1/rules/lib/core/function.mdx b/docs/versions/7.7.3/rules/lib/core/function.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/core/function.mdx rename to docs/versions/7.7.3/rules/lib/core/function.mdx
diff --git a/docs/versions/7.7.1/rules/lib/core/int.mdx b/docs/versions/7.7.3/rules/lib/core/int.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/core/int.mdx rename to docs/versions/7.7.3/rules/lib/core/int.mdx
diff --git a/docs/versions/7.7.1/rules/lib/core/json.mdx b/docs/versions/7.7.3/rules/lib/core/json.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/core/json.mdx rename to docs/versions/7.7.3/rules/lib/core/json.mdx
diff --git a/docs/versions/7.7.1/rules/lib/core/list.mdx b/docs/versions/7.7.3/rules/lib/core/list.mdx similarity index 92% rename from docs/versions/7.7.1/rules/lib/core/list.mdx rename to docs/versions/7.7.3/rules/lib/core/list.mdx index 9f941d7..399cce0 100644 --- a/docs/versions/7.7.1/rules/lib/core/list.mdx +++ b/docs/versions/7.7.3/rules/lib/core/list.mdx
@@ -91,8 +91,8 @@ | Parameter | Description | | --- | --- | | `x` | required | -| `start` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `None` The start index of the list portion to inspect. | -| `end` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `None` The end index of the list portion to inspect. | +| `start` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `None` The start index of the list portion to inspect. | +| `end` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `None` The end index of the list portion to inspect. | ## insert @@ -121,7 +121,7 @@ | Parameter | Description | | --- | --- | -| `i` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `-1` The index of the item. | +| `i` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `-1` The index of the item. | ## remove
diff --git a/docs/versions/7.7.1/rules/lib/core/range.mdx b/docs/versions/7.7.3/rules/lib/core/range.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/core/range.mdx rename to docs/versions/7.7.3/rules/lib/core/range.mdx
diff --git a/docs/versions/7.7.1/rules/lib/core/string.mdx b/docs/versions/7.7.3/rules/lib/core/string.mdx similarity index 87% rename from docs/versions/7.7.1/rules/lib/core/string.mdx rename to docs/versions/7.7.3/rules/lib/core/string.mdx index fbd4623..a4d6de6 100644 --- a/docs/versions/7.7.1/rules/lib/core/string.mdx +++ b/docs/versions/7.7.3/rules/lib/core/string.mdx
@@ -82,8 +82,8 @@ | Parameter | Description | | --- | --- | | `sub` | required | -| `start` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `0` | -| `end` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `None` optional position before which to restrict to search. | +| `start` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `0` | +| `end` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `None` optional position before which to restrict to search. | ## elems @@ -105,9 +105,9 @@ | Parameter | Description | | --- | --- | -| `sub` | [string](/versions/7.7.1/rules/lib/core/string); or [tuple](/versions/7.7.1/rules/lib/core/tuple) of [string](/versions/7.7.1/rules/lib/core/string)s; required The suffix (or tuple of alternative suffixes) to match. | -| `start` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `0` Test beginning at this position. | -| `end` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `None` optional position at which to stop comparing. | +| `sub` | [string](/versions/7.7.3/rules/lib/core/string); or [tuple](/versions/7.7.3/rules/lib/core/tuple) of [string](/versions/7.7.3/rules/lib/core/string)s; required The suffix (or tuple of alternative suffixes) to match. | +| `start` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `0` Test beginning at this position. | +| `end` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `None` optional position at which to stop comparing. | ## find @@ -122,8 +122,8 @@ | Parameter | Description | | --- | --- | | `sub` | required The substring to find. | -| `start` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `0` Restrict to search from this position. | -| `end` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `None` optional position before which to restrict to search. | +| `start` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `0` Restrict to search from this position. | +| `end` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `None` optional position before which to restrict to search. | ## format @@ -131,7 +131,7 @@ string string.format(*args, **kwargs) ``` -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](/versions/7.7.1/rules/lib/globals/all#str) function. +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](/versions/7.7.3/rules/lib/globals/all#str) function. ``` # Access in order: @@ -162,8 +162,8 @@ | Parameter | Description | | --- | --- | | `sub` | required The substring to find. | -| `start` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `0` Restrict to search from this position. | -| `end` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `None` optional position before which to restrict to search. | +| `start` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `0` Restrict to search from this position. | +| `end` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `None` optional position before which to restrict to search. | ## isalnum @@ -263,7 +263,7 @@ | Parameter | Description | | --- | --- | -| `chars` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` The characters to remove, or all whitespace if None. | +| `chars` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` The characters to remove, or all whitespace if None. | ## partition @@ -336,8 +336,8 @@ | Parameter | Description | | --- | --- | | `sub` | required The substring to find. | -| `start` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `0` Restrict to search from this position. | -| `end` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `None` optional position before which to restrict to search. | +| `start` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `0` Restrict to search from this position. | +| `end` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `None` optional position before which to restrict to search. | ## rindex @@ -352,8 +352,8 @@ | Parameter | Description | | --- | --- | | `sub` | required The substring to find. | -| `start` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `0` Restrict to search from this position. | -| `end` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `None` optional position before which to restrict to search. | +| `start` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `0` Restrict to search from this position. | +| `end` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `None` optional position before which to restrict to search. | ## rpartition @@ -382,7 +382,7 @@ | Parameter | Description | | --- | --- | | `sep` | required The string to split on. | -| `maxsplit` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `None` The maximum number of splits. | +| `maxsplit` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `None` The maximum number of splits. | ## rstrip @@ -400,7 +400,7 @@ | Parameter | Description | | --- | --- | -| `chars` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` The characters to remove, or all whitespace if None. | +| `chars` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` The characters to remove, or all whitespace if None. | ## split @@ -415,7 +415,7 @@ | Parameter | Description | | --- | --- | | `sep` | required The string to split on. | -| `maxsplit` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `None` The maximum number of splits. | +| `maxsplit` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `None` The maximum number of splits. | ## splitlines @@ -443,9 +443,9 @@ | Parameter | Description | | --- | --- | -| `sub` | [string](/versions/7.7.1/rules/lib/core/string); or [tuple](/versions/7.7.1/rules/lib/core/tuple) of [string](/versions/7.7.1/rules/lib/core/string)s; required The prefix (or tuple of alternative prefixes) to match. | -| `start` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `0` Test beginning at this position. | -| `end` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `None` Stop comparing at this position. | +| `sub` | [string](/versions/7.7.3/rules/lib/core/string); or [tuple](/versions/7.7.3/rules/lib/core/tuple) of [string](/versions/7.7.3/rules/lib/core/string)s; required The prefix (or tuple of alternative prefixes) to match. | +| `start` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `0` Test beginning at this position. | +| `end` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `None` Stop comparing at this position. | ## strip @@ -463,7 +463,7 @@ | Parameter | Description | | --- | --- | -| `chars` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` The characters to remove, or all whitespace if None. | +| `chars` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` The characters to remove, or all whitespace if None. | ## title
diff --git a/docs/versions/7.7.1/rules/lib/core/tuple.mdx b/docs/versions/7.7.3/rules/lib/core/tuple.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/core/tuple.mdx rename to docs/versions/7.7.3/rules/lib/core/tuple.mdx
diff --git a/docs/versions/7.7.3/rules/lib/fragments.mdx b/docs/versions/7.7.3/rules/lib/fragments.mdx new file mode 100644 index 0000000..3a0d599 --- /dev/null +++ b/docs/versions/7.7.3/rules/lib/fragments.mdx
@@ -0,0 +1,20 @@ +--- +title: 'Configuration Fragments' +--- + +Configuration fragments give rules access to language-specific parts of [configuration](/versions/7.7.3/rules/lib/builtins/configuration). + +Rule implementations can get them using `ctx.fragments.[fragment name]` + +* [apple](/versions/7.7.3/rules/lib/fragments/apple) +* [bazel\_android](/versions/7.7.3/rules/lib/fragments/bazel_android) +* [bazel\_py](/versions/7.7.3/rules/lib/fragments/bazel_py) +* [coverage](/versions/7.7.3/rules/lib/fragments/coverage) +* [cpp](/versions/7.7.3/rules/lib/fragments/cpp) +* [j2objc](/versions/7.7.3/rules/lib/fragments/j2objc) +* [java](/versions/7.7.3/rules/lib/fragments/java) +* [objc](/versions/7.7.3/rules/lib/fragments/objc) +* [platform](/versions/7.7.3/rules/lib/fragments/platform) +* [proto](/versions/7.7.3/rules/lib/fragments/proto) +* [py](/versions/7.7.3/rules/lib/fragments/py) +* [swift](/versions/7.7.3/rules/lib/fragments/swift) \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/fragments/apple.mdx b/docs/versions/7.7.3/rules/lib/fragments/apple.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/fragments/apple.mdx rename to docs/versions/7.7.3/rules/lib/fragments/apple.mdx
diff --git a/docs/versions/7.7.1/rules/lib/fragments/bazel_android.mdx b/docs/versions/7.7.3/rules/lib/fragments/bazel_android.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/fragments/bazel_android.mdx rename to docs/versions/7.7.3/rules/lib/fragments/bazel_android.mdx
diff --git a/docs/versions/7.7.1/rules/lib/fragments/bazel_py.mdx b/docs/versions/7.7.3/rules/lib/fragments/bazel_py.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/fragments/bazel_py.mdx rename to docs/versions/7.7.3/rules/lib/fragments/bazel_py.mdx
diff --git a/docs/versions/7.7.1/rules/lib/fragments/coverage.mdx b/docs/versions/7.7.3/rules/lib/fragments/coverage.mdx similarity index 81% rename from docs/versions/7.7.1/rules/lib/fragments/coverage.mdx rename to docs/versions/7.7.3/rules/lib/fragments/coverage.mdx index fbaab22..ffe968e 100644 --- a/docs/versions/7.7.1/rules/lib/fragments/coverage.mdx +++ b/docs/versions/7.7.3/rules/lib/fragments/coverage.mdx
@@ -14,7 +14,7 @@ Label coverage.output_generator ``` -Returns the label pointed to by the [`--coverage_output_generator`](https://bazel.build/versions/7.7.1/reference/command-line-reference#flag--coverage_output_generator) option if coverage collection is enabled, otherwise returns `None`. Can be accessed with [`configuration_field`](/versions/7.7.1/rules/lib/globals/bzl#configuration_field): +Returns the label pointed to by the [`--coverage_output_generator`](https://bazel.build/versions/7.7.3/reference/command-line-reference#flag--coverage_output_generator) option if coverage collection is enabled, otherwise returns `None`. Can be accessed with [`configuration_field`](/versions/7.7.3/rules/lib/globals/bzl#configuration_field): ``` attr.label(
diff --git a/docs/versions/7.7.1/rules/lib/fragments/cpp.mdx b/docs/versions/7.7.3/rules/lib/fragments/cpp.mdx similarity index 78% rename from docs/versions/7.7.1/rules/lib/fragments/cpp.mdx rename to docs/versions/7.7.3/rules/lib/fragments/cpp.mdx index c7b9a08..da5f029 100644 --- a/docs/versions/7.7.1/rules/lib/fragments/cpp.mdx +++ b/docs/versions/7.7.3/rules/lib/fragments/cpp.mdx
@@ -39,7 +39,7 @@ list cpp.conlyopts ``` -The flags passed to Bazel by [`--conlyopt`](/versions/7.7.1/docs/user-manual#flag--conlyopt) option. +The flags passed to Bazel by [`--conlyopt`](/versions/7.7.3/docs/user-manual#flag--conlyopt) option. ## copts @@ -47,7 +47,7 @@ list cpp.copts ``` -The flags passed to Bazel by [`--copt`](/versions/7.7.1/docs/user-manual#flag--copt) option. +The flags passed to Bazel by [`--copt`](/versions/7.7.3/docs/user-manual#flag--copt) option. ## custom\_malloc @@ -55,7 +55,7 @@ Label cpp.custom_malloc ``` -Returns label pointed to by [`--custom_malloc`](/versions/7.7.1/docs/user-manual#flag--custom_malloc) option. Can be accessed with [`configuration_field`](/versions/7.7.1/rules/lib/globals/bzl#configuration_field): +Returns label pointed to by [`--custom_malloc`](/versions/7.7.3/docs/user-manual#flag--custom_malloc) option. Can be accessed with [`configuration_field`](/versions/7.7.3/rules/lib/globals/bzl#configuration_field): ``` attr.label( @@ -74,7 +74,7 @@ list cpp.cxxopts ``` -The flags passed to Bazel by [`--cxxopt`](/versions/7.7.1/docs/user-manual#flag--cxxopt) option. +The flags passed to Bazel by [`--cxxopt`](/versions/7.7.3/docs/user-manual#flag--cxxopt) option. ## linkopts @@ -82,7 +82,7 @@ list cpp.linkopts ``` -The flags passed to Bazel by [`--linkopt`](/versions/7.7.1/docs/user-manual#flag--linkopt) option. +The flags passed to Bazel by [`--linkopt`](/versions/7.7.3/docs/user-manual#flag--linkopt) option. ## objc\_generate\_linkmap @@ -106,4 +106,4 @@ list cpp.objccopts ``` -The flags passed to Bazel by [`--objccopt`](/versions/7.7.1/docs/user-manual#flag--objccopt) option. \ No newline at end of file +The flags passed to Bazel by [`--objccopt`](/versions/7.7.3/docs/user-manual#flag--objccopt) option. \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/fragments/j2objc.mdx b/docs/versions/7.7.3/rules/lib/fragments/j2objc.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/fragments/j2objc.mdx rename to docs/versions/7.7.3/rules/lib/fragments/j2objc.mdx
diff --git a/docs/versions/7.7.1/rules/lib/fragments/java.mdx b/docs/versions/7.7.3/rules/lib/fragments/java.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/fragments/java.mdx rename to docs/versions/7.7.3/rules/lib/fragments/java.mdx
diff --git a/docs/versions/7.7.1/rules/lib/fragments/objc.mdx b/docs/versions/7.7.3/rules/lib/fragments/objc.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/fragments/objc.mdx rename to docs/versions/7.7.3/rules/lib/fragments/objc.mdx
diff --git a/docs/versions/7.7.1/rules/lib/fragments/platform.mdx b/docs/versions/7.7.3/rules/lib/fragments/platform.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/fragments/platform.mdx rename to docs/versions/7.7.3/rules/lib/fragments/platform.mdx
diff --git a/docs/versions/7.7.1/rules/lib/fragments/proto.mdx b/docs/versions/7.7.3/rules/lib/fragments/proto.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/fragments/proto.mdx rename to docs/versions/7.7.3/rules/lib/fragments/proto.mdx
diff --git a/docs/versions/7.7.1/rules/lib/fragments/py.mdx b/docs/versions/7.7.3/rules/lib/fragments/py.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/fragments/py.mdx rename to docs/versions/7.7.3/rules/lib/fragments/py.mdx
diff --git a/docs/versions/7.7.1/rules/lib/fragments/swift.mdx b/docs/versions/7.7.3/rules/lib/fragments/swift.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/fragments/swift.mdx rename to docs/versions/7.7.3/rules/lib/fragments/swift.mdx
diff --git a/docs/versions/7.7.3/rules/lib/globals.mdx b/docs/versions/7.7.3/rules/lib/globals.mdx new file mode 100644 index 0000000..f6d9ac6 --- /dev/null +++ b/docs/versions/7.7.3/rules/lib/globals.mdx
@@ -0,0 +1,12 @@ +--- +title: 'Global functions' +--- + +This section lists the global functions available in Starlark. The list of available functions differs depending on the file type (whether a BUILD file, or a .bzl file, etc). + +* [.bzl files](/versions/7.7.3/rules/lib/globals/bzl) +* [All Bazel files](/versions/7.7.3/rules/lib/globals/all) +* [BUILD files](/versions/7.7.3/rules/lib/globals/build) +* [MODULE.bazel files](/versions/7.7.3/rules/lib/globals/module) +* [VENDOR.bazel files](/versions/7.7.3/rules/lib/globals/vendor) +* [WORKSPACE files](/versions/7.7.3/rules/lib/globals/workspace) \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/globals/all.mdx b/docs/versions/7.7.3/rules/lib/globals/all.mdx similarity index 97% rename from docs/versions/7.7.1/rules/lib/globals/all.mdx rename to docs/versions/7.7.3/rules/lib/globals/all.mdx index a7b3634..1f407c9 100644 --- a/docs/versions/7.7.1/rules/lib/globals/all.mdx +++ b/docs/versions/7.7.3/rules/lib/globals/all.mdx
@@ -49,7 +49,7 @@ | Parameter | Description | | --- | --- | -| `x` | [int](/versions/7.7.1/rules/lib/core/int); or [float](/versions/7.7.1/rules/lib/core/float); required A number (int or float) | +| `x` | [int](/versions/7.7.3/rules/lib/core/int); or [float](/versions/7.7.3/rules/lib/core/float); required A number (int or float) | ## all @@ -109,7 +109,7 @@ dict dict(pairs=[], **kwargs) ``` -Creates a [dictionary](/versions/7.7.1/rules/lib/core/dict) 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. +Creates a [dictionary](/versions/7.7.3/rules/lib/core/dict) 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. ### Parameters @@ -164,7 +164,7 @@ | Parameter | Description | | --- | --- | | `msg` | default is `None` Deprecated: use positional arguments instead. This argument acts like an implicit leading positional argument. | -| `attr` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` Deprecated. Causes an optional prefix containing this string to be added to the error message. | +| `attr` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` Deprecated. Causes an optional prefix containing this string to be added to the error message. | | `sep` | default is `" "` The separator string between the objects, default is space (" "). | | `args` | required 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. | @@ -393,7 +393,7 @@ | Parameter | Description | | --- | --- | | `start_or_stop` | required Value of the start element if stop is provided, otherwise value of stop and the actual start is 0 | -| `stop_or_none` | [int](/versions/7.7.1/rules/lib/core/int); or `None`; default is `None` optional index of the first item *not* to be included in the resulting list; generation of the list stops before `stop` is reached. | +| `stop_or_none` | [int](/versions/7.7.3/rules/lib/core/int); or `None`; default is `None` optional index of the first item *not* to be included in the resulting list; generation of the list stops before `stop` is reached. | | `step` | default is `1` The increment (default is 1). It may be negative. | ## repr
diff --git a/docs/versions/7.7.1/rules/lib/globals/build.mdx b/docs/versions/7.7.3/rules/lib/globals/build.mdx similarity index 85% rename from docs/versions/7.7.1/rules/lib/globals/build.mdx rename to docs/versions/7.7.3/rules/lib/globals/build.mdx index 22c989b..0fe6542 100644 --- a/docs/versions/7.7.1/rules/lib/globals/build.mdx +++ b/docs/versions/7.7.3/rules/lib/globals/build.mdx
@@ -2,7 +2,7 @@ title: 'BUILD files' --- -Methods available in BUILD files. See also the Build Encyclopedia for extra [functions](/versions/7.7.1/reference/be/functions) and build rules, which can also be used in BUILD files. +Methods available in BUILD files. See also the Build Encyclopedia for extra [functions](/versions/7.7.3/reference/be/functions) and build rules, which can also be used in BUILD files. ## Members @@ -27,7 +27,7 @@ depset depset(direct=None, order="default", *, transitive=None) ``` -Creates a [depset](/versions/7.7.1/rules/lib/builtins/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](https://bazel.build/versions/7.7.1/extending/depsets) for more information. +Creates a [depset](/versions/7.7.3/rules/lib/builtins/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](https://bazel.build/versions/7.7.3/extending/depsets) for more information. All elements (direct and indirect) of a depset must be of the same type, as obtained by the expression `type(x)`. @@ -41,9 +41,9 @@ | Parameter | Description | | --- | --- | -| `direct` | [sequence](/versions/7.7.1/rules/lib/core/list); or `None`; default is `None` A list of *direct* elements of a depset. | -| `order` | default is `"default"` The traversal strategy for the new depset. See [here](/versions/7.7.1/rules/lib/builtins/depset) for the possible values. | -| `transitive` | [sequence](/versions/7.7.1/rules/lib/core/list) of [depset](/versions/7.7.1/rules/lib/builtins/depset)s; or `None`; default is `None` A list of depsets whose elements will become indirect elements of the depset. | +| `direct` | [sequence](/versions/7.7.3/rules/lib/core/list); or `None`; default is `None` A list of *direct* elements of a depset. | +| `order` | default is `"default"` The traversal strategy for the new depset. See [here](/versions/7.7.3/rules/lib/builtins/depset) for the possible values. | +| `transitive` | [sequence](/versions/7.7.3/rules/lib/core/list) of [depset](/versions/7.7.3/rules/lib/builtins/depset)s; or `None`; default is `None` A list of depsets whose elements will become indirect elements of the depset. | ## existing\_rule @@ -101,9 +101,9 @@ | Parameter | Description | | --- | --- | -| `srcs` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; required The list of files to export. | -| `visibility` | [sequence](/versions/7.7.1/rules/lib/core/list); or `None`; default is `None` 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. | -| `licenses` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; or `None`; default is `None` Licenses to be specified. | +| `srcs` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; required The list of files to export. | +| `visibility` | [sequence](/versions/7.7.3/rules/lib/core/list); or `None`; default is `None` 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. | +| `licenses` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; or `None`; default is `None` Licenses to be specified. | ## glob @@ -122,8 +122,8 @@ | Parameter | Description | | --- | --- | -| `include` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` The list of glob patterns to include. | -| `exclude` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` The list of glob patterns to exclude. | +| `include` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` The list of glob patterns to include. | +| `exclude` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` The list of glob patterns to exclude. | | `exclude_directories` | default is `1` A flag whether to exclude directories or not. | | `allow_empty` | default is `unbound` 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). | @@ -158,8 +158,8 @@ | Parameter | Description | | --- | --- | | `name` | required The unique name for this rule. | -| `packages` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` A complete enumeration of packages in this group. | -| `includes` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` Other package groups that are included in this one. | +| `packages` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` A complete enumeration of packages in this group. | +| `includes` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` Other package groups that are included in this one. | ## package\_name @@ -175,19 +175,19 @@ Label package_relative_label(input) ``` -Converts the input string into a [Label](/versions/7.7.1/rules/lib/builtins/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. +Converts the input string into a [Label](/versions/7.7.3/rules/lib/builtins/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()](/versions/7.7.1/rules/lib/builtins/Label#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.) +*Usage note:* The difference between this function and [Label()](/versions/7.7.3/rules/lib/builtins/Label#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.) ### Parameters | Parameter | Description | | --- | --- | -| `input` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); required The input label string or Label object. If a Label object is passed, it's returned as is. | +| `input` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); required The input label string or Label object. If a Label object is passed, it's returned as is. | ## repo\_name @@ -214,7 +214,7 @@ unknown select(x, no_match_error='') ``` -`select()` is the helper function that makes a rule attribute [configurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes). See [build encyclopedia](/versions/7.7.1/reference/be/functions#select) for details. +`select()` is the helper function that makes a rule attribute [configurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes). See [build encyclopedia](/versions/7.7.3/reference/be/functions#select) for details. ### Parameters @@ -235,6 +235,6 @@ | Parameter | Description | | --- | --- | -| `include` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; required The list of glob patterns to include in subpackages scan. | -| `exclude` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` The list of glob patterns to exclude from subpackages scan. | +| `include` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; required The list of glob patterns to include in subpackages scan. | +| `exclude` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` The list of glob patterns to exclude from subpackages scan. | | `allow_empty` | default is `False` 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. | \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/globals/bzl.mdx b/docs/versions/7.7.3/rules/lib/globals/bzl.mdx similarity index 81% rename from docs/versions/7.7.1/rules/lib/globals/bzl.mdx rename to docs/versions/7.7.3/rules/lib/globals/bzl.mdx index 792dfba..cd69b0c 100644 --- a/docs/versions/7.7.1/rules/lib/globals/bzl.mdx +++ b/docs/versions/7.7.3/rules/lib/globals/bzl.mdx
@@ -26,9 +26,9 @@ transition analysis_test_transition(settings) ``` -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 `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()`](/versions/7.7.1/rules/lib/builtins/transition). +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 `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()`](/versions/7.7.3/rules/lib/builtins/transition). -This function is primarily designed to facilitate the [Analysis Test Framework](https://bazel.build/versions/7.7.1/rules/testing) core library. See its documentation (or its implementation) for best practices. +This function is primarily designed to facilitate the [Analysis Test Framework](https://bazel.build/versions/7.7.3/rules/testing) core library. See its documentation (or its implementation) for best practices. ### Parameters @@ -42,28 +42,28 @@ Aspect aspect(implementation, attr_aspects=[], attrs={}, required_providers=[], required_aspect_providers=[], provides=[], requires=[], fragments=[], host_fragments=[], toolchains=[], incompatible_use_toolchain_transition=False, doc=None, *, apply_to_generating_rules=False, exec_compatible_with=[], exec_groups=None, subrules=[]) ``` -Creates a new aspect. The result of this function must be stored in a global value. Please see the [introduction to Aspects](https://bazel.build/versions/7.7.1/rules/aspects) for more details. +Creates a new aspect. The result of this function must be stored in a global value. Please see the [introduction to Aspects](https://bazel.build/versions/7.7.3/rules/aspects) for more details. ### Parameters | Parameter | Description | | --- | --- | -| `implementation` | required A Starlark function that implements this aspect, with exactly two parameters: [Target](/versions/7.7.1/rules/lib/builtins/Target) (the target to which the aspect is applied) and [ctx](/versions/7.7.1/rules/lib/builtins/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. | -| `attr_aspects` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` 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. | -| `attrs` | [dict](/versions/7.7.1/rules/lib/core/dict); default is `{}` 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](/versions/7.7.1/rules/lib/toplevel/attr) module). Aspect attributes are available to implementation function as fields of `ctx` parameter. Implicit attributes starting with `_` must have default values, and have type `label` or `label_list`. Explicit attributes must have type `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. | +| `implementation` | required A Starlark function that implements this aspect, with exactly two parameters: [Target](/versions/7.7.3/rules/lib/builtins/Target) (the target to which the aspect is applied) and [ctx](/versions/7.7.3/rules/lib/builtins/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. | +| `attr_aspects` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` 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. | +| `attrs` | [dict](/versions/7.7.3/rules/lib/core/dict); default is `{}` 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](/versions/7.7.3/rules/lib/toplevel/attr) module). Aspect attributes are available to implementation function as fields of `ctx` parameter. Implicit attributes starting with `_` must have default values, and have type `label` or `label_list`. Explicit attributes must have type `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. | | `required_providers` | default is `[]` This attribute allows the aspect to limit its propagation to only the targets whose rules advertise its required providers. 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. An unnested list of providers will automatically be converted to a list containing one list of providers. That is, `[FooInfo, BarInfo]` will automatically be converted to `[[FooInfo, BarInfo]]`. To make some rule (e.g. `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`. | | `required_aspect_providers` | default is `[]` 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. An unnested list of providers will automatically be converted to a list containing one list of providers. That is, `[FooInfo, BarInfo]` will automatically be converted to `[[FooInfo, BarInfo]]`. To make another aspect (e.g. `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`. | -| `provides` | default is `[]` A list of providers that the implementation function must return. 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 `*Info` object returned by [`provider()`](/versions/7.7.1/rules/lib/globals/bzl#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`](/versions/7.7.1/rules/lib/globals/bzl#aspect.required_providers) field of an [aspect](/versions/7.7.1/rules/lib/globals/bzl#aspect) does, however, require that providers are specified here. | -| `requires` | [sequence](/versions/7.7.1/rules/lib/core/list) of [Aspect](/versions/7.7.1/rules/lib/builtins/Aspect)s; default is `[]` List of aspects required to be propagated before this aspect. | -| `fragments` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` List of names of configuration fragments that the aspect requires in target configuration. | -| `host_fragments` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` List of names of configuration fragments that the aspect requires in host configuration. | -| `toolchains` | [sequence](/versions/7.7.1/rules/lib/core/list); default is `[]` 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`. | +| `provides` | default is `[]` A list of providers that the implementation function must return. 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 `*Info` object returned by [`provider()`](/versions/7.7.3/rules/lib/globals/bzl#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`](/versions/7.7.3/rules/lib/globals/bzl#aspect.required_providers) field of an [aspect](/versions/7.7.3/rules/lib/globals/bzl#aspect) does, however, require that providers are specified here. | +| `requires` | [sequence](/versions/7.7.3/rules/lib/core/list) of [Aspect](/versions/7.7.3/rules/lib/builtins/Aspect)s; default is `[]` List of aspects required to be propagated before this aspect. | +| `fragments` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` List of names of configuration fragments that the aspect requires in target configuration. | +| `host_fragments` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` List of names of configuration fragments that the aspect requires in host configuration. | +| `toolchains` | [sequence](/versions/7.7.3/rules/lib/core/list); default is `[]` 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`. | | `incompatible_use_toolchain_transition` | default is `False` Deprecated, this is no longer in use and should be removed. | -| `doc` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A description of the aspect that can be extracted by documentation generating tools. | +| `doc` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A description of the aspect that can be extracted by documentation generating tools. | | `apply_to_generating_rules` | default is `False` If true, the aspect will, when applied to an output file, instead apply to the output file's generating rule. 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. | -| `exec_compatible_with` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` A list of constraints on the execution platform that apply to all instances of this aspect. | -| `exec_groups` | [dict](/versions/7.7.1/rules/lib/core/dict); or `None`; default is `None` Dict of execution group name (string) to [`exec_group`s](/versions/7.7.1/rules/lib/globals/bzl#exec_group). If set, allows aspects to run actions on multiple execution platforms within a single instance. See [execution groups documentation](/versions/7.7.1/reference/exec-groups) for more info. | -| `subrules` | [sequence](/versions/7.7.1/rules/lib/core/list) of [Subrule](/versions/7.7.1/rules/lib/builtins/Subrule)s; default is `[]` Experimental: list of subrules used by this aspect. | +| `exec_compatible_with` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` A list of constraints on the execution platform that apply to all instances of this aspect. | +| `exec_groups` | [dict](/versions/7.7.3/rules/lib/core/dict); or `None`; default is `None` Dict of execution group name (string) to [`exec_group`s](/versions/7.7.3/rules/lib/globals/bzl#exec_group). If set, allows aspects to run actions on multiple execution platforms within a single instance. See [execution groups documentation](/versions/7.7.3/reference/exec-groups) for more info. | +| `subrules` | [sequence](/versions/7.7.3/rules/lib/core/list) of [Subrule](/versions/7.7.3/rules/lib/builtins/Subrule)s; default is `[]` Experimental: list of subrules used by this aspect. | ## configuration\_field @@ -71,7 +71,7 @@ LateBoundDefault configuration_field(fragment, name) ``` -References a late-bound default value for an attribute of type [label](/versions/7.7.1/rules/lib/toplevel/attr#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](https://bazel.build/versions/7.7.1/extending/rules#private-attributes). +References a late-bound default value for an attribute of type [label](/versions/7.7.3/rules/lib/toplevel/attr#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](https://bazel.build/versions/7.7.3/extending/rules#private-attributes). Example usage: @@ -102,7 +102,7 @@ depset depset(direct=None, order="default", *, transitive=None) ``` -Creates a [depset](/versions/7.7.1/rules/lib/builtins/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](https://bazel.build/versions/7.7.1/extending/depsets) for more information. +Creates a [depset](/versions/7.7.3/rules/lib/builtins/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](https://bazel.build/versions/7.7.3/extending/depsets) for more information. All elements (direct and indirect) of a depset must be of the same type, as obtained by the expression `type(x)`. @@ -116,9 +116,9 @@ | Parameter | Description | | --- | --- | -| `direct` | [sequence](/versions/7.7.1/rules/lib/core/list); or `None`; default is `None` A list of *direct* elements of a depset. | -| `order` | default is `"default"` The traversal strategy for the new depset. See [here](/versions/7.7.1/rules/lib/builtins/depset) for the possible values. | -| `transitive` | [sequence](/versions/7.7.1/rules/lib/core/list) of [depset](/versions/7.7.1/rules/lib/builtins/depset)s; or `None`; default is `None` A list of depsets whose elements will become indirect elements of the depset. | +| `direct` | [sequence](/versions/7.7.3/rules/lib/core/list); or `None`; default is `None` A list of *direct* elements of a depset. | +| `order` | default is `"default"` The traversal strategy for the new depset. See [here](/versions/7.7.3/rules/lib/builtins/depset) for the possible values. | +| `transitive` | [sequence](/versions/7.7.3/rules/lib/core/list) of [depset](/versions/7.7.3/rules/lib/builtins/depset)s; or `None`; default is `None` A list of depsets whose elements will become indirect elements of the depset. | ## exec\_group @@ -126,14 +126,14 @@ exec_group exec_group(toolchains=[], exec_compatible_with=[]) ``` -Creates an [execution group](/versions/7.7.1/reference/exec-groups) which can be used to create actions for a specific execution platform during rule implementation. +Creates an [execution group](/versions/7.7.3/reference/exec-groups) which can be used to create actions for a specific execution platform during rule implementation. ### Parameters | Parameter | Description | | --- | --- | -| `toolchains` | [sequence](/versions/7.7.1/rules/lib/core/list); default is `[]` The set of toolchains this execution group requires. The list can contain String, Label, or StarlarkToolchainTypeApi objects, in any combination. | -| `exec_compatible_with` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` A list of constraints on the execution platform. | +| `toolchains` | [sequence](/versions/7.7.3/rules/lib/core/list); default is `[]` The set of toolchains this execution group requires. The list can contain String, Label, or StarlarkToolchainTypeApi objects, in any combination. | +| `exec_compatible_with` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` A list of constraints on the execution platform. | ## module\_extension @@ -149,8 +149,8 @@ | --- | --- | | `implementation` | required The function that implements this module extension. Must take a single parameter, `module_ctx`. The function is called once at the beginning of a build to determine the set of available repos. | | `tag_classes` | default is `{}` 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. | -| `doc` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A description of the module extension that can be extracted by documentation generating tools. | -| `environ` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` 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. | +| `doc` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A description of the module extension that can be extracted by documentation generating tools. | +| `environ` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` 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. | | `os_dependent` | default is `False` Indicates whether this extension is OS-dependent or not | | `arch_dependent` | default is `False` Indicates whether this extension is architecture-dependent or not | @@ -173,18 +173,18 @@ ... ``` -See [Rules (Providers)](https://bazel.build/versions/7.7.1/extending/rules#providers) for a comprehensive guide on how to use providers. +See [Rules (Providers)](https://bazel.build/versions/7.7.3/extending/rules#providers) for a comprehensive guide on how to use providers. -Returns a [`Provider`](/versions/7.7.1/rules/lib/builtins/Provider) callable value if `init` is not specified. +Returns a [`Provider`](/versions/7.7.3/rules/lib/builtins/Provider) callable value if `init` is not specified. -If `init` is specified, returns a tuple of 2 elements: a [`Provider`](/versions/7.7.1/rules/lib/builtins/Provider) callable value and a *raw constructor* callable value. See [Rules (Custom initialization of custom providers)](https://bazel.build/versions/7.7.1/extending/rules#custom_initialization_of_providers) and the discussion of the `init` parameter below for details. +If `init` is specified, returns a tuple of 2 elements: a [`Provider`](/versions/7.7.3/rules/lib/builtins/Provider) callable value and a *raw constructor* callable value. See [Rules (Custom initialization of custom providers)](https://bazel.build/versions/7.7.3/extending/rules#custom_initialization_of_providers) and the discussion of the `init` parameter below for details. ### Parameters | Parameter | Description | | --- | --- | -| `doc` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` | -| `fields` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; or [dict](/versions/7.7.1/rules/lib/core/dict); or `None`; default is `None` If specified, restricts the set of allowed fields. Possible values are: * list of fields: ``` provider(fields = ['a', 'b']) ``` * dictionary field name -> documentation: ``` provider( fields = { 'a' : 'Documentation for a', 'b' : 'Documentation for b' }) ``` All fields are optional. | +| `doc` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` | +| `fields` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; or [dict](/versions/7.7.3/rules/lib/core/dict); or `None`; default is `None` If specified, restricts the set of allowed fields. Possible values are: * list of fields: ``` provider(fields = ['a', 'b']) ``` * dictionary field name -> documentation: ``` provider( fields = { 'a' : 'Documentation for a', 'b' : 'Documentation for b' }) ``` All fields are optional. | | `init` | callable; or `None`; default is `None` | ## repository\_rule @@ -200,12 +200,12 @@ | Parameter | Description | | --- | --- | | `implementation` | required | -| `attrs` | [dict](/versions/7.7.1/rules/lib/core/dict); or `None`; default is `None` | +| `attrs` | [dict](/versions/7.7.3/rules/lib/core/dict); or `None`; default is `None` | | `local` | default is `False` Indicate that this rule fetches everything from the local system and should be reevaluated at every fetch. | -| `environ` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` **Deprecated**. This parameter has been deprecated. Migrate to `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. | +| `environ` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` **Deprecated**. This parameter has been deprecated. Migrate to `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. | | `configure` | default is `False` Indicate that the repository inspects the system for configuration purpose | | `remotable` | default is `False` **Experimental**. This parameter is experimental and may change at any time. Please do not depend on it. It may be enabled on an experimental basis by setting `---experimental_repo_remote_exec` Compatible with remote execution | -| `doc` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` | +| `doc` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` | ## rule @@ -223,28 +223,28 @@ | Parameter | Description | | --- | --- | -| `implementation` | required the Starlark function implementing this rule, must have exactly one parameter: [ctx](/versions/7.7.1/rules/lib/builtins/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. | -| `test` | [bool](/versions/7.7.1/rules/lib/core/bool); default is `unbound` 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](#rule.executable); it is unnecessary (and discouraged) to explicitly set `executable = True` for a test rule. The value defaults to `False`. See the [Rules page](https://bazel.build/versions/7.7.1/extending/rules#executable_rules_and_test_rules) for more information. | -| `attrs` | [dict](/versions/7.7.1/rules/lib/core/dict); default is `{}` dictionary to declare all the attributes of the rule. It maps from an attribute name to an attribute object (see [attr](/versions/7.7.1/rules/lib/toplevel/attr) 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, the rule function imposes a cap on the size of attrs. | -| `outputs` | [dict](/versions/7.7.1/rules/lib/core/dict); or `None`; or [function](/versions/7.7.1/rules/lib/core/function); default is `None` **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. A schema for defining predeclared outputs. Unlike [`output`](/versions/7.7.1/rules/lib/toplevel/attr#output) and [`output_list`](/versions/7.7.1/rules/lib/toplevel/attr#output_list) attributes, the user does not specify the labels for these files. See the [Rules page](https://bazel.build/versions/7.7.1/extending/rules#files) for more on predeclared outputs. 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 `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. 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 [`File`](/versions/7.7.1/rules/lib/builtins/File) in [`ctx.outputs`](/versions/7.7.1/rules/lib/builtins/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`: * String-typed attributes are substituted verbatim.* Label-typed attributes become the part of the label after the package, minus the file extension. For example, the label `"//pkg:a/b.c"` becomes `"a/b"`.* Output-typed attributes become the part of the label after the package, including the file extension (for the above example, `"a/b.c"`).* All list-typed attributes (for example, `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`).* Other attribute types may not appear in placeholders.* The special non-attribute placeholders `%{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`. In practice, the most common substitution placeholder is `"%{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`. | -| `executable` | [bool](/versions/7.7.1/rules/lib/core/bool); default is `unbound` | +| `implementation` | required the Starlark function implementing this rule, must have exactly one parameter: [ctx](/versions/7.7.3/rules/lib/builtins/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. | +| `test` | [bool](/versions/7.7.3/rules/lib/core/bool); default is `unbound` 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](#rule.executable); it is unnecessary (and discouraged) to explicitly set `executable = True` for a test rule. The value defaults to `False`. See the [Rules page](https://bazel.build/versions/7.7.3/extending/rules#executable_rules_and_test_rules) for more information. | +| `attrs` | [dict](/versions/7.7.3/rules/lib/core/dict); default is `{}` dictionary to declare all the attributes of the rule. It maps from an attribute name to an attribute object (see [attr](/versions/7.7.3/rules/lib/toplevel/attr) 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, the rule function imposes a cap on the size of attrs. | +| `outputs` | [dict](/versions/7.7.3/rules/lib/core/dict); or `None`; or [function](/versions/7.7.3/rules/lib/core/function); default is `None` **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. A schema for defining predeclared outputs. Unlike [`output`](/versions/7.7.3/rules/lib/toplevel/attr#output) and [`output_list`](/versions/7.7.3/rules/lib/toplevel/attr#output_list) attributes, the user does not specify the labels for these files. See the [Rules page](https://bazel.build/versions/7.7.3/extending/rules#files) for more on predeclared outputs. 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 `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. 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 [`File`](/versions/7.7.3/rules/lib/builtins/File) in [`ctx.outputs`](/versions/7.7.3/rules/lib/builtins/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`: * String-typed attributes are substituted verbatim.* Label-typed attributes become the part of the label after the package, minus the file extension. For example, the label `"//pkg:a/b.c"` becomes `"a/b"`.* Output-typed attributes become the part of the label after the package, including the file extension (for the above example, `"a/b.c"`).* All list-typed attributes (for example, `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`).* Other attribute types may not appear in placeholders.* The special non-attribute placeholders `%{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`. In practice, the most common substitution placeholder is `"%{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`. | +| `executable` | [bool](/versions/7.7.3/rules/lib/core/bool); default is `unbound` | | `output_to_genfiles` | default is `False` 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. | -| `fragments` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` List of names of configuration fragments that the rule requires in target configuration. | -| `host_fragments` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` List of names of configuration fragments that the rule requires in host configuration. | -| `_skylark_testable` | default is `False` *(Experimental)* 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()](/versions/7.7.1/rules/lib/builtins/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. | -| `toolchains` | [sequence](/versions/7.7.1/rules/lib/core/list); default is `[]` 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`. | +| `fragments` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` List of names of configuration fragments that the rule requires in target configuration. | +| `host_fragments` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` List of names of configuration fragments that the rule requires in host configuration. | +| `_skylark_testable` | default is `False` *(Experimental)* 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()](/versions/7.7.3/rules/lib/builtins/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. | +| `toolchains` | [sequence](/versions/7.7.3/rules/lib/core/list); default is `[]` 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`. | | `incompatible_use_toolchain_transition` | default is `False` Deprecated, this is no longer in use and should be removed. | -| `doc` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A description of the rule that can be extracted by documentation generating tools. | -| `provides` | default is `[]` A list of providers that the implementation function must return. 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 `*Info` object returned by [`provider()`](/versions/7.7.1/rules/lib/globals/bzl#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`](/versions/7.7.1/rules/lib/globals/bzl#aspect.required_providers) field of an [aspect](/versions/7.7.1/rules/lib/globals/bzl#aspect) does, however, require that providers are specified here. | -| `exec_compatible_with` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` A list of constraints on the execution platform that apply to all targets of this rule type. | -| `analysis_test` | default is `False` If true, then this rule is treated as an analysis test. Note: Analysis test rules are primarily defined using infrastructure provided in core Starlark libraries. See [Testing](https://bazel.build/versions/7.7.1/rules/testing#testing-rules) for guidance. If a rule is defined as an analysis test rule, it becomes allowed to use configuration transitions defined using [analysis\_test\_transition](#analysis_test_transition) on its attributes, but opts into some restrictions: * Targets of this rule are limited in the number of transitive dependencies they may have.* The rule is considered a test rule (as if `test=True` were set). This supersedes the value of `test` * The rule implementation function may not register actions. Instead, it must register a pass/fail result via providing [AnalysisTestResultInfo](/versions/7.7.1/rules/lib/providers/AnalysisTestResultInfo). | -| `build_setting` | [BuildSetting](/versions/7.7.1/rules/lib/builtins/BuildSetting); or `None`; default is `None` If set, describes what kind of [`build setting`](/versions/7.7.1/rules/config#user-defined-build-settings) this rule is. See the [`config`](/versions/7.7.1/rules/lib/toplevel/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. | +| `doc` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A description of the rule that can be extracted by documentation generating tools. | +| `provides` | default is `[]` A list of providers that the implementation function must return. 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 `*Info` object returned by [`provider()`](/versions/7.7.3/rules/lib/globals/bzl#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`](/versions/7.7.3/rules/lib/globals/bzl#aspect.required_providers) field of an [aspect](/versions/7.7.3/rules/lib/globals/bzl#aspect) does, however, require that providers are specified here. | +| `exec_compatible_with` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` A list of constraints on the execution platform that apply to all targets of this rule type. | +| `analysis_test` | default is `False` If true, then this rule is treated as an analysis test. Note: Analysis test rules are primarily defined using infrastructure provided in core Starlark libraries. See [Testing](https://bazel.build/versions/7.7.3/rules/testing#testing-rules) for guidance. If a rule is defined as an analysis test rule, it becomes allowed to use configuration transitions defined using [analysis\_test\_transition](#analysis_test_transition) on its attributes, but opts into some restrictions: * Targets of this rule are limited in the number of transitive dependencies they may have.* The rule is considered a test rule (as if `test=True` were set). This supersedes the value of `test` * The rule implementation function may not register actions. Instead, it must register a pass/fail result via providing [AnalysisTestResultInfo](/versions/7.7.3/rules/lib/providers/AnalysisTestResultInfo). | +| `build_setting` | [BuildSetting](/versions/7.7.3/rules/lib/builtins/BuildSetting); or `None`; default is `None` If set, describes what kind of [`build setting`](/versions/7.7.3/rules/config#user-defined-build-settings) this rule is. See the [`config`](/versions/7.7.3/rules/lib/toplevel/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. | | `cfg` | default is `None` If set, points to the configuration transition the rule will apply to its own configuration before analysis. | -| `exec_groups` | [dict](/versions/7.7.1/rules/lib/core/dict); or `None`; default is `None` Dict of execution group name (string) to [`exec_group`s](/versions/7.7.1/rules/lib/globals/bzl#exec_group). If set, allows rules to run actions on multiple execution platforms within a single target. See [execution groups documentation](/versions/7.7.1/reference/exec-groups) for more info. | +| `exec_groups` | [dict](/versions/7.7.3/rules/lib/core/dict); or `None`; default is `None` Dict of execution group name (string) to [`exec_group`s](/versions/7.7.3/rules/lib/globals/bzl#exec_group). If set, allows rules to run actions on multiple execution platforms within a single target. See [execution groups documentation](/versions/7.7.3/reference/exec-groups) for more info. | | `initializer` | default is `None` Experimental: the Stalark function initializing the attributes of the rule. The function is called at load time for each instance of the rule. It's called with `name` and the values of public attributes defined bythe rule (not with generic attributes, for example `tags`). It has to return a dictionary from the attribute names to the desired values. The attributes that are not returned are unaffected. Returning `None` as value results in using the default value specified in the attribute definition. 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 `None`). 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 `**kwargs` for attributes that are not handled. 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. | | `parent` | default is `None` Experimental: the Stalark rule that is extended. When set the public attributes are merged as well as advertised providers. The rule matches `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. | -| `extendable` | [bool](/versions/7.7.1/rules/lib/core/bool); or [Label](/versions/7.7.1/rules/lib/builtins/Label); or [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` 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. | -| `subrules` | [sequence](/versions/7.7.1/rules/lib/core/list) of [Subrule](/versions/7.7.1/rules/lib/builtins/Subrule)s; default is `[]` Experimental: List of subrules used by this rule. | +| `extendable` | [bool](/versions/7.7.3/rules/lib/core/bool); or [Label](/versions/7.7.3/rules/lib/builtins/Label); or [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` 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. | +| `subrules` | [sequence](/versions/7.7.3/rules/lib/core/list) of [Subrule](/versions/7.7.3/rules/lib/builtins/Subrule)s; default is `[]` Experimental: List of subrules used by this rule. | ## select @@ -252,13 +252,13 @@ unknown select(x, no_match_error='') ``` -`select()` is the helper function that makes a rule attribute [configurable](/versions/7.7.1/reference/be/common-definitions#configurable-attributes). See [build encyclopedia](/versions/7.7.1/reference/be/functions#select) for details. +`select()` is the helper function that makes a rule attribute [configurable](/versions/7.7.3/reference/be/common-definitions#configurable-attributes). See [build encyclopedia](/versions/7.7.3/reference/be/functions#select) for details. ### Parameters | Parameter | Description | | --- | --- | -| `x` | required A dict that maps configuration conditions to values. Each key is a [Label](/versions/7.7.1/rules/lib/builtins/Label) or a label string that identifies a config\_setting or constraint\_value instance. See the [documentation on macros](https://bazel.build/versions/7.7.1/rules/macros#label-resolution) for when to use a Label instead of a string. | +| `x` | required A dict that maps configuration conditions to values. Each key is a [Label](/versions/7.7.3/rules/lib/builtins/Label) or a label string that identifies a config\_setting or constraint\_value instance. See the [documentation on macros](https://bazel.build/versions/7.7.3/rules/macros#label-resolution) for when to use a Label instead of a string. | | `no_match_error` | default is `''` Optional custom error to report if no condition matches. | ## subrule @@ -273,11 +273,11 @@ | Parameter | Description | | --- | --- | -| `implementation` | [function](/versions/7.7.1/rules/lib/core/function); required The Starlark function implementing this subrule | -| `attrs` | [dict](/versions/7.7.1/rules/lib/core/dict); default is `{}` A dictionary to declare all the (private) attributes of the subrule. Subrules may only have private attributes that are label-typed (i.e. label or label-list). The resolved values corresponding to these labels are automatically passed by Bazel to the subrule's implementation function as named arguments (thus the implementation function is required to accept named parameters matching the attribute names). The types of these values will be: * `FilesToRunProvider` for label attributes with `executable=True` * `File` for label attributes with `allow_single_file=True` * `Target` for all other label attributes * `[Target]` for all label-list attributes | -| `toolchains` | [sequence](/versions/7.7.1/rules/lib/core/list); default is `[]` 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 `ctx.toolchains`. | -| `fragments` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` List of names of configuration fragments that the subrule requires in target configuration. | -| `subrules` | [sequence](/versions/7.7.1/rules/lib/core/list) of [Subrule](/versions/7.7.1/rules/lib/builtins/Subrule)s; default is `[]` List of other subrules needed by this subrule. | +| `implementation` | [function](/versions/7.7.3/rules/lib/core/function); required The Starlark function implementing this subrule | +| `attrs` | [dict](/versions/7.7.3/rules/lib/core/dict); default is `{}` A dictionary to declare all the (private) attributes of the subrule. Subrules may only have private attributes that are label-typed (i.e. label or label-list). The resolved values corresponding to these labels are automatically passed by Bazel to the subrule's implementation function as named arguments (thus the implementation function is required to accept named parameters matching the attribute names). The types of these values will be: * `FilesToRunProvider` for label attributes with `executable=True` * `File` for label attributes with `allow_single_file=True` * `Target` for all other label attributes * `[Target]` for all label-list attributes | +| `toolchains` | [sequence](/versions/7.7.3/rules/lib/core/list); default is `[]` 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 `ctx.toolchains`. | +| `fragments` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` List of names of configuration fragments that the subrule requires in target configuration. | +| `subrules` | [sequence](/versions/7.7.3/rules/lib/core/list) of [Subrule](/versions/7.7.3/rules/lib/builtins/Subrule)s; default is `[]` List of other subrules needed by this subrule. | ## tag\_class @@ -291,8 +291,8 @@ | Parameter | Description | | --- | --- | -| `attrs` | default is `{}` A dictionary to declare all the attributes of this tag class. It maps from an attribute name to an attribute object (see [attr](/versions/7.7.1/rules/lib/toplevel/attr) module). | -| `doc` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A description of the tag class that can be extracted by documentation generating tools. | +| `attrs` | default is `{}` A dictionary to declare all the attributes of this tag class. It maps from an attribute name to an attribute object (see [attr](/versions/7.7.3/rules/lib/toplevel/attr) module). | +| `doc` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A description of the tag class that can be extracted by documentation generating tools. | ## visibility
diff --git a/docs/versions/7.7.1/rules/lib/globals/module.mdx b/docs/versions/7.7.3/rules/lib/globals/module.mdx similarity index 93% rename from docs/versions/7.7.1/rules/lib/globals/module.mdx rename to docs/versions/7.7.3/rules/lib/globals/module.mdx index 263fb23..ee63963 100644 --- a/docs/versions/7.7.1/rules/lib/globals/module.mdx +++ b/docs/versions/7.7.3/rules/lib/globals/module.mdx
@@ -36,11 +36,11 @@ | Parameter | Description | | --- | --- | | `module_name` | required The name of the Bazel module dependency to apply this override to. | -| `urls` | [string](/versions/7.7.1/rules/lib/core/string); or Iterable of [string](/versions/7.7.1/rules/lib/core/string)s; required The URLs of the archive; can be http(s):// or file:// URLs. | +| `urls` | [string](/versions/7.7.3/rules/lib/core/string); or Iterable of [string](/versions/7.7.3/rules/lib/core/string)s; required The URLs of the archive; can be http(s):// or file:// URLs. | | `integrity` | default is `''` The expected checksum of the archive file, in Subresource Integrity format. | | `strip_prefix` | default is `''` A directory prefix to strip from the extracted files. | -| `patches` | Iterable of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` 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. | -| `patch_cmds` | Iterable of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` Sequence of Bash commands to be applied on Linux/Macos after patches are applied. | +| `patches` | Iterable of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` 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. | +| `patch_cmds` | Iterable of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` Sequence of Bash commands to be applied on Linux/Macos after patches are applied. | | `patch_strip` | default is `0` Same as the --strip argument of Unix patch. | ## bazel\_dep @@ -58,7 +58,7 @@ | `name` | required The name of the module to be added as a direct dependency. | | `version` | default is `''` The version of the module to be added as a direct dependency. | | `max_compatibility_level` | default is `-1` 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. | -| `repo_name` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `''` The name of the external repo representing this dependency. This is by default the name of the module. Can be set to `None` to make this dependency a "*nodep*" dependency: in this case, this `bazel_dep` specification is only honored if the target module already exists in the dependency graph by some other means. | +| `repo_name` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `''` The name of the external repo representing this dependency. This is by default the name of the module. Can be set to `None` to make this dependency a "*nodep*" dependency: in this case, this `bazel_dep` specification is only honored if the target module already exists in the dependency graph by some other means. | | `dev_dependency` | default is `False` If true, this dependency will be ignored if the current module is not the root module or `--ignore_dev_dependency` is enabled. | ## flag\_alias @@ -91,8 +91,8 @@ | `module_name` | required The name of the Bazel module dependency to apply this override to. | | `remote` | required The URL of the remote Git repository. | | `commit` | default is `''` The commit that should be checked out. | -| `patches` | Iterable of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` 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. | -| `patch_cmds` | Iterable of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` Sequence of Bash commands to be applied on Linux/Macos after patches are applied. | +| `patches` | Iterable of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` 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. | +| `patch_cmds` | Iterable of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` Sequence of Bash commands to be applied on Linux/Macos after patches are applied. | | `patch_strip` | default is `0` Same as the --strip argument of Unix patch. | | `init_submodules` | default is `False` Whether git submodules in the fetched repo should be recursively initialized. | | `strip_prefix` | default is `''` A directory prefix to strip from the extracted files. This can be used to target a subdirectory of the git repo. Note that the subdirectory must have its own `MODULE.bazel` file with a module name that is the same as the `module\_name` arg passed to this `git\_override`. | @@ -168,10 +168,10 @@ | Parameter | Description | | --- | --- | | `name` | default is `''` 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. | -| `version` | default is `''` 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](/versions/7.7.1/external/module#version_format) for more details. | -| `compatibility_level` | default is `0` 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 `multiple_version_override` is in effect). See [the documentation](/versions/7.7.1/external/module#compatibility_level) for more details. | +| `version` | default is `''` 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](/versions/7.7.3/external/module#version_format) for more details. | +| `compatibility_level` | default is `0` 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 `multiple_version_override` is in effect). See [the documentation](/versions/7.7.3/external/module#compatibility_level) for more details. | | `repo_name` | default is `''` 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. | -| `bazel_compatibility` | Iterable of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` 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. | +| `bazel_compatibility` | Iterable of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` 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. | ## multiple\_version\_override @@ -179,14 +179,14 @@ None multiple_version_override(module_name, versions, registry='') ``` -Specifies that a dependency should still come from a registry, but multiple versions of it should be allowed to coexist. See [the documentation](/versions/7.7.1/external/module#multiple-version_override) 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. +Specifies that a dependency should still come from a registry, but multiple versions of it should be allowed to coexist. See [the documentation](/versions/7.7.3/external/module#multiple-version_override) 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. ### Parameters | Parameter | Description | | --- | --- | | `module_name` | required The name of the Bazel module dependency to apply this override to. | -| `versions` | Iterable of [string](/versions/7.7.1/rules/lib/core/string)s; required 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. | +| `versions` | Iterable of [string](/versions/7.7.3/rules/lib/core/string)s; required 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. | | `registry` | default is `''` Overrides the registry for this module; instead of finding this module from the default list of registries, the given registry should be used. | ## override\_repo @@ -215,14 +215,14 @@ None register_execution_platforms(dev_dependency=False, *platform_labels) ``` -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](/versions/7.7.1/docs/toolchains) for more information. +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](/versions/7.7.3/docs/toolchains) for more information. ### Parameters | Parameter | Description | | --- | --- | | `dev_dependency` | default is `False` If true, the execution platforms will not be registered if the current module is not the root module or `--ignore\_dev\_dependency` is enabled. | -| `platform_labels` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; required The labels of the platforms to register. | +| `platform_labels` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; required The labels of the platforms to register. | ## register\_toolchains @@ -230,14 +230,14 @@ None register_toolchains(dev_dependency=False, *toolchain_labels) ``` -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](/versions/7.7.1/docs/toolchains) for more information. +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](/versions/7.7.3/docs/toolchains) for more information. ### Parameters | Parameter | Description | | --- | --- | | `dev_dependency` | default is `False` If true, the toolchains will not be registered if the current module is not the root module or `--ignore\_dev\_dependency` is enabled. | -| `toolchain_labels` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; required The labels of the toolchains to register. Labels can include `:all`, in which case, all toolchain-providing targets in the package will be registered in lexicographical order by name. | +| `toolchain_labels` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; required The labels of the toolchains to register. Labels can include `:all`, in which case, all toolchain-providing targets in the package will be registered in lexicographical order by name. | ## single\_version\_override @@ -254,8 +254,8 @@ | `module_name` | required The name of the Bazel module dependency to apply this override to. | | `version` | default is `''` 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. | | `registry` | default is `''` Overrides the registry for this module; instead of finding this module from the default list of registries, the given registry should be used. | -| `patches` | Iterable of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` 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. 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. | -| `patch_cmds` | Iterable of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` Sequence of Bash commands to be applied on Linux/Macos after patches are applied. Changes to the MODULE.bazel file will not be effective. | +| `patches` | Iterable of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` 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. 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. | +| `patch_cmds` | Iterable of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` Sequence of Bash commands to be applied on Linux/Macos after patches are applied. Changes to the MODULE.bazel file will not be effective. | | `patch_strip` | default is `0` Same as the --strip argument of Unix patch. | ## use\_extension
diff --git a/docs/versions/7.7.1/rules/lib/globals/vendor.mdx b/docs/versions/7.7.3/rules/lib/globals/vendor.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/globals/vendor.mdx rename to docs/versions/7.7.3/rules/lib/globals/vendor.mdx
diff --git a/docs/versions/7.7.1/rules/lib/globals/workspace.mdx b/docs/versions/7.7.3/rules/lib/globals/workspace.mdx similarity index 79% rename from docs/versions/7.7.1/rules/lib/globals/workspace.mdx rename to docs/versions/7.7.3/rules/lib/globals/workspace.mdx index 67f7f9e..1c2814c 100644 --- a/docs/versions/7.7.1/rules/lib/globals/workspace.mdx +++ b/docs/versions/7.7.3/rules/lib/globals/workspace.mdx
@@ -26,7 +26,7 @@ | Parameter | Description | | --- | --- | | `name` | required The label under '//external' to serve as the alias name | -| `actual` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` The real label to be aliased | +| `actual` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` The real label to be aliased | ## register\_execution\_platforms @@ -34,13 +34,13 @@ None register_execution_platforms(*platform_labels) ``` -Register an already-defined platform so that Bazel can use it as an [execution platform](/versions/7.7.1/docs/toolchains#toolchain-resolution) during [toolchain resolution](/versions/7.7.1/docs/toolchains). +Register an already-defined platform so that Bazel can use it as an [execution platform](/versions/7.7.3/docs/toolchains#toolchain-resolution) during [toolchain resolution](/versions/7.7.3/docs/toolchains). ### Parameters | Parameter | Description | | --- | --- | -| `platform_labels` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; required The labels of the platforms to register. | +| `platform_labels` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; required The labels of the platforms to register. | ## register\_toolchains @@ -48,13 +48,13 @@ None register_toolchains(*toolchain_labels) ``` -Register an already-defined toolchain so that Bazel can use it during [toolchain resolution](/versions/7.7.1/docs/toolchains). See examples of [defining](/versions/7.7.1/docs/toolchains#defining-toolchains) and [registering toolchains](/versions/7.7.1/docs/toolchains#registering-and-building-with-toolchains). +Register an already-defined toolchain so that Bazel can use it during [toolchain resolution](/versions/7.7.3/docs/toolchains). See examples of [defining](/versions/7.7.3/docs/toolchains#defining-toolchains) and [registering toolchains](/versions/7.7.3/docs/toolchains#registering-and-building-with-toolchains). ### Parameters | Parameter | Description | | --- | --- | -| `toolchain_labels` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; required The labels of the toolchains to register. Labels can include `:all`, in which case, all toolchain-providing targets in the package will be registered in lexicographical order by name. | +| `toolchain_labels` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; required The labels of the toolchains to register. Labels can include `:all`, in which case, all toolchain-providing targets in the package will be registered in lexicographical order by name. | ## workspace @@ -68,7 +68,7 @@ This name is used for the directory that the repository's runfiles are stored in. For example, if there is a runfile `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`. -[Remote repository](/versions/7.7.1/docs/external) rule names must be valid workspace names. For example, you could have `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')`. +[Remote repository](/versions/7.7.3/docs/external) rule names must be valid workspace names. For example, you could have `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')`. ### Parameters
diff --git a/docs/versions/7.7.3/rules/lib/overview.mdx b/docs/versions/7.7.3/rules/lib/overview.mdx new file mode 100644 index 0000000..5396498 --- /dev/null +++ b/docs/versions/7.7.3/rules/lib/overview.mdx
@@ -0,0 +1,157 @@ +--- +title: 'One-Page Overview' +--- + +## [Global functions](/versions/7.7.3/rules/lib/globals) + +* [.bzl files](/versions/7.7.3/rules/lib/globals/bzl) +* [All Bazel files](/versions/7.7.3/rules/lib/globals/all) +* [BUILD files](/versions/7.7.3/rules/lib/globals/build) +* [MODULE.bazel files](/versions/7.7.3/rules/lib/globals/module) +* [VENDOR.bazel files](/versions/7.7.3/rules/lib/globals/vendor) +* [WORKSPACE files](/versions/7.7.3/rules/lib/globals/workspace) + +## [Configuration Fragments](/versions/7.7.3/rules/lib/fragments) + +* [apple](/versions/7.7.3/rules/lib/fragments/apple) +* [bazel\_android](/versions/7.7.3/rules/lib/fragments/bazel_android) +* [bazel\_py](/versions/7.7.3/rules/lib/fragments/bazel_py) +* [coverage](/versions/7.7.3/rules/lib/fragments/coverage) +* [cpp](/versions/7.7.3/rules/lib/fragments/cpp) +* [j2objc](/versions/7.7.3/rules/lib/fragments/j2objc) +* [java](/versions/7.7.3/rules/lib/fragments/java) +* [objc](/versions/7.7.3/rules/lib/fragments/objc) +* [platform](/versions/7.7.3/rules/lib/fragments/platform) +* [proto](/versions/7.7.3/rules/lib/fragments/proto) +* [py](/versions/7.7.3/rules/lib/fragments/py) +* [swift](/versions/7.7.3/rules/lib/fragments/swift) + +## [Providers](/versions/7.7.3/rules/lib/providers) + +* [AnalysisTestResultInfo](/versions/7.7.3/rules/lib/providers/AnalysisTestResultInfo) +* [AndroidNeverLinkLibrariesProvider](/versions/7.7.3/rules/lib/providers/AndroidNeverLinkLibrariesProvider) +* [AppleDebugOutputs](/versions/7.7.3/rules/lib/providers/AppleDebugOutputs) +* [AppleDynamicFramework](/versions/7.7.3/rules/lib/providers/AppleDynamicFramework) +* [AppleExecutableBinary](/versions/7.7.3/rules/lib/providers/AppleExecutableBinary) +* [BaselineProfileProvider](/versions/7.7.3/rules/lib/providers/BaselineProfileProvider) +* [CcInfo](/versions/7.7.3/rules/lib/providers/CcInfo) +* [CcToolchainConfigInfo](/versions/7.7.3/rules/lib/providers/CcToolchainConfigInfo) +* [CcToolchainInfo](/versions/7.7.3/rules/lib/providers/CcToolchainInfo) +* [ConstraintCollection](/versions/7.7.3/rules/lib/providers/ConstraintCollection) +* [ConstraintSettingInfo](/versions/7.7.3/rules/lib/providers/ConstraintSettingInfo) +* [ConstraintValueInfo](/versions/7.7.3/rules/lib/providers/ConstraintValueInfo) +* [DebugPackageInfo](/versions/7.7.3/rules/lib/providers/DebugPackageInfo) +* [DefaultInfo](/versions/7.7.3/rules/lib/providers/DefaultInfo) +* [ExecutionInfo](/versions/7.7.3/rules/lib/providers/ExecutionInfo) +* [FeatureFlagInfo](/versions/7.7.3/rules/lib/providers/FeatureFlagInfo) +* [file\_provider](/versions/7.7.3/rules/lib/providers/file_provider) +* [FilesToRunProvider](/versions/7.7.3/rules/lib/providers/FilesToRunProvider) +* [GeneratedExtensionRegistryProvider](/versions/7.7.3/rules/lib/providers/GeneratedExtensionRegistryProvider) +* [IncompatiblePlatformProvider](/versions/7.7.3/rules/lib/providers/IncompatiblePlatformProvider) +* [InstrumentedFilesInfo](/versions/7.7.3/rules/lib/providers/InstrumentedFilesInfo) +* [java\_compilation\_info](/versions/7.7.3/rules/lib/providers/java_compilation_info) +* [java\_output\_jars](/versions/7.7.3/rules/lib/providers/java_output_jars) +* [JavaRuntimeInfo](/versions/7.7.3/rules/lib/providers/JavaRuntimeInfo) +* [JavaToolchainInfo](/versions/7.7.3/rules/lib/providers/JavaToolchainInfo) +* [ObjcProvider](/versions/7.7.3/rules/lib/providers/ObjcProvider) +* [OutputGroupInfo](/versions/7.7.3/rules/lib/providers/OutputGroupInfo) +* [PackageSpecificationInfo](/versions/7.7.3/rules/lib/providers/PackageSpecificationInfo) +* [PlatformInfo](/versions/7.7.3/rules/lib/providers/PlatformInfo) +* [ProguardSpecProvider](/versions/7.7.3/rules/lib/providers/ProguardSpecProvider) +* [ProtoRegistryProvider](/versions/7.7.3/rules/lib/providers/ProtoRegistryProvider) +* [PyInfo](/versions/7.7.3/rules/lib/providers/PyInfo) +* [PyRuntimeInfo](/versions/7.7.3/rules/lib/providers/PyRuntimeInfo) +* [RunEnvironmentInfo](/versions/7.7.3/rules/lib/providers/RunEnvironmentInfo) +* [TemplateVariableInfo](/versions/7.7.3/rules/lib/providers/TemplateVariableInfo) +* [ToolchainInfo](/versions/7.7.3/rules/lib/providers/ToolchainInfo) +* [ToolchainTypeInfo](/versions/7.7.3/rules/lib/providers/ToolchainTypeInfo) +* [XcodeProperties](/versions/7.7.3/rules/lib/providers/XcodeProperties) +* [XcodeVersionConfig](/versions/7.7.3/rules/lib/providers/XcodeVersionConfig) + +## [Built-in Types](/versions/7.7.3/rules/lib/builtins) + +* [Action](/versions/7.7.3/rules/lib/builtins/Action) +* [actions](/versions/7.7.3/rules/lib/builtins/actions) +* [apple\_platform](/versions/7.7.3/rules/lib/builtins/apple_platform) +* [apple\_platform\_type](/versions/7.7.3/rules/lib/builtins/apple_platform_type) +* [apple\_toolchain](/versions/7.7.3/rules/lib/builtins/apple_toolchain) +* [Args](/versions/7.7.3/rules/lib/builtins/Args) +* [Aspect](/versions/7.7.3/rules/lib/builtins/Aspect) +* [Attribute](/versions/7.7.3/rules/lib/builtins/Attribute) +* [bazel\_module](/versions/7.7.3/rules/lib/builtins/bazel_module) +* [bazel\_module\_tags](/versions/7.7.3/rules/lib/builtins/bazel_module_tags) +* [BuildSetting](/versions/7.7.3/rules/lib/builtins/BuildSetting) +* [CcCompilationOutputs](/versions/7.7.3/rules/lib/builtins/CcCompilationOutputs) +* [CcLinkingOutputs](/versions/7.7.3/rules/lib/builtins/CcLinkingOutputs) +* [CompilationContext](/versions/7.7.3/rules/lib/builtins/CompilationContext) +* [configuration](/versions/7.7.3/rules/lib/builtins/configuration) +* [ctx](/versions/7.7.3/rules/lib/builtins/ctx) +* [depset](/versions/7.7.3/rules/lib/builtins/depset) +* [DirectoryExpander](/versions/7.7.3/rules/lib/builtins/DirectoryExpander) +* [DottedVersion](/versions/7.7.3/rules/lib/builtins/DottedVersion) +* [exec\_result](/versions/7.7.3/rules/lib/builtins/exec_result) +* [ExecGroupCollection](/versions/7.7.3/rules/lib/builtins/ExecGroupCollection) +* [ExecGroupContext](/versions/7.7.3/rules/lib/builtins/ExecGroupContext) +* [ExecTransitionFactory](/versions/7.7.3/rules/lib/builtins/ExecTransitionFactory) +* [extension\_metadata](/versions/7.7.3/rules/lib/builtins/extension_metadata) +* [FeatureConfiguration](/versions/7.7.3/rules/lib/builtins/FeatureConfiguration) +* [File](/versions/7.7.3/rules/lib/builtins/File) +* [fragments](/versions/7.7.3/rules/lib/builtins/fragments) +* [java\_annotation\_processing](/versions/7.7.3/rules/lib/builtins/java_annotation_processing) +* [Label](/versions/7.7.3/rules/lib/builtins/Label) +* [LateBoundDefault](/versions/7.7.3/rules/lib/builtins/LateBoundDefault) +* [LibraryToLink](/versions/7.7.3/rules/lib/builtins/LibraryToLink) +* [License](/versions/7.7.3/rules/lib/builtins/License) +* [LinkerInput](/versions/7.7.3/rules/lib/builtins/LinkerInput) +* [LinkingContext](/versions/7.7.3/rules/lib/builtins/LinkingContext) +* [mapped\_root](/versions/7.7.3/rules/lib/builtins/mapped_root) +* [module\_ctx](/versions/7.7.3/rules/lib/builtins/module_ctx) +* [native\_rule\_transition](/versions/7.7.3/rules/lib/builtins/native_rule_transition) +* [path](/versions/7.7.3/rules/lib/builtins/path) +* [Provider](/versions/7.7.3/rules/lib/builtins/Provider) +* [repository\_ctx](/versions/7.7.3/rules/lib/builtins/repository_ctx) +* [repository\_os](/versions/7.7.3/rules/lib/builtins/repository_os) +* [repository\_rule](/versions/7.7.3/rules/lib/builtins/repository_rule) +* [root](/versions/7.7.3/rules/lib/builtins/root) +* [rule](/versions/7.7.3/rules/lib/builtins/rule) +* [rule\_attributes](/versions/7.7.3/rules/lib/builtins/rule_attributes) +* [runfiles](/versions/7.7.3/rules/lib/builtins/runfiles) +* [struct](/versions/7.7.3/rules/lib/builtins/struct) +* [Subrule](/versions/7.7.3/rules/lib/builtins/Subrule) +* [subrule\_ctx](/versions/7.7.3/rules/lib/builtins/subrule_ctx) +* [SymlinkEntry](/versions/7.7.3/rules/lib/builtins/SymlinkEntry) +* [tag\_class](/versions/7.7.3/rules/lib/builtins/tag_class) +* [Target](/versions/7.7.3/rules/lib/builtins/Target) +* [TemplateDict](/versions/7.7.3/rules/lib/builtins/TemplateDict) +* [toolchain\_type](/versions/7.7.3/rules/lib/builtins/toolchain_type) +* [ToolchainContext](/versions/7.7.3/rules/lib/builtins/ToolchainContext) +* [transition](/versions/7.7.3/rules/lib/builtins/transition) + +## [Top-level Modules](/versions/7.7.3/rules/lib/toplevel) + +* [apple\_common](/versions/7.7.3/rules/lib/toplevel/apple_common) +* [attr](/versions/7.7.3/rules/lib/toplevel/attr) +* [cc\_common](/versions/7.7.3/rules/lib/toplevel/cc_common) +* [config](/versions/7.7.3/rules/lib/toplevel/config) +* [config\_common](/versions/7.7.3/rules/lib/toplevel/config_common) +* [coverage\_common](/versions/7.7.3/rules/lib/toplevel/coverage_common) +* [java\_common](/versions/7.7.3/rules/lib/toplevel/java_common) +* [native](/versions/7.7.3/rules/lib/toplevel/native) +* [platform\_common](/versions/7.7.3/rules/lib/toplevel/platform_common) +* [proto](/versions/7.7.3/rules/lib/toplevel/proto) +* [proto\_common](/versions/7.7.3/rules/lib/toplevel/proto_common) +* [testing](/versions/7.7.3/rules/lib/toplevel/testing) + +## [Core Starlark data types](/versions/7.7.3/rules/lib/core) + +* [bool](/versions/7.7.3/rules/lib/core/bool) +* [builtin\_function\_or\_method](/versions/7.7.3/rules/lib/core/builtin_function_or_method) +* [dict](/versions/7.7.3/rules/lib/core/dict) +* [float](/versions/7.7.3/rules/lib/core/float) +* [function](/versions/7.7.3/rules/lib/core/function) +* [int](/versions/7.7.3/rules/lib/core/int) +* [json](/versions/7.7.3/rules/lib/core/json) +* [list](/versions/7.7.3/rules/lib/core/list) +* [range](/versions/7.7.3/rules/lib/core/range) +* [string](/versions/7.7.3/rules/lib/core/string) +* [tuple](/versions/7.7.3/rules/lib/core/tuple) \ No newline at end of file
diff --git a/docs/versions/7.7.3/rules/lib/providers.mdx b/docs/versions/7.7.3/rules/lib/providers.mdx new file mode 100644 index 0000000..366e812 --- /dev/null +++ b/docs/versions/7.7.3/rules/lib/providers.mdx
@@ -0,0 +1,45 @@ +--- +title: 'Providers' +--- + +This section lists providers available on built-in rules. See the [Rules page](https://bazel.build/versions/7.7.3/extending/rules#providers) for more on providers. These symbols are available only in .bzl files. + +* [AnalysisTestResultInfo](/versions/7.7.3/rules/lib/providers/AnalysisTestResultInfo) +* [AndroidNeverLinkLibrariesProvider](/versions/7.7.3/rules/lib/providers/AndroidNeverLinkLibrariesProvider) +* [AppleDebugOutputs](/versions/7.7.3/rules/lib/providers/AppleDebugOutputs) +* [AppleDynamicFramework](/versions/7.7.3/rules/lib/providers/AppleDynamicFramework) +* [AppleExecutableBinary](/versions/7.7.3/rules/lib/providers/AppleExecutableBinary) +* [BaselineProfileProvider](/versions/7.7.3/rules/lib/providers/BaselineProfileProvider) +* [CcInfo](/versions/7.7.3/rules/lib/providers/CcInfo) +* [CcToolchainConfigInfo](/versions/7.7.3/rules/lib/providers/CcToolchainConfigInfo) +* [CcToolchainInfo](/versions/7.7.3/rules/lib/providers/CcToolchainInfo) +* [ConstraintCollection](/versions/7.7.3/rules/lib/providers/ConstraintCollection) +* [ConstraintSettingInfo](/versions/7.7.3/rules/lib/providers/ConstraintSettingInfo) +* [ConstraintValueInfo](/versions/7.7.3/rules/lib/providers/ConstraintValueInfo) +* [DebugPackageInfo](/versions/7.7.3/rules/lib/providers/DebugPackageInfo) +* [DefaultInfo](/versions/7.7.3/rules/lib/providers/DefaultInfo) +* [ExecutionInfo](/versions/7.7.3/rules/lib/providers/ExecutionInfo) +* [FeatureFlagInfo](/versions/7.7.3/rules/lib/providers/FeatureFlagInfo) +* [file\_provider](/versions/7.7.3/rules/lib/providers/file_provider) +* [FilesToRunProvider](/versions/7.7.3/rules/lib/providers/FilesToRunProvider) +* [GeneratedExtensionRegistryProvider](/versions/7.7.3/rules/lib/providers/GeneratedExtensionRegistryProvider) +* [IncompatiblePlatformProvider](/versions/7.7.3/rules/lib/providers/IncompatiblePlatformProvider) +* [InstrumentedFilesInfo](/versions/7.7.3/rules/lib/providers/InstrumentedFilesInfo) +* [java\_compilation\_info](/versions/7.7.3/rules/lib/providers/java_compilation_info) +* [java\_output\_jars](/versions/7.7.3/rules/lib/providers/java_output_jars) +* [JavaRuntimeInfo](/versions/7.7.3/rules/lib/providers/JavaRuntimeInfo) +* [JavaToolchainInfo](/versions/7.7.3/rules/lib/providers/JavaToolchainInfo) +* [ObjcProvider](/versions/7.7.3/rules/lib/providers/ObjcProvider) +* [OutputGroupInfo](/versions/7.7.3/rules/lib/providers/OutputGroupInfo) +* [PackageSpecificationInfo](/versions/7.7.3/rules/lib/providers/PackageSpecificationInfo) +* [PlatformInfo](/versions/7.7.3/rules/lib/providers/PlatformInfo) +* [ProguardSpecProvider](/versions/7.7.3/rules/lib/providers/ProguardSpecProvider) +* [ProtoRegistryProvider](/versions/7.7.3/rules/lib/providers/ProtoRegistryProvider) +* [PyInfo](/versions/7.7.3/rules/lib/providers/PyInfo) +* [PyRuntimeInfo](/versions/7.7.3/rules/lib/providers/PyRuntimeInfo) +* [RunEnvironmentInfo](/versions/7.7.3/rules/lib/providers/RunEnvironmentInfo) +* [TemplateVariableInfo](/versions/7.7.3/rules/lib/providers/TemplateVariableInfo) +* [ToolchainInfo](/versions/7.7.3/rules/lib/providers/ToolchainInfo) +* [ToolchainTypeInfo](/versions/7.7.3/rules/lib/providers/ToolchainTypeInfo) +* [XcodeProperties](/versions/7.7.3/rules/lib/providers/XcodeProperties) +* [XcodeVersionConfig](/versions/7.7.3/rules/lib/providers/XcodeVersionConfig) \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/providers/AnalysisTestResultInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/AnalysisTestResultInfo.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/AnalysisTestResultInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/AnalysisTestResultInfo.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/AndroidNeverLinkLibrariesProvider.mdx b/docs/versions/7.7.3/rules/lib/providers/AndroidNeverLinkLibrariesProvider.mdx similarity index 95% rename from docs/versions/7.7.1/rules/lib/providers/AndroidNeverLinkLibrariesProvider.mdx rename to docs/versions/7.7.3/rules/lib/providers/AndroidNeverLinkLibrariesProvider.mdx index d6e7628..c219b3d 100644 --- a/docs/versions/7.7.1/rules/lib/providers/AndroidNeverLinkLibrariesProvider.mdx +++ b/docs/versions/7.7.3/rules/lib/providers/AndroidNeverLinkLibrariesProvider.mdx
@@ -22,7 +22,7 @@ | Parameter | Description | | --- | --- | -| `transitive_neverlink_libraries` | [depset](/versions/7.7.1/rules/lib/builtins/depset) of [File](/versions/7.7.1/rules/lib/builtins/File)s; required The transitive neverlink libraries | +| `transitive_neverlink_libraries` | [depset](/versions/7.7.3/rules/lib/builtins/depset) of [File](/versions/7.7.3/rules/lib/builtins/File)s; required The transitive neverlink libraries | ## to\_json
diff --git a/docs/versions/7.7.1/rules/lib/providers/AppleDebugOutputs.mdx b/docs/versions/7.7.3/rules/lib/providers/AppleDebugOutputs.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/AppleDebugOutputs.mdx rename to docs/versions/7.7.3/rules/lib/providers/AppleDebugOutputs.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/AppleDynamicFramework.mdx b/docs/versions/7.7.3/rules/lib/providers/AppleDynamicFramework.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/AppleDynamicFramework.mdx rename to docs/versions/7.7.3/rules/lib/providers/AppleDynamicFramework.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/AppleExecutableBinary.mdx b/docs/versions/7.7.3/rules/lib/providers/AppleExecutableBinary.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/AppleExecutableBinary.mdx rename to docs/versions/7.7.3/rules/lib/providers/AppleExecutableBinary.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/BaselineProfileProvider.mdx b/docs/versions/7.7.3/rules/lib/providers/BaselineProfileProvider.mdx similarity index 93% rename from docs/versions/7.7.1/rules/lib/providers/BaselineProfileProvider.mdx rename to docs/versions/7.7.3/rules/lib/providers/BaselineProfileProvider.mdx index 3605141..ca1c3d8 100644 --- a/docs/versions/7.7.1/rules/lib/providers/BaselineProfileProvider.mdx +++ b/docs/versions/7.7.3/rules/lib/providers/BaselineProfileProvider.mdx
@@ -22,8 +22,8 @@ | Parameter | Description | | --- | --- | -| `files` | [depset](/versions/7.7.1/rules/lib/builtins/depset) of [File](/versions/7.7.1/rules/lib/builtins/File)s; required Transitive baseline profile files. | -| `art_profile_zip` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` The final ART profile zip to be packaged in the APK. Optional, only used for migration purposes. | +| `files` | [depset](/versions/7.7.3/rules/lib/builtins/depset) of [File](/versions/7.7.3/rules/lib/builtins/File)s; required Transitive baseline profile files. | +| `art_profile_zip` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` The final ART profile zip to be packaged in the APK. Optional, only used for migration purposes. | ## to\_json
diff --git a/docs/versions/7.7.1/rules/lib/providers/CcInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/CcInfo.mdx similarity index 96% rename from docs/versions/7.7.1/rules/lib/providers/CcInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/CcInfo.mdx index 35026c3..60359e5 100644 --- a/docs/versions/7.7.1/rules/lib/providers/CcInfo.mdx +++ b/docs/versions/7.7.3/rules/lib/providers/CcInfo.mdx
@@ -24,8 +24,8 @@ | Parameter | Description | | --- | --- | -| `compilation_context` | [CompilationContext](/versions/7.7.1/rules/lib/builtins/CompilationContext); or `None`; default is `None` The `CompilationContext`. | -| `linking_context` | [LinkingContext](/versions/7.7.1/rules/lib/builtins/LinkingContext); or `None`; default is `None` The `LinkingContext`. | +| `compilation_context` | [CompilationContext](/versions/7.7.3/rules/lib/builtins/CompilationContext); or `None`; default is `None` The `CompilationContext`. | +| `linking_context` | [LinkingContext](/versions/7.7.3/rules/lib/builtins/LinkingContext); or `None`; default is `None` The `LinkingContext`. | | `debug_context` | DebugContext; or `None`; default is `None` The `DebugContext`. | ## compilation\_context
diff --git a/docs/versions/7.7.1/rules/lib/providers/CcToolchainConfigInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/CcToolchainConfigInfo.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/CcToolchainConfigInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/CcToolchainConfigInfo.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/CcToolchainInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/CcToolchainInfo.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/CcToolchainInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/CcToolchainInfo.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/ConstraintCollection.mdx b/docs/versions/7.7.3/rules/lib/providers/ConstraintCollection.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/ConstraintCollection.mdx rename to docs/versions/7.7.3/rules/lib/providers/ConstraintCollection.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/ConstraintSettingInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/ConstraintSettingInfo.mdx similarity index 97% rename from docs/versions/7.7.1/rules/lib/providers/ConstraintSettingInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/ConstraintSettingInfo.mdx index 9622e68..dd0c00d 100644 --- a/docs/versions/7.7.1/rules/lib/providers/ConstraintSettingInfo.mdx +++ b/docs/versions/7.7.3/rules/lib/providers/ConstraintSettingInfo.mdx
@@ -2,7 +2,7 @@ title: 'ConstraintSettingInfo' --- -A specific constraint setting that may be used to define a platform. See [Defining Constraints and Platforms](/versions/7.7.1/docs/platforms#defining-constraints-and-platforms) for more information. +A specific constraint setting that may be used to define a platform. See [Defining Constraints and Platforms](/versions/7.7.3/docs/platforms#defining-constraints-and-platforms) for more information. *Note: This API is experimental and may change at any time. It is disabled by default, but may be enabled with `--experimental_platforms_api`* ## Members
diff --git a/docs/versions/7.7.1/rules/lib/providers/ConstraintValueInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/ConstraintValueInfo.mdx similarity index 97% rename from docs/versions/7.7.1/rules/lib/providers/ConstraintValueInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/ConstraintValueInfo.mdx index ecc4098..6514d26 100644 --- a/docs/versions/7.7.1/rules/lib/providers/ConstraintValueInfo.mdx +++ b/docs/versions/7.7.3/rules/lib/providers/ConstraintValueInfo.mdx
@@ -2,7 +2,7 @@ title: 'ConstraintValueInfo' --- -A value for a constraint setting that can be used to define a platform. See [Defining Constraints and Platforms](/versions/7.7.1/docs/platforms#defining-constraints-and-platforms) for more information. +A value for a constraint setting that can be used to define a platform. See [Defining Constraints and Platforms](/versions/7.7.3/docs/platforms#defining-constraints-and-platforms) for more information. *Note: This API is experimental and may change at any time. It is disabled by default, but may be enabled with `--experimental_platforms_api`* ## Members
diff --git a/docs/versions/7.7.1/rules/lib/providers/DebugPackageInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/DebugPackageInfo.mdx similarity index 96% rename from docs/versions/7.7.1/rules/lib/providers/DebugPackageInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/DebugPackageInfo.mdx index 17723a6..ceaaea2 100644 --- a/docs/versions/7.7.1/rules/lib/providers/DebugPackageInfo.mdx +++ b/docs/versions/7.7.3/rules/lib/providers/DebugPackageInfo.mdx
@@ -27,9 +27,9 @@ | Parameter | Description | | --- | --- | | `target_label` | required The label for the \*\_binary target | -| `stripped_file` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` The stripped file (the explicit ".stripped" target) | +| `stripped_file` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` The stripped file (the explicit ".stripped" target) | | `unstripped_file` | required The unstripped file (the default executable target). | -| `dwp_file` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` The .dwp file (for fission builds) or null if --fission=no. | +| `dwp_file` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` The .dwp file (for fission builds) or null if --fission=no. | ## dwp\_file
diff --git a/docs/versions/7.7.1/rules/lib/providers/DefaultInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/DefaultInfo.mdx similarity index 83% rename from docs/versions/7.7.1/rules/lib/providers/DefaultInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/DefaultInfo.mdx index bacdc76..8087256 100644 --- a/docs/versions/7.7.1/rules/lib/providers/DefaultInfo.mdx +++ b/docs/versions/7.7.3/rules/lib/providers/DefaultInfo.mdx
@@ -6,7 +6,7 @@ * `files`* `files_to_run`* `data_runfiles`* `default_runfiles` -See the [rules](https://bazel.build/versions/7.7.1/extending/rules) page for extensive guides on how to use this provider. +See the [rules](https://bazel.build/versions/7.7.3/extending/rules) page for extensive guides on how to use this provider. ## Members @@ -30,11 +30,11 @@ | Parameter | Description | | --- | --- | -| `files` | [depset](/versions/7.7.1/rules/lib/builtins/depset); or `None`; default is `None` A [`depset`](/versions/7.7.1/rules/lib/builtins/depset) of [`File`](/versions/7.7.1/rules/lib/builtins/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. | -| `runfiles` | [runfiles](/versions/7.7.1/rules/lib/builtins/runfiles); or `None`; default is `None` runfiles descriptor describing the files that this target needs when run (via the `run` command or as a tool dependency). | -| `data_runfiles` | [runfiles](/versions/7.7.1/rules/lib/builtins/runfiles); or `None`; default is `None` **It is recommended that you avoid using this parameter (see ["runfiles features to avoid"](https://bazel.build/versions/7.7.1/extending/rules#runfiles_features_to_avoid))** runfiles descriptor describing the runfiles this target needs to run when it is a dependency via the `data` attribute. | -| `default_runfiles` | [runfiles](/versions/7.7.1/rules/lib/builtins/runfiles); or `None`; default is `None` **It is recommended that you avoid using this parameter (see ["runfiles features to avoid"](https://bazel.build/versions/7.7.1/extending/rules#runfiles_features_to_avoid))** runfiles descriptor describing the runfiles this target needs to run when it is a dependency via any attribute other than the `data` attribute. | -| `executable` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` If this rule is marked [`executable`](/versions/7.7.1/rules/lib/globals/bzl#rule.executable) or [`test`](/versions/7.7.1/rules/lib/globals/bzl#rule.test), this is a [`File`](/versions/7.7.1/rules/lib/builtins/File) object representing the file that should be executed to run the target. By default it is the predeclared output `ctx.outputs.executable`. | +| `files` | [depset](/versions/7.7.3/rules/lib/builtins/depset); or `None`; default is `None` A [`depset`](/versions/7.7.3/rules/lib/builtins/depset) of [`File`](/versions/7.7.3/rules/lib/builtins/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. | +| `runfiles` | [runfiles](/versions/7.7.3/rules/lib/builtins/runfiles); or `None`; default is `None` runfiles descriptor describing the files that this target needs when run (via the `run` command or as a tool dependency). | +| `data_runfiles` | [runfiles](/versions/7.7.3/rules/lib/builtins/runfiles); or `None`; default is `None` **It is recommended that you avoid using this parameter (see ["runfiles features to avoid"](https://bazel.build/versions/7.7.3/extending/rules#runfiles_features_to_avoid))** runfiles descriptor describing the runfiles this target needs to run when it is a dependency via the `data` attribute. | +| `default_runfiles` | [runfiles](/versions/7.7.3/rules/lib/builtins/runfiles); or `None`; default is `None` **It is recommended that you avoid using this parameter (see ["runfiles features to avoid"](https://bazel.build/versions/7.7.3/extending/rules#runfiles_features_to_avoid))** runfiles descriptor describing the runfiles this target needs to run when it is a dependency via any attribute other than the `data` attribute. | +| `executable` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` If this rule is marked [`executable`](/versions/7.7.3/rules/lib/globals/bzl#rule.executable) or [`test`](/versions/7.7.3/rules/lib/globals/bzl#rule.test), this is a [`File`](/versions/7.7.3/rules/lib/builtins/File) object representing the file that should be executed to run the target. By default it is the predeclared output `ctx.outputs.executable`. | ## data\_runfiles @@ -42,7 +42,7 @@ runfiles DefaultInfo.data_runfiles ``` -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"](https://bazel.build/versions/7.7.1/extending/rules#runfiles_features_to_avoid) for details. +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"](https://bazel.build/versions/7.7.3/extending/rules#runfiles_features_to_avoid) for details. May return `None`. ## default\_runfiles @@ -60,7 +60,7 @@ depset DefaultInfo.files ``` -A [`depset`](/versions/7.7.1/rules/lib/builtins/depset) of [`File`](/versions/7.7.1/rules/lib/builtins/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. +A [`depset`](/versions/7.7.3/rules/lib/builtins/depset) of [`File`](/versions/7.7.3/rules/lib/builtins/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. May return `None`. ## files\_to\_run @@ -69,7 +69,7 @@ FilesToRunProvider DefaultInfo.files_to_run ``` -A [`FilesToRunProvider`](/versions/7.7.1/rules/lib/providers/FilesToRunProvider) object containing information about the executable and runfiles of the target. +A [`FilesToRunProvider`](/versions/7.7.3/rules/lib/providers/FilesToRunProvider) object containing information about the executable and runfiles of the target. May return `None`. ## to\_json
diff --git a/docs/versions/7.7.1/rules/lib/providers/ExecutionInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/ExecutionInfo.mdx similarity index 96% rename from docs/versions/7.7.1/rules/lib/providers/ExecutionInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/ExecutionInfo.mdx index 1257d76..5ce7975 100644 --- a/docs/versions/7.7.1/rules/lib/providers/ExecutionInfo.mdx +++ b/docs/versions/7.7.3/rules/lib/providers/ExecutionInfo.mdx
@@ -24,8 +24,8 @@ | Parameter | Description | | --- | --- | -| `requirements` | [dict](/versions/7.7.1/rules/lib/core/dict); default is `{}` A dict indicating special execution requirements, such as hardware platforms. | -| `exec_group` | [string](/versions/7.7.1/rules/lib/core/string); default is `'test'` The name of the exec group that is used to execute the test. | +| `requirements` | [dict](/versions/7.7.3/rules/lib/core/dict); default is `{}` A dict indicating special execution requirements, such as hardware platforms. | +| `exec_group` | [string](/versions/7.7.3/rules/lib/core/string); default is `'test'` The name of the exec group that is used to execute the test. | ## exec\_group
diff --git a/docs/versions/7.7.1/rules/lib/providers/FeatureFlagInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/FeatureFlagInfo.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/FeatureFlagInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/FeatureFlagInfo.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/FilesToRunProvider.mdx b/docs/versions/7.7.3/rules/lib/providers/FilesToRunProvider.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/FilesToRunProvider.mdx rename to docs/versions/7.7.3/rules/lib/providers/FilesToRunProvider.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/GeneratedExtensionRegistryProvider.mdx b/docs/versions/7.7.3/rules/lib/providers/GeneratedExtensionRegistryProvider.mdx similarity index 96% rename from docs/versions/7.7.1/rules/lib/providers/GeneratedExtensionRegistryProvider.mdx rename to docs/versions/7.7.3/rules/lib/providers/GeneratedExtensionRegistryProvider.mdx index 0d66fb2..474b376 100644 --- a/docs/versions/7.7.1/rules/lib/providers/GeneratedExtensionRegistryProvider.mdx +++ b/docs/versions/7.7.3/rules/lib/providers/GeneratedExtensionRegistryProvider.mdx
@@ -26,7 +26,7 @@ | `isLite` | required If this registry was generated for lite or full runtime | | `classJar` | required Class jar generated by the registry | | `srcJar` | required Source jar generated by the registry | -| `inputs` | [depset](/versions/7.7.1/rules/lib/builtins/depset) of [File](/versions/7.7.1/rules/lib/builtins/File)s; required Proto jars used to generate the registry | +| `inputs` | [depset](/versions/7.7.3/rules/lib/builtins/depset) of [File](/versions/7.7.3/rules/lib/builtins/File)s; required Proto jars used to generate the registry | ## to\_json
diff --git a/docs/versions/7.7.1/rules/lib/providers/IncompatiblePlatformProvider.mdx b/docs/versions/7.7.3/rules/lib/providers/IncompatiblePlatformProvider.mdx similarity index 77% rename from docs/versions/7.7.1/rules/lib/providers/IncompatiblePlatformProvider.mdx rename to docs/versions/7.7.3/rules/lib/providers/IncompatiblePlatformProvider.mdx index 8bbd9cc..4812a9d 100644 --- a/docs/versions/7.7.1/rules/lib/providers/IncompatiblePlatformProvider.mdx +++ b/docs/versions/7.7.3/rules/lib/providers/IncompatiblePlatformProvider.mdx
@@ -2,4 +2,4 @@ title: 'IncompatiblePlatformProvider' --- -A provider for targets that are incompatible with the target platform. See [Detecting incompatible targets using `bazel cquery`](/versions/7.7.1/docs/platforms#detecting-incompatible-targets-using-bazel-cquery) for more information. \ No newline at end of file +A provider for targets that are incompatible with the target platform. See [Detecting incompatible targets using `bazel cquery`](/versions/7.7.3/docs/platforms#detecting-incompatible-targets-using-bazel-cquery) for more information. \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/providers/InstrumentedFilesInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/InstrumentedFilesInfo.mdx similarity index 89% rename from docs/versions/7.7.1/rules/lib/providers/InstrumentedFilesInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/InstrumentedFilesInfo.mdx index d2fb109..91f9c8e 100644 --- a/docs/versions/7.7.1/rules/lib/providers/InstrumentedFilesInfo.mdx +++ b/docs/versions/7.7.3/rules/lib/providers/InstrumentedFilesInfo.mdx
@@ -2,7 +2,7 @@ title: 'InstrumentedFilesInfo' --- -Contains information about source files and instrumentation metadata files for rule targets matched by [`--instrumentation_filter`](https://bazel.build/versions/7.7.1/reference/command-line-reference#flag--instrumentation_filter) for purposes of [code coverage data collection](https://bazel.build/versions/7.7.1/extending/rules#code_coverage). When coverage data collection is enabled, a manifest containing the combined paths in [`instrumented_files`](#instrumented_files) and [`metadata_files`](#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](https://bazel.build/versions/7.7.1/rules/aspects)'s implementation function, any `InstrumentedFilesInfo` from the base rule target is ignored. +Contains information about source files and instrumentation metadata files for rule targets matched by [`--instrumentation_filter`](https://bazel.build/versions/7.7.3/reference/command-line-reference#flag--instrumentation_filter) for purposes of [code coverage data collection](https://bazel.build/versions/7.7.3/extending/rules#code_coverage). When coverage data collection is enabled, a manifest containing the combined paths in [`instrumented_files`](#instrumented_files) and [`metadata_files`](#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](https://bazel.build/versions/7.7.3/rules/aspects)'s implementation function, any `InstrumentedFilesInfo` from the base rule target is ignored. ## Members @@ -17,7 +17,7 @@ depset InstrumentedFilesInfo.instrumented_files ``` -[`depset`](/versions/7.7.1/rules/lib/builtins/depset) of [`File`](/versions/7.7.1/rules/lib/builtins/File) objects representing instrumented source files for this target and its dependencies. +[`depset`](/versions/7.7.3/rules/lib/builtins/depset) of [`File`](/versions/7.7.3/rules/lib/builtins/File) objects representing instrumented source files for this target and its dependencies. ## metadata\_files @@ -25,7 +25,7 @@ depset InstrumentedFilesInfo.metadata_files ``` -[`depset`](/versions/7.7.1/rules/lib/builtins/depset) of [`File`](/versions/7.7.1/rules/lib/builtins/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`. +[`depset`](/versions/7.7.3/rules/lib/builtins/depset) of [`File`](/versions/7.7.3/rules/lib/builtins/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`. ## to\_json
diff --git a/docs/versions/7.7.1/rules/lib/providers/JavaRuntimeInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/JavaRuntimeInfo.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/JavaRuntimeInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/JavaRuntimeInfo.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/JavaToolchainInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/JavaToolchainInfo.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/JavaToolchainInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/JavaToolchainInfo.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/ObjcProvider.mdx b/docs/versions/7.7.3/rules/lib/providers/ObjcProvider.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/ObjcProvider.mdx rename to docs/versions/7.7.3/rules/lib/providers/ObjcProvider.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/OutputGroupInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/OutputGroupInfo.mdx similarity index 95% rename from docs/versions/7.7.1/rules/lib/providers/OutputGroupInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/OutputGroupInfo.mdx index f09c277..0e1d791 100644 --- a/docs/versions/7.7.1/rules/lib/providers/OutputGroupInfo.mdx +++ b/docs/versions/7.7.3/rules/lib/providers/OutputGroupInfo.mdx
@@ -3,7 +3,7 @@ --- A provider that indicates what output groups a rule has. -See [Requesting output files](https://bazel.build/versions/7.7.1/extending/rules#requesting_output_files) for more information. +See [Requesting output files](https://bazel.build/versions/7.7.3/extending/rules#requesting_output_files) for more information. ## Members @@ -23,7 +23,7 @@ OutputGroupInfo(group1 = <files>, group2 = <files>...) ``` -See [Requesting output files](https://bazel.build/versions/7.7.1/extending/rules#requesting_output_files) for more information. +See [Requesting output files](https://bazel.build/versions/7.7.3/extending/rules#requesting_output_files) for more information. ### Parameters
diff --git a/docs/versions/7.7.1/rules/lib/providers/PackageSpecificationInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/PackageSpecificationInfo.mdx similarity index 95% rename from docs/versions/7.7.1/rules/lib/providers/PackageSpecificationInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/PackageSpecificationInfo.mdx index 442b0ee..f9f0c7a 100644 --- a/docs/versions/7.7.1/rules/lib/providers/PackageSpecificationInfo.mdx +++ b/docs/versions/7.7.3/rules/lib/providers/PackageSpecificationInfo.mdx
@@ -22,7 +22,7 @@ | Parameter | Description | | --- | --- | -| `target` | [Label](/versions/7.7.1/rules/lib/builtins/Label); or [string](/versions/7.7.1/rules/lib/core/string); required A target which is checked if it exists inside the package group. | +| `target` | [Label](/versions/7.7.3/rules/lib/builtins/Label); or [string](/versions/7.7.3/rules/lib/core/string); required A target which is checked if it exists inside the package group. | ## to\_json
diff --git a/docs/versions/7.7.1/rules/lib/providers/PlatformInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/PlatformInfo.mdx similarity index 97% rename from docs/versions/7.7.1/rules/lib/providers/PlatformInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/PlatformInfo.mdx index c58c383..cbca194 100644 --- a/docs/versions/7.7.1/rules/lib/providers/PlatformInfo.mdx +++ b/docs/versions/7.7.3/rules/lib/providers/PlatformInfo.mdx
@@ -2,7 +2,7 @@ title: 'PlatformInfo' --- -Provides access to data about a specific platform. See [Defining Constraints and Platforms](/versions/7.7.1/docs/platforms#defining-constraints-and-platforms) for more information. +Provides access to data about a specific platform. See [Defining Constraints and Platforms](/versions/7.7.3/docs/platforms#defining-constraints-and-platforms) for more information. *Note: This API is experimental and may change at any time. It is disabled by default, but may be enabled with `--experimental_platforms_api`* ## Members
diff --git a/docs/versions/7.7.1/rules/lib/providers/ProguardSpecProvider.mdx b/docs/versions/7.7.3/rules/lib/providers/ProguardSpecProvider.mdx similarity index 95% rename from docs/versions/7.7.1/rules/lib/providers/ProguardSpecProvider.mdx rename to docs/versions/7.7.3/rules/lib/providers/ProguardSpecProvider.mdx index f4bc78a..90b41a2 100644 --- a/docs/versions/7.7.1/rules/lib/providers/ProguardSpecProvider.mdx +++ b/docs/versions/7.7.3/rules/lib/providers/ProguardSpecProvider.mdx
@@ -22,7 +22,7 @@ | Parameter | Description | | --- | --- | -| `specs` | [depset](/versions/7.7.1/rules/lib/builtins/depset) of [File](/versions/7.7.1/rules/lib/builtins/File)s; required Transitive proguard specs. | +| `specs` | [depset](/versions/7.7.3/rules/lib/builtins/depset) of [File](/versions/7.7.3/rules/lib/builtins/File)s; required Transitive proguard specs. | ## to\_json
diff --git a/docs/versions/7.7.1/rules/lib/providers/ProtoRegistryProvider.mdx b/docs/versions/7.7.3/rules/lib/providers/ProtoRegistryProvider.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/ProtoRegistryProvider.mdx rename to docs/versions/7.7.3/rules/lib/providers/ProtoRegistryProvider.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/PyInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/PyInfo.mdx similarity index 88% rename from docs/versions/7.7.1/rules/lib/providers/PyInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/PyInfo.mdx index d32d240a..ad03c84 100644 --- a/docs/versions/7.7.1/rules/lib/providers/PyInfo.mdx +++ b/docs/versions/7.7.3/rules/lib/providers/PyInfo.mdx
@@ -25,9 +25,9 @@ | Parameter | Description | | --- | --- | -| `transitive_sources` | [depset](/versions/7.7.1/rules/lib/builtins/depset) of [File](/versions/7.7.1/rules/lib/builtins/File)s; required The value for the new object's `transitive_sources` field. | +| `transitive_sources` | [depset](/versions/7.7.3/rules/lib/builtins/depset) of [File](/versions/7.7.3/rules/lib/builtins/File)s; required The value for the new object's `transitive_sources` field. | | `uses_shared_libraries` | default is `False` The value for the new object's `uses_shared_libraries` field. | -| `imports` | [depset](/versions/7.7.1/rules/lib/builtins/depset) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `unbound` The value for the new object's `imports` field. | +| `imports` | [depset](/versions/7.7.3/rules/lib/builtins/depset) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `unbound` The value for the new object's `imports` field. | | `has_py2_only_sources` | default is `False` The value for the new object's `has_py2_only_sources` field. | | `has_py3_only_sources` | default is `False` The value for the new object's `has_py3_only_sources` field. |
diff --git a/docs/versions/7.7.1/rules/lib/providers/PyRuntimeInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/PyRuntimeInfo.mdx similarity index 87% rename from docs/versions/7.7.1/rules/lib/providers/PyRuntimeInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/PyRuntimeInfo.mdx index f4888a5..21b85a0 100644 --- a/docs/versions/7.7.1/rules/lib/providers/PyRuntimeInfo.mdx +++ b/docs/versions/7.7.3/rules/lib/providers/PyRuntimeInfo.mdx
@@ -30,14 +30,14 @@ | Parameter | Description | | --- | --- | -| `interpreter_path` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` The value for the new object's `interpreter_path` field. Do not give a value for this argument if you pass in `interpreter`. | -| `interpreter` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` The value for the new object's `interpreter` field. Do not give a value for this argument if you pass in `interpreter_path`. | -| `files` | [depset](/versions/7.7.1/rules/lib/builtins/depset) of [File](/versions/7.7.1/rules/lib/builtins/File)s; or `None`; default is `None` The value for the new object's `files` field. Do not give a value for this argument if you pass in `interpreter_path`. If `interpreter` is given and this argument is `None`, `files` becomes an empty `depset` instead. | -| `coverage_tool` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` The value for the new object's `coverage_tool` field. | -| `coverage_files` | [depset](/versions/7.7.1/rules/lib/builtins/depset) of [File](/versions/7.7.1/rules/lib/builtins/File)s; or `None`; default is `None` The value for the new object's `coverage_files` field. Do not give a value for this argument if you do not also pass in `coverage_tool`. | +| `interpreter_path` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` The value for the new object's `interpreter_path` field. Do not give a value for this argument if you pass in `interpreter`. | +| `interpreter` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` The value for the new object's `interpreter` field. Do not give a value for this argument if you pass in `interpreter_path`. | +| `files` | [depset](/versions/7.7.3/rules/lib/builtins/depset) of [File](/versions/7.7.3/rules/lib/builtins/File)s; or `None`; default is `None` The value for the new object's `files` field. Do not give a value for this argument if you pass in `interpreter_path`. If `interpreter` is given and this argument is `None`, `files` becomes an empty `depset` instead. | +| `coverage_tool` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` The value for the new object's `coverage_tool` field. | +| `coverage_files` | [depset](/versions/7.7.3/rules/lib/builtins/depset) of [File](/versions/7.7.3/rules/lib/builtins/File)s; or `None`; default is `None` The value for the new object's `coverage_files` field. Do not give a value for this argument if you do not also pass in `coverage_tool`. | | `python_version` | required The value for the new object's `python_version` field. | -| `stub_shebang` | [string](/versions/7.7.1/rules/lib/core/string); default is `None` The value for the new object's `stub_shebang` field. If None or not specified, `#!/usr/bin/env python3` is used. | -| `bootstrap_template` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` | +| `stub_shebang` | [string](/versions/7.7.3/rules/lib/core/string); default is `None` The value for the new object's `stub_shebang` field. If None or not specified, `#!/usr/bin/env python3` is used. | +| `bootstrap_template` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` | ## bootstrap\_template
diff --git a/docs/versions/7.7.1/rules/lib/providers/RunEnvironmentInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/RunEnvironmentInfo.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/RunEnvironmentInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/RunEnvironmentInfo.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/TemplateVariableInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/TemplateVariableInfo.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/TemplateVariableInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/TemplateVariableInfo.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/ToolchainInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/ToolchainInfo.mdx similarity index 93% rename from docs/versions/7.7.1/rules/lib/providers/ToolchainInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/ToolchainInfo.mdx index 7d5b877..353ccad 100644 --- a/docs/versions/7.7.1/rules/lib/providers/ToolchainInfo.mdx +++ b/docs/versions/7.7.3/rules/lib/providers/ToolchainInfo.mdx
@@ -2,7 +2,7 @@ title: 'ToolchainInfo' --- -Provider returned by [toolchain rules](/versions/7.7.1/docs/toolchains#defining-toolchains) to share data with [rules which depend on toolchains](/versions/7.7.1/docs/toolchains#writing-rules-that-use-toolchains). Read about [toolchains](/versions/7.7.1/docs/toolchains) for more information. +Provider returned by [toolchain rules](/versions/7.7.3/docs/toolchains#defining-toolchains) to share data with [rules which depend on toolchains](/versions/7.7.3/docs/toolchains#writing-rules-that-use-toolchains). Read about [toolchains](/versions/7.7.3/docs/toolchains) for more information. ## Members
diff --git a/docs/versions/7.7.1/rules/lib/providers/ToolchainTypeInfo.mdx b/docs/versions/7.7.3/rules/lib/providers/ToolchainTypeInfo.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/ToolchainTypeInfo.mdx rename to docs/versions/7.7.3/rules/lib/providers/ToolchainTypeInfo.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/XcodeProperties.mdx b/docs/versions/7.7.3/rules/lib/providers/XcodeProperties.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/XcodeProperties.mdx rename to docs/versions/7.7.3/rules/lib/providers/XcodeProperties.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/XcodeVersionConfig.mdx b/docs/versions/7.7.3/rules/lib/providers/XcodeVersionConfig.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/XcodeVersionConfig.mdx rename to docs/versions/7.7.3/rules/lib/providers/XcodeVersionConfig.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/file_provider.mdx b/docs/versions/7.7.3/rules/lib/providers/file_provider.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/file_provider.mdx rename to docs/versions/7.7.3/rules/lib/providers/file_provider.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/java_compilation_info.mdx b/docs/versions/7.7.3/rules/lib/providers/java_compilation_info.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/java_compilation_info.mdx rename to docs/versions/7.7.3/rules/lib/providers/java_compilation_info.mdx
diff --git a/docs/versions/7.7.1/rules/lib/providers/java_output_jars.mdx b/docs/versions/7.7.3/rules/lib/providers/java_output_jars.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/providers/java_output_jars.mdx rename to docs/versions/7.7.3/rules/lib/providers/java_output_jars.mdx
diff --git a/docs/versions/7.7.1/rules/lib/repo/cache.mdx b/docs/versions/7.7.3/rules/lib/repo/cache.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/repo/cache.mdx rename to docs/versions/7.7.3/rules/lib/repo/cache.mdx
diff --git a/docs/versions/7.7.1/rules/lib/repo/git.mdx b/docs/versions/7.7.3/rules/lib/repo/git.mdx similarity index 95% rename from docs/versions/7.7.1/rules/lib/repo/git.mdx rename to docs/versions/7.7.3/rules/lib/repo/git.mdx index a39c5df..f067e4b 100644 --- a/docs/versions/7.7.1/rules/lib/repo/git.mdx +++ b/docs/versions/7.7.3/rules/lib/repo/git.mdx
@@ -33,14 +33,14 @@ If that fails (usually due to missing server support), it will fall back to a full fetch of the repository. -Prefer [`http_archive`](/versions/7.7.1/rules/lib/repo/http#http_archive) to `git_repository`. +Prefer [`http_archive`](/versions/7.7.3/rules/lib/repo/http#http_archive) to `git_repository`. The reasons are: * Git repository rules depend on system `git(1)` whereas the HTTP downloader is built into Bazel and has no system dependencies. * `http_archive` supports a list of `urls` as mirrors, and `git_repository` supports only a single `remote`. -* `http_archive` works with the [repository cache](/versions/7.7.1/run/build#repository-cache), but not +* `http_archive` works with the [repository cache](/versions/7.7.3/run/build#repository-cache), but not `git_repository`. See [#5116](https://github.com/bazelbuild/bazel/issues/5116) for more information. @@ -56,7 +56,7 @@ <td><code>name</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/concepts/labels#target-names">Name</a>; required +<a href="https://bazel.build/versions/7.7.3/concepts/labels#target-names">Name</a>; required <p> @@ -82,7 +82,7 @@ <td><code>build_file</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/concepts/labels">Label</a>; optional +<a href="https://bazel.build/versions/7.7.3/concepts/labels">Label</a>; optional <p> @@ -186,7 +186,7 @@ <td><code>patches</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/concepts/labels">List of labels</a>; optional +<a href="https://bazel.build/versions/7.7.3/concepts/labels">List of labels</a>; optional <p> @@ -251,7 +251,7 @@ <td><code>repo_mapping</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/rules/lib/dict">Dictionary: String -> String</a>; optional +<a href="https://bazel.build/versions/7.7.3/rules/lib/dict">Dictionary: String -> String</a>; optional <p> @@ -315,7 +315,7 @@ <td><code>workspace_file</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/concepts/labels">Label</a>; optional +<a href="https://bazel.build/versions/7.7.3/concepts/labels">Label</a>; optional <p> @@ -366,14 +366,14 @@ If that fails (usually due to missing server support), it will fall back to a full fetch of the repository. -Prefer [`http_archive`](/versions/7.7.1/rules/lib/repo/http#http_archive) to `git_repository`. +Prefer [`http_archive`](/versions/7.7.3/rules/lib/repo/http#http_archive) to `git_repository`. The reasons are: * Git repository rules depend on system `git(1)` whereas the HTTP downloader is built into Bazel and has no system dependencies. * `http_archive` supports a list of `urls` as mirrors, and `git_repository` supports only a single `remote`. -* `http_archive` works with the [repository cache](/versions/7.7.1/run/build#repository-cache), but not +* `http_archive` works with the [repository cache](/versions/7.7.3/run/build#repository-cache), but not `git_repository`. See [#5116](https://github.com/bazelbuild/bazel/issues/5116) for more information. @@ -389,7 +389,7 @@ <td><code>name</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/concepts/labels#target-names">Name</a>; required +<a href="https://bazel.build/versions/7.7.3/concepts/labels#target-names">Name</a>; required <p> @@ -415,7 +415,7 @@ <td><code>build_file</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/concepts/labels">Label</a>; optional +<a href="https://bazel.build/versions/7.7.3/concepts/labels">Label</a>; optional <p> @@ -519,7 +519,7 @@ <td><code>patches</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/concepts/labels">List of labels</a>; optional +<a href="https://bazel.build/versions/7.7.3/concepts/labels">List of labels</a>; optional <p> @@ -584,7 +584,7 @@ <td><code>repo_mapping</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/rules/lib/dict">Dictionary: String -> String</a>; optional +<a href="https://bazel.build/versions/7.7.3/rules/lib/dict">Dictionary: String -> String</a>; optional <p> @@ -648,7 +648,7 @@ <td><code>workspace_file</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/concepts/labels">Label</a>; optional +<a href="https://bazel.build/versions/7.7.3/concepts/labels">Label</a>; optional <p>
diff --git a/docs/versions/7.7.1/rules/lib/repo/http.mdx b/docs/versions/7.7.3/rules/lib/repo/http.mdx similarity index 96% rename from docs/versions/7.7.1/rules/lib/repo/http.mdx rename to docs/versions/7.7.3/rules/lib/repo/http.mdx index 1c46af6..c5bd0bd 100644 --- a/docs/versions/7.7.1/rules/lib/repo/http.mdx +++ b/docs/versions/7.7.3/rules/lib/repo/http.mdx
@@ -102,7 +102,7 @@ <td><code>name</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/concepts/labels#target-names">Name</a>; required +<a href="https://bazel.build/versions/7.7.3/concepts/labels#target-names">Name</a>; required <p> @@ -133,7 +133,7 @@ <td><code>auth_patterns</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/rules/lib/dict">Dictionary: String -> String</a>; optional +<a href="https://bazel.build/versions/7.7.3/rules/lib/dict">Dictionary: String -> String</a>; optional <p> @@ -176,7 +176,7 @@ <td><code>build_file</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/concepts/labels">Label</a>; optional +<a href="https://bazel.build/versions/7.7.3/concepts/labels">Label</a>; optional <p> @@ -307,7 +307,7 @@ <td><code>patches</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/concepts/labels">List of labels</a>; optional +<a href="https://bazel.build/versions/7.7.3/concepts/labels">List of labels</a>; optional <p> @@ -320,7 +320,7 @@ <td><code>remote_file_integrity</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/rules/lib/dict">Dictionary: String -> String</a>; optional +<a href="https://bazel.build/versions/7.7.3/rules/lib/dict">Dictionary: String -> String</a>; optional <p> @@ -333,7 +333,7 @@ <td><code>remote_file_urls</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/rules/lib/dict">Dictionary: String -> List of strings</a>; optional +<a href="https://bazel.build/versions/7.7.3/rules/lib/dict">Dictionary: String -> List of strings</a>; optional <p> @@ -385,7 +385,7 @@ <td><code>remote_patches</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/rules/lib/dict">Dictionary: String -> String</a>; optional +<a href="https://bazel.build/versions/7.7.3/rules/lib/dict">Dictionary: String -> String</a>; optional <p> @@ -398,7 +398,7 @@ <td><code>repo_mapping</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/rules/lib/dict">Dictionary: String -> String</a>; optional +<a href="https://bazel.build/versions/7.7.3/rules/lib/dict">Dictionary: String -> String</a>; optional <p> @@ -519,7 +519,7 @@ <td><code>workspace_file</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/concepts/labels">Label</a>; optional +<a href="https://bazel.build/versions/7.7.3/concepts/labels">Label</a>; optional <p> @@ -593,7 +593,7 @@ <td><code>name</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/concepts/labels#target-names">Name</a>; required +<a href="https://bazel.build/versions/7.7.3/concepts/labels#target-names">Name</a>; required <p> @@ -606,7 +606,7 @@ <td><code>auth_patterns</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/rules/lib/dict">Dictionary: String -> String</a>; optional +<a href="https://bazel.build/versions/7.7.3/rules/lib/dict">Dictionary: String -> String</a>; optional <p> @@ -728,7 +728,7 @@ <td><code>repo_mapping</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/rules/lib/dict">Dictionary: String -> String</a>; optional +<a href="https://bazel.build/versions/7.7.3/rules/lib/dict">Dictionary: String -> String</a>; optional <p> @@ -858,7 +858,7 @@ <td><code>name</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/concepts/labels#target-names">Name</a>; required +<a href="https://bazel.build/versions/7.7.3/concepts/labels#target-names">Name</a>; required <p> @@ -871,7 +871,7 @@ <td><code>auth_patterns</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/rules/lib/dict">Dictionary: String -> String</a>; optional +<a href="https://bazel.build/versions/7.7.3/rules/lib/dict">Dictionary: String -> String</a>; optional <p> @@ -980,7 +980,7 @@ <td><code>repo_mapping</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/rules/lib/dict">Dictionary: String -> String</a>; optional +<a href="https://bazel.build/versions/7.7.3/rules/lib/dict">Dictionary: String -> String</a>; optional <p>
diff --git a/docs/versions/7.7.3/rules/lib/repo/index.mdx b/docs/versions/7.7.3/rules/lib/repo/index.mdx new file mode 100644 index 0000000..71da584 --- /dev/null +++ b/docs/versions/7.7.3/rules/lib/repo/index.mdx
@@ -0,0 +1,11 @@ +--- +title: 'Repository Rules' +--- + +* [Rules related to git](/versions/7.7.3/rules/lib/repo/git) +* [Rules related to http](/versions/7.7.3/rules/lib/repo/http) +* [Rules related to local directories](/versions/7.7.3/rules/lib/repo/local) + +# Generic functions for repository rule authors + +* [Utility functions on patching](/versions/7.7.3/rules/lib/repo/utils)
diff --git a/docs/versions/7.7.1/rules/lib/repo/local.mdx b/docs/versions/7.7.3/rules/lib/repo/local.mdx similarity index 94% rename from docs/versions/7.7.1/rules/lib/repo/local.mdx rename to docs/versions/7.7.3/rules/lib/repo/local.mdx index 0f7478d..9ce9345 100644 --- a/docs/versions/7.7.1/rules/lib/repo/local.mdx +++ b/docs/versions/7.7.3/rules/lib/repo/local.mdx
@@ -54,7 +54,7 @@ <td><code>name</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/concepts/labels#target-names">Name</a>; required +<a href="https://bazel.build/versions/7.7.3/concepts/labels#target-names">Name</a>; required <p> @@ -76,7 +76,7 @@ <td><code>repo_mapping</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/rules/lib/dict">Dictionary: String -> String</a>; optional +<a href="https://bazel.build/versions/7.7.3/rules/lib/dict">Dictionary: String -> String</a>; optional <p> @@ -116,7 +116,7 @@ <td><code>name</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/concepts/labels#target-names">Name</a>; required +<a href="https://bazel.build/versions/7.7.3/concepts/labels#target-names">Name</a>; required <p> @@ -129,7 +129,7 @@ <td><code>build_file</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/concepts/labels">Label</a>; optional +<a href="https://bazel.build/versions/7.7.3/concepts/labels">Label</a>; optional <p> A file to use as a BUILD file for this repo. Exactly one of <code>build_file</code> and <code>build_file_content</code> must be specified. The file addressed by this label does not need to be named BUILD, but can be. Something like <code>BUILD.new-repo-name</code> may work well to distinguish it from actual BUILD files. @@ -158,7 +158,7 @@ <td><code>repo_mapping</code></td> <td> -<a href="https://bazel.build/versions/7.7.1/rules/lib/dict">Dictionary: String -> String</a>; optional +<a href="https://bazel.build/versions/7.7.3/rules/lib/dict">Dictionary: String -> String</a>; optional <p>
diff --git a/docs/versions/7.7.1/rules/lib/repo/utils.mdx b/docs/versions/7.7.3/rules/lib/repo/utils.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/repo/utils.mdx rename to docs/versions/7.7.3/rules/lib/repo/utils.mdx
diff --git a/docs/versions/7.7.3/rules/lib/toplevel.mdx b/docs/versions/7.7.3/rules/lib/toplevel.mdx new file mode 100644 index 0000000..29ae891 --- /dev/null +++ b/docs/versions/7.7.3/rules/lib/toplevel.mdx
@@ -0,0 +1,18 @@ +--- +title: 'Top-level Modules' +--- + +This section lists top-level modules. These symbols are available only in .bzl files. + +* [apple\_common](/versions/7.7.3/rules/lib/toplevel/apple_common) +* [attr](/versions/7.7.3/rules/lib/toplevel/attr) +* [cc\_common](/versions/7.7.3/rules/lib/toplevel/cc_common) +* [config](/versions/7.7.3/rules/lib/toplevel/config) +* [config\_common](/versions/7.7.3/rules/lib/toplevel/config_common) +* [coverage\_common](/versions/7.7.3/rules/lib/toplevel/coverage_common) +* [java\_common](/versions/7.7.3/rules/lib/toplevel/java_common) +* [native](/versions/7.7.3/rules/lib/toplevel/native) +* [platform\_common](/versions/7.7.3/rules/lib/toplevel/platform_common) +* [proto](/versions/7.7.3/rules/lib/toplevel/proto) +* [proto\_common](/versions/7.7.3/rules/lib/toplevel/proto_common) +* [testing](/versions/7.7.3/rules/lib/toplevel/testing) \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/toplevel/apple_common.mdx b/docs/versions/7.7.3/rules/lib/toplevel/apple_common.mdx similarity index 86% rename from docs/versions/7.7.1/rules/lib/toplevel/apple_common.mdx rename to docs/versions/7.7.3/rules/lib/toplevel/apple_common.mdx index 9974ccf..d55a7d8 100644 --- a/docs/versions/7.7.1/rules/lib/toplevel/apple_common.mdx +++ b/docs/versions/7.7.3/rules/lib/toplevel/apple_common.mdx
@@ -30,7 +30,7 @@ dict apple_common.apple_host_system_env(xcode_config) ``` -Returns a [dict](/versions/7.7.1/rules/lib/core/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. +Returns a [dict](/versions/7.7.3/rules/lib/core/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. ### Parameters @@ -97,7 +97,7 @@ DottedVersion apple_common.dotted_version(version) ``` -Creates a new [DottedVersion](/versions/7.7.1/rules/lib/builtins/DottedVersion) instance. +Creates a new [DottedVersion](/versions/7.7.3/rules/lib/builtins/DottedVersion) instance. ### Parameters @@ -120,11 +120,11 @@ | Parameter | Description | | --- | --- | | `ctx` | required | -| `avoid_deps` | [sequence](/versions/7.7.1/rules/lib/core/list) of [Target](/versions/7.7.1/rules/lib/builtins/Target)s; or `None`; default is `None` | -| `extra_linkopts` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` Extra linkopts to be passed to the linker action. | -| `extra_link_inputs` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; default is `[]` Extra files to pass to the linker action. | -| `extra_requested_features` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` Extra requested features to be passed to the linker action. | -| `extra_disabled_features` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` Extra disabled features to be passed to the linker action. | +| `avoid_deps` | [sequence](/versions/7.7.3/rules/lib/core/list) of [Target](/versions/7.7.3/rules/lib/builtins/Target)s; or `None`; default is `None` | +| `extra_linkopts` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` Extra linkopts to be passed to the linker action. | +| `extra_link_inputs` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; default is `[]` Extra files to pass to the linker action. | +| `extra_requested_features` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` Extra requested features to be passed to the linker action. | +| `extra_disabled_features` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` Extra disabled features to be passed to the linker action. | | `stamp` | default is `-1` 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. | ## link\_multi\_arch\_static\_library @@ -155,11 +155,11 @@ | Parameter | Description | | --- | --- | -| `binary` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` The dylib binary artifact of the dynamic framework. | +| `binary` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` The dylib binary artifact of the dynamic framework. | | `cc_info` | default is `None` A CcInfo which contains information about the transitive dependencies linked into the binary. | | `objc` | default is `None` An ObjcProvider which contains information about the transitive dependencies linked into the binary. | -| `framework_dirs` | [depset](/versions/7.7.1/rules/lib/builtins/depset) of [string](/versions/7.7.1/rules/lib/core/string)s; or `None`; default is `None` The framework path names used as link inputs in order to link against the dynamic framework. | -| `framework_files` | [depset](/versions/7.7.1/rules/lib/builtins/depset) of [File](/versions/7.7.1/rules/lib/builtins/File)s; or `None`; default is `None` The full set of artifacts that should be included as inputs to link against the dynamic framework | +| `framework_dirs` | [depset](/versions/7.7.3/rules/lib/builtins/depset) of [string](/versions/7.7.3/rules/lib/core/string)s; or `None`; default is `None` The framework path names used as link inputs in order to link against the dynamic framework. | +| `framework_files` | [depset](/versions/7.7.3/rules/lib/builtins/depset) of [File](/versions/7.7.3/rules/lib/builtins/File)s; or `None`; default is `None` The full set of artifacts that should be included as inputs to link against the dynamic framework | ## new\_executable\_binary\_provider @@ -173,7 +173,7 @@ | Parameter | Description | | --- | --- | -| `binary` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` The binary artifact of the executable. | +| `binary` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` The binary artifact of the executable. | | `cc_info` | default is `None` A CcInfo which contains information about the transitive dependencies linked into the binary. | | `objc` | default is `None` An ObjcProvider which contains information about the transitive dependencies linked into the binary. | @@ -224,7 +224,7 @@ * `watchos_device` * `watchos_simulator` -These values can be passed to methods that expect a platform, like [XcodeVersionConfig.sdk\_version\_for\_platform](/versions/7.7.1/rules/lib/providers/XcodeVersionConfig#sdk_version_for_platform). +These values can be passed to methods that expect a platform, like [XcodeVersionConfig.sdk\_version\_for\_platform](/versions/7.7.3/rules/lib/providers/XcodeVersionConfig#sdk_version_for_platform). ## platform\_type @@ -240,7 +240,7 @@ * `visionos` * `watchos` -These values can be passed to methods that expect a platform type, like the 'apple' configuration fragment's [multi\_arch\_platform](/versions/7.7.1/rules/lib/fragments/apple#multi_arch_platform) method. +These values can be passed to methods that expect a platform type, like the 'apple' configuration fragment's [multi\_arch\_platform](/versions/7.7.3/rules/lib/fragments/apple#multi_arch_platform) method. Example:
diff --git a/docs/versions/7.7.1/rules/lib/toplevel/attr.mdx b/docs/versions/7.7.3/rules/lib/toplevel/attr.mdx similarity index 73% rename from docs/versions/7.7.1/rules/lib/toplevel/attr.mdx rename to docs/versions/7.7.3/rules/lib/toplevel/attr.mdx index 0a5faf9..1751e08 100644 --- a/docs/versions/7.7.1/rules/lib/toplevel/attr.mdx +++ b/docs/versions/7.7.3/rules/lib/toplevel/attr.mdx
@@ -2,9 +2,9 @@ title: 'attr' --- -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()`](/versions/7.7.1/rules/lib/globals/bzl#rule) and [`aspect()`](/versions/7.7.1/rules/lib/globals/bzl#aspect). +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()`](/versions/7.7.3/rules/lib/globals/bzl#rule) and [`aspect()`](/versions/7.7.3/rules/lib/globals/bzl#aspect). -See the Rules page for more on [defining](https://bazel.build/versions/7.7.1/extending/rules#attributes) and [using](https://bazel.build/versions/7.7.1/extending/rules#implementation_function) attributes. +See the Rules page for more on [defining](https://bazel.build/versions/7.7.3/extending/rules#attributes) and [using](https://bazel.build/versions/7.7.3/extending/rules#implementation_function) attributes. ## Members @@ -28,14 +28,14 @@ Attribute attr.bool(default=False, doc=None, mandatory=False) ``` -Creates a schema for a boolean attribute. The corresponding [`ctx.attr`](/versions/7.7.1/rules/lib/builtins/ctx#attr) attribute will be of type [`bool`](/versions/7.7.1/rules/lib/core/bool). +Creates a schema for a boolean attribute. The corresponding [`ctx.attr`](/versions/7.7.3/rules/lib/builtins/ctx#attr) attribute will be of type [`bool`](/versions/7.7.3/rules/lib/core/bool). ### Parameters | Parameter | Description | | --- | --- | | `default` | default is `False` A default value to use if no value for this attribute is given when instantiating the rule. | -| `doc` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | +| `doc` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | | `mandatory` | default is `False` If true, the value must be specified explicitly (even if it has a `default`). | ## int @@ -44,16 +44,16 @@ Attribute attr.int(default=0, doc=None, mandatory=False, values=[]) ``` -Creates a schema for an integer attribute. The value must be in the signed 32-bit range. The corresponding [`ctx.attr`](/versions/7.7.1/rules/lib/builtins/ctx#attr) attribute will be of type [`int`](/versions/7.7.1/rules/lib/core/int). +Creates a schema for an integer attribute. The value must be in the signed 32-bit range. The corresponding [`ctx.attr`](/versions/7.7.3/rules/lib/builtins/ctx#attr) attribute will be of type [`int`](/versions/7.7.3/rules/lib/core/int). ### Parameters | Parameter | Description | | --- | --- | | `default` | default is `0` A default value to use if no value for this attribute is given when instantiating the rule. | -| `doc` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | +| `doc` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | | `mandatory` | default is `False` If true, the value must be specified explicitly (even if it has a `default`). | -| `values` | [sequence](/versions/7.7.1/rules/lib/core/list) of [int](/versions/7.7.1/rules/lib/core/int)s; default is `[]` The list of allowed values for the attribute. An error is raised if any other value is given. | +| `values` | [sequence](/versions/7.7.3/rules/lib/core/list) of [int](/versions/7.7.3/rules/lib/core/int)s; default is `[]` The list of allowed values for the attribute. An error is raised if any other value is given. | ## int\_list @@ -69,8 +69,8 @@ | --- | --- | | `mandatory` | default is `False` If true, the value must be specified explicitly (even if it has a `default`). | | `allow_empty` | default is `True` True if the attribute can be empty. | -| `default` | [sequence](/versions/7.7.1/rules/lib/core/list) of [int](/versions/7.7.1/rules/lib/core/int)s; default is `[]` A default value to use if no value for this attribute is given when instantiating the rule. | -| `doc` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | +| `default` | [sequence](/versions/7.7.3/rules/lib/core/list) of [int](/versions/7.7.3/rules/lib/core/int)s; default is `[]` A default value to use if no value for this attribute is given when instantiating the rule. | +| `doc` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | ## label @@ -80,27 +80,27 @@ Creates a schema for a label attribute. This is a dependency attribute. -This attribute contains unique [`Label`](/versions/7.7.1/rules/lib/builtins/Label) values. If a string is supplied in place of a `Label`, it will be converted using the [label constructor](/versions/7.7.1/rules/lib/builtins/Label#Label). The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target's package. +This attribute contains unique [`Label`](/versions/7.7.3/rules/lib/builtins/Label) values. If a string is supplied in place of a `Label`, it will be converted using the [label constructor](/versions/7.7.3/rules/lib/builtins/Label#Label). The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target's package. -At analysis time (within the rule's implementation function), when retrieving the attribute value from `ctx.attr`, labels are replaced by the corresponding [`Target`](/versions/7.7.1/rules/lib/builtins/Target)s. This allows you to access the providers of the current target's dependencies. +At analysis time (within the rule's implementation function), when retrieving the attribute value from `ctx.attr`, labels are replaced by the corresponding [`Target`](/versions/7.7.3/rules/lib/builtins/Target)s. This allows you to access the providers of the current target's dependencies. -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 `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](https://bazel.build/versions/7.7.1/extending/rules#private-attributes) page for more information. +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 `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](https://bazel.build/versions/7.7.3/extending/rules#private-attributes) page for more information. ### Parameters | Parameter | Description | | --- | --- | -| `default` | [Label](/versions/7.7.1/rules/lib/builtins/Label); or [string](/versions/7.7.1/rules/lib/core/string); or [LateBoundDefault](/versions/7.7.1/rules/lib/builtins/LateBoundDefault); or NativeComputedDefault; or [function](/versions/7.7.1/rules/lib/core/function); or `None`; default is `None` A default value to use if no value for this attribute is given when instantiating the rule.Use a string or the [`Label`](/versions/7.7.1/rules/lib/builtins/Label#Label) function to specify a default value, for example, `attr.label(default = "//a:b")`. | -| `doc` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | +| `default` | [Label](/versions/7.7.3/rules/lib/builtins/Label); or [string](/versions/7.7.3/rules/lib/core/string); or [LateBoundDefault](/versions/7.7.3/rules/lib/builtins/LateBoundDefault); or NativeComputedDefault; or [function](/versions/7.7.3/rules/lib/core/function); or `None`; default is `None` A default value to use if no value for this attribute is given when instantiating the rule.Use a string or the [`Label`](/versions/7.7.3/rules/lib/builtins/Label#Label) function to specify a default value, for example, `attr.label(default = "//a:b")`. | +| `doc` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | | `executable` | default is `False` 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>`. | -| `allow_files` | [bool](/versions/7.7.1/rules/lib/core/bool); or [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; or `None`; default is `None` Whether `File` targets are allowed. Can be `True`, `False` (default), or a list of file extensions that are allowed (for example, `[".cc", ".cpp"]`). | -| `allow_single_file` | default is `None` This is similar to `allow_files`, with the restriction that the label must correspond to a single [File](/versions/7.7.1/rules/lib/builtins/File). Access it through `ctx.file.<attribute_name>`. | +| `allow_files` | [bool](/versions/7.7.3/rules/lib/core/bool); or [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; or `None`; default is `None` Whether `File` targets are allowed. Can be `True`, `False` (default), or a list of file extensions that are allowed (for example, `[".cc", ".cpp"]`). | +| `allow_single_file` | default is `None` This is similar to `allow_files`, with the restriction that the label must correspond to a single [File](/versions/7.7.3/rules/lib/builtins/File). Access it through `ctx.file.<attribute_name>`. | | `mandatory` | default is `False` If true, the value must be specified explicitly (even if it has a `default`). | -| `providers` | default is `[]` 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 -- `*Info` objects returned by [`provider()`](/versions/7.7.1/rules/lib/globals/bzl#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. | -| `allow_rules` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; or `None`; default is `None` Which rule targets (name of the classes) are allowed. This is deprecated (kept only for compatibility), use providers instead. | -| `cfg` | default is `None` [Configuration](https://bazel.build/versions/7.7.1/extending/rules#configurations) 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. | -| `aspects` | [sequence](/versions/7.7.1/rules/lib/core/list) of [Aspect](/versions/7.7.1/rules/lib/builtins/Aspect)s; default is `[]` Aspects that should be applied to the dependency or dependencies specified by this attribute. | -| `flags` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` Deprecated, will be removed. | +| `providers` | default is `[]` 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 -- `*Info` objects returned by [`provider()`](/versions/7.7.3/rules/lib/globals/bzl#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. | +| `allow_rules` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; or `None`; default is `None` Which rule targets (name of the classes) are allowed. This is deprecated (kept only for compatibility), use providers instead. | +| `cfg` | default is `None` [Configuration](https://bazel.build/versions/7.7.3/extending/rules#configurations) 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. | +| `aspects` | [sequence](/versions/7.7.3/rules/lib/core/list) of [Aspect](/versions/7.7.3/rules/lib/builtins/Aspect)s; default is `[]` Aspects that should be applied to the dependency or dependencies specified by this attribute. | +| `flags` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` Deprecated, will be removed. | ## label\_keyed\_string\_dict @@ -110,24 +110,24 @@ 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 [`Label`](/versions/7.7.1/rules/lib/builtins/Label) values. If a string is supplied in place of a `Label`, it will be converted using the [label constructor](/versions/7.7.1/rules/lib/builtins/Label#Label). The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target's package. +This attribute contains unique [`Label`](/versions/7.7.3/rules/lib/builtins/Label) values. If a string is supplied in place of a `Label`, it will be converted using the [label constructor](/versions/7.7.3/rules/lib/builtins/Label#Label). The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target's package. -At analysis time (within the rule's implementation function), when retrieving the attribute value from `ctx.attr`, labels are replaced by the corresponding [`Target`](/versions/7.7.1/rules/lib/builtins/Target)s. This allows you to access the providers of the current target's dependencies. +At analysis time (within the rule's implementation function), when retrieving the attribute value from `ctx.attr`, labels are replaced by the corresponding [`Target`](/versions/7.7.3/rules/lib/builtins/Target)s. This allows you to access the providers of the current target's dependencies. ### Parameters | Parameter | Description | | --- | --- | | `allow_empty` | default is `True` True if the attribute can be empty. | -| `default` | [dict](/versions/7.7.1/rules/lib/core/dict); or [function](/versions/7.7.1/rules/lib/core/function); default is `{}` A default value to use if no value for this attribute is given when instantiating the rule.Use strings or the [`Label`](/versions/7.7.1/rules/lib/builtins/Label#Label) function to specify default values, for example, `attr.label_keyed_string_dict(default = {"//a:b": "value", "//a:c": "string"})`. | -| `doc` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | -| `allow_files` | [bool](/versions/7.7.1/rules/lib/core/bool); or [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; or `None`; default is `None` Whether `File` targets are allowed. Can be `True`, `False` (default), or a list of file extensions that are allowed (for example, `[".cc", ".cpp"]`). | -| `allow_rules` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; or `None`; default is `None` Which rule targets (name of the classes) are allowed. This is deprecated (kept only for compatibility), use providers instead. | -| `providers` | default is `[]` 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 -- `*Info` objects returned by [`provider()`](/versions/7.7.1/rules/lib/globals/bzl#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. | -| `flags` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` Deprecated, will be removed. | +| `default` | [dict](/versions/7.7.3/rules/lib/core/dict); or [function](/versions/7.7.3/rules/lib/core/function); default is `{}` A default value to use if no value for this attribute is given when instantiating the rule.Use strings or the [`Label`](/versions/7.7.3/rules/lib/builtins/Label#Label) function to specify default values, for example, `attr.label_keyed_string_dict(default = {"//a:b": "value", "//a:c": "string"})`. | +| `doc` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | +| `allow_files` | [bool](/versions/7.7.3/rules/lib/core/bool); or [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; or `None`; default is `None` Whether `File` targets are allowed. Can be `True`, `False` (default), or a list of file extensions that are allowed (for example, `[".cc", ".cpp"]`). | +| `allow_rules` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; or `None`; default is `None` Which rule targets (name of the classes) are allowed. This is deprecated (kept only for compatibility), use providers instead. | +| `providers` | default is `[]` 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 -- `*Info` objects returned by [`provider()`](/versions/7.7.3/rules/lib/globals/bzl#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. | +| `flags` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` Deprecated, will be removed. | | `mandatory` | default is `False` If true, the value must be specified explicitly (even if it has a `default`). | -| `cfg` | default is `None` [Configuration](https://bazel.build/versions/7.7.1/extending/rules#configurations) 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`. | -| `aspects` | [sequence](/versions/7.7.1/rules/lib/core/list) of [Aspect](/versions/7.7.1/rules/lib/builtins/Aspect)s; default is `[]` Aspects that should be applied to the dependency or dependencies specified by this attribute. | +| `cfg` | default is `None` [Configuration](https://bazel.build/versions/7.7.3/extending/rules#configurations) 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`. | +| `aspects` | [sequence](/versions/7.7.3/rules/lib/core/list) of [Aspect](/versions/7.7.3/rules/lib/builtins/Aspect)s; default is `[]` Aspects that should be applied to the dependency or dependencies specified by this attribute. | ## label\_list @@ -135,26 +135,26 @@ Attribute attr.label_list(allow_empty=True, *, default=[], doc=None, allow_files=None, allow_rules=None, providers=[], flags=[], mandatory=False, cfg=None, aspects=[]) ``` -Creates a schema for a list-of-labels attribute. This is a dependency attribute. The corresponding [`ctx.attr`](/versions/7.7.1/rules/lib/builtins/ctx#attr) attribute will be of type [list](/versions/7.7.1/rules/lib/core/list) of [`Target`s](/versions/7.7.1/rules/lib/builtins/Target). +Creates a schema for a list-of-labels attribute. This is a dependency attribute. The corresponding [`ctx.attr`](/versions/7.7.3/rules/lib/builtins/ctx#attr) attribute will be of type [list](/versions/7.7.3/rules/lib/core/list) of [`Target`s](/versions/7.7.3/rules/lib/builtins/Target). -This attribute contains unique [`Label`](/versions/7.7.1/rules/lib/builtins/Label) values. If a string is supplied in place of a `Label`, it will be converted using the [label constructor](/versions/7.7.1/rules/lib/builtins/Label#Label). The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target's package. +This attribute contains unique [`Label`](/versions/7.7.3/rules/lib/builtins/Label) values. If a string is supplied in place of a `Label`, it will be converted using the [label constructor](/versions/7.7.3/rules/lib/builtins/Label#Label). The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target's package. -At analysis time (within the rule's implementation function), when retrieving the attribute value from `ctx.attr`, labels are replaced by the corresponding [`Target`](/versions/7.7.1/rules/lib/builtins/Target)s. This allows you to access the providers of the current target's dependencies. +At analysis time (within the rule's implementation function), when retrieving the attribute value from `ctx.attr`, labels are replaced by the corresponding [`Target`](/versions/7.7.3/rules/lib/builtins/Target)s. This allows you to access the providers of the current target's dependencies. ### Parameters | Parameter | Description | | --- | --- | | `allow_empty` | default is `True` True if the attribute can be empty. | -| `default` | [sequence](/versions/7.7.1/rules/lib/core/list) of [Label](/versions/7.7.1/rules/lib/builtins/Label)s; or [function](/versions/7.7.1/rules/lib/core/function); default is `[]` A default value to use if no value for this attribute is given when instantiating the rule.Use strings or the [`Label`](/versions/7.7.1/rules/lib/builtins/Label#Label) function to specify default values, for example, `attr.label_list(default = ["//a:b", "//a:c"])`. | -| `doc` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | -| `allow_files` | [bool](/versions/7.7.1/rules/lib/core/bool); or [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; or `None`; default is `None` Whether `File` targets are allowed. Can be `True`, `False` (default), or a list of file extensions that are allowed (for example, `[".cc", ".cpp"]`). | -| `allow_rules` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; or `None`; default is `None` Which rule targets (name of the classes) are allowed. This is deprecated (kept only for compatibility), use providers instead. | -| `providers` | default is `[]` 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 -- `*Info` objects returned by [`provider()`](/versions/7.7.1/rules/lib/globals/bzl#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. | -| `flags` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` Deprecated, will be removed. | +| `default` | [sequence](/versions/7.7.3/rules/lib/core/list) of [Label](/versions/7.7.3/rules/lib/builtins/Label)s; or [function](/versions/7.7.3/rules/lib/core/function); default is `[]` A default value to use if no value for this attribute is given when instantiating the rule.Use strings or the [`Label`](/versions/7.7.3/rules/lib/builtins/Label#Label) function to specify default values, for example, `attr.label_list(default = ["//a:b", "//a:c"])`. | +| `doc` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | +| `allow_files` | [bool](/versions/7.7.3/rules/lib/core/bool); or [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; or `None`; default is `None` Whether `File` targets are allowed. Can be `True`, `False` (default), or a list of file extensions that are allowed (for example, `[".cc", ".cpp"]`). | +| `allow_rules` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; or `None`; default is `None` Which rule targets (name of the classes) are allowed. This is deprecated (kept only for compatibility), use providers instead. | +| `providers` | default is `[]` 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 -- `*Info` objects returned by [`provider()`](/versions/7.7.3/rules/lib/globals/bzl#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. | +| `flags` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` Deprecated, will be removed. | | `mandatory` | default is `False` If true, the value must be specified explicitly (even if it has a `default`). | -| `cfg` | default is `None` [Configuration](https://bazel.build/versions/7.7.1/extending/rules#configurations) 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`. | -| `aspects` | [sequence](/versions/7.7.1/rules/lib/core/list) of [Aspect](/versions/7.7.1/rules/lib/builtins/Aspect)s; default is `[]` Aspects that should be applied to the dependency or dependencies specified by this attribute. | +| `cfg` | default is `None` [Configuration](https://bazel.build/versions/7.7.3/extending/rules#configurations) 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`. | +| `aspects` | [sequence](/versions/7.7.3/rules/lib/core/list) of [Aspect](/versions/7.7.3/rules/lib/builtins/Aspect)s; default is `[]` Aspects that should be applied to the dependency or dependencies specified by this attribute. | ## output @@ -164,15 +164,15 @@ Creates a schema for an output (label) attribute. -This attribute contains unique [`Label`](/versions/7.7.1/rules/lib/builtins/Label) values. If a string is supplied in place of a `Label`, it will be converted using the [label constructor](/versions/7.7.1/rules/lib/builtins/Label#Label). The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target's package. +This attribute contains unique [`Label`](/versions/7.7.3/rules/lib/builtins/Label) values. If a string is supplied in place of a `Label`, it will be converted using the [label constructor](/versions/7.7.3/rules/lib/builtins/Label#Label). The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target's package. -At analysis time, the corresponding [`File`](/versions/7.7.1/rules/lib/builtins/File) can be retrieved using [`ctx.outputs`](/versions/7.7.1/rules/lib/builtins/ctx#outputs). +At analysis time, the corresponding [`File`](/versions/7.7.3/rules/lib/builtins/File) can be retrieved using [`ctx.outputs`](/versions/7.7.3/rules/lib/builtins/ctx#outputs). ### Parameters | Parameter | Description | | --- | --- | -| `doc` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | +| `doc` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | | `mandatory` | default is `False` If true, the value must be specified explicitly (even if it has a `default`). | ## output\_list @@ -183,16 +183,16 @@ Creates a schema for a list-of-outputs attribute. -This attribute contains unique [`Label`](/versions/7.7.1/rules/lib/builtins/Label) values. If a string is supplied in place of a `Label`, it will be converted using the [label constructor](/versions/7.7.1/rules/lib/builtins/Label#Label). The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target's package. +This attribute contains unique [`Label`](/versions/7.7.3/rules/lib/builtins/Label) values. If a string is supplied in place of a `Label`, it will be converted using the [label constructor](/versions/7.7.3/rules/lib/builtins/Label#Label). The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target's package. -At analysis time, the corresponding [`File`](/versions/7.7.1/rules/lib/builtins/File) can be retrieved using [`ctx.outputs`](/versions/7.7.1/rules/lib/builtins/ctx#outputs). +At analysis time, the corresponding [`File`](/versions/7.7.3/rules/lib/builtins/File) can be retrieved using [`ctx.outputs`](/versions/7.7.3/rules/lib/builtins/ctx#outputs). ### Parameters | Parameter | Description | | --- | --- | | `allow_empty` | default is `True` True if the attribute can be empty. | -| `doc` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | +| `doc` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | | `mandatory` | default is `False` If true, the value must be specified explicitly (even if it has a `default`). | ## string @@ -201,16 +201,16 @@ Attribute attr.string(default='', doc=None, mandatory=False, values=[]) ``` -Creates a schema for a [string](/versions/7.7.1/rules/lib/core/string#attr) attribute. +Creates a schema for a [string](/versions/7.7.3/rules/lib/core/string#attr) attribute. ### Parameters | Parameter | Description | | --- | --- | -| `default` | [string](/versions/7.7.1/rules/lib/core/string); or NativeComputedDefault; default is `''` A default value to use if no value for this attribute is given when instantiating the rule. | -| `doc` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | +| `default` | [string](/versions/7.7.3/rules/lib/core/string); or NativeComputedDefault; default is `''` A default value to use if no value for this attribute is given when instantiating the rule. | +| `doc` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | | `mandatory` | default is `False` If true, the value must be specified explicitly (even if it has a `default`). | -| `values` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` The list of allowed values for the attribute. An error is raised if any other value is given. | +| `values` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` The list of allowed values for the attribute. An error is raised if any other value is given. | ## string\_dict @@ -226,7 +226,7 @@ | --- | --- | | `allow_empty` | default is `True` True if the attribute can be empty. | | `default` | default is `{}` A default value to use if no value for this attribute is given when instantiating the rule. | -| `doc` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | +| `doc` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | | `mandatory` | default is `False` If true, the value must be specified explicitly (even if it has a `default`). | ## string\_keyed\_label\_dict @@ -237,24 +237,24 @@ 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 [`Label`](/versions/7.7.1/rules/lib/builtins/Label) values. If a string is supplied in place of a `Label`, it will be converted using the [label constructor](/versions/7.7.1/rules/lib/builtins/Label#Label). The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target's package. +This attribute contains unique [`Label`](/versions/7.7.3/rules/lib/builtins/Label) values. If a string is supplied in place of a `Label`, it will be converted using the [label constructor](/versions/7.7.3/rules/lib/builtins/Label#Label). The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target's package. -At analysis time (within the rule's implementation function), when retrieving the attribute value from `ctx.attr`, labels are replaced by the corresponding [`Target`](/versions/7.7.1/rules/lib/builtins/Target)s. This allows you to access the providers of the current target's dependencies. +At analysis time (within the rule's implementation function), when retrieving the attribute value from `ctx.attr`, labels are replaced by the corresponding [`Target`](/versions/7.7.3/rules/lib/builtins/Target)s. This allows you to access the providers of the current target's dependencies. ### Parameters | Parameter | Description | | --- | --- | | `allow_empty` | default is `True` True if the attribute can be empty. | -| `default` | [dict](/versions/7.7.1/rules/lib/core/dict); or [function](/versions/7.7.1/rules/lib/core/function); default is `{}` A default value to use if no value for this attribute is given when instantiating the rule.Use strings or the [`Label`](/versions/7.7.1/rules/lib/builtins/Label#Label) function to specify default values, for example, `attr.string_keyed_label_dict(default = {"foo": "//a:b", "bar": "//a:c"})`. | -| `doc` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | -| `allow_files` | [bool](/versions/7.7.1/rules/lib/core/bool); or [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; or `None`; default is `None` Whether `File` targets are allowed. Can be `True`, `False` (default), or a list of file extensions that are allowed (for example, `[".cc", ".cpp"]`). | -| `allow_rules` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; or `None`; default is `None` Which rule targets (name of the classes) are allowed. This is deprecated (kept only for compatibility), use providers instead. | -| `providers` | default is `[]` 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 -- `*Info` objects returned by [`provider()`](/versions/7.7.1/rules/lib/globals/bzl#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. | -| `flags` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` Deprecated, will be removed. | +| `default` | [dict](/versions/7.7.3/rules/lib/core/dict); or [function](/versions/7.7.3/rules/lib/core/function); default is `{}` A default value to use if no value for this attribute is given when instantiating the rule.Use strings or the [`Label`](/versions/7.7.3/rules/lib/builtins/Label#Label) function to specify default values, for example, `attr.string_keyed_label_dict(default = {"foo": "//a:b", "bar": "//a:c"})`. | +| `doc` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | +| `allow_files` | [bool](/versions/7.7.3/rules/lib/core/bool); or [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; or `None`; default is `None` Whether `File` targets are allowed. Can be `True`, `False` (default), or a list of file extensions that are allowed (for example, `[".cc", ".cpp"]`). | +| `allow_rules` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; or `None`; default is `None` Which rule targets (name of the classes) are allowed. This is deprecated (kept only for compatibility), use providers instead. | +| `providers` | default is `[]` 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 -- `*Info` objects returned by [`provider()`](/versions/7.7.3/rules/lib/globals/bzl#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. | +| `flags` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` Deprecated, will be removed. | | `mandatory` | default is `False` If true, the value must be specified explicitly (even if it has a `default`). | -| `cfg` | default is `None` [Configuration](https://bazel.build/versions/7.7.1/extending/rules#configurations) 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`. | -| `aspects` | [sequence](/versions/7.7.1/rules/lib/core/list) of [Aspect](/versions/7.7.1/rules/lib/builtins/Aspect)s; default is `[]` Aspects that should be applied to the dependency or dependencies specified by this attribute. | +| `cfg` | default is `None` [Configuration](https://bazel.build/versions/7.7.3/extending/rules#configurations) 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`. | +| `aspects` | [sequence](/versions/7.7.3/rules/lib/core/list) of [Aspect](/versions/7.7.3/rules/lib/builtins/Aspect)s; default is `[]` Aspects that should be applied to the dependency or dependencies specified by this attribute. | ## string\_list @@ -270,8 +270,8 @@ | --- | --- | | `mandatory` | default is `False` If true, the value must be specified explicitly (even if it has a `default`). | | `allow_empty` | default is `True` True if the attribute can be empty. | -| `default` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; or NativeComputedDefault; default is `[]` A default value to use if no value for this attribute is given when instantiating the rule. | -| `doc` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | +| `default` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; or NativeComputedDefault; default is `[]` A default value to use if no value for this attribute is given when instantiating the rule. | +| `doc` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | ## string\_list\_dict @@ -287,5 +287,5 @@ | --- | --- | | `allow_empty` | default is `True` True if the attribute can be empty. | | `default` | default is `{}` A default value to use if no value for this attribute is given when instantiating the rule. | -| `doc` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | +| `doc` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` A description of the attribute that can be extracted by documentation generating tools. | | `mandatory` | default is `False` If true, the value must be specified explicitly (even if it has a `default`). | \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/toplevel/cc_common.mdx b/docs/versions/7.7.3/rules/lib/toplevel/cc_common.mdx similarity index 90% rename from docs/versions/7.7.1/rules/lib/toplevel/cc_common.mdx rename to docs/versions/7.7.3/rules/lib/toplevel/cc_common.mdx index 2ac7489..39fc394 100644 --- a/docs/versions/7.7.1/rules/lib/toplevel/cc_common.mdx +++ b/docs/versions/7.7.3/rules/lib/toplevel/cc_common.mdx
@@ -70,7 +70,7 @@ | `srcs` | default is `[]` The list of source files to be compiled. | | `public_hdrs` | default is `[]` List of headers needed for compilation of srcs and may be included by dependent rules transitively. | | `private_hdrs` | default is `[]` List of headers needed for compilation of srcs and NOT to be included by dependent rules. | -| `includes` | [sequence](/versions/7.7.1/rules/lib/core/list); or [depset](/versions/7.7.1/rules/lib/builtins/depset); default is `[]` Search paths for header files referenced both by angle bracket and quotes. Usually passed with -I. Propagated to dependents transitively. | +| `includes` | [sequence](/versions/7.7.3/rules/lib/core/list); or [depset](/versions/7.7.3/rules/lib/builtins/depset); default is `[]` Search paths for header files referenced both by angle bracket and quotes. Usually passed with -I. Propagated to dependents transitively. | | `quote_includes` | default is `[]` Search paths 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. Propagated to dependents transitively. | | `system_includes` | default is `[]` Search paths 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. Propagated to dependents transitively. | | `framework_includes` | default is `[]` Search paths for header files from Apple frameworks. They can be either relative to the exec root or absolute. Usually passed with -F. Propagated to dependents transitively. | @@ -99,9 +99,9 @@ | Parameter | Description | | --- | --- | -| `ctx` | [ctx](/versions/7.7.1/rules/lib/builtins/ctx); or `None`; default is `None` The rule context. | +| `ctx` | [ctx](/versions/7.7.3/rules/lib/builtins/ctx); or `None`; default is `None` The rule context. | | `cc_toolchain` | required cc\_toolchain for which we configure features. | -| `language` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` The language to configure for: either c++ or objc (default c++) | +| `language` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` The language to configure for: either c++ or objc (default c++) | | `requested_features` | default is `[]` List of features to be enabled. | | `unsupported_features` | default is `[]` List of features that are unsupported by the current rule. | @@ -123,17 +123,17 @@ | `artifact_name_patterns` | default is `[]` The name for an artifact of a given category of input or output artifacts to an action. Arguments: `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. | | `cxx_builtin_include_directories` | default is `[]` 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. | | `toolchain_identifier` | required 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]\* | -| `host_system_name` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` Ignored. | +| `host_system_name` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` Ignored. | | `target_system_name` | required The GNU System Name. | | `target_cpu` | required The target architecture string. | | `target_libc` | required The libc version string (e.g. "glibc-2.2.2"). | | `compiler` | required The compiler version string (e.g. "gcc-4.1.1"). | -| `abi_version` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` The abi in use, which is a gcc version. E.g.: "gcc-3.4" | -| `abi_libc_version` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` The glibc version used by the abi we're using. | +| `abi_version` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` The abi in use, which is a gcc version. E.g.: "gcc-3.4" | +| `abi_libc_version` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` The glibc version used by the abi we're using. | | `tool_paths` | default is `[]` Tool locations. Arguments: `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. | | `make_variables` | default is `[]` A make variable that is made accessible to rules. | -| `builtin_sysroot` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` 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. | -| `cc_target_os` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` Internal purpose only, do not use. | +| `builtin_sysroot` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` 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. | +| `cc_target_os` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` Internal purpose only, do not use. | ## create\_compilation\_context @@ -167,8 +167,8 @@ | Parameter | Description | | --- | --- | -| `objects` | [depset](/versions/7.7.1/rules/lib/builtins/depset); or `None`; default is `None` List of object files. | -| `pic_objects` | [depset](/versions/7.7.1/rules/lib/builtins/depset); or `None`; default is `None` List of pic object files. | +| `objects` | [depset](/versions/7.7.3/rules/lib/builtins/depset); or `None`; default is `None` List of object files. | +| `pic_objects` | [depset](/versions/7.7.3/rules/lib/builtins/depset); or `None`; default is `None` List of pic object files. | ## create\_compile\_variables @@ -186,18 +186,18 @@ | `feature_configuration` | required Feature configuration to be queried. | | `source_file` | default is `None` 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. | | `output_file` | default is `None` 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. | -| `user_compile_flags` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; or `None`; default is `None` List of additional compilation flags (copts). | -| `include_directories` | [depset](/versions/7.7.1/rules/lib/builtins/depset); or `None`; default is `None` Depset of include directories. | -| `quote_include_directories` | [depset](/versions/7.7.1/rules/lib/builtins/depset); or `None`; default is `None` Depset of quote include directories. | -| `system_include_directories` | [depset](/versions/7.7.1/rules/lib/builtins/depset); or `None`; default is `None` Depset of system include directories. | -| `framework_include_directories` | [depset](/versions/7.7.1/rules/lib/builtins/depset); or `None`; default is `None` Depset of framework include directories. | -| `preprocessor_defines` | [depset](/versions/7.7.1/rules/lib/builtins/depset); or `None`; default is `None` Depset of preprocessor defines. | -| `thinlto_index` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` LTO index file path. | -| `thinlto_input_bitcode_file` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` Bitcode file that is input to LTO backend. | -| `thinlto_output_object_file` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` Object file that is output by LTO backend. | +| `user_compile_flags` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; or `None`; default is `None` List of additional compilation flags (copts). | +| `include_directories` | [depset](/versions/7.7.3/rules/lib/builtins/depset); or `None`; default is `None` Depset of include directories. | +| `quote_include_directories` | [depset](/versions/7.7.3/rules/lib/builtins/depset); or `None`; default is `None` Depset of quote include directories. | +| `system_include_directories` | [depset](/versions/7.7.3/rules/lib/builtins/depset); or `None`; default is `None` Depset of system include directories. | +| `framework_include_directories` | [depset](/versions/7.7.3/rules/lib/builtins/depset); or `None`; default is `None` Depset of framework include directories. | +| `preprocessor_defines` | [depset](/versions/7.7.3/rules/lib/builtins/depset); or `None`; default is `None` Depset of preprocessor defines. | +| `thinlto_index` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` LTO index file path. | +| `thinlto_input_bitcode_file` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` Bitcode file that is input to LTO backend. | +| `thinlto_output_object_file` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` Object file that is output by LTO backend. | | `use_pic` | default is `False` When true the compilation will generate position independent code. | | `add_legacy_cxx_options` | default is `False` Unused. | -| `variables_extension` | [dict](/versions/7.7.1/rules/lib/core/dict); default is `unbound` A dictionary of additional variables used by compile actions. | +| `variables_extension` | [dict](/versions/7.7.3/rules/lib/core/dict); default is `unbound` A dictionary of additional variables used by compile actions. | ## create\_library\_to\_link @@ -214,14 +214,14 @@ | `actions` | required `actions` object. | | `feature_configuration` | default is `None` `feature_configuration` to be queried. | | `cc_toolchain` | default is `None` `CcToolchainInfo` provider to be used. | -| `static_library` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` `File` of static library to be linked. | -| `pic_static_library` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` `File` of pic static library to be linked. | -| `dynamic_library` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` `File` of dynamic library to be linked. Always used for runtime and used for linking if `interface_library` is not passed. | -| `interface_library` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` `File` of interface library to be linked. | -| `pic_objects` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; default is `unbound` Experimental, do not use | -| `objects` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; default is `unbound` Experimental, do not use | +| `static_library` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` `File` of static library to be linked. | +| `pic_static_library` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` `File` of pic static library to be linked. | +| `dynamic_library` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` `File` of dynamic library to be linked. Always used for runtime and used for linking if `interface_library` is not passed. | +| `interface_library` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` `File` of interface library to be linked. | +| `pic_objects` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; default is `unbound` Experimental, do not use | +| `objects` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; default is `unbound` Experimental, do not use | | `alwayslink` | default is `False` Whether to link the static library/objects in the --whole\_archive block. | -| `dynamic_library_symlink_path` | [string](/versions/7.7.1/rules/lib/core/string); default is `''` Override the default path of the dynamic library link in the solib directory. Empty string to use the default. | +| `dynamic_library_symlink_path` | [string](/versions/7.7.3/rules/lib/core/string); default is `''` Override the default path of the dynamic library link in the solib directory. Empty string to use the default. | | `interface_library_symlink_path` | default is `''` Override the default path of the interface library link in the solib directory. Empty string to use the default. | ## create\_link\_variables @@ -238,9 +238,9 @@ | --- | --- | | `cc_toolchain` | required cc\_toolchain for which we are creating build variables. | | `feature_configuration` | required Feature configuration to be queried. | -| `library_search_directories` | `None`; or [depset](/versions/7.7.1/rules/lib/builtins/depset); default is `None` Depset of directories where linker will look for libraries at link time. | -| `runtime_library_search_directories` | `None`; or [depset](/versions/7.7.1/rules/lib/builtins/depset); default is `None` Depset of directories where loader will look for libraries at runtime. | -| `user_link_flags` | `None`; or [sequence](/versions/7.7.1/rules/lib/core/list); default is `None` List of additional link flags (linkopts). | +| `library_search_directories` | `None`; or [depset](/versions/7.7.3/rules/lib/builtins/depset); default is `None` Depset of directories where linker will look for libraries at link time. | +| `runtime_library_search_directories` | `None`; or [depset](/versions/7.7.3/rules/lib/builtins/depset); default is `None` Depset of directories where loader will look for libraries at runtime. | +| `user_link_flags` | `None`; or [sequence](/versions/7.7.3/rules/lib/core/list); default is `None` List of additional link flags (linkopts). | | `output_file` | default is `None` Optional output file path. | | `param_file` | default is `None` Optional param file path. | | `def_file` | default is `None` Optional .def file path. | @@ -263,9 +263,9 @@ | Parameter | Description | | --- | --- | | `owner` | required The label of the target that produced all files used in this input. | -| `libraries` | `None`; or [depset](/versions/7.7.1/rules/lib/builtins/depset); default is `None` List of `LibraryToLink`. | -| `user_link_flags` | `None`; or [depset](/versions/7.7.1/rules/lib/builtins/depset) of [string](/versions/7.7.1/rules/lib/core/string)s; or [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `None` 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. | -| `additional_inputs` | `None`; or [depset](/versions/7.7.1/rules/lib/builtins/depset); default is `None` For additional inputs to the linking action, e.g.: linking scripts. | +| `libraries` | `None`; or [depset](/versions/7.7.3/rules/lib/builtins/depset); default is `None` List of `LibraryToLink`. | +| `user_link_flags` | `None`; or [depset](/versions/7.7.3/rules/lib/builtins/depset) of [string](/versions/7.7.3/rules/lib/core/string)s; or [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `None` 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. | +| `additional_inputs` | `None`; or [depset](/versions/7.7.3/rules/lib/builtins/depset); default is `None` For additional inputs to the linking action, e.g.: linking scripts. | ## create\_linking\_context @@ -279,10 +279,10 @@ | Parameter | Description | | --- | --- | -| `linker_inputs` | `None`; or [depset](/versions/7.7.1/rules/lib/builtins/depset); default is `None` Depset of `LinkerInput`. | -| `libraries_to_link` | `None`; or [sequence](/versions/7.7.1/rules/lib/core/list); default is `None` **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`. | -| `user_link_flags` | `None`; or [sequence](/versions/7.7.1/rules/lib/core/list); default is `None` | -| `additional_inputs` | `None`; or [sequence](/versions/7.7.1/rules/lib/core/list); default is `None` | +| `linker_inputs` | `None`; or [depset](/versions/7.7.3/rules/lib/builtins/depset); default is `None` Depset of `LinkerInput`. | +| `libraries_to_link` | `None`; or [sequence](/versions/7.7.3/rules/lib/core/list); default is `None` **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`. | +| `user_link_flags` | `None`; or [sequence](/versions/7.7.3/rules/lib/core/list); default is `None` | +| `additional_inputs` | `None`; or [sequence](/versions/7.7.3/rules/lib/core/list); default is `None` | ## create\_linking\_context\_from\_compilation\_outputs @@ -409,7 +409,7 @@ | `actions` | required `actions` object. | | `feature_configuration` | required `feature_configuration` to be queried. | | `cc_toolchain` | required `CcToolchainInfo` provider to be used. | -| `compilation_outputs` | [CcCompilationOutputs](/versions/7.7.1/rules/lib/builtins/CcCompilationOutputs); or `None`; default is `None` Compilation outputs containing object files to link. | +| `compilation_outputs` | [CcCompilationOutputs](/versions/7.7.3/rules/lib/builtins/CcCompilationOutputs); or `None`; default is `None` Compilation outputs containing object files to link. | | `user_link_flags` | default is `[]` Additional list of linker options. | | `linking_contexts` | default is `[]` Linking contexts from dependencies to be linked into the linking context generated by this rule. | | `name` | required This is used for naming the output artifacts of actions created by this method. | @@ -417,8 +417,8 @@ | `output_type` | default is `'executable'` Can be either 'executable' or 'dynamic\_library'. | | `link_deps_statically` | default is `True` True to link dependencies statically, False dynamically. | | `stamp` | default is `0` 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. | -| `additional_inputs` | [sequence](/versions/7.7.1/rules/lib/core/list); or [depset](/versions/7.7.1/rules/lib/builtins/depset); default is `[]` For additional inputs to the linking action, e.g.: linking scripts. | -| `additional_outputs` | [sequence](/versions/7.7.1/rules/lib/core/list); default is `unbound` For additional outputs to the linking action, e.g.: map files. | +| `additional_inputs` | [sequence](/versions/7.7.3/rules/lib/core/list); or [depset](/versions/7.7.3/rules/lib/builtins/depset); default is `[]` For additional inputs to the linking action, e.g.: linking scripts. | +| `additional_outputs` | [sequence](/versions/7.7.3/rules/lib/core/list); default is `unbound` For additional outputs to the linking action, e.g.: map files. | ## merge\_compilation\_contexts
diff --git a/docs/versions/7.7.1/rules/lib/toplevel/config.mdx b/docs/versions/7.7.3/rules/lib/toplevel/config.mdx similarity index 97% rename from docs/versions/7.7.1/rules/lib/toplevel/config.mdx rename to docs/versions/7.7.3/rules/lib/toplevel/config.mdx index 11ed3ef..5858a93 100644 --- a/docs/versions/7.7.1/rules/lib/toplevel/config.mdx +++ b/docs/versions/7.7.3/rules/lib/toplevel/config.mdx
@@ -48,7 +48,7 @@ | Parameter | Description | | --- | --- | -| `exec_group` | [string](/versions/7.7.1/rules/lib/core/string); or `None`; default is `None` 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. | +| `exec_group` | [string](/versions/7.7.3/rules/lib/core/string); or `None`; default is `None` 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. | ## int
diff --git a/docs/versions/7.7.1/rules/lib/toplevel/config_common.mdx b/docs/versions/7.7.3/rules/lib/toplevel/config_common.mdx similarity index 77% rename from docs/versions/7.7.1/rules/lib/toplevel/config_common.mdx rename to docs/versions/7.7.3/rules/lib/toplevel/config_common.mdx index d871437..ecfe619 100644 --- a/docs/versions/7.7.1/rules/lib/toplevel/config_common.mdx +++ b/docs/versions/7.7.3/rules/lib/toplevel/config_common.mdx
@@ -29,5 +29,5 @@ | Parameter | Description | | --- | --- | -| `name` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); required The toolchain type that is required. | -| `mandatory` | [bool](/versions/7.7.1/rules/lib/core/bool); default is `True` Whether the toolchain type is mandatory or optional. | \ No newline at end of file +| `name` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); required The toolchain type that is required. | +| `mandatory` | [bool](/versions/7.7.3/rules/lib/core/bool); default is `True` Whether the toolchain type is mandatory or optional. | \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/toplevel/coverage_common.mdx b/docs/versions/7.7.3/rules/lib/toplevel/coverage_common.mdx similarity index 79% rename from docs/versions/7.7.1/rules/lib/toplevel/coverage_common.mdx rename to docs/versions/7.7.3/rules/lib/toplevel/coverage_common.mdx index b7d4cbd..ddd57f0 100644 --- a/docs/versions/7.7.1/rules/lib/toplevel/coverage_common.mdx +++ b/docs/versions/7.7.3/rules/lib/toplevel/coverage_common.mdx
@@ -14,7 +14,7 @@ InstrumentedFilesInfo coverage_common.instrumented_files_info(ctx, *, source_attributes=[], dependency_attributes=[], extensions=None, metadata_files=[]) ``` -Creates a new [InstrumentedFilesInfo](/versions/7.7.1/rules/lib/providers/InstrumentedFilesInfo) instance. Use this provider to communicate coverage-related attributes of the current build rule. +Creates a new [InstrumentedFilesInfo](/versions/7.7.3/rules/lib/providers/InstrumentedFilesInfo) instance. Use this provider to communicate coverage-related attributes of the current build rule. ### Parameters @@ -23,5 +23,5 @@ | `ctx` | required The rule context. | | `source_attributes` | default is `[]` A list of attribute names which contain source files processed by this rule. | | `dependency_attributes` | default is `[]` A list of attribute names which might provide runtime dependencies (either code dependencies or runfiles). | -| `extensions` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; or `None`; default is `None` 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. | -| `metadata_files` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; default is `[]` Additional files required to generate coverage LCOV files after code execution. e.g. .gcno files for C++. | \ No newline at end of file +| `extensions` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; or `None`; default is `None` 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. | +| `metadata_files` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; default is `[]` Additional files required to generate coverage LCOV files after code execution. e.g. .gcno files for C++. | \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/toplevel/java_common.mdx b/docs/versions/7.7.3/rules/lib/toplevel/java_common.mdx similarity index 72% rename from docs/versions/7.7.1/rules/lib/toplevel/java_common.mdx rename to docs/versions/7.7.3/rules/lib/toplevel/java_common.mdx index cffa60e..5b190a0 100644 --- a/docs/versions/7.7.1/rules/lib/toplevel/java_common.mdx +++ b/docs/versions/7.7.3/rules/lib/toplevel/java_common.mdx
@@ -36,32 +36,32 @@ | Parameter | Description | | --- | --- | | `ctx` | required The rule context. | -| `source_jars` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; default is `[]` A list of the jars to be compiled. At least one of source\_jars or source\_files should be specified. | -| `source_files` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; default is `[]` A list of the Java source files to be compiled. At least one of source\_jars or source\_files should be specified. | +| `source_jars` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; default is `[]` A list of the jars to be compiled. At least one of source\_jars or source\_files should be specified. | +| `source_files` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; default is `[]` A list of the Java source files to be compiled. At least one of source\_jars or source\_files should be specified. | | `output` | required | -| `output_source_jar` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` The output source jar. Optional. Defaults to `{output\_jar}-src.jar` if unset. | -| `javac_opts` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` A list of the desired javac options. Optional. | -| `deps` | [sequence](/versions/7.7.1/rules/lib/core/list) of [struct](/versions/7.7.1/rules/lib/builtins/struct)s; default is `[]` A list of dependencies. Optional. | -| `runtime_deps` | [sequence](/versions/7.7.1/rules/lib/core/list) of [struct](/versions/7.7.1/rules/lib/builtins/struct)s; default is `[]` A list of runtime dependencies. Optional. | -| `exports` | [sequence](/versions/7.7.1/rules/lib/core/list) of [struct](/versions/7.7.1/rules/lib/builtins/struct)s; default is `[]` A list of exports. Optional. | -| `plugins` | [sequence](/versions/7.7.1/rules/lib/core/list) of [struct](/versions/7.7.1/rules/lib/builtins/struct)s; or [sequence](/versions/7.7.1/rules/lib/core/list) of [struct](/versions/7.7.1/rules/lib/builtins/struct)s; default is `[]` A list of plugins. Optional. | -| `exported_plugins` | [sequence](/versions/7.7.1/rules/lib/core/list) of [struct](/versions/7.7.1/rules/lib/builtins/struct)s; or [sequence](/versions/7.7.1/rules/lib/core/list) of [struct](/versions/7.7.1/rules/lib/builtins/struct)s; default is `[]` A list of exported plugins. Optional. | -| `native_libraries` | [sequence](/versions/7.7.1/rules/lib/core/list) of [CcInfo](/versions/7.7.1/rules/lib/providers/CcInfo)s; default is `[]` CC native library dependencies that are needed for this library. | -| `annotation_processor_additional_inputs` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; default is `[]` A list of inputs that the Java compilation action will take in addition to the Java sources for annotation processing. | -| `annotation_processor_additional_outputs` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; default is `[]` A list of outputs that the Java compilation action will output in addition to the class jar from annotation processing. | +| `output_source_jar` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` The output source jar. Optional. Defaults to `{output\_jar}-src.jar` if unset. | +| `javac_opts` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` A list of the desired javac options. Optional. | +| `deps` | [sequence](/versions/7.7.3/rules/lib/core/list) of [struct](/versions/7.7.3/rules/lib/builtins/struct)s; default is `[]` A list of dependencies. Optional. | +| `runtime_deps` | [sequence](/versions/7.7.3/rules/lib/core/list) of [struct](/versions/7.7.3/rules/lib/builtins/struct)s; default is `[]` A list of runtime dependencies. Optional. | +| `exports` | [sequence](/versions/7.7.3/rules/lib/core/list) of [struct](/versions/7.7.3/rules/lib/builtins/struct)s; default is `[]` A list of exports. Optional. | +| `plugins` | [sequence](/versions/7.7.3/rules/lib/core/list) of [struct](/versions/7.7.3/rules/lib/builtins/struct)s; or [sequence](/versions/7.7.3/rules/lib/core/list) of [struct](/versions/7.7.3/rules/lib/builtins/struct)s; default is `[]` A list of plugins. Optional. | +| `exported_plugins` | [sequence](/versions/7.7.3/rules/lib/core/list) of [struct](/versions/7.7.3/rules/lib/builtins/struct)s; or [sequence](/versions/7.7.3/rules/lib/core/list) of [struct](/versions/7.7.3/rules/lib/builtins/struct)s; default is `[]` A list of exported plugins. Optional. | +| `native_libraries` | [sequence](/versions/7.7.3/rules/lib/core/list) of [CcInfo](/versions/7.7.3/rules/lib/providers/CcInfo)s; default is `[]` CC native library dependencies that are needed for this library. | +| `annotation_processor_additional_inputs` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; default is `[]` A list of inputs that the Java compilation action will take in addition to the Java sources for annotation processing. | +| `annotation_processor_additional_outputs` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; default is `[]` A list of outputs that the Java compilation action will output in addition to the class jar from annotation processing. | | `strict_deps` | default is `'ERROR'` 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'. | | `java_toolchain` | required A JavaToolchainInfo to be used for this compilation. Mandatory. | | `bootclasspath` | default is `None` A BootClassPathInfo to be used for this compilation. If present, overrides the bootclasspath associated with the provided java\_toolchain. Optional. | | `host_javabase` | default is `None` **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. Deprecated: You can drop this parameter (host\_javabase is provided with java\_toolchain) | -| `sourcepath` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; default is `[]` | -| `resources` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; default is `[]` | -| `resource_jars` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; default is `[]` | -| `classpath_resources` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; default is `[]` | +| `sourcepath` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; default is `[]` | +| `resources` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; default is `[]` | +| `resource_jars` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; default is `[]` | +| `classpath_resources` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; default is `[]` | | `neverlink` | default is `False` | | `enable_annotation_processing` | default is `True` Disables annotation processing in this compilation, causing any annotation processors provided in plugins or in exported\_plugins of deps to be ignored. | | `enable_compile_jar_action` | default is `True` 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. | -| `add_exports` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` Allow this library to access the given /. Optional. | -| `add_opens` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` Allow this library to reflectively access the given /. Optional. | +| `add_exports` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` Allow this library to access the given /. Optional. | +| `add_opens` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` Allow this library to reflectively access the given /. Optional. | ## JavaRuntimeInfo @@ -91,7 +91,7 @@ | Parameter | Description | | --- | --- | -| `providers` | [sequence](/versions/7.7.1/rules/lib/core/list) of [struct](/versions/7.7.1/rules/lib/builtins/struct)s; required The list of providers to merge. | +| `providers` | [sequence](/versions/7.7.3/rules/lib/core/list) of [struct](/versions/7.7.3/rules/lib/builtins/struct)s; required The list of providers to merge. | ## pack\_sources @@ -110,10 +110,10 @@ | Parameter | Description | | --- | --- | | `actions` | required ctx.actions | -| `output_jar` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` **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. Deprecated: The output jar of the rule. Used to name the resulting source jar. The parameter sets output\_source\_jar parameter to `{output\_jar}-src.jar`.Use output\_source\_jar parameter directly instead. | -| `output_source_jar` | [File](/versions/7.7.1/rules/lib/builtins/File); or `None`; default is `None` | -| `sources` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; default is `[]` A list of Java source files to be packed into the source jar. | -| `source_jars` | [sequence](/versions/7.7.1/rules/lib/core/list) of [File](/versions/7.7.1/rules/lib/builtins/File)s; default is `[]` A list of source jars to be packed into the source jar. | +| `output_jar` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` **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. Deprecated: The output jar of the rule. Used to name the resulting source jar. The parameter sets output\_source\_jar parameter to `{output\_jar}-src.jar`.Use output\_source\_jar parameter directly instead. | +| `output_source_jar` | [File](/versions/7.7.3/rules/lib/builtins/File); or `None`; default is `None` | +| `sources` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; default is `[]` A list of Java source files to be packed into the source jar. | +| `source_jars` | [sequence](/versions/7.7.3/rules/lib/core/list) of [File](/versions/7.7.3/rules/lib/builtins/File)s; default is `[]` A list of source jars to be packed into the source jar. | | `java_toolchain` | required A JavaToolchainInfo to used to find the ijar tool. | | `host_javabase` | default is `None` **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. Deprecated: You can drop this parameter (host\_javabase is provided with java\_toolchain) | @@ -131,7 +131,7 @@ | --- | --- | | `actions` | required | | `jar` | required The jar to run ijar on. | -| `target_label` | [Label](/versions/7.7.1/rules/lib/builtins/Label); or `None`; default is `None` 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. | +| `target_label` | [Label](/versions/7.7.3/rules/lib/builtins/Label); or `None`; default is `None` 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. | | `java_toolchain` | required A JavaToolchainInfo to used to find the ijar tool. | ## stamp\_jar
diff --git a/docs/versions/7.7.1/rules/lib/toplevel/native.mdx b/docs/versions/7.7.3/rules/lib/toplevel/native.mdx similarity index 87% rename from docs/versions/7.7.1/rules/lib/toplevel/native.mdx rename to docs/versions/7.7.3/rules/lib/toplevel/native.mdx index fb3b070..6db2b84 100644 --- a/docs/versions/7.7.1/rules/lib/toplevel/native.mdx +++ b/docs/versions/7.7.3/rules/lib/toplevel/native.mdx
@@ -76,9 +76,9 @@ | Parameter | Description | | --- | --- | -| `srcs` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; required The list of files to export. | -| `visibility` | [sequence](/versions/7.7.1/rules/lib/core/list); or `None`; default is `None` 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. | -| `licenses` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; or `None`; default is `None` Licenses to be specified. | +| `srcs` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; required The list of files to export. | +| `visibility` | [sequence](/versions/7.7.3/rules/lib/core/list); or `None`; default is `None` 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. | +| `licenses` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; or `None`; default is `None` Licenses to be specified. | ## glob @@ -97,8 +97,8 @@ | Parameter | Description | | --- | --- | -| `include` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` The list of glob patterns to include. | -| `exclude` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` The list of glob patterns to exclude. | +| `include` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` The list of glob patterns to include. | +| `exclude` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` The list of glob patterns to exclude. | | `exclude_directories` | default is `1` A flag whether to exclude directories or not. | | `allow_empty` | default is `unbound` 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). | @@ -133,8 +133,8 @@ | Parameter | Description | | --- | --- | | `name` | required The unique name for this rule. | -| `packages` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` A complete enumeration of packages in this group. | -| `includes` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` Other package groups that are included in this one. | +| `packages` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` A complete enumeration of packages in this group. | +| `includes` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` Other package groups that are included in this one. | ## package\_name @@ -150,19 +150,19 @@ Label native.package_relative_label(input) ``` -Converts the input string into a [Label](/versions/7.7.1/rules/lib/builtins/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. +Converts the input string into a [Label](/versions/7.7.3/rules/lib/builtins/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()](/versions/7.7.1/rules/lib/builtins/Label#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.) +*Usage note:* The difference between this function and [Label()](/versions/7.7.3/rules/lib/builtins/Label#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.) ### Parameters | Parameter | Description | | --- | --- | -| `input` | [string](/versions/7.7.1/rules/lib/core/string); or [Label](/versions/7.7.1/rules/lib/builtins/Label); required The input label string or Label object. If a Label object is passed, it's returned as is. | +| `input` | [string](/versions/7.7.3/rules/lib/core/string); or [Label](/versions/7.7.3/rules/lib/builtins/Label); required The input label string or Label object. If a Label object is passed, it's returned as is. | ## repo\_name @@ -195,6 +195,6 @@ | Parameter | Description | | --- | --- | -| `include` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; required | -| `exclude` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` The list of glob patterns to exclude from subpackages scan. | +| `include` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; required | +| `exclude` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` The list of glob patterns to exclude from subpackages scan. | | `allow_empty` | default is `False` 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. | \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/toplevel/platform_common.mdx b/docs/versions/7.7.3/rules/lib/toplevel/platform_common.mdx similarity index 82% rename from docs/versions/7.7.1/rules/lib/toplevel/platform_common.mdx rename to docs/versions/7.7.3/rules/lib/toplevel/platform_common.mdx index 7ba1c09..6c7249f 100644 --- a/docs/versions/7.7.1/rules/lib/toplevel/platform_common.mdx +++ b/docs/versions/7.7.3/rules/lib/toplevel/platform_common.mdx
@@ -18,7 +18,7 @@ Provider platform_common.ConstraintSettingInfo ``` -The constructor/key for the [ConstraintSettingInfo](/versions/7.7.1/rules/lib/providers/ConstraintSettingInfo) provider. +The constructor/key for the [ConstraintSettingInfo](/versions/7.7.3/rules/lib/providers/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`* ## ConstraintValueInfo @@ -27,7 +27,7 @@ Provider platform_common.ConstraintValueInfo ``` -The constructor/key for the [ConstraintValueInfo](/versions/7.7.1/rules/lib/providers/ConstraintValueInfo) provider. +The constructor/key for the [ConstraintValueInfo](/versions/7.7.3/rules/lib/providers/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`* ## PlatformInfo @@ -36,7 +36,7 @@ Provider platform_common.PlatformInfo ``` -The constructor/key for the [PlatformInfo](/versions/7.7.1/rules/lib/providers/PlatformInfo) provider. +The constructor/key for the [PlatformInfo](/versions/7.7.3/rules/lib/providers/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`* ## TemplateVariableInfo @@ -45,7 +45,7 @@ Provider platform_common.TemplateVariableInfo ``` -The constructor/key for the [TemplateVariableInfo](/versions/7.7.1/rules/lib/providers/TemplateVariableInfo) provider. +The constructor/key for the [TemplateVariableInfo](/versions/7.7.3/rules/lib/providers/TemplateVariableInfo) provider. ## ToolchainInfo @@ -53,4 +53,4 @@ Provider platform_common.ToolchainInfo ``` -The constructor/key for the [ToolchainInfo](/versions/7.7.1/rules/lib/providers/ToolchainInfo) provider. \ No newline at end of file +The constructor/key for the [ToolchainInfo](/versions/7.7.3/rules/lib/providers/ToolchainInfo) provider. \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/lib/toplevel/proto.mdx b/docs/versions/7.7.3/rules/lib/toplevel/proto.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/toplevel/proto.mdx rename to docs/versions/7.7.3/rules/lib/toplevel/proto.mdx
diff --git a/docs/versions/7.7.1/rules/lib/toplevel/proto_common.mdx b/docs/versions/7.7.3/rules/lib/toplevel/proto_common.mdx similarity index 100% rename from docs/versions/7.7.1/rules/lib/toplevel/proto_common.mdx rename to docs/versions/7.7.3/rules/lib/toplevel/proto_common.mdx
diff --git a/docs/versions/7.7.1/rules/lib/toplevel/testing.mdx b/docs/versions/7.7.3/rules/lib/toplevel/testing.mdx similarity index 73% rename from docs/versions/7.7.1/rules/lib/toplevel/testing.mdx rename to docs/versions/7.7.3/rules/lib/toplevel/testing.mdx index 83883fa..f335a23 100644 --- a/docs/versions/7.7.1/rules/lib/toplevel/testing.mdx +++ b/docs/versions/7.7.3/rules/lib/toplevel/testing.mdx
@@ -25,11 +25,11 @@ | Parameter | Description | | --- | --- | | `name` | required Name of the target. It should be a Starlark identifier, matching pattern '[A-Za-z\_][A-Za-z0-9\_]\*'. | -| `implementation` | required The Starlark function implementing this analysis test. It must have exactly one parameter: [ctx](/versions/7.7.1/rules/lib/builtins/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](/versions/7.7.1/rules/lib/providers/AnalysisTestResultInfo). | -| `attrs` | [dict](/versions/7.7.1/rules/lib/core/dict); default is `{}` Dictionary declaring the attributes. See the [rule](/versions/7.7.1/rules/lib/globals/bzl#rule) call. Attributes are allowed to use configuration transitions defined using [analysis\_test\_transition](/versions/7.7.1/rules/lib/globals/bzl#analysis_test_transition). | -| `fragments` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` List of configuration fragments that are available to the implementation of the analysis test. | -| `toolchains` | [sequence](/versions/7.7.1/rules/lib/core/list); default is `[]` The set of toolchains the test requires. See the [rule](/versions/7.7.1/rules/lib/globals/bzl#rule) call. | -| `attr_values` | [dict](/versions/7.7.1/rules/lib/core/dict) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `{}` Dictionary of attribute values to pass to the implementation. | +| `implementation` | required The Starlark function implementing this analysis test. It must have exactly one parameter: [ctx](/versions/7.7.3/rules/lib/builtins/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](/versions/7.7.3/rules/lib/providers/AnalysisTestResultInfo). | +| `attrs` | [dict](/versions/7.7.3/rules/lib/core/dict); default is `{}` Dictionary declaring the attributes. See the [rule](/versions/7.7.3/rules/lib/globals/bzl#rule) call. Attributes are allowed to use configuration transitions defined using [analysis\_test\_transition](/versions/7.7.3/rules/lib/globals/bzl#analysis_test_transition). | +| `fragments` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` List of configuration fragments that are available to the implementation of the analysis test. | +| `toolchains` | [sequence](/versions/7.7.3/rules/lib/core/list); default is `[]` The set of toolchains the test requires. See the [rule](/versions/7.7.3/rules/lib/globals/bzl#rule) call. | +| `attr_values` | [dict](/versions/7.7.3/rules/lib/core/dict) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `{}` Dictionary of attribute values to pass to the implementation. | ## ExecutionInfo @@ -37,7 +37,7 @@ ExecutionInfo testing.ExecutionInfo(requirements={}, exec_group='test') ``` -[testing.ExecutionInfo](/versions/7.7.1/rules/lib/providers/ExecutionInfo) provider key/constructor +[testing.ExecutionInfo](/versions/7.7.3/rules/lib/providers/ExecutionInfo) provider key/constructor ## TestEnvironment @@ -52,4 +52,4 @@ | Parameter | Description | | --- | --- | | `environment` | required A map of string keys and values that represent environment variables and their values. These will be made available during the test execution. | -| `inherited_environment` | [sequence](/versions/7.7.1/rules/lib/core/list) of [string](/versions/7.7.1/rules/lib/core/string)s; default is `[]` 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. | \ No newline at end of file +| `inherited_environment` | [sequence](/versions/7.7.3/rules/lib/core/list) of [string](/versions/7.7.3/rules/lib/core/string)s; default is `[]` 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. | \ No newline at end of file
diff --git a/docs/versions/7.7.1/rules/macro-tutorial.mdx b/docs/versions/7.7.3/rules/macro-tutorial.mdx similarity index 96% rename from docs/versions/7.7.1/rules/macro-tutorial.mdx rename to docs/versions/7.7.3/rules/macro-tutorial.mdx index 290e9b2..5ab06a8 100644 --- a/docs/versions/7.7.1/rules/macro-tutorial.mdx +++ b/docs/versions/7.7.3/rules/macro-tutorial.mdx
@@ -8,7 +8,7 @@ Macros are suitable for simple tasks. If you want to do anything more complicated, for example add support for a new programming language, consider -creating a [rule](/versions/7.7.1/extending/rules). Rules give you more control and flexibility. +creating a [rule](/versions/7.7.3/extending/rules). Rules give you more control and flexibility. The easiest way to create a macro that resizes an image is to use a `genrule`:
diff --git a/docs/versions/7.7.1/rules/performance.mdx b/docs/versions/7.7.3/rules/performance.mdx similarity index 93% rename from docs/versions/7.7.1/rules/performance.mdx rename to docs/versions/7.7.3/rules/performance.mdx index 227df92..6f8c45b 100644 --- a/docs/versions/7.7.1/rules/performance.mdx +++ b/docs/versions/7.7.3/rules/performance.mdx
@@ -15,7 +15,7 @@ ## Use depsets {#use-depsets} Whenever you are rolling up information from rule dependencies you should use -[depsets](/versions/7.7.1/rules/lib/builtins/depset). Only use plain lists or dicts to publish information +[depsets](/versions/7.7.3/rules/lib/builtins/depset). Only use plain lists or dicts to publish information local to the current rule. A depset represents information as a nested graph which enables sharing. @@ -68,12 +68,12 @@ )] ``` -See the [depset overview](/versions/7.7.1/extending/depsets) page for more information. +See the [depset overview](/versions/7.7.3/extending/depsets) page for more information. ### Avoid calling `depset.to_list()` {#avoid-depset-to-list} You can coerce a depset to a flat list using -[`to_list()`](/versions/7.7.1/rules/lib/builtins/depset#to_list), but doing so usually results in O(N^2) +[`to_list()`](/versions/7.7.3/rules/lib/builtins/depset#to_list), but doing so usually results in O(N^2) cost. If at all possible, avoid any flattening of depsets except for debugging purposes. @@ -115,7 +115,7 @@ ## Use ctx.actions.args() for command lines {#ctx-actions-args} -When building command lines you should use [ctx.actions.args()](/versions/7.7.1/rules/lib/builtins/Args). +When building command lines you should use [ctx.actions.args()](/versions/7.7.3/rules/lib/builtins/Args). This defers expansion of any depsets to the execution phase. Apart from being strictly faster, this will reduce the memory consumption of @@ -126,11 +126,11 @@ * Pass depsets and lists directly as arguments, instead of flattening them yourself. They will get expanded by `ctx.actions.args()` for you. If you need any transformations on the depset contents, look at -[ctx.actions.args#add](/versions/7.7.1/rules/lib/builtins/Args#add) to see if anything fits the bill. +[ctx.actions.args#add](/versions/7.7.3/rules/lib/builtins/Args#add) to see if anything fits the bill. * Are you passing `File#path` as arguments? No need. Any -[File](/versions/7.7.1/rules/lib/builtins/File) is automatically turned into its -[path](/versions/7.7.1/rules/lib/builtins/File#path), deferred to expansion time. +[File](/versions/7.7.3/rules/lib/builtins/File) is automatically turned into its +[path](/versions/7.7.3/rules/lib/builtins/File#path), deferred to expansion time. * Avoid constructing strings by concatenating them together. The best string argument is a constant as its memory will be shared between @@ -138,10 +138,10 @@ * If the args are too long for the command line an `ctx.actions.args()` object can be conditionally or unconditionally written to a param file using -[`ctx.actions.args#use_param_file`](/versions/7.7.1/rules/lib/builtins/Args#use_param_file). This is +[`ctx.actions.args#use_param_file`](/versions/7.7.3/rules/lib/builtins/Args#use_param_file). This is done behind the scenes when the action is executed. If you need to explicitly control the params file you can write it manually using -[`ctx.actions.write`](/versions/7.7.1/rules/lib/builtins/actions#write). +[`ctx.actions.write`](/versions/7.7.3/rules/lib/builtins/actions#write). Example: @@ -176,7 +176,7 @@ ## Transitive action inputs should be depsets {#transitive-action-inputs} -When building an action using [ctx.actions.run](/versions/7.7.1/rules/lib/builtins/actions#run), do not +When building an action using [ctx.actions.run](/versions/7.7.3/rules/lib/builtins/actions#run), do not forget that the `inputs` field accepts a depset. Use this whenever inputs are collected from dependencies transitively. @@ -200,7 +200,7 @@ ## Performance profiling {#performance-profiling} -The [JSON trace profile](/versions/7.7.1/advanced/performance/json-trace-profile) can be very +The [JSON trace profile](/versions/7.7.3/advanced/performance/json-trace-profile) can be very useful to quickly understand what Bazel spent time on during the invocation. ## Memory profiling {#memory-profiling}
diff --git a/docs/versions/7.7.1/rules/profile.png b/docs/versions/7.7.3/rules/profile.png similarity index 100% rename from docs/versions/7.7.1/rules/profile.png rename to docs/versions/7.7.3/rules/profile.png Binary files differ
diff --git a/docs/versions/7.7.1/rules/rules-tutorial.mdx b/docs/versions/7.7.3/rules/rules-tutorial.mdx similarity index 89% rename from docs/versions/7.7.1/rules/rules-tutorial.mdx rename to docs/versions/7.7.3/rules/rules-tutorial.mdx index 01292fb..b3de749 100644 --- a/docs/versions/7.7.1/rules/rules-tutorial.mdx +++ b/docs/versions/7.7.3/rules/rules-tutorial.mdx
@@ -13,7 +13,7 @@ such as `glob`, `genrule`, `java_binary`, and so on. See the -[Bazel](/versions/7.7.1/start/) and [Starlark](/versions/7.7.1/extending/concepts) documentation for +[Bazel](/versions/7.7.3/start/) and [Starlark](/versions/7.7.3/extending/concepts) documentation for more details, and the [Rules SIG template](https://github.com/bazel-contrib/rules-template) as a starting point for new rulesets. @@ -31,9 +31,9 @@ ) ``` -When you call the [`rule`](/versions/7.7.1/rules/lib/globals#rule) function, you +When you call the [`rule`](/versions/7.7.3/rules/lib/globals#rule) function, you must define a callback function. The logic will go there, but you -can leave the function empty for now. The [`ctx`](/versions/7.7.1/rules/lib/builtins/ctx) argument +can leave the function empty for now. The [`ctx`](/versions/7.7.3/rules/lib/builtins/ctx) argument provides information about the target. You can load the rule and use it from a `BUILD` file. @@ -86,10 +86,10 @@ foo_binary(name = "bin2") ``` -[`ctx.label`](/versions/7.7.1/rules/lib/builtins/ctx#label) +[`ctx.label`](/versions/7.7.3/rules/lib/builtins/ctx#label) corresponds to the label of the target being analyzed. The `ctx` object has many useful fields and methods; you can find an exhaustive list in the -[API reference](/versions/7.7.1/rules/lib/builtins/ctx). +[API reference](/versions/7.7.3/rules/lib/builtins/ctx). Query the code: @@ -110,7 +110,7 @@ * The callback function `_foo_binary_impl` is not called. Bazel query loads `BUILD` files, but doesn't analyze targets. -To analyze the targets, use the [`cquery`](/versions/7.7.1/query/cquery) ("configured +To analyze the targets, use the [`cquery`](/versions/7.7.3/query/cquery) ("configured query") or the `build` command: ``` @@ -145,7 +145,7 @@ ``` Whenever you declare a file, you have to tell Bazel how to generate it by -creating an action. Use [`ctx.actions.write`](/versions/7.7.1/rules/lib/builtins/actions#write), +creating an action. Use [`ctx.actions.write`](/versions/7.7.3/rules/lib/builtins/actions#write), to create a file with the given content. ```python @@ -200,7 +200,7 @@ ## Attributes To make the rule more useful, add new attributes using -[the `attr` module](/versions/7.7.1/rules/lib/toplevel/attr) and update the rule definition. +[the `attr` module](/versions/7.7.3/rules/lib/toplevel/attr) and update the rule definition. Add a string attribute called `username`: @@ -236,22 +236,22 @@ ``` Note that you can make the attribute mandatory or set a default value. Look at -the documentation of [`attr.string`](/versions/7.7.1/rules/lib/toplevel/attr#string). -You may also use other types of attributes, such as [boolean](/versions/7.7.1/rules/lib/toplevel/attr#bool) -or [list of integers](/versions/7.7.1/rules/lib/toplevel/attr#int_list). +the documentation of [`attr.string`](/versions/7.7.3/rules/lib/toplevel/attr#string). +You may also use other types of attributes, such as [boolean](/versions/7.7.3/rules/lib/toplevel/attr#bool) +or [list of integers](/versions/7.7.3/rules/lib/toplevel/attr#int_list). ## Dependencies -Dependency attributes, such as [`attr.label`](/versions/7.7.1/rules/lib/toplevel/attr#label) -and [`attr.label_list`](/versions/7.7.1/rules/lib/toplevel/attr#label_list), +Dependency attributes, such as [`attr.label`](/versions/7.7.3/rules/lib/toplevel/attr#label) +and [`attr.label_list`](/versions/7.7.3/rules/lib/toplevel/attr#label_list), declare a dependency from the target that owns the attribute to the target whose label appears in the attribute's value. This kind of attribute forms the basis of the target graph. In the `BUILD` file, the target label appears as a string object, such as `//pkg:name`. In the implementation function, the target will be accessible as a -[`Target`](/versions/7.7.1/rules/lib/builtins/Target) object. For example, view the files returned -by the target using [`Target.files`](/versions/7.7.1/rules/lib/builtins/Target#modules.Target.files). +[`Target`](/versions/7.7.3/rules/lib/builtins/Target) object. For example, view the files returned +by the target using [`Target.files`](/versions/7.7.3/rules/lib/builtins/Target#modules.Target.files). ### Multiple files @@ -294,7 +294,7 @@ bigger, it becomes more memory efficient to put it in a separate file and avoid constructing large strings during the analysis phase. Second, using a separate file is more convenient for the user. Instead, use -[`ctx.actions.expand_template`](/versions/7.7.1/rules/lib/builtins/actions#expand_template), +[`ctx.actions.expand_template`](/versions/7.7.3/rules/lib/builtins/actions#expand_template), which performs substitutions on a template file. Create a `template` attribute to declare a dependency on the template @@ -351,7 +351,7 @@ `BUILD` file. The template is now an _implicit dependency_: Every `hello_world` target has a dependency on this file. Don't forget to make this file visible to other packages by updating the `BUILD` file and using -[`exports_files`](/versions/7.7.1/reference/be/functions#exports_files): +[`exports_files`](/versions/7.7.3/reference/be/functions#exports_files): ```python exports_files(["file.cc.tpl"]) @@ -359,7 +359,7 @@ ## Going further -* Take a look at the [reference documentation for rules](/versions/7.7.1/extending/rules#contents). -* Get familiar with [depsets](/versions/7.7.1/extending/depsets). +* Take a look at the [reference documentation for rules](/versions/7.7.3/extending/rules#contents). +* Get familiar with [depsets](/versions/7.7.3/extending/depsets). * Check out the [examples repository](https://github.com/bazelbuild/examples/tree/master/rules) which includes additional examples of rules.
diff --git a/docs/versions/7.7.1/rules/scalability-graph.png b/docs/versions/7.7.3/rules/scalability-graph.png similarity index 100% rename from docs/versions/7.7.1/rules/scalability-graph.png rename to docs/versions/7.7.3/rules/scalability-graph.png Binary files differ
diff --git a/docs/versions/7.7.1/rules/testing.mdx b/docs/versions/7.7.3/rules/testing.mdx similarity index 98% rename from docs/versions/7.7.1/rules/testing.mdx rename to docs/versions/7.7.3/rules/testing.mdx index 5e77fa3..c8c144f 100644 --- a/docs/versions/7.7.1/rules/testing.mdx +++ b/docs/versions/7.7.3/rules/testing.mdx
@@ -23,7 +23,7 @@ * It requires a fair amount of boilerplate to set up the rules under test and the rules containing test assertions. This boilerplate may seem daunting at - first. It helps to [keep in mind](/versions/7.7.1/extending/concepts#evaluation-model) that macros + first. It helps to [keep in mind](/versions/7.7.3/extending/concepts#evaluation-model) that macros are evaluated and targets generated during the loading phase, while rule implementation functions don't run until later, during the analysis phase. @@ -234,7 +234,7 @@ ``` Note that `analysistest.target_actions(env)` returns a list of -[`Action`](/versions/7.7.1/rules/lib/builtins/Action) objects which represent actions registered by the +[`Action`](/versions/7.7.3/rules/lib/builtins/Action) objects which represent actions registered by the target under test. ### Verifying rule behavior under different flags {#verifying-rule-behavior}
diff --git a/docs/versions/7.7.1/rules/validation_action.svg b/docs/versions/7.7.3/rules/validation_action.svg similarity index 100% rename from docs/versions/7.7.1/rules/validation_action.svg rename to docs/versions/7.7.3/rules/validation_action.svg
diff --git a/docs/versions/7.7.1/rules/validation_action_historical.svg b/docs/versions/7.7.3/rules/validation_action_historical.svg similarity index 100% rename from docs/versions/7.7.1/rules/validation_action_historical.svg rename to docs/versions/7.7.3/rules/validation_action_historical.svg
diff --git a/docs/versions/7.7.1/rules/verbs-tutorial.mdx b/docs/versions/7.7.3/rules/verbs-tutorial.mdx similarity index 97% rename from docs/versions/7.7.1/rules/verbs-tutorial.mdx rename to docs/versions/7.7.3/rules/verbs-tutorial.mdx index 4083e4c..7be89f6 100644 --- a/docs/versions/7.7.1/rules/verbs-tutorial.mdx +++ b/docs/versions/7.7.3/rules/verbs-tutorial.mdx
@@ -66,7 +66,7 @@ ## Adapting your own rules -[Macros](/versions/7.7.1/extending/macros) are the heart of this pattern. Macros are used like +[Macros](/versions/7.7.3/extending/macros) are the heart of this pattern. Macros are used like rules, but they can create several targets. Typically, they will create a target with the specified name which performs the primary build action: perhaps it builds a normal binary, a Docker image, or an archive of source code. In @@ -136,7 +136,7 @@ It's not immediately obvious what the implementation of the `_sphinx_publisher` rule might look like. Often, actions like this write a _launcher_ shell script. This method typically involves using -[`ctx.actions.expand_template`](/versions/7.7.1/rules/lib/builtins/actions#expand_template) +[`ctx.actions.expand_template`](/versions/7.7.3/rules/lib/builtins/actions#expand_template) to write a very simple shell script, in this case invoking the publisher binary with a path to the output of the primary target. This way, the publisher implementation can remain generic, the `_sphinx_site` rule can just produce
diff --git a/docs/versions/7.7.1/rules/windows.mdx b/docs/versions/7.7.3/rules/windows.mdx similarity index 100% rename from docs/versions/7.7.1/rules/windows.mdx rename to docs/versions/7.7.3/rules/windows.mdx
diff --git a/docs/versions/7.7.1/run/bazelrc.mdx b/docs/versions/7.7.3/run/bazelrc.mdx similarity index 100% rename from docs/versions/7.7.1/run/bazelrc.mdx rename to docs/versions/7.7.3/run/bazelrc.mdx
diff --git a/docs/versions/7.7.1/run/build.mdx b/docs/versions/7.7.3/run/build.mdx similarity index 94% rename from docs/versions/7.7.1/run/build.mdx rename to docs/versions/7.7.3/run/build.mdx index 91a1250..8afc49d 100644 --- a/docs/versions/7.7.1/run/build.mdx +++ b/docs/versions/7.7.3/run/build.mdx
@@ -7,7 +7,7 @@ ## Quickstart {#quickstart} -To run Bazel, go to your base [workspace](/versions/7.7.1/concepts/build-ref#workspace) directory +To run Bazel, go to your base [workspace](/versions/7.7.3/concepts/build-ref#workspace) directory or any of its subdirectories and type `bazel`. See [build](#bazel-build) if you need to make a new workspace. @@ -19,28 +19,28 @@ ### Available commands {#available-commands} -* [`analyze-profile`](/versions/7.7.1/docs/user-manual#analyze-profile): Analyzes build profile data. -* [`aquery`](/versions/7.7.1/docs/user-manual#aquery): Executes a query on the [post-analysis](#analysis) action graph. +* [`analyze-profile`](/versions/7.7.3/docs/user-manual#analyze-profile): Analyzes build profile data. +* [`aquery`](/versions/7.7.3/docs/user-manual#aquery): Executes a query on the [post-analysis](#analysis) action graph. * [`build`](#bazel-build): Builds the specified targets. -* [`canonicalize-flags`](/versions/7.7.1/docs/user-manual#canonicalize-flags): Canonicalize Bazel flags. -* [`clean`](/versions/7.7.1/docs/user-manual#clean): Removes output files and optionally stops the server. -* [`cquery`](/versions/7.7.1/query/cquery): Executes a [post-analysis](#analysis) dependency graph query. -* [`dump`](/versions/7.7.1/docs/user-manual#dump): Dumps the internal state of the Bazel server process. -* [`help`](/versions/7.7.1/docs/user-manual#help): Prints help for commands, or the index. -* [`info`](/versions/7.7.1/docs/user-manual#info): Displays runtime info about the bazel server. +* [`canonicalize-flags`](/versions/7.7.3/docs/user-manual#canonicalize-flags): Canonicalize Bazel flags. +* [`clean`](/versions/7.7.3/docs/user-manual#clean): Removes output files and optionally stops the server. +* [`cquery`](/versions/7.7.3/query/cquery): Executes a [post-analysis](#analysis) dependency graph query. +* [`dump`](/versions/7.7.3/docs/user-manual#dump): Dumps the internal state of the Bazel server process. +* [`help`](/versions/7.7.3/docs/user-manual#help): Prints help for commands, or the index. +* [`info`](/versions/7.7.3/docs/user-manual#info): Displays runtime info about the bazel server. * [`fetch`](#fetching-external-dependencies): Fetches all external dependencies of a target. -* [`mobile-install`](/versions/7.7.1/docs/user-manual#mobile-install): Installs apps on mobile devices. -* [`query`](/versions/7.7.1/query/guide): Executes a dependency graph query. -* [`run`](/versions/7.7.1/docs/user-manual#running-executables): Runs the specified target. -* [`shutdown`](/versions/7.7.1/docs/user-manual#shutdown): Stops the Bazel server. -* [`test`](/versions/7.7.1/docs/user-manual#running-tests): Builds and runs the specified test targets. -* [`version`](/versions/7.7.1/docs/user-manual#version): Prints version information for Bazel. +* [`mobile-install`](/versions/7.7.3/docs/user-manual#mobile-install): Installs apps on mobile devices. +* [`query`](/versions/7.7.3/query/guide): Executes a dependency graph query. +* [`run`](/versions/7.7.3/docs/user-manual#running-executables): Runs the specified target. +* [`shutdown`](/versions/7.7.3/docs/user-manual#shutdown): Stops the Bazel server. +* [`test`](/versions/7.7.3/docs/user-manual#running-tests): Builds and runs the specified test targets. +* [`version`](/versions/7.7.3/docs/user-manual#version): Prints version information for Bazel. ### Getting help {#getting-help} * `bazel help command`: Prints help and options for `command`. -* `bazel help `[`startup_options`](/versions/7.7.1/docs/user-manual#startup-options): Options for the JVM hosting Bazel. +* `bazel help `[`startup_options`](/versions/7.7.3/docs/user-manual#startup-options): Options for the JVM hosting Bazel. * `bazel help `[`target-syntax`](#specifying-build-targets): Explains the syntax for specifying targets. * `bazel help info-keys`: Displays a list of keys used by the info command. @@ -89,7 +89,7 @@ At the end of the build, Bazel prints which targets were requested, whether or not they were successfully built, and if so, where the output files can be found. Scripts that run builds can reliably parse this output; see -[`--show_result`](/versions/7.7.1/docs/user-manual#show-result) for more details. +[`--show_result`](/versions/7.7.3/docs/user-manual#show-result) for more details. If you type the same command again, the build finishes much faster. @@ -114,7 +114,7 @@ these are known as _target patterns_. This syntax is used in commands like `build`, `test`, or `query`. -Whereas [labels](/versions/7.7.1/concepts/labels) are used to specify individual +Whereas [labels](/versions/7.7.3/concepts/labels) are used to specify individual targets, such as for declaring dependencies in `BUILD` files, Bazel's target patterns specify multiple targets. Target patterns are a generalization of the label syntax for _sets_ of targets, using wildcards. In the simplest case, any @@ -156,7 +156,7 @@ <tr> <td><code>//...</code></td> <td>All targets in packages in the workspace. This does not include targets - from <a href="/versions/7.7.1/docs/external">external repositories</a>.</td> + from <a href="/versions/7.7.3/docs/external">external repositories</a>.</td> </tr> <tr> <td><code>//:all</code></td> @@ -346,7 +346,7 @@ preparation. Using the -[`--distdir=/path/to-directory`](/versions/7.7.1/reference/command-line-reference#flag--distdir) +[`--distdir=/path/to-directory`](/versions/7.7.3/reference/command-line-reference#flag--distdir) option, you can specify additional read-only directories to look for files instead of fetching them. A file is taken from such a directory if the file name is equal to the base name of the URL and additionally the hash of the file is @@ -373,7 +373,7 @@ transfer them to the airgapped environment with an offline approach. To prepare the [distribution directory](#distribution-directory), use the -[`--distdir`](/versions/7.7.1/reference/command-line-reference#flag--distdir) +[`--distdir`](/versions/7.7.3/reference/command-line-reference#flag--distdir) flag. You will need to do this once for every new Bazel binary version, since the implicit dependencies can be different for every release. @@ -573,7 +573,7 @@ Note: Hermeticity means that the action only uses its declared input files and no other files in the filesystem, and it only produces its declared -output files. See [Hermeticity](/versions/7.7.1/basics/hermeticity) for more details. +output files. See [Hermeticity](/versions/7.7.3/basics/hermeticity) for more details. On some platforms such as [Google Kubernetes Engine](https://cloud.google.com/kubernetes-engine/) cluster nodes or Debian, user namespaces are deactivated by default due to security @@ -628,7 +628,7 @@ The loading and analysis phases are fast because Bazel avoids unnecessary file I/O at this stage, reading only BUILD files in order to determine the work to be done. This is by design, and makes Bazel a good foundation for analysis tools, -such as Bazel's [query](/versions/7.7.1/query/guide) command, which is implemented atop the loading +such as Bazel's [query](/versions/7.7.3/query/guide) command, which is implemented atop the loading phase. #### Execution phase {#execution}
diff --git a/docs/versions/7.7.1/run/client-server.mdx b/docs/versions/7.7.3/run/client-server.mdx similarity index 97% rename from docs/versions/7.7.1/run/client-server.mdx rename to docs/versions/7.7.3/run/client-server.mdx index 94a1624..ae675b6 100644 --- a/docs/versions/7.7.1/run/client-server.mdx +++ b/docs/versions/7.7.3/run/client-server.mdx
@@ -45,7 +45,7 @@ This makes it easier to find out which server process belongs to a given workspace. (Beware that with certain other options to `ps`, Bazel server processes may be named just `java`.) Bazel servers can be stopped using the -[shutdown](/versions/7.7.1/docs/user-manual#shutdown) command. +[shutdown](/versions/7.7.3/docs/user-manual#shutdown) command. When running `bazel`, the client first checks that the server is the appropriate version; if not, the server is stopped and a new one started. This ensures that
diff --git a/docs/versions/7.7.1/run/scripts.mdx b/docs/versions/7.7.3/run/scripts.mdx similarity index 96% rename from docs/versions/7.7.1/run/scripts.mdx rename to docs/versions/7.7.3/run/scripts.mdx index 641fe3f..2f07fd3 100644 --- a/docs/versions/7.7.1/run/scripts.mdx +++ b/docs/versions/7.7.3/run/scripts.mdx
@@ -28,7 +28,7 @@ ### Notes about server mode {#server-mode} -By default, Bazel uses a long-running [server process](/versions/7.7.1/run/client-server) as an +By default, Bazel uses a long-running [server process](/versions/7.7.3/run/client-server) as an optimization. When running Bazel in a script, don't forget to call `shutdown` when you're finished with the server, or, specify `--max_idle_secs=5` so that idle servers shut themselves down promptly. @@ -85,7 +85,7 @@ ### Reading the .bazelrc file {#reading-bazelrc} -By default, Bazel reads the [`.bazelrc` file](/versions/7.7.1/run/bazelrc) from the base +By default, Bazel reads the [`.bazelrc` file](/versions/7.7.3/run/bazelrc) from the base workspace directory or the user's home directory. Whether or not this is desirable is a choice for your script; if your script needs to be perfectly hermetic (such as when doing release builds), you should disable reading the @@ -119,4 +119,4 @@ ## Troubleshooting performance by profiling {#performance-profiling} -See the [Performance Profiling](/versions/7.7.1/rules/performance#performance-profiling) section. +See the [Performance Profiling](/versions/7.7.3/rules/performance#performance-profiling) section.
diff --git a/docs/versions/7.7.1/start/android-app.mdx b/docs/versions/7.7.3/start/android-app.mdx similarity index 93% rename from docs/versions/7.7.1/start/android-app.mdx rename to docs/versions/7.7.3/start/android-app.mdx index 85e6fa4..923d679 100644 --- a/docs/versions/7.7.1/start/android-app.mdx +++ b/docs/versions/7.7.3/start/android-app.mdx
@@ -8,7 +8,7 @@ This tutorial covers how to build a simple Android app using Bazel. Bazel supports building Android apps using the -[Android rules](/versions/7.7.1/reference/be/android). +[Android rules](/versions/7.7.3/reference/be/android). This tutorial is intended for Windows, macOS and Linux users and does not require experience with Bazel or Android app development. You do not need to @@ -20,7 +20,7 @@ * Set up your environment by installing Bazel and Android Studio, and downloading the sample project. -* Set up a Bazel [workspace](/versions/7.7.1/reference/be/workspace) that contains the source code +* Set up a Bazel [workspace](/versions/7.7.3/reference/be/workspace) that contains the source code for the app and a `WORKSPACE` file that identifies the top level of the workspace directory. * Update the `WORKSPACE` file to contain references to the required @@ -35,7 +35,7 @@ Before you begin the tutorial, install the following software: -* **Bazel.** To install, follow the [installation instructions](/versions/7.7.1/install). +* **Bazel.** To install, follow the [installation instructions](/versions/7.7.3/install). * **Android Studio.** To install, follow the steps to [download Android Studio](https://developer.android.com/sdk/index.html). Execute the setup wizard to download the SDK and configure your environment. * (Optional) **Git.** Use `git` to download the Android app project. @@ -47,7 +47,7 @@ This app has a single button that prints a greeting when clicked: - + **Figure 1.** Android app button greeting. @@ -97,11 +97,11 @@ ### Set up the workspace -A [workspace](/versions/7.7.1/concepts/build-ref#workspace) is a directory that contains the +A [workspace](/versions/7.7.3/concepts/build-ref#workspace) is a directory that contains the source files for one or more software projects, and has a `WORKSPACE` file at its root. -The `WORKSPACE` file may be empty or may contain references to [external dependencies](/versions/7.7.1/docs/external) required to build your project. +The `WORKSPACE` file may be empty or may contain references to [external dependencies](/versions/7.7.3/docs/external) required to build your project. First, run the following command to create an empty `WORKSPACE` file: @@ -204,7 +204,7 @@ from the `ANDROID_NDK_HOME` environment variable by default. The path can also be explicitly specified with a `path` attribute on `android_ndk_repository`. -For more information, read [Using the Android Native Development Kit with Bazel](/versions/7.7.1/docs/android-ndk). +For more information, read [Using the Android Native Development Kit with Bazel](/versions/7.7.3/docs/android-ndk). `api_level` is the version of the Android API that the SDK and NDK target - for example, 23 for Android 6.0 and 25 for Android 7.1. If not @@ -217,7 +217,7 @@ ### Create a BUILD file -A [`BUILD` file](/versions/7.7.1/concepts/build-files) describes the relationship +A [`BUILD` file](/versions/7.7.3/concepts/build-files) describes the relationship between a set of build outputs, like compiled Android resources from `aapt` or class files from `javac`, and their dependencies. These dependencies may be source files (Java, C++) in your workspace or other build outputs. `BUILD` files @@ -225,7 +225,7 @@ `BUILD` files are part of a concept in Bazel known as the *package hierarchy*. The package hierarchy is a logical structure that overlays the directory -structure in your workspace. Each [package](/versions/7.7.1/concepts/build-ref#packages) is a +structure in your workspace. Each [package](/versions/7.7.3/concepts/build-ref#packages) is a directory (and its subdirectories) that contains a related set of source files and a `BUILD` file. The package also includes any subdirectories, excluding those that contain their own `BUILD` file. The *package name* is the path to the @@ -243,11 +243,11 @@ A `BUILD` file contains several different types of declarations for Bazel. The most important type is the -[build rule](/versions/7.7.1/concepts/build-files#types-of-build-rules), which tells +[build rule](/versions/7.7.3/concepts/build-files#types-of-build-rules), which tells Bazel how to build an intermediate or final software output from a set of source files or other dependencies. Bazel provides two build rules, -[`android_library`](/versions/7.7.1/reference/be/android#android_library) and -[`android_binary`](/versions/7.7.1/reference/be/android#android_binary), that you can use to +[`android_library`](/versions/7.7.3/reference/be/android#android_library) and +[`android_binary`](/versions/7.7.3/reference/be/android#android_binary), that you can use to build an Android app. For this tutorial, you'll first use the @@ -283,7 +283,7 @@ #### Add an android_binary rule -The [`android_binary`](/versions/7.7.1/reference/be/android#android_binary) rule builds +The [`android_binary`](/versions/7.7.3/reference/be/android#android_binary) rule builds the Android application package (`.apk` file) for your app. Create a new `BUILD` file in the `src/main/` directory, @@ -316,7 +316,7 @@ bazel build //src/main:app ``` -The [`build`](/versions/7.7.1/docs/user-manual#build) subcommand instructs Bazel to build the +The [`build`](/versions/7.7.3/docs/user-manual#build) subcommand instructs Bazel to build the target that follows. The target is specified as the name of a build rule inside a `BUILD` file, with along with the package path relative to your workspace directory. For this example, the target is `app` and the package path is @@ -324,7 +324,7 @@ Note that you can sometimes omit the package path or target name, depending on your current working directory at the command line and the name of the target. -For more details about target labels and paths, see [Labels](/versions/7.7.1/concepts/labels). +For more details about target labels and paths, see [Labels](/versions/7.7.3/concepts/labels). Bazel will start to build the sample app. During the build process, its output will appear similar to the following: @@ -366,7 +366,7 @@ ### Run the app You can now deploy the app to a connected Android device or emulator from the -command line using the [`bazel mobile-install`](/versions/7.7.1/docs/user-manual#mobile-install) command. This command uses +command line using the [`bazel mobile-install`](/versions/7.7.3/docs/user-manual#mobile-install) command. This command uses the Android Debug Bridge (`adb`) to communicate with the device. You must set up your device to use `adb` following the instructions in [Android Debug Bridge](http://developer.android.com/tools/help/adb.html) before deployment. You can also choose to install the app on the Android emulator included in Android @@ -380,14 +380,14 @@ Next, find and launch the "Bazel Tutorial App": - + **Figure 2.** Bazel tutorial app. **Congratulations! You have just installed your first Bazel-built Android app.** Note that the `mobile-install` subcommand also supports the -[`--incremental`](/versions/7.7.1/docs/user-manual#mobile-install) flag that can be used to +[`--incremental`](/versions/7.7.3/docs/user-manual#mobile-install) flag that can be used to deploy only those parts of the app that have changed since the last deployment. It also supports the `--start_app` flag to start the app immediately upon @@ -398,13 +398,13 @@ For more details, see these pages: * Open issues on [GitHub](https://github.com/bazelbuild/bazel/issues) -* More information on [mobile-install](/versions/7.7.1/docs/mobile-install) +* More information on [mobile-install](/versions/7.7.3/docs/mobile-install) * Integrate external dependencies like AppCompat, Guava and JUnit from Maven repositories using [rules_jvm_external](https://github.com/bazelbuild/rules_jvm_external) * Run Robolectric tests with the [robolectric-bazel](https://github.com/robolectric/robolectric-bazel) integration. -* Testing your app with [Android instrumentation tests](/versions/7.7.1/docs/android-instrumentation-test) -* Integrating C and C++ code into your Android app with the [NDK](/versions/7.7.1/docs/android-ndk) +* Testing your app with [Android instrumentation tests](/versions/7.7.3/docs/android-instrumentation-test) +* Integrating C and C++ code into your Android app with the [NDK](/versions/7.7.3/docs/android-ndk) * See more Bazel example projects of: * [a Kotlin app](https://github.com/bazelbuild/rules_jvm_external/tree/master/examples/android_kotlin_app) * [Robolectric testing](https://github.com/bazelbuild/rules_jvm_external/tree/master/examples/android_local_test)
diff --git a/docs/versions/7.7.1/start/cpp.mdx b/docs/versions/7.7.3/start/cpp.mdx similarity index 90% rename from docs/versions/7.7.1/start/cpp.mdx rename to docs/versions/7.7.3/start/cpp.mdx index 679f96f..07fb687 100644 --- a/docs/versions/7.7.1/start/cpp.mdx +++ b/docs/versions/7.7.3/start/cpp.mdx
@@ -10,7 +10,7 @@ workflow. Starting with the tools you need, you will build and run three projects with increasing complexity and learn how and why they get more complex. -While Bazel is a [build system](https://bazel.build/versions/7.7.1/basics/build-systems) that +While Bazel is a [build system](https://bazel.build/versions/7.7.3/basics/build-systems) that supports multi-language builds, this tutorial uses a C++ project as an example and provides the general guidelines and flow that apply to most languages. @@ -18,7 +18,7 @@ ### Prerequisites {#prerequisites} -Start by [installing Bazel](https://bazel.build/versions/7.7.1/install), if you haven’t +Start by [installing Bazel](https://bazel.build/versions/7.7.3/install), if you haven’t already. This tutorial uses Git for source control, so for best results [install Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) as well. @@ -63,7 +63,7 @@ ``` There are three sets of files, each set representing a stage in this tutorial. -In the first stage, you will build a single [target](https://bazel.build/versions/7.7.1/reference/glossary#target) residing in a single [package](https://bazel.build/versions/7.7.1/reference/glossary#package). In the second stage, you will +In the first stage, you will build a single [target](https://bazel.build/versions/7.7.3/reference/glossary#target) residing in a single [package](https://bazel.build/versions/7.7.3/reference/glossary#package). In the second stage, you will build both a binary and a library from a single package. In the third and final stage, you will build a project with multiple packages and build it with multiple targets. @@ -72,7 +72,7 @@ By installing Bazel (and Git) and cloning the repository for this tutorial, you have laid the foundation for your first build with Bazel. Continue to the next -section to define some terms and set up your [workspace](https://bazel.build/versions/7.7.1/reference/glossary#workspace). +section to define some terms and set up your [workspace](https://bazel.build/versions/7.7.3/reference/glossary#workspace). ## Getting started {#getting-started} @@ -82,13 +82,13 @@ a directory that holds your project's source files and Bazel's build outputs. It also contains these significant files: -* The <code>[`WORKSPACE` file](https://bazel.build/versions/7.7.1/reference/glossary#workspace-file) +* The <code>[`WORKSPACE` file](https://bazel.build/versions/7.7.3/reference/glossary#workspace-file) </code>, which identifies the directory and its contents as a Bazel workspace and lives at the root of the project's directory structure. -* One or more <code>[`BUILD` files](https://bazel.build/versions/7.7.1/reference/glossary#build-file) +* One or more <code>[`BUILD` files](https://bazel.build/versions/7.7.3/reference/glossary#build-file) </code>, which tell Bazel how to build different parts of the project. A directory within the workspace that contains a <code>BUILD</code> file is a -[package](https://bazel.build/versions/7.7.1/reference/glossary#package). (More on packages +[package](https://bazel.build/versions/7.7.3/reference/glossary#package). (More on packages later in this tutorial.) In future projects, to designate a directory as a Bazel workspace, create an @@ -98,16 +98,16 @@ **NOTE**: When Bazel builds the project, all inputs must be in the same workspace. Files residing in different workspaces are independent of one another unless linked. More detailed information about workspace rules can -be found in [this guide](https://bazel.build/versions/7.7.1/reference/be/workspace). +be found in [this guide](https://bazel.build/versions/7.7.3/reference/be/workspace). ### Understand the BUILD file {#understand-build} A `BUILD` file contains several different types of instructions for Bazel. Each -`BUILD` file requires at least one [rule](https://bazel.build/versions/7.7.1/reference/glossary#rule) +`BUILD` file requires at least one [rule](https://bazel.build/versions/7.7.3/reference/glossary#rule) as a set of instructions, which tells Bazel how to build the desired outputs, such as executable binaries or libraries. Each instance of a build rule in the -`BUILD` file is called a [target](https://bazel.build/versions/7.7.1/reference/glossary#target) -and points to a specific set of source files and [dependencies](https://bazel.build/versions/7.7.1/reference/glossary#dependency). +`BUILD` file is called a [target](https://bazel.build/versions/7.7.3/reference/glossary#target) +and points to a specific set of source files and [dependencies](https://bazel.build/versions/7.7.3/reference/glossary#dependency). A target can also point to other targets. Take a look at the `BUILD` file in the `cpp-tutorial/stage1/main` directory: @@ -120,7 +120,7 @@ ``` In our example, the `hello-world` target instantiates Bazel's built-in -<code>[cc_binary rule](https://bazel.build/versions/7.7.1/reference/be/c-cpp#cc_binary)</code>. +<code>[cc_binary rule](https://bazel.build/versions/7.7.3/reference/be/c-cpp#cc_binary)</code>. The rule tells Bazel to build a self-contained executable binary from the <code>hello-world.cc</code> source file with no dependencies. @@ -184,7 +184,7 @@ Here’s the dependency graph of Stage 1: - + ### Summary: stage 1 {#summary-stage-1} @@ -231,7 +231,7 @@ ``` With this `BUILD` file, Bazel first builds the `hello-greet` library -(using Bazel's built-in <code>[cc_library rule](https://bazel.build/versions/7.7.1/reference/be/c-cpp#cc_library)</code>), +(using Bazel's built-in <code>[cc_library rule](https://bazel.build/versions/7.7.3/reference/be/c-cpp#cc_library)</code>), then the <code>hello-world</code> binary. The <code>deps</code> attribute in the <code>hello-world</code> target tells Bazel that the <code>hello-greet</code> library is required to build the <code>hello-world</code> binary. @@ -270,7 +270,7 @@ Looking at the dependency graph, you can see that `hello-world` depends on an extra input named `hello-greet`: - + ### Summary: stage 2 {#summary-stage-2} @@ -338,7 +338,7 @@ this through the `deps` attribute. You can see this reflected in the dependency graph: - + For the build to succeed, you make the `//lib:hello-time` target in `lib/BUILD` explicitly visible to targets in `main/BUILD` using the visibility attribute. @@ -386,12 +386,12 @@ You’ve now completed your first basic build with Bazel, but this is just the start. Here are some more resources to continue learning with Bazel: -* To keep focusing on C++, read about common [C++ build use cases](https://bazel.build/versions/7.7.1/tutorials/cpp-use-cases). +* To keep focusing on C++, read about common [C++ build use cases](https://bazel.build/versions/7.7.3/tutorials/cpp-use-cases). * To get started with building other applications with Bazel, see the tutorials -for [Java](https://bazel.build/versions/7.7.1/start/java), [Android application](https://bazel.build/versions/7.7.1/start/android-app ), -or [iOS application](https://bazel.build/versions/7.7.1/start/ios-app)). +for [Java](https://bazel.build/versions/7.7.3/start/java), [Android application](https://bazel.build/versions/7.7.3/start/android-app ), +or [iOS application](https://bazel.build/versions/7.7.3/start/ios-app)). * To learn more about working with local and remote repositories, read about -[external dependencies](https://bazel.build/versions/7.7.1/docs/external). -* To learn more about Bazel’s other rules, see this [reference guide](https://bazel.build/versions/7.7.1/rules). +[external dependencies](https://bazel.build/versions/7.7.3/docs/external). +* To learn more about Bazel’s other rules, see this [reference guide](https://bazel.build/versions/7.7.3/rules). Happy building!
diff --git a/docs/versions/7.7.1/start/docker.svg b/docs/versions/7.7.3/start/docker.svg similarity index 100% rename from docs/versions/7.7.1/start/docker.svg rename to docs/versions/7.7.3/start/docker.svg
diff --git a/docs/versions/7.7.1/start/ios-app.mdx b/docs/versions/7.7.3/start/ios-app.mdx similarity index 100% rename from docs/versions/7.7.1/start/ios-app.mdx rename to docs/versions/7.7.3/start/ios-app.mdx
diff --git a/docs/versions/7.7.1/start/java.mdx b/docs/versions/7.7.3/start/java.mdx similarity index 95% rename from docs/versions/7.7.1/start/java.mdx rename to docs/versions/7.7.3/start/java.mdx index 99ced97..67c01b8 100644 --- a/docs/versions/7.7.1/start/java.mdx +++ b/docs/versions/7.7.3/start/java.mdx
@@ -23,7 +23,7 @@ ### Install Bazel -To prepare for the tutorial, first [Install Bazel](/versions/7.7.1/install) if +To prepare for the tutorial, first [Install Bazel](/versions/7.7.3/install) if you don't have it installed already. ### Install the JDK @@ -111,7 +111,7 @@ ``` In our example, the `ProjectRunner` target instantiates Bazel's built-in -[`java_binary` rule](/versions/7.7.1/reference/be/java#java_binary). The rule tells Bazel to +[`java_binary` rule](/versions/7.7.3/reference/be/java#java_binary). The rule tells Bazel to build a `.jar` file and a wrapper shell script (both named after the target). The attributes in the target explicitly state its dependencies and options. @@ -119,7 +119,7 @@ `ProjectRunner` rule target, `name` is the name of the target, `srcs` specifies the source files that Bazel uses to build the target, and `main_class` specifies the class that contains the main method. (You may have noticed that our example -uses [glob](/versions/7.7.1/reference/be/functions#glob) to pass a set of source files to Bazel +uses [glob](/versions/7.7.3/reference/be/functions#glob) to pass a set of source files to Bazel instead of listing them one by one.) ### Build the project @@ -178,7 +178,7 @@ As you can see, the project has a single target that build two source files with no additional dependencies: - + After you set up your workspace, build your project, and examine its dependencies, then you can add some complexity. @@ -241,7 +241,7 @@ Looking at the dependency graph, you can see that `ProjectRunner` depends on the same inputs as it did before, but the structure of the build is different: - + You've now built the project with two targets. The `ProjectRunner` target builds two source files and depends on one other target (`:greeter`), which builds @@ -270,7 +270,7 @@ the target label `//:greeter`) - Bazel knows this through the `deps` attribute. Take a look at the dependency graph: - + However, for the build to succeed, you must explicitly give the `runner` target in `//src/main/java/com/example/cmdline/BUILD` visibility to targets in @@ -351,7 +351,7 @@ of its runtime dependencies. This lets you run the binary outside of your development environment. -As you remember, the [java_binary](/versions/7.7.1/reference/be/java#java_binary) build rule +As you remember, the [java_binary](/versions/7.7.3/reference/be/java#java_binary) build rule produces a `.jar` and a wrapper shell script. Take a look at the contents of `runner.jar` using this command: @@ -417,16 +417,16 @@ * [rules_jvm_external](https://github.com/bazelbuild/rules_jvm_external) for rules to manage transitive Maven dependencies. -* [External Dependencies](/versions/7.7.1/docs/external) to learn more about working with +* [External Dependencies](/versions/7.7.3/docs/external) to learn more about working with local and remote repositories. -* The [other rules](/versions/7.7.1/rules) to learn more about Bazel. +* The [other rules](/versions/7.7.3/rules) to learn more about Bazel. -* The [C++ build tutorial](/versions/7.7.1/start/cpp) to get started with building +* The [C++ build tutorial](/versions/7.7.3/start/cpp) to get started with building C++ projects with Bazel. -* The [Android application tutorial](/versions/7.7.1/start/android-app) and - [iOS application tutorial](/versions/7.7.1/start/ios-app)) to get started with +* The [Android application tutorial](/versions/7.7.3/start/android-app) and + [iOS application tutorial](/versions/7.7.3/start/ios-app)) to get started with building mobile applications for Android and iOS with Bazel. Happy building!
diff --git a/docs/versions/7.7.1/tutorials/ccp-toolchain-config.mdx b/docs/versions/7.7.3/tutorials/ccp-toolchain-config.mdx similarity index 95% rename from docs/versions/7.7.1/tutorials/ccp-toolchain-config.mdx rename to docs/versions/7.7.3/tutorials/ccp-toolchain-config.mdx index 1fbe7ec..bfed984 100644 --- a/docs/versions/7.7.1/tutorials/ccp-toolchain-config.mdx +++ b/docs/versions/7.7.3/tutorials/ccp-toolchain-config.mdx
@@ -31,7 +31,7 @@ Set up your build environment as follows: 1. If you have not already done so, - [download and install Bazel 0.23](/versions/7.7.1/install/ubuntu) or later. + [download and install Bazel 0.23](/versions/7.7.3/install/ubuntu) or later. 2. Download the [example C++ project](https://github.com/bazelbuild/examples/tree/master/cpp-tutorial/stage1) @@ -67,16 +67,16 @@ For an entry `build:{config_name} --flag=value`, the command line flag `--config={config_name}` is associated with that particular flag. See documentation for the flags used: -[`crosstool_top`](/versions/7.7.1/docs/user-manual#crosstool-top), -[`cpu`](/versions/7.7.1/docs/user-manual#cpu) and -[`host_crosstool_top`](/versions/7.7.1/docs/user-manual#host-crosstool-top). +[`crosstool_top`](/versions/7.7.3/docs/user-manual#crosstool-top), +[`cpu`](/versions/7.7.3/docs/user-manual#cpu) and +[`host_crosstool_top`](/versions/7.7.3/docs/user-manual#host-crosstool-top). -When you build your [target](/versions/7.7.1/concepts/build-ref#targets) +When you build your [target](/versions/7.7.3/concepts/build-ref#targets) with `bazel build --config=clang_config //main:hello-world`, Bazel uses your custom toolchain from the -[cc_toolchain_suite](/versions/7.7.1/reference/be/c-cpp#cc_toolchain_suite) +[cc_toolchain_suite](/versions/7.7.3/reference/be/c-cpp#cc_toolchain_suite) `//toolchain:clang_suite`. The suite may list different -[toolchains](/versions/7.7.1/reference/be/c-cpp#cc_toolchain) for different CPUs, +[toolchains](/versions/7.7.3/reference/be/c-cpp#cc_toolchain) for different CPUs, and that's why it is differentiated with the flag `--cpu=k8`. Because Bazel uses many internal tools written in C++ during the build, such as @@ -133,7 +133,7 @@ ``` Bazel discovered that the `--crosstool_top` flag points to a rule that - doesn't provide the necessary [`ToolchainInfo`](/versions/7.7.1/rules/lib/providers/ToolchainInfo) + doesn't provide the necessary [`ToolchainInfo`](/versions/7.7.3/rules/lib/providers/ToolchainInfo) provider. So you need to point `--crosstool_top` to a rule that does provide `ToolchainInfo` - that is the `cc_toolchain_suite` rule. In the `toolchain/BUILD` file, replace the empty filegroup with the following: @@ -324,7 +324,7 @@ Bazel needs to know where to search for included headers. There are multiple ways to solve this, such as using the `includes` attribute of `cc_binary`, but here this is solved at the toolchain level with the - [`cxx_builtin_include_directories`](/versions/7.7.1/rules/lib/toplevel/cc_common#create_cc_toolchain_config_info) + [`cxx_builtin_include_directories`](/versions/7.7.3/rules/lib/toplevel/cc_common#create_cc_toolchain_config_info) parameter of `cc_common.create_cc_toolchain_config_info`. Beware that if you are using a different version of `clang`, the include path will be different. These paths may also be different depending on the distribution. @@ -480,7 +480,7 @@ - You have to let the toolchain know where the tools live. In this tutorial there is a simplified version where you access the tools from the system. If you are interested in a more self-contained approach, you can read about - workspaces [here](/versions/7.7.1/reference/be/workspace). Your tools could come from a + workspaces [here](/versions/7.7.3/reference/be/workspace). Your tools could come from a different workspace and you would have to make their files available to the `cc_toolchain` with target dependencies on attributes, such as `compiler_files`. The `tool_paths` would need to be changed as well. @@ -490,4 +490,4 @@ ## Further reading {#further-reading} For more details, see -[C++ toolchain configuration](/versions/7.7.1/docs/cc-toolchain-config-reference) +[C++ toolchain configuration](/versions/7.7.3/docs/cc-toolchain-config-reference)
diff --git a/docs/versions/7.7.1/tutorials/cpp-dependency.mdx b/docs/versions/7.7.3/tutorials/cpp-dependency.mdx similarity index 95% rename from docs/versions/7.7.1/tutorials/cpp-dependency.mdx rename to docs/versions/7.7.3/tutorials/cpp-dependency.mdx index b5d1af0..25172b4 100644 --- a/docs/versions/7.7.1/tutorials/cpp-dependency.mdx +++ b/docs/versions/7.7.3/tutorials/cpp-dependency.mdx
@@ -39,7 +39,7 @@ As you can see, the first stage of the sample project has a single target that builds a single source file with no additional dependencies: - + **Figure 1.** Dependency graph for `hello-world` displays a single target with a single source file.
diff --git a/docs/versions/7.7.1/tutorials/cpp-labels.mdx b/docs/versions/7.7.3/tutorials/cpp-labels.mdx similarity index 100% rename from docs/versions/7.7.1/tutorials/cpp-labels.mdx rename to docs/versions/7.7.3/tutorials/cpp-labels.mdx
diff --git a/docs/versions/7.7.1/tutorials/cpp-use-cases.mdx b/docs/versions/7.7.3/tutorials/cpp-use-cases.mdx similarity index 97% rename from docs/versions/7.7.1/tutorials/cpp-use-cases.mdx rename to docs/versions/7.7.3/tutorials/cpp-use-cases.mdx index 3b26b4c..3512d7c 100644 --- a/docs/versions/7.7.1/tutorials/cpp-use-cases.mdx +++ b/docs/versions/7.7.3/tutorials/cpp-use-cases.mdx
@@ -5,15 +5,15 @@ Here you will find some of the most common use cases for building C++ projects with Bazel. If you have not done so already, get started with building C++ projects with Bazel by completing the tutorial -[Introduction to Bazel: Build a C++ Project](/versions/7.7.1/start/cpp). +[Introduction to Bazel: Build a C++ Project](/versions/7.7.3/start/cpp). For information on cc_library and hdrs header files, see -<a href="/versions/7.7.1/reference/be/c-cpp#cc_library">cc_library</a>. +<a href="/versions/7.7.3/reference/be/c-cpp#cc_library">cc_library</a>. ## Including multiple files in a target {#multiple-files-target} You can include multiple files in a single target with -<a href="/versions/7.7.1/reference/be/functions#glob">glob</a>. +<a href="/versions/7.7.3/reference/be/functions#glob">glob</a>. For example: ```python