aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/protobuf
diff options
context:
space:
mode:
authorGravatar twerth <twerth@google.com>2018-02-22 04:25:09 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-02-22 04:27:06 -0800
commit1d8ad1a1394926dcc8a2edd43ea554656e907c5a (patch)
tree871ddeb18a0e8f50103d28ae3b263a506721f998 /src/main/protobuf
parentdaf78cc149c135514e557485007fffb058bd94f2 (diff)
Add option to dump the action graph.
Note that this dumps the current state in skyframe (which may contain more nodes than you're interested in): - bazel build --nobuild //interesting:targets - bazel dump --action_graph=/path/to/file - printproto --proto2 --raw_protocol_buffer --message=action_graph.ActionGraphContainer --multiline --proto=third_party/bazel/src/main/protobuf/action_graph.proto /path/to/file We'll add filtering options in a later CL. RELNOTES[NEW]: Add option to dump the action graph to a file: 'bazel dump --action_graph=/path/to/file'. PiperOrigin-RevId: 186597930
Diffstat (limited to 'src/main/protobuf')
-rw-r--r--src/main/protobuf/BUILD1
-rw-r--r--src/main/protobuf/action_graph.proto157
2 files changed, 158 insertions, 0 deletions
diff --git a/src/main/protobuf/BUILD b/src/main/protobuf/BUILD
index d48de4388e..cdb557a374 100644
--- a/src/main/protobuf/BUILD
+++ b/src/main/protobuf/BUILD
@@ -14,6 +14,7 @@ exports_files(
FILES = [
"action_cache",
+ "action_graph",
"android_deploy_info",
"bazel_flags",
"build",
diff --git a/src/main/protobuf/action_graph.proto b/src/main/protobuf/action_graph.proto
new file mode 100644
index 0000000000..fdb49d79ca
--- /dev/null
+++ b/src/main/protobuf/action_graph.proto
@@ -0,0 +1,157 @@
+// Copyright 2018 The Bazel Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+syntax = "proto3";
+
+package action_graph;
+
+option java_package = "com.google.devtools.build.lib.actions";
+option java_outer_classname = "ActionGraphProtos";
+
+// Container for the action graph properties.
+message ActionGraphContainer {
+ repeated Artifact artifacts = 1;
+ repeated Action actions = 2;
+ repeated Target targets = 3;
+ repeated DepSetOfFiles dep_set_of_files = 4;
+ repeated Configuration configuration = 5;
+ repeated AspectDescriptor aspect_descriptors = 6;
+ repeated RuleClass rule_classes = 7;
+}
+
+// Represents a single artifact, whether it's a source file or a derived output
+// file.
+message Artifact {
+ // Identifier for this artifact; this is an opaque string, only valid for this
+ // particular dump of the action graph.
+ string id = 1;
+
+ // The relative path of the file within the execution root.
+ string exec_path = 2;
+
+ // True iff the artifact is a tree artifact, i.e. the above exec_path refers
+ // a directory.
+ bool is_tree_artifact = 3;
+}
+
+// Represents a single action, which is a function from Artifact(s) to
+// Artifact(s).
+message Action {
+ // The target that was responsible for the creation of the action.
+ string target_id = 1;
+
+ // The aspects that were responsible for the creation of the action (if any).
+ repeated string aspect_descriptor_ids = 2;
+
+ // Encodes all significant behavior that might affect the output. The key
+ // must change if the work performed by the execution of this action changes.
+ // Note that the key doesn't include checksums of the input files.
+ string action_key = 3;
+
+ // The mnemonic for this kind of action.
+ string mnemonic = 4;
+
+ // The configuration under which this action is executed.
+ string configuration_id = 5;
+
+ // The command line arguments of the action. This will be only set if
+ // explicitly requested.
+ repeated string arguments = 6;
+
+ // The list of environment variables to be set before executing the command.
+ repeated KeyValuePair environment_variables = 7;
+
+ // The set of input dep sets that the action depends upon. If the action does
+ // input discovery, the contents of this set might change during execution.
+ repeated string input_dep_set_ids = 8;
+
+ // The list of Artifact IDs that represent the output files that this action
+ // will generate.
+ repeated string output_ids = 9;
+
+ // True iff the action does input discovery during execution.
+ bool discovers_inputs = 10;
+}
+
+// Represents a single target (without configuration information) that is
+// associated with an action.
+message Target {
+ // Identifier for this target; this is an opaque string, only valid for this
+ // particular dump of the action graph.
+ string id = 1;
+
+ // Label of the target, e.g. //foo:bar.
+ string label = 2;
+
+ // Class of the rule.
+ string rule_class_id = 3;
+}
+
+message RuleClass {
+ // Identifier for this rule class; this is an opaque string, only valid for
+ // this particular dump of the action graph.
+ string id = 1;
+
+ // Name of the rule class, e.g. cc_library.
+ string name = 2;
+}
+
+// Represents an invocation specific descriptor of an aspect.
+message AspectDescriptor {
+ // Identifier for this aspect descriptor; this is an opaque string, only valid
+ // for the particular dump of the action graph.
+ string id = 1;
+
+ // The name of the corresponding aspect. For native aspects, it's the Java
+ // class name, for Skylark aspects it's the bzl file followed by a % sign
+ // followed by the name of the aspect.
+ string name = 2;
+
+ // The list of parameters bound to a particular invocation of that aspect on
+ // a target. Note that aspects can be executed multiple times on the same
+ // target in different order.
+ repeated KeyValuePair parameters = 3;
+}
+
+message DepSetOfFiles {
+ // Identifier for this named set of files; this is an opaque string, only
+ // valid for the particular dump of the action graph.
+ string id = 1;
+
+ // Other transitively included named set of files.
+ repeated string transitive_dep_set_ids = 2;
+
+ // The list of input artifact IDs that are immediately contained in this set.
+ repeated string direct_artifact_ids = 3;
+}
+
+message Configuration {
+ // Identifier for this configuration; this is an opaque string, only valid for
+ // the particular dump of the action graph.
+ string id = 1;
+
+ // The mnemonic representing the build configuration.
+ string mnemonic = 2;
+
+ // The platform string.
+ string platform_name = 3;
+}
+
+message KeyValuePair {
+ // The variable name.
+ string key = 1;
+
+ // The variable value.
+ string value = 2;
+}