stackb / bazel-stack-vscode-cc

C/C++ Support For Bazel Stack VSCode Extension
Apache License 2.0
31 stars 7 forks source link

Generation fails for more than one target #11

Closed themarwhal closed 2 years ago

themarwhal commented 2 years ago

Our current configuration for github.com/magma/magma is like this with 1 binary target.

        "bsv.bazel.buildFlags": [
        ],
        "bsv.bazel.testFlags": [
        ],
        "bsv.bes.enabled": false,
        "bsv.bzl.codesearch.enabled": false,
        "bsv.bzl.invocation.buildEventPublishAllActions": false,
        "bsv.bzl.invocation.enabled": false,
        "bsv.bzl.invocation.invokeWithBuildEventStreaming": false,
        "bsv.bzl.lsp.enableCodelensStarlarkDebug": false,
        "bsv.bzl.lsp.enableCodelensRun": false,
        "bsv.bzl.remoteCache.enabled": false,
        "bsv.bzl.starlarkDebugger.enabled": false,
        // Update this field with any new targets that need compilation database generation
        "bsv.cc.compdb.targets": [
            "//lte/gateway/c/session_manager:sessiond",
        ]

This works great as expected, but if I add another binary, I end up with an empty compile_commands.json, with not too much error to go off of.

This is the modified config that fails:

        "bsv.cc.compdb.targets": [
            "//lte/gateway/c/session_manager:sessiond",
                        "//lte/gateway/c/connection_tracker/src:main",
        ]

gist of output I see: https://gist.github.com/themarwhal/b27527151f7a6732f91eb1cd3ebe9ad1

Not sure if there could be an error message somewhere else though.

Thanks!

djfm commented 2 years ago

I have the exact same issue, glad to see I'm not alone I have been fiddling with my configuration for hours now!

wannesvanloock commented 2 years ago

I'm also experiencing the same issue.

lucabergamini commented 2 years ago

Same, the only workaround is to do it for each target independently and cat everything together.

@pcj can we expect a fix for this anytime soon?

wannesvanloock commented 2 years ago

I started looking into the issue. It appears that the build event json file has a slightly different structure and I managed to get it running with some minor changes to postprocess.py. I'll create a PR soon.

pcj commented 2 years ago

Just seeing this, @wannesvanloock thanks for looking into it.

pcj commented 2 years ago

Version 1.2.0 published to marketplace with bugfix #13.