Skip to content

Commit

Permalink
The shared dependency cache has to be initialized
Browse files Browse the repository at this point in the history
This clarifies that the cache must not be empty as it would be overhead
only then.

Fixes #12293
  • Loading branch information
ljacomet committed Feb 20, 2020
1 parent f4e1d67 commit 92bb949
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -266,6 +266,11 @@ If multiple incompatible Gradle versions are in play, all should be used when se

Instead of <<sub:cache_copy,copying the dependency cache into each container>>, it's possible to mount a shared, read-only folder that will act as a dependency cache for all containers.
This cache, unlike the classical dependency cache, is accessed without locking, making it possible for multiple builds to read from the cache concurrently.

By definition, this cache, to have any value, must be sourced from a Gradle dependency cache that contains the required dependencies.
It can however be incomplete, as Gradle will then rely on the regular, not shared, dependency cache.
An empty shared cache will only result in overhead.

When Gradle looks for dependencies (artifacts or metadata), it will look into the writable cache in the local Gradle home directory, but will also search the shared read-only cache if it is activated.
If an artifact is present in the read-only cache, it will not be downloaded.
If an artifact missing from the read-only dependency cache, it will be added to the _local_, writable cache of the Gradle instance.
Expand Down

0 comments on commit 92bb949

Please sign in to comment.