kleaf: support ddk_library in compile_commands.json
Currently, ddk_library targets explicitly skip compdb generation,
and kernel_module does not propagate CompileCommandsInfo from
dependencies (which are represented as KernelModuleDepInfo structs
in kernel_module_deps).
This change:
1. Removes internal_compdb = "skip" from ddk_library.
2. Adds the compile_commands.json target to the generated Makefiles
for libraries, allowing Kbuild to generate the commands.
3. Adds compile_commands_info field to KernelModuleDepInfo to
propagate this information from libraries to modules that depend on
them.
4. Updates kernel_module implementation to collect these transitive
compile commands from both legacy targets and DDK dependency
structs.
This ensures that running kernel_compile_commands on a module will
correctly include compile commands for its dependent libraries.
Bug: 394411899
Test: tools/bazel run //build/kernel/kleaf/tests/ddk_examples/ddk_library:mymod_compile_commands
Test: tools/bazel run //build/kernel/kleaf/tests/integration_test -- DdkWorkspaceSetupTest.test_compile_commands_reachable
Assisted-by: Antigravity:Gemini
Change-Id: I2c0f3c7ed88840c5616a2089e447760fe2006adf
11 files changed