Skip to content
This repository has been archived by the owner on Aug 1, 2019. It is now read-only.

Commit

Permalink
Bazel: Update local cache activation instructions
Browse files Browse the repository at this point in the history
Since [1] two action cache option were merged, and the experimental
prefix was removed. Also update the section about repository cache.
This cache is now activated per default and we can only change the
location of that cache.

[1] bazelbuild/bazel#4874

Change-Id: Iec4557a28987665182e9fe3f476d035421b751fe
  • Loading branch information
davido authored and David Ostrovsky committed May 30, 2018
1 parent 60c5618 commit 47b79bd
Showing 1 changed file with 10 additions and 26 deletions.
36 changes: 10 additions & 26 deletions Documentation/dev-bazel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -365,38 +365,25 @@ JGit repository.

[[local-action-cache]]

To accelerate builds, local action cache can be activated. Note, that this
experimental feature is not activated per default and only available since
Bazel version 0.7.

To activate the local action cache, create accessible cache directory:

----
mkdir -p ~/.gerritcodereview/bazel-cache/cas
----

and add these lines to your `~/.bazelrc` file:
To accelerate builds, local action cache can be activated.
To activate the local action cache add these lines to your `~/.bazelrc` file:

----
build --experimental_local_disk_cache_path=/home/<user>/.gerritcodereview/bazel-cache/cas
build --experimental_local_disk_cache
build --disk_cache=~/.gerritcodereview/bazel-cache/cas
build --experimental_strict_action_env
build --action_env=PATH
----

[NOTE] `experimental_local_disk_cache_path` must be absolute path. Expansion of `~` is
unfortunately not supported yet. This is also the reason why we can't activate this
feature by default yet (by adjusting tools/bazel.rc file).

[[repository_cache]]

To accelerate fetches, local repository cache can be activated. This cache is
only used for rules_closure external repository and transitive dependendcies.
That's because rules_closure uses standard Bazel download facility. For all
other gerrit dependencies, the download_artifacts repository cache is used
To accelerate fetches, local repository cache is activated per default in Bazel.
This cache is only used for rules_closure external repository and transitive
dependendcies. That's because rules_closure uses standard Bazel download facility.
For all other gerrit dependencies, the download_artifacts repository cache is used
already.

To activate the local repository cache, create accessible cache directory:
To change the default local repository cache directry, create accessible cache
directory:

----
mkdir -p ~/.gerritcodereview/bazel-cache/repository
Expand All @@ -405,12 +392,9 @@ To activate the local repository cache, create accessible cache directory:
and add this line to your `~/.bazelrc` file:

----
build --experimental_repository_cache=/home/<user>/.gerritcodereview/bazel-cache/repository
build --repository_cache=/home/<user>/.gerritcodereview/bazel-cache/repository
----

[NOTE] `experimental_repository_cache` must be absolute path. Expansion of `~` is
unfortunately not supported yet. This is also the reason why we can't activate this
feature by default yet (by adjusting tools/bazel.rc file).
GERRIT
------
Part of link:index.html[Gerrit Code Review]
Expand Down

0 comments on commit 47b79bd

Please sign in to comment.