Skip to content
master
Go to file
Code

Latest commit

…r custom

Starlark command lines.

Actions constructing arguments in Starlark can define them as a lazy
evaluation, which will be run when we are about to execute the action, using
`Args.add_all`.

`Args.add_all` offers a `expand_directories` feature which causes all of the
directories in the args list to be replaced with the files in the directory at
the time of evaluation.

When this option is used in conjunction with `map_each`, the behavior is to
first expand the directory and than run the provided function on each of the
elements of the expanded array.

`ArtifactExpander`, used to expand the directories, is not available before
execution phase. Given `Action.getKey` can be called before that (and is for
instance for shared actions detection), we currently compute the fingerprint
without expanding directories. In fact, current implementation, calls the
provided function on the directory itself rather than expanded list of files in
it. As a result of that, if we have 2 functions which return the same value for
the directory, but differ for the files in it, the key will not denote them as
different. That leads to false sharing of actions through the action cache,
which is based on action fingerprints.

Action cache checks happen during execution phase, when we technically have the
ability to expand the directories. Expand the fingerprinting function to take
advantage of `ArtifactExpander` when it is provided to produce the key based on
the result of actual function execution. Rework the `ActionExecutionFunction`
to provide `ArtifactExpander` to logic computing keys for action caches.

PiperOrigin-RevId: 323090803
e6cce76

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time

README.md

Bazel

{Fast, Correct} - Choose two

Build and test software of any size, quickly and reliably.

  • Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.

  • One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.

  • Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.

  • Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.

Getting Started

Documentation

Contributing to Bazel

See CONTRIBUTING.md

Build status

You can’t perform that action at this time.