Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

create a new & improved bazel integration #20

Open
shrouxm opened this issue Oct 19, 2020 · 2 comments
Open

create a new & improved bazel integration #20

shrouxm opened this issue Oct 19, 2020 · 2 comments

Comments

@shrouxm
Copy link
Contributor

shrouxm commented Oct 19, 2020

The current tool for generating compile_commands for a bazel project (https://github.com/grailbio/bazel-compilation-database) mostly works but is often quite involved to get working (some users had to submit patches). No one is blocked on this right now, but long term we should write a replacement.

@shrouxm shrouxm added this to the Backlog milestone Oct 19, 2020
@jlisee
Copy link
Contributor

jlisee commented Jun 27, 2022

It would be really great if we could run the tool as a Bazel aspect (great guide here), which basically runs the tool alongside the normal C++ build. You already have to do this to make the compile_commands.json, so this would cut out the middle man, and allow for distributed indexing of large C++ repositories.

The core feature needed is being able to run on each source file separately, produce an artifact for that file, then combine them into a final index file in a post process gather step.

@kkpattern
Copy link

Run lsif-clang as a bazel aspect can potentially save a lot of time when processing a large project, utilizing the remote cache support of bazel. Just like bazel_clang_tidy. There is one problem with this method. Cares need to be taken to correctly assemble the compile flags in an aspect implementation. For example, bazel_clang_tidy only takes care of C++ source code. We have to modify it to support C and Objective-C code in our project. bazel-compile-commands-extractor use action query to get the correct compile flags. So far I think it's the best bazel tool to generate a compilation database. But it can't help with lsif-clang processing large projects so I think aspect is still worthy of investigation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants