Skip to content

Remote: Cleanup the code that determines whether the spawn should accept/upload results from/to remote cache.#13769

Closed
coeuvre wants to merge 6 commits intobazelbuild:masterfrom
coeuvre:fix-13621
Closed

Remote: Cleanup the code that determines whether the spawn should accept/upload results from/to remote cache.#13769
coeuvre wants to merge 6 commits intobazelbuild:masterfrom
coeuvre:fix-13621

Conversation

@coeuvre
Copy link
Copy Markdown
Member

@coeuvre coeuvre commented Jul 29, 2021

Remote cache (and execution) for an action can be controlled with following tags:

  • no-remote-cache: prevent remote caching, but allow local caching
  • no-remote-exec: prevent remote execution, but allow remote caching
  • no-remote: combine no-remote-cache and no-remote-exec
  • no-cache: extend no-remote-cache to also prevent local caching

A combined cache is treated as remote cache, hence is disabled for actions that are tagged with no-remote-cache unless --incompatible_remote_results_ignore_disk is set in which case local component is enabled.

Fixes #13621.

@google-cla google-cla bot added the cla: yes label Jul 29, 2021
@coeuvre coeuvre marked this pull request as ready for review July 29, 2021 07:28
@coeuvre coeuvre requested a review from philwo July 29, 2021 07:28
public boolean mayBeCached(Spawn spawn) {
return remoteCache != null && Spawns.mayBeCached(spawn);
private static boolean useDiskCache(RemoteOptions options) {
return options.diskCache != null && !options.diskCache.isEmpty();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we use !isNullOrEmpty(options.diskCache) here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

options.diskCache is a PathFragment, before converting to String we have to check for null, which makes isNullOrEmpty less appealing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

no-remote and no-remote-cache are affecting the disk cache

2 participants