[clangd-dev] [llvm-dev] Network RPCs in LLVM projects

James Y Knight via clangd-dev clangd-dev at lists.llvm.org
Fri Dec 13 13:09:13 PST 2019


On Fri, Dec 13, 2019 at 2:12 PM Chris Bieneman via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

>
>
> On Dec 12, 2019, at 5:58 AM, Sam McCall via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
> Short version: clangd would like to be able to build a client+server that
> can make RPCs across the internet. An RPC system isn't a trivial dependency
> and rolling our own from scratch isn't appealing.
> Have other projects had a need for this? Any advice on how to approach
> such dependencies?
>
> --
>
> Longer: clangd (a language server, like an IDE backend) builds an index of
> the project you're working on in order to answer queries (go to definition,
> code completion...). This takes *lots* of CPU-time to build, and RAM to
> serve.
> For large codebases with many developers, sharing an index across users
> <https://llvm.discourse.group/t/sharing-indexes-for-multiple-users/202>
> is a better approach - you spend the CPU in one place, you spend the RAM in
> a few places, and an RPC is fast enough even for code completion. We have
> experience with this approach inside Google.
>
> We'd like to build this index server upstream (just a shell around
> clangd's current index code) and put the client in clangd. For open-source
> projects, I imagine the server being publicly accessible over the internet.
> This means we care about
>  - latency (this is interactive, every 10ms counts)
>  - security
>  - proxy traversal, probably
>  - sensible behavior under load
>  - auth is probably nice-to-have
>
> I don't think this is something we want to build from scratch, I hear
> portable networking is hard :-)
>
>
> It really isn't that bad. Just as a note, LLDB does have portable socket
> communication already, so it could be a refactor and reuse exercise rather
> than building from scratch.
>

It sounds as if the clangd index server is supposed to work across the open
internet, which effectively means it needs to speak HTTPS. That's not
really something that you can just write.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/clangd-dev/attachments/20191213/e6710cb9/attachment.html>


More information about the clangd-dev mailing list