File tree Expand file tree Collapse file tree 4 files changed +20
-1
lines changed
java/com/google/devtools/build/lib/exec
java/com/google/devtools/build/lib/exec Expand file tree Collapse file tree 4 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,7 @@ public void logSpawn(
138138 builder .setTimeoutMillis (timeout .toMillis ());
139139 }
140140 builder .setCacheable (Spawns .mayBeCached (spawn ));
141+ builder .setRemoteCacheable (Spawns .mayBeCachedRemotely (spawn ));
141142 builder .setExitCode (result .exitCode ());
142143 builder .setRemoteCacheHit (result .isCacheHit ());
143144 builder .setRunner (result .getRunnerName ());
Original file line number Diff line number Diff line change @@ -123,4 +123,7 @@ message SpawnExec {
123123 // Its semantics varies greatly depending on the status field.
124124 // Dependable: if status is empty, exit_code is guaranteed to be zero.
125125 int32 exit_code = 15 ;
126+
127+ // Was the Spawn result allowed to be cached remotely.
128+ bool remote_cacheable = 16 ;
126129}
Original file line number Diff line number Diff line change @@ -360,6 +360,7 @@ public void testLogSpawn() throws Exception {
360360 .setExitCode (23 )
361361 .setRemotable (true )
362362 .setCacheable (true )
363+ .setRemoteCacheable (true )
363364 .setProgressMessage ("my progress message" )
364365 .setMnemonic ("MyMnemonic" )
365366 .setRunner ("runner" )
@@ -486,6 +487,7 @@ private static SpawnExec.Builder defaultSpawnExecBuilder(String cmd) {
486487 .setMnemonic ("Mnemonic" )
487488 .setRunner ("runner" )
488489 .setStatus ("NON_ZERO_EXIT" )
489- .setExitCode (23 );
490+ .setExitCode (23 )
491+ .setRemoteCacheable (true );
490492 }
491493}
Original file line number Diff line number Diff line change 188188 grep " listedOutputs" output.json || fail " log does not contain listed outputs"
189189}
190190
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+
191204run_suite " execlog_tests"
You can’t perform that action at this time.
0 commit comments