Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.aspect.build/llms.txt

Use this file to discover all available pages before exploring further.

Documentation for @bazel_lib@v3.2.0 View source
Utilities for rules that expose resource_set on ctx.actions.run[_shell] Workaround for https://github.com/bazelbuild/bazel/issues/15187 Note, this workaround only provides some fixed values for either CPU or Memory. Rule authors who are ALSO the BUILD author might know better, and can write custom resource_set functions for use within their own repository. This seems to be the use case that Google engineers imagined.

Function: resource_set

Parameters

attr
name
required

Function: resource_set_for

return an appropriate resource_set for the given values.

Parameters

cpu_cores
label
default:"0"
(int) the number of cores to request. 0 means “use the bazel default”. If the value is larger than the hard-coded max value, it will be clamped to the max value.
mem_mb
label
default:"0"
(int) megabytes of memory to request. 0 means “use the bazel default”. The value will be rounded up to a supported ram value, and will be clamped to the max value.
Returns: a resource_set function, as required by ctx.actions.run and ctx.actions.run_shell