Bump minimum Bazel version to 0.14.0 and activate caches

During migration from Buck to Bazel we lost action caches activation per
default. For one, local action cache wasn't implemented in Bazel, for
another, there was no option to specify HOME directory. I fixed both
problems and starting with Bazel 0.14.0 both features are included in
released Bazel version: [1], [2].

There is still one not implemented option, limit the cache directory
with max size: [3]. But for now the advantage to activate the caches per
default far outweigh the disadvantage of unlimited growth of size of
cache directory beyound imaginary max size of say 10 GB. In meantime we
add a warning to watch the size of the directory cache and periodically
clean cache directory:

  $ rm -rf ~/.gerritcodereview/bazel-cache/cas/*

[1] https://bazel-review.googlesource.com/#/c/bazel/+/16810
[2] https://github.com/bazelbuild/bazel/pull/4852
[3] https://github.com/bazelbuild/bazel/issues/5139

Change-Id: I42e8f6fb9770a5976751ffef286c0fe80b75cf93
This commit is contained in:
David Ostrovsky
2018-05-30 08:58:22 +02:00
committed by David Ostrovsky
parent 1492e86cd2
commit 2bf355df5a
3 changed files with 16 additions and 1 deletions

View File

@@ -364,6 +364,18 @@ To consume the JGit dependency from the development tree, edit
`lib/jgit/jgit.bzl` setting LOCAL_JGIT_REPO to a directory holding a
JGit repository.
[[bazel-local-caches]]
To accelerate builds, number of caches are activated per default:
* ~/.gerritcodereview/bazel-cache/downloaded-artifacts
* ~/.gerritcodereview/bazel-cache/repository
* ~/.gerritcodereview/bazel-cache/cas
All these caches currently don't have max. size limit,
link:https://github.com/bazelbuild/bazel/issues/5139[see this pending issue],
The users should watch their size and clean them manually if needed.
GERRIT
------
Part of link:index.html[Gerrit Code Review]

View File

@@ -29,7 +29,7 @@ http_file(
load("@bazel_skylib//:lib.bzl", "versions")
versions.check(minimum_bazel_version = "0.7.0")
versions.check(minimum_bazel_version = "0.14.0")
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_repositories")

View File

@@ -1,2 +1,5 @@
build --workspace_status_command=./tools/workspace-status.sh --strategy=Closure=worker
build --disk_cache=~/.gerritcodereview/bazel-cache/cas
build --repository_cache=~/.gerritcodereview/bazel-cache/repository
build --experimental_strict_action_env
test --build_tests_only