blob: 81ef57869f26ee67cc9530a16e3b12be2ab1938a [file] [log] [blame]
Liz Kammerea6666f2021-02-17 10:17:28 -05001// 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 android
16
Liz Kammerba3ea162021-02-17 13:22:03 -050017import (
18 "fmt"
19 "io/ioutil"
20 "path/filepath"
21 "strings"
22
Liz Kammerbdc60992021-02-24 16:55:11 -050023 "github.com/google/blueprint"
Liz Kammerba3ea162021-02-17 13:22:03 -050024 "github.com/google/blueprint/proptools"
25)
26
27type bazelModuleProperties struct {
28 // The label of the Bazel target replacing this Soong module. When run in conversion mode, this
29 // will import the handcrafted build target into the autogenerated file. Note: this may result in
30 // a conflict due to duplicate targets if bp2build_available is also set.
31 Label *string
32
33 // If true, bp2build will generate the converted Bazel target for this module. Note: this may
34 // cause a conflict due to the duplicate targets if label is also set.
Jingwen Chen12b4c272021-03-10 02:05:59 -050035 //
36 // This is a bool pointer to support tristates: true, false, not set.
37 //
38 // To opt-in a module, set bazel_module: { bp2build_available: true }
39 // To opt-out a module, set bazel_module: { bp2build_available: false }
40 // To defer the default setting for the directory, do not set the value.
41 Bp2build_available *bool
Liz Kammerba3ea162021-02-17 13:22:03 -050042}
43
44// Properties contains common module properties for Bazel migration purposes.
45type properties struct {
46 // In USE_BAZEL_ANALYSIS=1 mode, this represents the Bazel target replacing
47 // this Soong module.
48 Bazel_module bazelModuleProperties
49}
Liz Kammerea6666f2021-02-17 10:17:28 -050050
51// BazelModuleBase contains the property structs with metadata for modules which can be converted to
52// Bazel.
53type BazelModuleBase struct {
Liz Kammerba3ea162021-02-17 13:22:03 -050054 bazelProperties properties
Liz Kammerea6666f2021-02-17 10:17:28 -050055}
56
57// Bazelable is specifies the interface for modules that can be converted to Bazel.
58type Bazelable interface {
Liz Kammerba3ea162021-02-17 13:22:03 -050059 bazelProps() *properties
60 HasHandcraftedLabel() bool
Liz Kammerbdc60992021-02-24 16:55:11 -050061 HandcraftedLabel() string
62 GetBazelLabel(ctx BazelConversionPathContext, module blueprint.Module) string
Jingwen Chen12b4c272021-03-10 02:05:59 -050063 ConvertWithBp2build(ctx BazelConversionPathContext) bool
Liz Kammerba3ea162021-02-17 13:22:03 -050064 GetBazelBuildFileContents(c Config, path, name string) (string, error)
Jingwen Chen12b4c272021-03-10 02:05:59 -050065 ConvertedToBazel(ctx BazelConversionPathContext) bool
Liz Kammerea6666f2021-02-17 10:17:28 -050066}
67
68// BazelModule is a lightweight wrapper interface around Module for Bazel-convertible modules.
69type BazelModule interface {
70 Module
71 Bazelable
72}
73
74// InitBazelModule is a wrapper function that decorates a BazelModule with Bazel-conversion
75// properties.
76func InitBazelModule(module BazelModule) {
77 module.AddProperties(module.bazelProps())
78}
79
80// bazelProps returns the Bazel properties for the given BazelModuleBase.
Liz Kammerba3ea162021-02-17 13:22:03 -050081func (b *BazelModuleBase) bazelProps() *properties {
Liz Kammerea6666f2021-02-17 10:17:28 -050082 return &b.bazelProperties
83}
84
Liz Kammerba3ea162021-02-17 13:22:03 -050085// HasHandcraftedLabel returns whether this module has a handcrafted Bazel label.
86func (b *BazelModuleBase) HasHandcraftedLabel() bool {
87 return b.bazelProperties.Bazel_module.Label != nil
88}
89
90// HandcraftedLabel returns the handcrafted label for this module, or empty string if there is none
91func (b *BazelModuleBase) HandcraftedLabel() string {
92 return proptools.String(b.bazelProperties.Bazel_module.Label)
93}
94
Liz Kammerea6666f2021-02-17 10:17:28 -050095// GetBazelLabel returns the Bazel label for the given BazelModuleBase.
Liz Kammerbdc60992021-02-24 16:55:11 -050096func (b *BazelModuleBase) GetBazelLabel(ctx BazelConversionPathContext, module blueprint.Module) string {
97 if b.HasHandcraftedLabel() {
98 return b.HandcraftedLabel()
99 }
Jingwen Chen12b4c272021-03-10 02:05:59 -0500100 if b.ConvertWithBp2build(ctx) {
Liz Kammerbdc60992021-02-24 16:55:11 -0500101 return bp2buildModuleLabel(ctx, module)
102 }
103 return "" // no label for unconverted module
Liz Kammerea6666f2021-02-17 10:17:28 -0500104}
105
Jingwen Chen12b4c272021-03-10 02:05:59 -0500106// Configuration to decide if modules in a directory should default to true/false for bp2build_available
107type Bp2BuildConfig map[string]BazelConversionConfigEntry
108type BazelConversionConfigEntry int
109
110const (
Jingwen Chen91220d72021-03-24 02:18:33 -0400111 // A sentinel value to be used as a key in Bp2BuildConfig for modules with
112 // no package path. This is also the module dir for top level Android.bp
113 // modules.
114 BP2BUILD_TOPLEVEL = "."
115
Jingwen Chen12b4c272021-03-10 02:05:59 -0500116 // iota + 1 ensures that the int value is not 0 when used in the Bp2buildAllowlist map,
117 // which can also mean that the key doesn't exist in a lookup.
118
119 // all modules in this package and subpackages default to bp2build_available: true.
120 // allows modules to opt-out.
121 Bp2BuildDefaultTrueRecursively BazelConversionConfigEntry = iota + 1
122
123 // all modules in this package (not recursively) default to bp2build_available: false.
124 // allows modules to opt-in.
125 Bp2BuildDefaultFalse
126)
127
128var (
Rupert Shuttleworth2a4fc3e2021-04-21 07:10:09 -0400129 // Do not write BUILD files for these directories
130 // NOTE: this is not recursive
131 bp2buildDoNotWriteBuildFileList = []string{
132 // Don't generate these BUILD files - because external BUILD files already exist
133 "external/boringssl",
134 "external/brotli",
135 "external/dagger2",
136 "external/flatbuffers",
137 "external/gflags",
138 "external/google-fruit",
139 "external/grpc-grpc",
140 "external/grpc-grpc/test/core/util",
141 "external/grpc-grpc/test/cpp/common",
142 "external/grpc-grpc/third_party/address_sorting",
143 "external/nanopb-c",
144 "external/nos/host/generic",
145 "external/nos/host/generic/libnos",
146 "external/nos/host/generic/libnos/generator",
147 "external/nos/host/generic/libnos_datagram",
148 "external/nos/host/generic/libnos_transport",
149 "external/nos/host/generic/nugget/proto",
150 "external/perfetto",
151 "external/protobuf",
152 "external/rust/cxx",
153 "external/rust/cxx/demo",
154 "external/ruy",
155 "external/tensorflow",
156 "external/tensorflow/tensorflow/lite",
157 "external/tensorflow/tensorflow/lite/java",
158 "external/tensorflow/tensorflow/lite/kernels",
159 "external/tflite-support",
160 "external/tinyalsa_new",
161 "external/wycheproof",
162 "external/libyuv",
163 }
164
Jingwen Chen12b4c272021-03-10 02:05:59 -0500165 // Configure modules in these directories to enable bp2build_available: true or false by default.
166 bp2buildDefaultConfig = Bp2BuildConfig{
167 "bionic": Bp2BuildDefaultTrueRecursively,
Rupert Shuttleworthc143cc52021-04-13 13:08:04 -0400168 "external/gwp_asan": Bp2BuildDefaultTrueRecursively,
Jingwen Chen12b4c272021-03-10 02:05:59 -0500169 "system/core/libcutils": Bp2BuildDefaultTrueRecursively,
Lukacs T. Berki497f17d2021-04-26 12:15:57 +0200170 "system/core/property_service/libpropertyinfoparser": Bp2BuildDefaultTrueRecursively,
Jingwen Chen28288162021-04-28 07:19:54 +0000171 "system/libbase": Bp2BuildDefaultTrueRecursively,
172 "system/logging/liblog": Bp2BuildDefaultTrueRecursively,
Jingwen Chen790324e2021-04-30 08:20:01 +0000173 "external/jemalloc_new": Bp2BuildDefaultTrueRecursively,
174 "external/fmtlib": Bp2BuildDefaultTrueRecursively,
Jingwen Chen28288162021-04-28 07:19:54 +0000175 "external/arm-optimized-routines": Bp2BuildDefaultTrueRecursively,
Jingwen Chen12b4c272021-03-10 02:05:59 -0500176 }
Jingwen Chen5d72cba2021-03-25 09:28:38 +0000177
Chris Parsonsbab4d7e2021-04-15 17:27:08 -0400178 // Per-module denylist to always opt modules out of both bp2build and mixed builds.
Rupert Shuttleworth4f43fe92021-03-30 14:13:16 +0000179 bp2buildModuleDoNotConvertList = []string{
Jingwen Chen28288162021-04-28 07:19:54 +0000180 // Things that transitively depend on unconverted libc_* modules.
Rupert Shuttleworth47aa5842021-04-30 04:04:15 -0400181 "libc_nopthread", // http://b/186821550, cc_library_static, depends on //bionic/libc:libc_bionic_ndk (http://b/186822256)
182 // also depends on //bionic/libc:libc_tzcode (http://b/186822591)
183 // also depends on //bionic/libc:libstdc++ (http://b/186822597)
184 "libc_common", // http://b/186821517, cc_library_static, depends on //bionic/libc:libc_nopthread (http://b/186821550)
185 "libc_common_static", // http://b/186824119, cc_library_static, depends on //bionic/libc:libc_common (http://b/186821517)
186 "libc_common_shared", // http://b/186824118, cc_library_static, depends on //bionic/libc:libc_common (http://b/186821517)
187 "libc_nomalloc", // http://b/186825031, cc_library_static, depends on //bionic/libc:libc_common (http://b/186821517)
Jingwen Chen0a92ed72021-04-12 05:37:42 +0000188
Rupert Shuttleworth47aa5842021-04-30 04:04:15 -0400189 "libbionic_spawn_benchmark", // http://b/186824595, cc_library_static, depends on //external/google-benchmark (http://b/186822740)
190 // also depends on //system/logging/liblog:liblog (http://b/186822772)
191
192 "libc_malloc_debug", // http://b/186824339, cc_library_static, depends on //system/libbase:libbase (http://b/186823646)
193 "libc_malloc_debug_backtrace", // http://b/186824112, cc_library_static, depends on //external/libcxxabi:libc++demangle (http://b/186823773)
194
195 "libcutils", // http://b/186827426, cc_library, depends on //system/core/libprocessgroup:libprocessgroup_headers (http://b/186826841)
196 "libcutils_sockets", // http://b/186826853, cc_library, depends on //system/libbase:libbase (http://b/186826479)
197
198 "liblinker_debuggerd_stub", // http://b/186824327, cc_library_static, depends on //external/zlib:libz (http://b/186823782)
199 // also depends on //system/libziparchive:libziparchive (http://b/186823656)
200 // also depends on //system/logging/liblog:liblog (http://b/186822772)
201 "liblinker_main", // http://b/186825989, cc_library_static, depends on //external/zlib:libz (http://b/186823782)
202 // also depends on //system/libziparchive:libziparchive (http://b/186823656)
203 // also depends on//system/logging/liblog:liblog (http://b/186822772)
204 "liblinker_malloc", // http://b/186826466, cc_library_static, depends on //external/zlib:libz (http://b/186823782)
205 // also depends on //system/libziparchive:libziparchive (http://b/186823656)
206 // also depends on //system/logging/liblog:liblog (http://b/186822772)
Jingwen Chen790324e2021-04-30 08:20:01 +0000207 "libc_jemalloc_wrapper", // cc_library_static, depends on //external/jemalloc_new:libjemalloc5
208 "libc_ndk", // cc_library_static, depends on libc_bionic_ndk, libc_jemalloc_wrapper, libc_tzcode, libstdc++
209 // libc: http://b/183064430
210 // cc_library, depends on libc_jemalloc_wrapper (and possibly many others)
211 // Also http://b/186816506: Handle static and shared props
212 // Also http://b/186650430: version_script prop support
213 // Also http://b/186651708: pack_relocations prop support
214 // Also http://b/186576099: multilib props support
215 "libc",
Lukacs T. Berkib5ac5af2021-04-27 11:02:11 +0200216
Jingwen Chen790324e2021-04-30 08:20:01 +0000217 // Compilation or linker error from command line and toolchain inconsistencies.
218 // http://b/186388670: Make Bazel/Ninja command lines more similar.
219 // http://b/186628704: Incorporate Soong's Clang flags into Bazel's toolchains.
220 //
221 "libc_tzcode", // http://b/186822591: cc_library_static, error: expected expression
222 "libjemalloc5", // http://b/186828626: cc_library, ld.lld: error: undefined symbol: memset, __stack_chk_fail, pthread_mutex_trylock..
223 // libc_bionic_ndk, cc_library_static
224 // Error: ISO C++ requires field designators...
225 // Also http://b/186576099: multilib props support
226 // Also http://b/183595873: product_variables support
227 "libc_bionic_ndk",
228 // libc_malloc_hooks, cc_library
229 // Error: undefined symbol: __malloc_hook, __realloc_hook, __free_hook, __memalign_hook, memset, __errno
230 // These symbols are defined in https://cs.android.com/android/platform/superproject/+/master:bionic/libc/bionic/malloc_common.cpp;l=57-60;drc=9cad8424ff7b0fa63b53cb9919eae31539b8561a
231 // Also http://b/186650430: version_script prop support
232 "libc_malloc_hooks",
233 // http://b/186822597, libstdc++, cc_library
234 // Error: undefined symbol: __errno, syscall, async_safe_fatal_no_abort, abort, malloc, free
235 // Also http://b/186024507: depends on libc through system_shared_libraries.
236 // Also http://b/186650430: version_script prop support
237 // Also http://b/186651708: pack_relocations prop support
238 "libstdc++",
239 // http://b/183064661, libm:
240 // cc_library, error: "expected register here" (and many others)
241 // Also http://b/186024507: depends on libc through system_shared_libraries.
242 // Also http://b/186650430: version_script prop support
243 // Also http://b/186651708: pack_relocations prop support
244 // Also http://b/186576099: multilib props support
245 "libm",
Lukacs T. Berkib5ac5af2021-04-27 11:02:11 +0200246
Jingwen Chen790324e2021-04-30 08:20:01 +0000247 // http://b/186823769: Needs C++ STL support, includes from unconverted standard libraries in //external/libcxx
248 // c++_static
249 "fmtlib_ndk", // cc_library, from c++_static
250 "libbase_ndk", // http://b/186826477, cc_library, depends on fmtlib_ndk, which depends on c++_static
251 // libcxx
252 "libBionicBenchmarksUtils", // cc_library_static, fatal error: 'map' file not found, from libcxx
253 "fmtlib", // cc_library_static, fatal error: 'cassert' file not found, from libcxx
254 "libbase", // http://b/186826479, cc_library, fatal error: 'memory' file not found, from libcxx
Lukacs T. Berkib5ac5af2021-04-27 11:02:11 +0200255
Jingwen Chen790324e2021-04-30 08:20:01 +0000256 // http://b/186024507: Includes errors because of the system_shared_libs default value.
257 // Missing -isystem bionic/libc/include through the libc/libm/libdl
258 // default dependencies if system_shared_libs is unset.
259 "liblog", // http://b/186822772: cc_library, 'sys/cdefs.h' file not found
260 "libjemalloc5_jet", // cc_library, 'sys/cdefs.h' file not found
261 "libseccomp_policy", // http://b/186476753: cc_library, 'linux/filter.h' not found
262 "note_memtag_heap_async", // http://b/185127353: cc_library_static, error: feature.h not found
263 "note_memtag_heap_sync", // http://b/185127353: cc_library_static, error: feature.h not found
Lukacs T. Berkib5ac5af2021-04-27 11:02:11 +0200264
Jingwen Chen790324e2021-04-30 08:20:01 +0000265 // Tests. Handle later.
266 "libbionic_tests_headers_posix", // http://b/186024507, cc_library_static, sched.h, time.h not found
267 "libjemalloc5_integrationtest",
268 "libjemalloc5_stresstestlib",
269 "libjemalloc5_unittest",
Chris Parsonsbab4d7e2021-04-15 17:27:08 -0400270 }
Rupert Shuttleworthc143cc52021-04-13 13:08:04 -0400271
Chris Parsonsbab4d7e2021-04-15 17:27:08 -0400272 // Per-module denylist to opt modules out of mixed builds. Such modules will
273 // still be generated via bp2build.
274 mixedBuildsDisabledList = []string{
Jingwen Chen28288162021-04-28 07:19:54 +0000275 "libc_netbsd", // lberki@, cc_library_static, version script assignment of 'LIBC_PRIVATE' to symbol 'SHA1Final' failed: symbol not defined
276 "libc_openbsd", // ruperts@, cc_library_static, OK for bp2build but error: duplicate symbol: strcpy for mixed builds
277 "libsystemproperties", // cparsons@, cc_library_static, wrong include paths
278 "libpropertyinfoparser", // cparsons@, cc_library_static, wrong include paths
279 "libarm-optimized-routines-string", // jingwen@, cc_library_static, OK for bp2build but b/186615213 (asflags not handled in bp2build), version script assignment of 'LIBC' to symbol 'memcmp' failed: symbol not defined (also for memrchr, strnlen)
Jingwen Chen5d72cba2021-03-25 09:28:38 +0000280 }
Rupert Shuttleworth4f43fe92021-03-30 14:13:16 +0000281
282 // Used for quicker lookups
Rupert Shuttleworth2a4fc3e2021-04-21 07:10:09 -0400283 bp2buildDoNotWriteBuildFile = map[string]bool{}
284 bp2buildModuleDoNotConvert = map[string]bool{}
285 mixedBuildsDisabled = map[string]bool{}
Jingwen Chen12b4c272021-03-10 02:05:59 -0500286)
287
Rupert Shuttleworth4f43fe92021-03-30 14:13:16 +0000288func init() {
Rupert Shuttleworth2a4fc3e2021-04-21 07:10:09 -0400289 for _, moduleName := range bp2buildDoNotWriteBuildFileList {
290 bp2buildDoNotWriteBuildFile[moduleName] = true
291 }
292
Rupert Shuttleworth4f43fe92021-03-30 14:13:16 +0000293 for _, moduleName := range bp2buildModuleDoNotConvertList {
294 bp2buildModuleDoNotConvert[moduleName] = true
295 }
Chris Parsonsbab4d7e2021-04-15 17:27:08 -0400296
297 for _, moduleName := range mixedBuildsDisabledList {
298 mixedBuildsDisabled[moduleName] = true
299 }
300}
301
Rupert Shuttleworth2a4fc3e2021-04-21 07:10:09 -0400302func ShouldWriteBuildFileForDir(dir string) bool {
303 if _, ok := bp2buildDoNotWriteBuildFile[dir]; ok {
304 return false
305 } else {
306 return true
307 }
308}
309
Chris Parsonsbab4d7e2021-04-15 17:27:08 -0400310// MixedBuildsEnabled checks that a module is ready to be replaced by a
311// converted or handcrafted Bazel target.
312func (b *BazelModuleBase) MixedBuildsEnabled(ctx BazelConversionPathContext) bool {
313 if !ctx.Config().BazelContext.BazelEnabled() {
314 return false
315 }
316 if len(b.GetBazelLabel(ctx, ctx.Module())) == 0 {
317 return false
318 }
319 return !mixedBuildsDisabled[ctx.Module().Name()]
Rupert Shuttleworth4f43fe92021-03-30 14:13:16 +0000320}
321
Liz Kammerea6666f2021-02-17 10:17:28 -0500322// ConvertWithBp2build returns whether the given BazelModuleBase should be converted with bp2build.
Jingwen Chen12b4c272021-03-10 02:05:59 -0500323func (b *BazelModuleBase) ConvertWithBp2build(ctx BazelConversionPathContext) bool {
Jingwen Chen5d72cba2021-03-25 09:28:38 +0000324 if bp2buildModuleDoNotConvert[ctx.Module().Name()] {
325 return false
326 }
327
Jingwen Chen12b4c272021-03-10 02:05:59 -0500328 // Ensure that the module type of this module has a bp2build converter. This
329 // prevents mixed builds from using auto-converted modules just by matching
330 // the package dir; it also has to have a bp2build mutator as well.
331 if ctx.Config().bp2buildModuleTypeConfig[ctx.ModuleType()] == false {
332 return false
333 }
334
335 packagePath := ctx.ModuleDir()
336 config := ctx.Config().bp2buildPackageConfig
337
338 // This is a tristate value: true, false, or unset.
339 propValue := b.bazelProperties.Bazel_module.Bp2build_available
340 if bp2buildDefaultTrueRecursively(packagePath, config) {
341 // Allow modules to explicitly opt-out.
342 return proptools.BoolDefault(propValue, true)
343 }
344
345 // Allow modules to explicitly opt-in.
346 return proptools.BoolDefault(propValue, false)
347}
348
349// bp2buildDefaultTrueRecursively checks that the package contains a prefix from the
350// set of package prefixes where all modules must be converted. That is, if the
351// package is x/y/z, and the list contains either x, x/y, or x/y/z, this function will
352// return true.
353//
354// However, if the package is x/y, and it matches a Bp2BuildDefaultFalse "x/y" entry
355// exactly, this module will return false early.
356//
357// This function will also return false if the package doesn't match anything in
358// the config.
359func bp2buildDefaultTrueRecursively(packagePath string, config Bp2BuildConfig) bool {
360 ret := false
361
Jingwen Chen91220d72021-03-24 02:18:33 -0400362 // Return exact matches in the config.
363 if config[packagePath] == Bp2BuildDefaultTrueRecursively {
364 return true
365 }
Jingwen Chen12b4c272021-03-10 02:05:59 -0500366 if config[packagePath] == Bp2BuildDefaultFalse {
367 return false
368 }
369
Jingwen Chen91220d72021-03-24 02:18:33 -0400370 // If not, check for the config recursively.
Jingwen Chen12b4c272021-03-10 02:05:59 -0500371 packagePrefix := ""
372 // e.g. for x/y/z, iterate over x, x/y, then x/y/z, taking the final value from the allowlist.
373 for _, part := range strings.Split(packagePath, "/") {
374 packagePrefix += part
375 if config[packagePrefix] == Bp2BuildDefaultTrueRecursively {
376 // package contains this prefix and this prefix should convert all modules
377 return true
378 }
379 // Continue to the next part of the package dir.
380 packagePrefix += "/"
381 }
382
383 return ret
Liz Kammerea6666f2021-02-17 10:17:28 -0500384}
Liz Kammerba3ea162021-02-17 13:22:03 -0500385
386// GetBazelBuildFileContents returns the file contents of a hand-crafted BUILD file if available or
387// an error if there are errors reading the file.
388// TODO(b/181575318): currently we append the whole BUILD file, let's change that to do
389// something more targeted based on the rule type and target.
390func (b *BazelModuleBase) GetBazelBuildFileContents(c Config, path, name string) (string, error) {
Liz Kammerbdc60992021-02-24 16:55:11 -0500391 if !strings.Contains(b.HandcraftedLabel(), path) {
392 return "", fmt.Errorf("%q not found in bazel_module.label %q", path, b.HandcraftedLabel())
Liz Kammerba3ea162021-02-17 13:22:03 -0500393 }
394 name = filepath.Join(path, name)
395 f, err := c.fs.Open(name)
396 if err != nil {
397 return "", err
398 }
399 defer f.Close()
400
401 data, err := ioutil.ReadAll(f)
402 if err != nil {
403 return "", err
404 }
405 return string(data[:]), nil
406}
Liz Kammerbdc60992021-02-24 16:55:11 -0500407
408// ConvertedToBazel returns whether this module has been converted to Bazel, whether automatically
409// or manually
Jingwen Chen12b4c272021-03-10 02:05:59 -0500410func (b *BazelModuleBase) ConvertedToBazel(ctx BazelConversionPathContext) bool {
411 return b.ConvertWithBp2build(ctx) || b.HasHandcraftedLabel()
Liz Kammerbdc60992021-02-24 16:55:11 -0500412}