in src/main/java/com/google/devtools/build/remote/client/RemoteClient.java [505:537]
private static void doRun(String grpcLogFile, RunCommand options, RemoteClient client)
throws IOException, ParamException {
Path path = options.path != null ? options.path : Files.createTempDir().toPath();
if (options.file != null && options.actionDigest != null) {
System.err.println("Only one of --file or --action_digest should be specified");
System.exit(1);
}
if (options.file != null) {
client.setupDocker(getActionV1FromFile(options.file), path);
} else if (options.actionDigest != null) {
client.setupDocker(client.getAction(options.actionDigest), path);
} else if (!grpcLogFile.isEmpty()) {
LogParserUtils parser = new LogParserUtils(grpcLogFile);
List<Digest> actions = parser.failedActions();
if (actions.size() == 0) {
System.err.println("No action specified. No failed actions found in GRPC log.");
System.exit(1);
} else if (actions.size() > 1) {
System.err.println(
"No action specified. Multiple failed actions found in GRPC log. Add one of the following options:");
for (Digest d : actions) {
System.err.println(" --digest " + d.getHash() + "/" + d.getSizeBytes());
}
System.exit(1);
}
Digest action = actions.get(0);
client.setupDocker(client.getAction(action), path);
} else {
System.err.println("Specify --file or --action_digest");
System.exit(1);
}
}