Merge "Store the bp2build module opt-out list as a list instead of a map."

This commit is contained in:
Rupert Shuttleworth
2021-03-30 22:04:21 +00:00
committed by Gerrit Code Review

View File

@@ -129,49 +129,59 @@ var (
} }
// Per-module denylist to always opt modules out. // Per-module denylist to always opt modules out.
bp2buildModuleDoNotConvert = map[string]bool{
"libBionicBenchmarksUtils": true, bp2buildModuleDoNotConvertList = []string{
"libbionic_spawn_benchmark": true, "libBionicBenchmarksUtils",
"libc_jemalloc_wrapper": true, "libbionic_spawn_benchmark",
"libc_bootstrap": true, "libc_jemalloc_wrapper",
"libc_init_static": true, "libc_bootstrap",
"libc_init_dynamic": true, "libc_init_static",
"libc_tzcode": true, "libc_init_dynamic",
"libc_freebsd": true, "libc_tzcode",
"libc_freebsd_large_stack": true, "libc_freebsd",
"libc_netbsd": true, "libc_freebsd_large_stack",
"libc_openbsd_ndk": true, "libc_netbsd",
"libc_openbsd_large_stack": true, "libc_openbsd_ndk",
"libc_openbsd": true, "libc_openbsd_large_stack",
"libc_gdtoa": true, "libc_openbsd",
"libc_fortify": true, "libc_gdtoa",
"libc_bionic": true, "libc_fortify",
"libc_bionic_ndk": true, "libc_bionic",
"libc_bionic_systrace": true, "libc_bionic_ndk",
"libc_pthread": true, "libc_bionic_systrace",
"libc_syscalls": true, "libc_pthread",
"libc_aeabi": true, "libc_syscalls",
"libc_ndk": true, "libc_aeabi",
"libc_nopthread": true, "libc_ndk",
"libc_common": true, "libc_nopthread",
"libc_static_dispatch": true, "libc_common",
"libc_dynamic_dispatch": true, "libc_static_dispatch",
"libc_common_static": true, "libc_dynamic_dispatch",
"libc_common_shared": true, "libc_common_static",
"libc_unwind_static": true, "libc_common_shared",
"libc_nomalloc": true, "libc_unwind_static",
"libasync_safe": true, "libc_nomalloc",
"libc_malloc_debug_backtrace": true, "libasync_safe",
"libsystemproperties": true, "libc_malloc_debug_backtrace",
"libdl_static": true, "libsystemproperties",
"liblinker_main": true, "libdl_static",
"liblinker_malloc": true, "liblinker_main",
"liblinker_debuggerd_stub": true, "liblinker_malloc",
"libbionic_tests_headers_posix": true, "liblinker_debuggerd_stub",
"libc_dns": true, "libbionic_tests_headers_posix",
"libc_dns",
} }
// Used for quicker lookups
bp2buildModuleDoNotConvert = map[string]bool{}
) )
func init() {
for _, moduleName := range bp2buildModuleDoNotConvertList {
bp2buildModuleDoNotConvert[moduleName] = true
}
}
// ConvertWithBp2build returns whether the given BazelModuleBase should be converted with bp2build. // ConvertWithBp2build returns whether the given BazelModuleBase should be converted with bp2build.
func (b *BazelModuleBase) ConvertWithBp2build(ctx BazelConversionPathContext) bool { func (b *BazelModuleBase) ConvertWithBp2build(ctx BazelConversionPathContext) bool {
if bp2buildModuleDoNotConvert[ctx.Module().Name()] { if bp2buildModuleDoNotConvert[ctx.Module().Name()] {