Make GetDirectDep implementation match comment

The comment on the interface of GetDirectDep states if there are
multiple deps with different tags, the first will be returned; however,
the current behavior is to panic if there are multiple deps. The
behavior now:
* a single dep, return the module and tag
* a single module with different tags: return module with first tag
* multiple modules: panic
* no module: return nil, nil

Bug: 186488405
Test: ~/aosp/build/bazel/ci/bp2build.sh
Test: m nothing
Change-Id: Id1e7315e7874b4a683ad7357ed2793822315821f
This commit is contained in:
Liz Kammer
2021-04-26 15:47:28 -04:00
parent c860588763
commit 2b50ce669c
3 changed files with 62 additions and 8 deletions

View File

@@ -181,7 +181,8 @@ var (
"libc_nopthread", // ruperts@, cc_library_static, depends on //external/arm-optimized-routine
// Things that transitively depend on //system/libbase. libbase doesn't work because:
// "Multiple dependencies having same BaseModuleName() "fmtlib" found from "libbase""
// fmtlib: fatal error: 'cassert' file not found
// libbase: no such target '//build/bazel/platforms/os:darwin': target 'darwin' not declared
"libbionic_spawn_benchmark", // ruperts@, cc_library_static, depends on libbase, libgoogle-benchmark
"libc_malloc_debug", // ruperts@, cc_library_static, depends on libbase
"libc_malloc_debug_backtrace", // ruperts@, cc_library_static, depends on libbase