twerth | 1d8ad1a | 2018-02-22 04:25:09 -0800 | [diff] [blame] | 1 | // Copyright 2018 The Bazel Authors. All rights reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | syntax = "proto3"; |
| 16 | |
twerth | 586ef00 | 2018-02-22 10:07:49 -0800 | [diff] [blame] | 17 | package analysis; |
twerth | 1d8ad1a | 2018-02-22 04:25:09 -0800 | [diff] [blame] | 18 | |
twerth | 586ef00 | 2018-02-22 10:07:49 -0800 | [diff] [blame] | 19 | option java_package = "com.google.devtools.build.lib.analysis"; |
| 20 | option java_outer_classname = "AnalysisProtos"; |
twerth | 1d8ad1a | 2018-02-22 04:25:09 -0800 | [diff] [blame] | 21 | |
juliexxia | 87cd8d6 | 2018-04-03 08:56:37 -0700 | [diff] [blame] | 22 | import "src/main/protobuf/build.proto"; |
| 23 | |
twerth | 1d8ad1a | 2018-02-22 04:25:09 -0800 | [diff] [blame] | 24 | // Container for the action graph properties. |
| 25 | message ActionGraphContainer { |
| 26 | repeated Artifact artifacts = 1; |
| 27 | repeated Action actions = 2; |
| 28 | repeated Target targets = 3; |
| 29 | repeated DepSetOfFiles dep_set_of_files = 4; |
| 30 | repeated Configuration configuration = 5; |
| 31 | repeated AspectDescriptor aspect_descriptors = 6; |
| 32 | repeated RuleClass rule_classes = 7; |
| 33 | } |
| 34 | |
| 35 | // Represents a single artifact, whether it's a source file or a derived output |
| 36 | // file. |
| 37 | message Artifact { |
| 38 | // Identifier for this artifact; this is an opaque string, only valid for this |
twerth | 586ef00 | 2018-02-22 10:07:49 -0800 | [diff] [blame] | 39 | // particular dump of the analysis. |
twerth | 1d8ad1a | 2018-02-22 04:25:09 -0800 | [diff] [blame] | 40 | string id = 1; |
| 41 | |
| 42 | // The relative path of the file within the execution root. |
| 43 | string exec_path = 2; |
| 44 | |
| 45 | // True iff the artifact is a tree artifact, i.e. the above exec_path refers |
| 46 | // a directory. |
| 47 | bool is_tree_artifact = 3; |
| 48 | } |
| 49 | |
| 50 | // Represents a single action, which is a function from Artifact(s) to |
| 51 | // Artifact(s). |
| 52 | message Action { |
| 53 | // The target that was responsible for the creation of the action. |
| 54 | string target_id = 1; |
| 55 | |
| 56 | // The aspects that were responsible for the creation of the action (if any). |
leba | ed99017 | 2019-01-23 07:49:26 -0800 | [diff] [blame] | 57 | // In the case of aspect-on-aspect, AspectDescriptors are listed in |
| 58 | // topological order of the dependency graph. |
| 59 | // e.g. [A, B] would imply that aspect A is applied on top of aspect B. |
twerth | 1d8ad1a | 2018-02-22 04:25:09 -0800 | [diff] [blame] | 60 | repeated string aspect_descriptor_ids = 2; |
| 61 | |
| 62 | // Encodes all significant behavior that might affect the output. The key |
| 63 | // must change if the work performed by the execution of this action changes. |
| 64 | // Note that the key doesn't include checksums of the input files. |
| 65 | string action_key = 3; |
| 66 | |
| 67 | // The mnemonic for this kind of action. |
| 68 | string mnemonic = 4; |
| 69 | |
| 70 | // The configuration under which this action is executed. |
| 71 | string configuration_id = 5; |
| 72 | |
| 73 | // The command line arguments of the action. This will be only set if |
| 74 | // explicitly requested. |
| 75 | repeated string arguments = 6; |
| 76 | |
| 77 | // The list of environment variables to be set before executing the command. |
| 78 | repeated KeyValuePair environment_variables = 7; |
| 79 | |
| 80 | // The set of input dep sets that the action depends upon. If the action does |
| 81 | // input discovery, the contents of this set might change during execution. |
| 82 | repeated string input_dep_set_ids = 8; |
| 83 | |
| 84 | // The list of Artifact IDs that represent the output files that this action |
| 85 | // will generate. |
| 86 | repeated string output_ids = 9; |
| 87 | |
| 88 | // True iff the action does input discovery during execution. |
| 89 | bool discovers_inputs = 10; |
Googler | 38673e8 | 2018-08-27 10:57:34 -0700 | [diff] [blame] | 90 | |
| 91 | // Execution info for the action. Remote execution services may use this |
| 92 | // information to modify the execution environment, but actions will |
| 93 | // generally not be aware of it. |
| 94 | repeated KeyValuePair execution_info = 11; |
leba | 9a3582d | 2019-01-14 13:15:59 -0800 | [diff] [blame] | 95 | |
| 96 | // The list of param files. This will be only set if explicitly requested. |
| 97 | repeated ParamFile param_files = 12; |
twerth | 1d8ad1a | 2018-02-22 04:25:09 -0800 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | // Represents a single target (without configuration information) that is |
| 101 | // associated with an action. |
| 102 | message Target { |
| 103 | // Identifier for this target; this is an opaque string, only valid for this |
twerth | 586ef00 | 2018-02-22 10:07:49 -0800 | [diff] [blame] | 104 | // particular dump of the analysis. |
twerth | 1d8ad1a | 2018-02-22 04:25:09 -0800 | [diff] [blame] | 105 | string id = 1; |
| 106 | |
| 107 | // Label of the target, e.g. //foo:bar. |
| 108 | string label = 2; |
| 109 | |
| 110 | // Class of the rule. |
| 111 | string rule_class_id = 3; |
| 112 | } |
| 113 | |
| 114 | message RuleClass { |
| 115 | // Identifier for this rule class; this is an opaque string, only valid for |
twerth | 586ef00 | 2018-02-22 10:07:49 -0800 | [diff] [blame] | 116 | // this particular dump of the analysis. |
twerth | 1d8ad1a | 2018-02-22 04:25:09 -0800 | [diff] [blame] | 117 | string id = 1; |
| 118 | |
| 119 | // Name of the rule class, e.g. cc_library. |
| 120 | string name = 2; |
| 121 | } |
| 122 | |
| 123 | // Represents an invocation specific descriptor of an aspect. |
| 124 | message AspectDescriptor { |
| 125 | // Identifier for this aspect descriptor; this is an opaque string, only valid |
twerth | 586ef00 | 2018-02-22 10:07:49 -0800 | [diff] [blame] | 126 | // for the particular dump of the analysis. |
twerth | 1d8ad1a | 2018-02-22 04:25:09 -0800 | [diff] [blame] | 127 | string id = 1; |
| 128 | |
| 129 | // The name of the corresponding aspect. For native aspects, it's the Java |
| 130 | // class name, for Skylark aspects it's the bzl file followed by a % sign |
| 131 | // followed by the name of the aspect. |
| 132 | string name = 2; |
| 133 | |
| 134 | // The list of parameters bound to a particular invocation of that aspect on |
| 135 | // a target. Note that aspects can be executed multiple times on the same |
| 136 | // target in different order. |
| 137 | repeated KeyValuePair parameters = 3; |
| 138 | } |
| 139 | |
| 140 | message DepSetOfFiles { |
| 141 | // Identifier for this named set of files; this is an opaque string, only |
twerth | 586ef00 | 2018-02-22 10:07:49 -0800 | [diff] [blame] | 142 | // valid for the particular dump of the analysis. |
twerth | 1d8ad1a | 2018-02-22 04:25:09 -0800 | [diff] [blame] | 143 | string id = 1; |
| 144 | |
| 145 | // Other transitively included named set of files. |
| 146 | repeated string transitive_dep_set_ids = 2; |
| 147 | |
| 148 | // The list of input artifact IDs that are immediately contained in this set. |
| 149 | repeated string direct_artifact_ids = 3; |
| 150 | } |
| 151 | |
| 152 | message Configuration { |
| 153 | // Identifier for this configuration; this is an opaque string, only valid for |
twerth | 586ef00 | 2018-02-22 10:07:49 -0800 | [diff] [blame] | 154 | // the particular dump of the analysis. |
twerth | 1d8ad1a | 2018-02-22 04:25:09 -0800 | [diff] [blame] | 155 | string id = 1; |
| 156 | |
| 157 | // The mnemonic representing the build configuration. |
| 158 | string mnemonic = 2; |
| 159 | |
| 160 | // The platform string. |
| 161 | string platform_name = 3; |
juliexxia | 87cd8d6 | 2018-04-03 08:56:37 -0700 | [diff] [blame] | 162 | |
| 163 | // The checksum representation of the configuration options; |
| 164 | string checksum = 4; |
twerth | 1d8ad1a | 2018-02-22 04:25:09 -0800 | [diff] [blame] | 165 | } |
| 166 | |
| 167 | message KeyValuePair { |
| 168 | // The variable name. |
| 169 | string key = 1; |
| 170 | |
| 171 | // The variable value. |
| 172 | string value = 2; |
| 173 | } |
juliexxia | 87cd8d6 | 2018-04-03 08:56:37 -0700 | [diff] [blame] | 174 | |
| 175 | message ConfiguredTarget { |
| 176 | // The target. We use blaze_query.Target defined in build.proto instead of |
| 177 | // the Target defined in this file because blaze_query.Target is much heavier |
| 178 | // and will output proto results similar to what users are familiar with from |
| 179 | // regular blaze query. |
| 180 | blaze_query.Target target = 1; |
| 181 | |
| 182 | // The configuration |
| 183 | Configuration configuration = 2; |
| 184 | } |
| 185 | |
| 186 | // Container for cquery results |
| 187 | message CqueryResult { |
| 188 | // All the configuredtargets returns by cquery |
| 189 | repeated ConfiguredTarget results = 1; |
| 190 | } |
leba | 9a3582d | 2019-01-14 13:15:59 -0800 | [diff] [blame] | 191 | |
| 192 | // Content of a param file. |
| 193 | message ParamFile { |
| 194 | // The exec path of the param file artifact. |
| 195 | string exec_path = 1; |
| 196 | |
| 197 | // The arguments in the param file. |
| 198 | // Each argument corresponds to a line in the param file. |
| 199 | repeated string arguments = 2; |
| 200 | } |