hedronvision / bazel-compile-commands-extractor

Goal: Enable awesome tooling for Bazel users of the C language family.
Other
659 stars 109 forks source link

protobufs not working in clangd #171

Closed phaedon closed 6 months ago

phaedon commented 6 months ago

When I run: bazel run @hedron_compile_commands//:refresh_all --keep_going I get a long list of errors similar to those pasted below, and then in vscode when hovering over the protobuf header: In included file: 'google/protobuf/port_def.inc' file not foundclang(pp_file_not_found)

bazel-out/k8-fastbuild/bin/proto/ifc.pb.h:13:2: error: #error "This file was generated by a newer version of protoc which is"
   13 | #error "This file was generated by a newer version of protoc which is"
      |  ^~~~~
bazel-out/k8-fastbuild/bin/proto/ifc.pb.h:14:2: error: #error "incompatible with your Protocol Buffer headers. Please update"
   14 | #error "incompatible with your Protocol Buffer headers. Please update"
      |  ^~~~~
bazel-out/k8-fastbuild/bin/proto/ifc.pb.h:15:2: error: #error "your headers."
   15 | #error "your headers."
      |  ^~~~~

protoc --version: libprotoc 3.20.3

Current version of protobuf library via bzlmod: bazel_dep(name = "protobuf", version = "23.1", repo_name = "com_google_protobuf")

phaedon commented 6 months ago

conda uninstall libprotobuf solved it -- I had apparently installed protoc locally in a conda environment. Closing out this issue.