blob: 2d4755fb5d63289f7acf66e255823a2126e25919 [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 Shuttleworth00960792021-05-12 21:20:13 -0400129 // Keep any existing BUILD files (and do not generate new BUILD files) for these directories
130 bp2buildKeepExistingBuildFile = map[string]bool{
131 // This is actually build/bazel/build.BAZEL symlinked to ./BUILD
132 ".":/*recrusive = */ false,
133
134 "build/bazel":/* recursive = */ true,
135 "build/pesto":/* recursive = */ true,
136
137 // external/bazelbuild-rules_android/... is needed by mixed builds, otherwise mixed builds analysis fails
138 // e.g. ERROR: Analysis of target '@soong_injection//mixed_builds:buildroot' failed
139 "external/bazelbuild-rules_android":/* recursive = */ true,
140
141 "prebuilts/clang/host/linux-x86":/* recursive = */ false,
142 "prebuilts/sdk":/* recursive = */ false,
143 "prebuilts/sdk/tools":/* recursive = */ false,
Rupert Shuttleworth2a4fc3e2021-04-21 07:10:09 -0400144 }
145
Jingwen Chen12b4c272021-03-10 02:05:59 -0500146 // Configure modules in these directories to enable bp2build_available: true or false by default.
147 bp2buildDefaultConfig = Bp2BuildConfig{
148 "bionic": Bp2BuildDefaultTrueRecursively,
Rupert Shuttleworthc143cc52021-04-13 13:08:04 -0400149 "external/gwp_asan": Bp2BuildDefaultTrueRecursively,
Jingwen Chen12b4c272021-03-10 02:05:59 -0500150 "system/core/libcutils": Bp2BuildDefaultTrueRecursively,
Lukacs T. Berki497f17d2021-04-26 12:15:57 +0200151 "system/core/property_service/libpropertyinfoparser": Bp2BuildDefaultTrueRecursively,
Jingwen Chen28288162021-04-28 07:19:54 +0000152 "system/libbase": Bp2BuildDefaultTrueRecursively,
153 "system/logging/liblog": Bp2BuildDefaultTrueRecursively,
Jingwen Chen790324e2021-04-30 08:20:01 +0000154 "external/jemalloc_new": Bp2BuildDefaultTrueRecursively,
155 "external/fmtlib": Bp2BuildDefaultTrueRecursively,
Jingwen Chen28288162021-04-28 07:19:54 +0000156 "external/arm-optimized-routines": Bp2BuildDefaultTrueRecursively,
Jingwen Chen75be1ca2021-05-12 05:04:58 +0000157 "external/scudo": Bp2BuildDefaultTrueRecursively,
Jingwen Chen12b4c272021-03-10 02:05:59 -0500158 }
Jingwen Chen5d72cba2021-03-25 09:28:38 +0000159
Chris Parsonsbab4d7e2021-04-15 17:27:08 -0400160 // Per-module denylist to always opt modules out of both bp2build and mixed builds.
Rupert Shuttleworth4f43fe92021-03-30 14:13:16 +0000161 bp2buildModuleDoNotConvertList = []string{
Jingwen Chen28288162021-04-28 07:19:54 +0000162 // Things that transitively depend on unconverted libc_* modules.
Rupert Shuttleworth47aa5842021-04-30 04:04:15 -0400163 "libbionic_spawn_benchmark", // http://b/186824595, cc_library_static, depends on //external/google-benchmark (http://b/186822740)
164 // also depends on //system/logging/liblog:liblog (http://b/186822772)
165
166 "libc_malloc_debug", // http://b/186824339, cc_library_static, depends on //system/libbase:libbase (http://b/186823646)
167 "libc_malloc_debug_backtrace", // http://b/186824112, cc_library_static, depends on //external/libcxxabi:libc++demangle (http://b/186823773)
168
169 "libcutils", // http://b/186827426, cc_library, depends on //system/core/libprocessgroup:libprocessgroup_headers (http://b/186826841)
170 "libcutils_sockets", // http://b/186826853, cc_library, depends on //system/libbase:libbase (http://b/186826479)
171
172 "liblinker_debuggerd_stub", // http://b/186824327, cc_library_static, depends on //external/zlib:libz (http://b/186823782)
173 // also depends on //system/libziparchive:libziparchive (http://b/186823656)
174 // also depends on //system/logging/liblog:liblog (http://b/186822772)
175 "liblinker_main", // http://b/186825989, cc_library_static, depends on //external/zlib:libz (http://b/186823782)
176 // also depends on //system/libziparchive:libziparchive (http://b/186823656)
177 // also depends on//system/logging/liblog:liblog (http://b/186822772)
178 "liblinker_malloc", // http://b/186826466, cc_library_static, depends on //external/zlib:libz (http://b/186823782)
179 // also depends on //system/libziparchive:libziparchive (http://b/186823656)
180 // also depends on //system/logging/liblog:liblog (http://b/186822772)
Jingwen Chen53542922021-05-18 09:01:49 +0000181 "libc_ndk", // http://b/187013218, cc_library_static, depends on //bionic/libm:libm (http://b/183064661)
182 "libc", // http://b/183064430, cc_library, depends on //external/jemalloc_new:libjemalloc5 (http://b/186828626)
183 "libc_malloc_hooks", // http://b/187016307, cc_library, ld.lld: error: undefined symbol: __malloc_hook
184 "libm", // http://b/183064661, cc_library, math.h:25:16: error: unexpected token in argument list
Lukacs T. Berkib5ac5af2021-04-27 11:02:11 +0200185
Jingwen Chen790324e2021-04-30 08:20:01 +0000186 // http://b/186823769: Needs C++ STL support, includes from unconverted standard libraries in //external/libcxx
187 // c++_static
Rupert Shuttleworthfb955382021-05-03 04:32:36 -0400188 "libbase_ndk", // http://b/186826477, cc_library, no such target '//build/bazel/platforms/os:darwin' when --platforms //build/bazel/platforms:android_x86 is added
Jingwen Chen790324e2021-04-30 08:20:01 +0000189 // libcxx
190 "libBionicBenchmarksUtils", // cc_library_static, fatal error: 'map' file not found, from libcxx
191 "fmtlib", // cc_library_static, fatal error: 'cassert' file not found, from libcxx
Rupert Shuttleworth00960792021-05-12 21:20:13 -0400192 "fmtlib_ndk", // cc_library_static, fatal error: 'cassert' file not found
Jingwen Chen790324e2021-04-30 08:20:01 +0000193 "libbase", // http://b/186826479, cc_library, fatal error: 'memory' file not found, from libcxx
Lukacs T. Berkib5ac5af2021-04-27 11:02:11 +0200194
Jingwen Chen790324e2021-04-30 08:20:01 +0000195 // http://b/186024507: Includes errors because of the system_shared_libs default value.
196 // Missing -isystem bionic/libc/include through the libc/libm/libdl
197 // default dependencies if system_shared_libs is unset.
198 "liblog", // http://b/186822772: cc_library, 'sys/cdefs.h' file not found
199 "libjemalloc5_jet", // cc_library, 'sys/cdefs.h' file not found
200 "libseccomp_policy", // http://b/186476753: cc_library, 'linux/filter.h' not found
201 "note_memtag_heap_async", // http://b/185127353: cc_library_static, error: feature.h not found
202 "note_memtag_heap_sync", // http://b/185127353: cc_library_static, error: feature.h not found
Lukacs T. Berkib5ac5af2021-04-27 11:02:11 +0200203
Rupert Shuttleworth00960792021-05-12 21:20:13 -0400204 "gwp_asan_crash_handler", // cc_library, ld.lld: error: undefined symbol: memset
205
Jingwen Chen790324e2021-04-30 08:20:01 +0000206 // Tests. Handle later.
207 "libbionic_tests_headers_posix", // http://b/186024507, cc_library_static, sched.h, time.h not found
208 "libjemalloc5_integrationtest",
209 "libjemalloc5_stresstestlib",
210 "libjemalloc5_unittest",
Chris Parsonsbab4d7e2021-04-15 17:27:08 -0400211 }
Rupert Shuttleworthc143cc52021-04-13 13:08:04 -0400212
Jingwen Chen179856a2021-05-03 09:15:48 +0000213 // Per-module denylist of cc_library modules to only generate the static
214 // variant if their shared variant isn't ready or buildable by Bazel.
215 bp2buildCcLibraryStaticOnlyList = []string{
Jingwen Chen53542922021-05-18 09:01:49 +0000216 "libstdc++", // http://b/186822597, cc_library, ld.lld: error: undefined symbol: __errno
217 "libjemalloc5", // http://b/188503688, cc_library, `target: { android: { enabled: false } }` for android targets.
Jingwen Chen179856a2021-05-03 09:15:48 +0000218 }
219
Chris Parsonsbab4d7e2021-04-15 17:27:08 -0400220 // Per-module denylist to opt modules out of mixed builds. Such modules will
221 // still be generated via bp2build.
222 mixedBuildsDisabledList = []string{
Chris Parsonsc4fb1332021-05-18 12:31:25 -0400223 "libc_bionic_ndk", // cparsons@ cc_library_static, depends on //bionic/libc:libsystemproperties
Chris Parsons484e50a2021-05-13 15:13:04 -0400224 "libc_common", // cparsons@ cc_library_static, depends on //bionic/libc:libc_nopthread
225 "libc_common_static", // cparsons@ cc_library_static, depends on //bionic/libc:libc_common
226 "libc_common_shared", // cparsons@ cc_library_static, depends on //bionic/libc:libc_common
Jingwen Chen28288162021-04-28 07:19:54 +0000227 "libc_netbsd", // lberki@, cc_library_static, version script assignment of 'LIBC_PRIVATE' to symbol 'SHA1Final' failed: symbol not defined
Chris Parsons484e50a2021-05-13 15:13:04 -0400228 "libc_nopthread", // cparsons@ cc_library_static, depends on //bionic/libc:libc_bionic_ndk
Jingwen Chen28288162021-04-28 07:19:54 +0000229 "libc_openbsd", // ruperts@, cc_library_static, OK for bp2build but error: duplicate symbol: strcpy for mixed builds
230 "libsystemproperties", // cparsons@, cc_library_static, wrong include paths
231 "libpropertyinfoparser", // cparsons@, cc_library_static, wrong include paths
232 "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)
Rupert Shuttleworth52e66722021-05-03 09:59:38 -0400233 "fmtlib_ndk", // http://b/187040371, cc_library_static, OK for bp2build but format-inl.h:11:10: fatal error: 'cassert' file not found for mixed builds
Jingwen Chen17e18c72021-05-20 10:57:58 +0000234 "libc_nomalloc", // cc_library_static, OK for bp2build but ld.lld: error: undefined symbol: pthread_mutex_lock (and others)
235 }
Rupert Shuttleworth4f43fe92021-03-30 14:13:16 +0000236
237 // Used for quicker lookups
Rupert Shuttleworth2a4fc3e2021-04-21 07:10:09 -0400238 bp2buildModuleDoNotConvert = map[string]bool{}
Jingwen Chen179856a2021-05-03 09:15:48 +0000239 bp2buildCcLibraryStaticOnly = map[string]bool{}
Rupert Shuttleworth2a4fc3e2021-04-21 07:10:09 -0400240 mixedBuildsDisabled = map[string]bool{}
Jingwen Chen12b4c272021-03-10 02:05:59 -0500241)
242
Rupert Shuttleworth4f43fe92021-03-30 14:13:16 +0000243func init() {
244 for _, moduleName := range bp2buildModuleDoNotConvertList {
245 bp2buildModuleDoNotConvert[moduleName] = true
246 }
Chris Parsonsbab4d7e2021-04-15 17:27:08 -0400247
Jingwen Chen179856a2021-05-03 09:15:48 +0000248 for _, moduleName := range bp2buildCcLibraryStaticOnlyList {
249 bp2buildCcLibraryStaticOnly[moduleName] = true
250 }
251
Chris Parsonsbab4d7e2021-04-15 17:27:08 -0400252 for _, moduleName := range mixedBuildsDisabledList {
253 mixedBuildsDisabled[moduleName] = true
254 }
255}
256
Jingwen Chen179856a2021-05-03 09:15:48 +0000257func GenerateCcLibraryStaticOnly(ctx BazelConversionPathContext) bool {
258 return bp2buildCcLibraryStaticOnly[ctx.Module().Name()]
259}
260
Rupert Shuttleworth00960792021-05-12 21:20:13 -0400261func ShouldKeepExistingBuildFileForDir(dir string) bool {
262 if _, ok := bp2buildKeepExistingBuildFile[dir]; ok {
263 // Exact dir match
Rupert Shuttleworth2a4fc3e2021-04-21 07:10:09 -0400264 return true
265 }
Rupert Shuttleworth00960792021-05-12 21:20:13 -0400266 // Check if subtree match
267 for prefix, recursive := range bp2buildKeepExistingBuildFile {
268 if recursive {
269 if strings.HasPrefix(dir, prefix+"/") {
270 return true
271 }
272 }
273 }
274 // Default
275 return false
Rupert Shuttleworth2a4fc3e2021-04-21 07:10:09 -0400276}
277
Chris Parsonsbab4d7e2021-04-15 17:27:08 -0400278// MixedBuildsEnabled checks that a module is ready to be replaced by a
279// converted or handcrafted Bazel target.
280func (b *BazelModuleBase) MixedBuildsEnabled(ctx BazelConversionPathContext) bool {
281 if !ctx.Config().BazelContext.BazelEnabled() {
282 return false
283 }
284 if len(b.GetBazelLabel(ctx, ctx.Module())) == 0 {
285 return false
286 }
Jingwen Chen179856a2021-05-03 09:15:48 +0000287 if GenerateCcLibraryStaticOnly(ctx) {
288 // Don't use partially-converted cc_library targets in mixed builds,
289 // since mixed builds would generally rely on both static and shared
290 // variants of a cc_library.
291 return false
292 }
Chris Parsonsbab4d7e2021-04-15 17:27:08 -0400293 return !mixedBuildsDisabled[ctx.Module().Name()]
Rupert Shuttleworth4f43fe92021-03-30 14:13:16 +0000294}
295
Liz Kammerea6666f2021-02-17 10:17:28 -0500296// ConvertWithBp2build returns whether the given BazelModuleBase should be converted with bp2build.
Jingwen Chen12b4c272021-03-10 02:05:59 -0500297func (b *BazelModuleBase) ConvertWithBp2build(ctx BazelConversionPathContext) bool {
Jingwen Chen5d72cba2021-03-25 09:28:38 +0000298 if bp2buildModuleDoNotConvert[ctx.Module().Name()] {
299 return false
300 }
301
Jingwen Chen12b4c272021-03-10 02:05:59 -0500302 // Ensure that the module type of this module has a bp2build converter. This
303 // prevents mixed builds from using auto-converted modules just by matching
304 // the package dir; it also has to have a bp2build mutator as well.
305 if ctx.Config().bp2buildModuleTypeConfig[ctx.ModuleType()] == false {
306 return false
307 }
308
309 packagePath := ctx.ModuleDir()
310 config := ctx.Config().bp2buildPackageConfig
311
312 // This is a tristate value: true, false, or unset.
313 propValue := b.bazelProperties.Bazel_module.Bp2build_available
314 if bp2buildDefaultTrueRecursively(packagePath, config) {
315 // Allow modules to explicitly opt-out.
316 return proptools.BoolDefault(propValue, true)
317 }
318
319 // Allow modules to explicitly opt-in.
320 return proptools.BoolDefault(propValue, false)
321}
322
323// bp2buildDefaultTrueRecursively checks that the package contains a prefix from the
324// set of package prefixes where all modules must be converted. That is, if the
325// package is x/y/z, and the list contains either x, x/y, or x/y/z, this function will
326// return true.
327//
328// However, if the package is x/y, and it matches a Bp2BuildDefaultFalse "x/y" entry
329// exactly, this module will return false early.
330//
331// This function will also return false if the package doesn't match anything in
332// the config.
333func bp2buildDefaultTrueRecursively(packagePath string, config Bp2BuildConfig) bool {
334 ret := false
335
Jingwen Chen91220d72021-03-24 02:18:33 -0400336 // Return exact matches in the config.
337 if config[packagePath] == Bp2BuildDefaultTrueRecursively {
338 return true
339 }
Jingwen Chen12b4c272021-03-10 02:05:59 -0500340 if config[packagePath] == Bp2BuildDefaultFalse {
341 return false
342 }
343
Jingwen Chen91220d72021-03-24 02:18:33 -0400344 // If not, check for the config recursively.
Jingwen Chen12b4c272021-03-10 02:05:59 -0500345 packagePrefix := ""
346 // e.g. for x/y/z, iterate over x, x/y, then x/y/z, taking the final value from the allowlist.
347 for _, part := range strings.Split(packagePath, "/") {
348 packagePrefix += part
349 if config[packagePrefix] == Bp2BuildDefaultTrueRecursively {
350 // package contains this prefix and this prefix should convert all modules
351 return true
352 }
353 // Continue to the next part of the package dir.
354 packagePrefix += "/"
355 }
356
357 return ret
Liz Kammerea6666f2021-02-17 10:17:28 -0500358}
Liz Kammerba3ea162021-02-17 13:22:03 -0500359
360// GetBazelBuildFileContents returns the file contents of a hand-crafted BUILD file if available or
361// an error if there are errors reading the file.
362// TODO(b/181575318): currently we append the whole BUILD file, let's change that to do
363// something more targeted based on the rule type and target.
364func (b *BazelModuleBase) GetBazelBuildFileContents(c Config, path, name string) (string, error) {
Liz Kammerbdc60992021-02-24 16:55:11 -0500365 if !strings.Contains(b.HandcraftedLabel(), path) {
366 return "", fmt.Errorf("%q not found in bazel_module.label %q", path, b.HandcraftedLabel())
Liz Kammerba3ea162021-02-17 13:22:03 -0500367 }
368 name = filepath.Join(path, name)
369 f, err := c.fs.Open(name)
370 if err != nil {
371 return "", err
372 }
373 defer f.Close()
374
375 data, err := ioutil.ReadAll(f)
376 if err != nil {
377 return "", err
378 }
379 return string(data[:]), nil
380}
Liz Kammerbdc60992021-02-24 16:55:11 -0500381
382// ConvertedToBazel returns whether this module has been converted to Bazel, whether automatically
383// or manually
Jingwen Chen12b4c272021-03-10 02:05:59 -0500384func (b *BazelModuleBase) ConvertedToBazel(ctx BazelConversionPathContext) bool {
385 return b.ConvertWithBp2build(ctx) || b.HasHandcraftedLabel()
Liz Kammerbdc60992021-02-24 16:55:11 -0500386}