Add a GenSignatureActionContext to inject the command line info.
This is needed to fulfill the contract of the gensignature rule / the
corresponding audit trail protobuf. Note that the action is uncachable and
unconditional to execute.
--
MOS_MIGRATED_REVID=139178114
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java b/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java
index c72c05e..c96c5a0 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java
@@ -93,7 +93,8 @@
private ImmutableList<ActionInputPrefetcher> actionInputPrefetchers = ImmutableList.of();
private Path workingDirectory;
- private OptionsClassProvider options;
+ private String commandName;
+ private OptionsProvider options;
private AtomicReference<AbruptExitException> pendingException = new AtomicReference<>();
@@ -182,7 +183,11 @@
return Collections.unmodifiableMap(clientEnv);
}
- public OptionsClassProvider getOptions() {
+ public String getCommandName() {
+ return commandName;
+ }
+
+ public OptionsProvider getOptions() {
return options;
}
@@ -533,6 +538,7 @@
throw new IllegalStateException(e);
}
}
+ this.commandName = command.name();
this.options = optionsParser;
eventBus.post(new GotOptionsEvent(runtime.getStartupOptionsProvider(), optionsParser));