blob: b46248f9fc48e99c42f5a067c7e5bd46fa31a132 [file] [log] [blame]
Liz Kammer2b8004b2021-10-04 13:55:44 -04001// Copyright 2021 Google Inc. 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
15package bp2build
16
17import (
18 "android/soong/android"
19 "android/soong/cc"
Liz Kammere6583482021-10-19 13:56:10 -040020 "android/soong/genrule"
Liz Kammer2b8004b2021-10-04 13:55:44 -040021 "fmt"
22 "strings"
23 "testing"
24)
25
26const (
Liz Kammer12615db2021-09-28 09:19:17 -040027 ccBinaryTypePlaceHolder = "{rule_name}"
Liz Kammer2b8004b2021-10-04 13:55:44 -040028)
29
Liz Kammer78cfdaa2021-11-08 12:56:31 -050030type testBazelTarget struct {
31 typ string
32 name string
33 attrs attrNameToString
34}
35
36func generateBazelTargetsForTest(targets []testBazelTarget) []string {
37 ret := make([]string, 0, len(targets))
38 for _, t := range targets {
39 ret = append(ret, makeBazelTarget(t.typ, t.name, t.attrs))
40 }
41 return ret
42}
43
44type ccBinaryBp2buildTestCase struct {
45 description string
46 blueprint string
47 targets []testBazelTarget
48}
49
Liz Kammer2b8004b2021-10-04 13:55:44 -040050func registerCcBinaryModuleTypes(ctx android.RegistrationContext) {
51 cc.RegisterCCBuildComponents(ctx)
52 ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
53 ctx.RegisterModuleType("cc_library_static", cc.LibraryStaticFactory)
54 ctx.RegisterModuleType("cc_library", cc.LibraryFactory)
Liz Kammere6583482021-10-19 13:56:10 -040055 ctx.RegisterModuleType("genrule", genrule.GenRuleFactory)
Liz Kammer2b8004b2021-10-04 13:55:44 -040056}
57
Liz Kammer78cfdaa2021-11-08 12:56:31 -050058var binaryReplacer = strings.NewReplacer(ccBinaryTypePlaceHolder, "cc_binary")
59var hostBinaryReplacer = strings.NewReplacer(ccBinaryTypePlaceHolder, "cc_binary_host")
Liz Kammer2b8004b2021-10-04 13:55:44 -040060
Liz Kammer78cfdaa2021-11-08 12:56:31 -050061func runCcBinaryTests(t *testing.T, tc ccBinaryBp2buildTestCase) {
Liz Kammer2b8004b2021-10-04 13:55:44 -040062 t.Helper()
63 runCcBinaryTestCase(t, tc)
64 runCcHostBinaryTestCase(t, tc)
65}
66
Liz Kammer78cfdaa2021-11-08 12:56:31 -050067func runCcBinaryTestCase(t *testing.T, tc ccBinaryBp2buildTestCase) {
Liz Kammer2b8004b2021-10-04 13:55:44 -040068 t.Helper()
Liz Kammer78cfdaa2021-11-08 12:56:31 -050069 moduleTypeUnderTest := "cc_binary"
70 testCase := bp2buildTestCase{
71 expectedBazelTargets: generateBazelTargetsForTest(tc.targets),
72 moduleTypeUnderTest: moduleTypeUnderTest,
73 moduleTypeUnderTestFactory: cc.BinaryFactory,
74 moduleTypeUnderTestBp2BuildMutator: cc.BinaryBp2build,
75 description: fmt.Sprintf("%s %s", moduleTypeUnderTest, tc.description),
76 blueprint: binaryReplacer.Replace(tc.blueprint),
Liz Kammer2b8004b2021-10-04 13:55:44 -040077 }
78 t.Run(testCase.description, func(t *testing.T) {
79 runBp2BuildTestCase(t, registerCcBinaryModuleTypes, testCase)
80 })
81}
82
Liz Kammer78cfdaa2021-11-08 12:56:31 -050083func runCcHostBinaryTestCase(t *testing.T, tc ccBinaryBp2buildTestCase) {
Liz Kammer2b8004b2021-10-04 13:55:44 -040084 t.Helper()
85 testCase := tc
Liz Kammer12615db2021-09-28 09:19:17 -040086 for i, tar := range testCase.targets {
87 if tar.typ != "cc_binary" {
88 continue
89 }
90 tar.attrs["target_compatible_with"] = `select({
Liz Kammer78cfdaa2021-11-08 12:56:31 -050091 "//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
92 "//conditions:default": [],
93 })`
Liz Kammer12615db2021-09-28 09:19:17 -040094 testCase.targets[i] = tar
Liz Kammer2b8004b2021-10-04 13:55:44 -040095 }
Liz Kammer78cfdaa2021-11-08 12:56:31 -050096 moduleTypeUnderTest := "cc_binary_host"
Liz Kammer2b8004b2021-10-04 13:55:44 -040097 t.Run(testCase.description, func(t *testing.T) {
Liz Kammer78cfdaa2021-11-08 12:56:31 -050098 runBp2BuildTestCase(t, registerCcBinaryModuleTypes, bp2buildTestCase{
99 expectedBazelTargets: generateBazelTargetsForTest(testCase.targets),
100 moduleTypeUnderTest: moduleTypeUnderTest,
101 moduleTypeUnderTestFactory: cc.BinaryHostFactory,
102 moduleTypeUnderTestBp2BuildMutator: cc.BinaryHostBp2build,
103 description: fmt.Sprintf("%s %s", moduleTypeUnderTest, tc.description),
104 blueprint: hostBinaryReplacer.Replace(testCase.blueprint),
105 })
Liz Kammer2b8004b2021-10-04 13:55:44 -0400106 })
107}
108
109func TestBasicCcBinary(t *testing.T) {
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500110 runCcBinaryTests(t, ccBinaryBp2buildTestCase{
Liz Kammer2b8004b2021-10-04 13:55:44 -0400111 description: "basic -- properties -> attrs with little/no transformation",
112 blueprint: `
113{rule_name} {
114 name: "foo",
115 srcs: ["a.cc"],
116 local_include_dirs: ["dir"],
117 include_dirs: ["absolute_dir"],
118 cflags: ["-Dcopt"],
119 cppflags: ["-Dcppflag"],
120 conlyflags: ["-Dconlyflag"],
121 asflags: ["-Dasflag"],
122 ldflags: ["ld-flag"],
123 rtti: true,
124 strip: {
125 all: true,
126 keep_symbols: true,
127 keep_symbols_and_debug_frame: true,
128 keep_symbols_list: ["symbol"],
129 none: true,
130 },
131}
132`,
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500133 targets: []testBazelTarget{
134 {"cc_binary", "foo", attrNameToString{
135 "absolute_includes": `["absolute_dir"]`,
136 "asflags": `["-Dasflag"]`,
137 "conlyflags": `["-Dconlyflag"]`,
138 "copts": `["-Dcopt"]`,
139 "cppflags": `["-Dcppflag"]`,
140 "linkopts": `["ld-flag"]`,
141 "local_includes": `[
Liz Kammer2b8004b2021-10-04 13:55:44 -0400142 "dir",
143 ".",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500144 ]`,
145 "rtti": `True`,
146 "srcs": `["a.cc"]`,
147 "strip": `{
Liz Kammer2b8004b2021-10-04 13:55:44 -0400148 "all": True,
149 "keep_symbols": True,
150 "keep_symbols_and_debug_frame": True,
151 "keep_symbols_list": ["symbol"],
152 "none": True,
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500153 }`,
154 },
155 },
156 },
Liz Kammer2b8004b2021-10-04 13:55:44 -0400157 })
158}
159
160func TestCcBinaryWithSharedLdflagDisableFeature(t *testing.T) {
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500161 runCcBinaryTests(t, ccBinaryBp2buildTestCase{
Liz Kammer2b8004b2021-10-04 13:55:44 -0400162 description: `ldflag "-shared" disables static_flag feature`,
163 blueprint: `
164{rule_name} {
165 name: "foo",
166 ldflags: ["-shared"],
167 include_build_directory: false,
168}
169`,
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500170 targets: []testBazelTarget{
171 {"cc_binary", "foo", attrNameToString{
172 "features": `["-static_flag"]`,
173 "linkopts": `["-shared"]`,
174 },
175 },
176 },
Liz Kammer2b8004b2021-10-04 13:55:44 -0400177 })
178}
179
180func TestCcBinaryWithLinkStatic(t *testing.T) {
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500181 runCcBinaryTests(t, ccBinaryBp2buildTestCase{
Liz Kammer2b8004b2021-10-04 13:55:44 -0400182 description: "link static",
183 blueprint: `
184{rule_name} {
185 name: "foo",
186 static_executable: true,
187 include_build_directory: false,
188}
189`,
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500190 targets: []testBazelTarget{
191 {"cc_binary", "foo", attrNameToString{
192 "linkshared": `False`,
193 },
194 },
195 },
Liz Kammer2b8004b2021-10-04 13:55:44 -0400196 })
197}
198
199func TestCcBinaryVersionScript(t *testing.T) {
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500200 runCcBinaryTests(t, ccBinaryBp2buildTestCase{
Liz Kammer2b8004b2021-10-04 13:55:44 -0400201 description: `version script`,
202 blueprint: `
203{rule_name} {
204 name: "foo",
205 include_build_directory: false,
206 version_script: "vs",
207}
208`,
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500209 targets: []testBazelTarget{
210 {"cc_binary", "foo", attrNameToString{
211 "additional_linker_inputs": `["vs"]`,
212 "linkopts": `["-Wl,--version-script,$(location vs)"]`,
213 },
214 },
215 },
Liz Kammer2b8004b2021-10-04 13:55:44 -0400216 })
217}
218
219func TestCcBinarySplitSrcsByLang(t *testing.T) {
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500220 runCcHostBinaryTestCase(t, ccBinaryBp2buildTestCase{
Liz Kammer2b8004b2021-10-04 13:55:44 -0400221 description: "split srcs by lang",
222 blueprint: `
223{rule_name} {
224 name: "foo",
225 srcs: [
226 "asonly.S",
227 "conly.c",
228 "cpponly.cpp",
229 ":fg_foo",
230 ],
231 include_build_directory: false,
232}
233` + simpleModuleDoNotConvertBp2build("filegroup", "fg_foo"),
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500234 targets: []testBazelTarget{
235 {"cc_binary", "foo", attrNameToString{
236 "srcs": `[
Liz Kammer2b8004b2021-10-04 13:55:44 -0400237 "cpponly.cpp",
238 ":fg_foo_cpp_srcs",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500239 ]`,
240 "srcs_as": `[
Liz Kammer2b8004b2021-10-04 13:55:44 -0400241 "asonly.S",
242 ":fg_foo_as_srcs",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500243 ]`,
244 "srcs_c": `[
Liz Kammer2b8004b2021-10-04 13:55:44 -0400245 "conly.c",
246 ":fg_foo_c_srcs",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500247 ]`,
248 },
249 },
250 },
Liz Kammer2b8004b2021-10-04 13:55:44 -0400251 })
252}
253
254func TestCcBinaryDoNotDistinguishBetweenDepsAndImplementationDeps(t *testing.T) {
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500255 runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
Liz Kammer2b8004b2021-10-04 13:55:44 -0400256 description: "no implementation deps",
257 blueprint: `
Liz Kammere6583482021-10-19 13:56:10 -0400258genrule {
259 name: "generated_hdr",
260 cmd: "nothing to see here",
261}
262
263genrule {
264 name: "export_generated_hdr",
265 cmd: "nothing to see here",
266}
267
Liz Kammer2b8004b2021-10-04 13:55:44 -0400268{rule_name} {
269 name: "foo",
Liz Kammere6583482021-10-19 13:56:10 -0400270 srcs: ["foo.cpp"],
Liz Kammer2b8004b2021-10-04 13:55:44 -0400271 shared_libs: ["implementation_shared_dep", "shared_dep"],
272 export_shared_lib_headers: ["shared_dep"],
273 static_libs: ["implementation_static_dep", "static_dep"],
274 export_static_lib_headers: ["static_dep", "whole_static_dep"],
275 whole_static_libs: ["not_explicitly_exported_whole_static_dep", "whole_static_dep"],
276 include_build_directory: false,
Liz Kammere6583482021-10-19 13:56:10 -0400277 generated_headers: ["generated_hdr", "export_generated_hdr"],
278 export_generated_headers: ["export_generated_hdr"],
Liz Kammer2b8004b2021-10-04 13:55:44 -0400279}
280` +
281 simpleModuleDoNotConvertBp2build("cc_library_static", "static_dep") +
282 simpleModuleDoNotConvertBp2build("cc_library_static", "implementation_static_dep") +
283 simpleModuleDoNotConvertBp2build("cc_library_static", "whole_static_dep") +
284 simpleModuleDoNotConvertBp2build("cc_library_static", "not_explicitly_exported_whole_static_dep") +
285 simpleModuleDoNotConvertBp2build("cc_library", "shared_dep") +
286 simpleModuleDoNotConvertBp2build("cc_library", "implementation_shared_dep"),
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500287 targets: []testBazelTarget{
288 {"cc_binary", "foo", attrNameToString{
289 "deps": `[
Liz Kammer2b8004b2021-10-04 13:55:44 -0400290 ":implementation_static_dep",
291 ":static_dep",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500292 ]`,
293 "dynamic_deps": `[
Liz Kammer2b8004b2021-10-04 13:55:44 -0400294 ":implementation_shared_dep",
295 ":shared_dep",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500296 ]`,
297 "srcs": `[
Liz Kammere6583482021-10-19 13:56:10 -0400298 "foo.cpp",
299 ":generated_hdr",
300 ":export_generated_hdr",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500301 ]`,
302 "whole_archive_deps": `[
Liz Kammer2b8004b2021-10-04 13:55:44 -0400303 ":not_explicitly_exported_whole_static_dep",
304 ":whole_static_dep",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500305 ]`,
Liz Kammer1263d9b2021-12-10 14:28:20 -0500306 "local_includes": `["."]`,
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500307 },
308 },
309 },
Liz Kammer2b8004b2021-10-04 13:55:44 -0400310 })
311}
312
313func TestCcBinaryNocrtTests(t *testing.T) {
314 baseTestCases := []struct {
315 description string
316 soongProperty string
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500317 bazelAttr attrNameToString
Liz Kammer2b8004b2021-10-04 13:55:44 -0400318 }{
319 {
320 description: "nocrt: true",
321 soongProperty: `nocrt: true,`,
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500322 bazelAttr: attrNameToString{"link_crt": `False`},
Liz Kammer2b8004b2021-10-04 13:55:44 -0400323 },
324 {
325 description: "nocrt: false",
326 soongProperty: `nocrt: false,`,
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500327 bazelAttr: attrNameToString{},
Liz Kammer2b8004b2021-10-04 13:55:44 -0400328 },
329 {
330 description: "nocrt: not set",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500331 bazelAttr: attrNameToString{},
Liz Kammer2b8004b2021-10-04 13:55:44 -0400332 },
333 }
334
335 baseBlueprint := `{rule_name} {
336 name: "foo",%s
337 include_build_directory: false,
338}
339`
340
Liz Kammer2b8004b2021-10-04 13:55:44 -0400341 for _, btc := range baseTestCases {
342 prop := btc.soongProperty
343 if len(prop) > 0 {
344 prop = "\n" + prop
345 }
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500346 runCcBinaryTests(t, ccBinaryBp2buildTestCase{
Liz Kammer2b8004b2021-10-04 13:55:44 -0400347 description: btc.description,
348 blueprint: fmt.Sprintf(baseBlueprint, prop),
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500349 targets: []testBazelTarget{
350 {"cc_binary", "foo", btc.bazelAttr},
Liz Kammer2b8004b2021-10-04 13:55:44 -0400351 },
352 })
353 }
354}
355
356func TestCcBinaryNo_libcrtTests(t *testing.T) {
357 baseTestCases := []struct {
358 description string
359 soongProperty string
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500360 bazelAttr attrNameToString
Liz Kammer2b8004b2021-10-04 13:55:44 -0400361 }{
362 {
363 description: "no_libcrt: true",
364 soongProperty: `no_libcrt: true,`,
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500365 bazelAttr: attrNameToString{"use_libcrt": `False`},
Liz Kammer2b8004b2021-10-04 13:55:44 -0400366 },
367 {
368 description: "no_libcrt: false",
369 soongProperty: `no_libcrt: false,`,
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500370 bazelAttr: attrNameToString{"use_libcrt": `True`},
Liz Kammer2b8004b2021-10-04 13:55:44 -0400371 },
372 {
373 description: "no_libcrt: not set",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500374 bazelAttr: attrNameToString{},
Liz Kammer2b8004b2021-10-04 13:55:44 -0400375 },
376 }
377
378 baseBlueprint := `{rule_name} {
379 name: "foo",%s
380 include_build_directory: false,
381}
382`
383
Liz Kammer2b8004b2021-10-04 13:55:44 -0400384 for _, btc := range baseTestCases {
385 prop := btc.soongProperty
386 if len(prop) > 0 {
387 prop = "\n" + prop
388 }
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500389 runCcBinaryTests(t, ccBinaryBp2buildTestCase{
Liz Kammer2b8004b2021-10-04 13:55:44 -0400390 description: btc.description,
391 blueprint: fmt.Sprintf(baseBlueprint, prop),
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500392 targets: []testBazelTarget{
393 {"cc_binary", "foo", btc.bazelAttr},
Liz Kammer2b8004b2021-10-04 13:55:44 -0400394 },
395 })
396 }
397}
398
399func TestCcBinaryPropertiesToFeatures(t *testing.T) {
400 baseTestCases := []struct {
401 description string
402 soongProperty string
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500403 bazelAttr attrNameToString
Liz Kammer2b8004b2021-10-04 13:55:44 -0400404 }{
405 {
406 description: "pack_relocation: true",
407 soongProperty: `pack_relocations: true,`,
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500408 bazelAttr: attrNameToString{},
Liz Kammer2b8004b2021-10-04 13:55:44 -0400409 },
410 {
411 description: "pack_relocations: false",
412 soongProperty: `pack_relocations: false,`,
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500413 bazelAttr: attrNameToString{"features": `["disable_pack_relocations"]`},
Liz Kammer2b8004b2021-10-04 13:55:44 -0400414 },
415 {
416 description: "pack_relocations: not set",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500417 bazelAttr: attrNameToString{},
Liz Kammer2b8004b2021-10-04 13:55:44 -0400418 },
419 {
420 description: "pack_relocation: true",
421 soongProperty: `allow_undefined_symbols: true,`,
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500422 bazelAttr: attrNameToString{"features": `["-no_undefined_symbols"]`},
Liz Kammer2b8004b2021-10-04 13:55:44 -0400423 },
424 {
425 description: "allow_undefined_symbols: false",
426 soongProperty: `allow_undefined_symbols: false,`,
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500427 bazelAttr: attrNameToString{},
Liz Kammer2b8004b2021-10-04 13:55:44 -0400428 },
429 {
430 description: "allow_undefined_symbols: not set",
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500431 bazelAttr: attrNameToString{},
Liz Kammer2b8004b2021-10-04 13:55:44 -0400432 },
433 }
434
435 baseBlueprint := `{rule_name} {
436 name: "foo",%s
437 include_build_directory: false,
438}
439`
Liz Kammer2b8004b2021-10-04 13:55:44 -0400440 for _, btc := range baseTestCases {
441 prop := btc.soongProperty
442 if len(prop) > 0 {
443 prop = "\n" + prop
444 }
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500445 runCcBinaryTests(t, ccBinaryBp2buildTestCase{
Liz Kammer2b8004b2021-10-04 13:55:44 -0400446 description: btc.description,
447 blueprint: fmt.Sprintf(baseBlueprint, prop),
Liz Kammer78cfdaa2021-11-08 12:56:31 -0500448 targets: []testBazelTarget{
449 {"cc_binary", "foo", btc.bazelAttr},
Liz Kammer2b8004b2021-10-04 13:55:44 -0400450 },
451 })
452 }
453}
Liz Kammer12615db2021-09-28 09:19:17 -0400454
455func TestCcBinarySharedProto(t *testing.T) {
456 runCcBinaryTests(t, ccBinaryBp2buildTestCase{
457 blueprint: soongCcProtoLibraries + `{rule_name} {
458 name: "foo",
459 srcs: ["foo.proto"],
460 proto: {
461 canonical_path_from_root: false,
462 },
463 include_build_directory: false,
464}`,
465 targets: []testBazelTarget{
466 {"proto_library", "foo_proto", attrNameToString{
467 "srcs": `["foo.proto"]`,
468 }}, {"cc_lite_proto_library", "foo_cc_proto_lite", attrNameToString{
469 "deps": `[":foo_proto"]`,
470 }}, {"cc_binary", "foo", attrNameToString{
471 "dynamic_deps": `[":libprotobuf-cpp-lite"]`,
472 "whole_archive_deps": `[":foo_cc_proto_lite"]`,
473 }},
474 },
475 })
476}
477
478func TestCcBinaryStaticProto(t *testing.T) {
479 runCcBinaryTests(t, ccBinaryBp2buildTestCase{
480 blueprint: soongCcProtoLibraries + `{rule_name} {
481 name: "foo",
482 srcs: ["foo.proto"],
483 static_executable: true,
484 proto: {
485 canonical_path_from_root: false,
486 },
487 include_build_directory: false,
488}`,
489 targets: []testBazelTarget{
490 {"proto_library", "foo_proto", attrNameToString{
491 "srcs": `["foo.proto"]`,
492 }}, {"cc_lite_proto_library", "foo_cc_proto_lite", attrNameToString{
493 "deps": `[":foo_proto"]`,
494 }}, {"cc_binary", "foo", attrNameToString{
495 "deps": `[":libprotobuf-cpp-lite"]`,
496 "whole_archive_deps": `[":foo_cc_proto_lite"]`,
497 "linkshared": `False`,
498 }},
499 },
500 })
501}