aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/protobuf/analysis.proto
blob: 017df322506de0fa944dfb1143a8677a8853ccd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
// 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 analysis;

option java_package = "com.google.devtools.build.lib.analysis";
option java_outer_classname = "AnalysisProtos";

import "src/main/protobuf/build.proto";

// 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 analysis.
  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 analysis.
  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 analysis.
  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 analysis.
  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 analysis.
  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 analysis.
  string id = 1;

  // The mnemonic representing the build configuration.
  string mnemonic = 2;

  // The platform string.
  string platform_name = 3;

  // The checksum representation of the configuration options;
  string checksum = 4;
}

message KeyValuePair {
  // The variable name.
  string key = 1;

  // The variable value.
  string value = 2;
}

message ConfiguredTarget {
  // The target. We use blaze_query.Target defined in build.proto instead of
  // the Target defined in this file because blaze_query.Target is much heavier
  // and will output proto results similar to what users are familiar with from
  // regular blaze query.
  blaze_query.Target target = 1;

  // The configuration
  Configuration configuration = 2;
}

// Container for cquery results
message CqueryResult {
  // All the configuredtargets returns by cquery
  repeated ConfiguredTarget results = 1;
}