File tree 4 files changed +20
-1
lines changed
java/com/google/devtools/build/lib/exec
java/com/google/devtools/build/lib/exec
4 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,7 @@ public void logSpawn(
138
138
builder .setTimeoutMillis (timeout .toMillis ());
139
139
}
140
140
builder .setCacheable (Spawns .mayBeCached (spawn ));
141
+ builder .setRemoteCacheable (Spawns .mayBeCachedRemotely (spawn ));
141
142
builder .setExitCode (result .exitCode ());
142
143
builder .setRemoteCacheHit (result .isCacheHit ());
143
144
builder .setRunner (result .getRunnerName ());
Original file line number Diff line number Diff line change @@ -123,4 +123,7 @@ message SpawnExec {
123
123
// Its semantics varies greatly depending on the status field.
124
124
// Dependable: if status is empty, exit_code is guaranteed to be zero.
125
125
int32 exit_code = 15 ;
126
+
127
+ // Was the Spawn result allowed to be cached remotely.
128
+ bool remote_cacheable = 16 ;
126
129
}
Original file line number Diff line number Diff line change @@ -360,6 +360,7 @@ public void testLogSpawn() throws Exception {
360
360
.setExitCode (23 )
361
361
.setRemotable (true )
362
362
.setCacheable (true )
363
+ .setRemoteCacheable (true )
363
364
.setProgressMessage ("my progress message" )
364
365
.setMnemonic ("MyMnemonic" )
365
366
.setRunner ("runner" )
@@ -486,6 +487,7 @@ private static SpawnExec.Builder defaultSpawnExecBuilder(String cmd) {
486
487
.setMnemonic ("Mnemonic" )
487
488
.setRunner ("runner" )
488
489
.setStatus ("NON_ZERO_EXIT" )
489
- .setExitCode (23 );
490
+ .setExitCode (23 )
491
+ .setRemoteCacheable (true );
490
492
}
491
493
}
Original file line number Diff line number Diff line change 188
188
grep " listedOutputs" output.json || fail " log does not contain listed outputs"
189
189
}
190
190
191
+ function test_no_remote_cache() {
192
+ cat > BUILD << 'EOF '
193
+ genrule(
194
+ name = "action",
195
+ outs = ["out.txt"],
196
+ cmd = "echo hello > $(location out.txt)",
197
+ tags = ["no-remote-cache"],
198
+ )
199
+ EOF
200
+ bazel build //:action --execution_log_json_file=output.json 2>&1 >> $TEST_log || fail " could not build"
201
+ grep " \" remoteCacheable\" : false" output.json || fail " log does not contain valid remoteCacheable entry"
202
+ }
203
+
191
204
run_suite " execlog_tests"
You can’t perform that action at this time.
0 commit comments