Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge two experimental_local_disk_cache options to one #4874

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions site/docs/remote-caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ make builds significantly faster.
* [Delete content from the remote cache](#delete-content-from-the-remote-cache)
* [Known Issues](#known-issues)
* [External Links](#external-links)
* [Build cache](#build-cache)
* [Bazel remote execution (in development)](#bazel-remote-execution-in-development)

## Remote caching overview
Expand Down Expand Up @@ -306,6 +307,31 @@ You may want to delete content from the cache to:
* Create a clean cache after a cache was poisoned
* Reduce the amount of storage used by deleting old outputs

## Build cache

Bazel can use a directory on the filesystem as a remote cache. This is
useful for sharing build artifacts when switching branches and/or working
on multiple workspaces of the same project i.e. multiple checkouts. Bazel
does not garbage collect the directory and thus one might want to set up a
cron job or similar to periodically clean up the directory. The build cache
can be enabled with the following flags.

```
build --build_cache=/path/to/build/cache
```

Additionally, one can pass a user specific path to the --build_cache flag
via the ~ character. Bazel will replace this with the current user's home
directory. This comes in handy when one wants to enable the build cache for
all developers of a project via the project's checked in `.bazelrc` file.

To have cache hits across different workspaces, additional option should be
used:
Copy link
Contributor Author

@davido davido Mar 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the listing of the env. variables. The use case I'm after is: the same user (no multiple uses involved) has different clones of the same project, say:

  • /home/davido/projects/gerrit
  • /home/davido/projects/gerrit2

After building in gerrit directory, the cache is populated. When I build in gerrit2 directory, without --experimental_strict_action_env I experienced cache misses. I havn't re-checked whether this is still the case, but @ulfjack recommended to use this option in this comment: #3042 (comment) and pointed to the discussion in context of this issue: #2574.

I should have probably said: "To have cache hits across different clones of the same project..."?


```
build --experimental_strict_action_env
```

## Known issues

**Input file modification during a Build**
Expand Down