forkpkgs codesearch #88

Open
opened 2024-08-01 13:23:04 +00:00 by janik · 7 comments
Owner

We want a code search as web interface for nixpkgs and potentially more projects, so developers can easily find code and reference it using a link.

A few months ago, source graph would have been basically the no-brainer solution, but they switched to a closed source license.

We have a few options here:

@jade suggested we could ask source graph to sponsor us a license. I personally would prefer to go with a FOSS solution to reduce our reliance on third parties.

TODO:

  • Decide on a codesarch solution
  • package/deploy it
  • integrate it with forkpkgs
We want a code search as web interface for nixpkgs and potentially more projects, so developers can easily find code and reference it using a link. A few months ago, source graph would have been basically the no-brainer solution, but they switched to a closed source license. We have a few options here: - https://github.com/livegrep/livegrep - https://oracle.github.io/opengrok/ - https://searchfox.org/ @jade suggested we could ask source graph to sponsor us a license. I personally would prefer to go with a FOSS solution to reduce our reliance on third parties. TODO: - [ ] Decide on a codesarch solution - [ ] package/deploy it - [ ] integrate it with forkpkgs
Owner

i think most likely the only viable option of that list is searchfox. the others do not have precise code intelligence support which should be a non starter. ctags on web is just so silly.

i think most likely the only viable option of that list is searchfox. the others do not have precise code intelligence support which should be a non starter. ctags on web is just *so* silly.
Owner

@jade could you expand on the precise code intelligence support that searchfox has? I was not able to find any information on that on searchfox (but it is likely that I missed it)

@jade could you expand on the precise code intelligence support that searchfox has? I was not able to find any information on that on searchfox (but it is likely that I missed it)
Owner

You may observe that it has very consistently correct c++ navigation. this is due to the clang plugin they use. I've not done much more research other than seeing there's a clang plugin, though.

You may observe that it has very consistently correct c++ navigation. this is due to the clang plugin they use. I've not done much more research other than seeing there's a clang plugin, though.
Owner

From what I can see it will not work on nix files, unless a specific plugin is written

This step processes C++, Rust, JavaScript, and IDL files.

From what I can see it will not work on nix files, unless a specific plugin is written > This step processes C++, Rust, JavaScript, and IDL files.
Owner

In the ideal world, a tool should use https://lsif.dev/ so we can provide a Nix LSIF.

In the ideal world, a tool should use https://lsif.dev/ so we can provide a Nix LSIF.
Owner
(or https://sourcegraph.com/blog/announcing-scip but unsure.)
Owner

From what I can see it will not work on nix files, unless a specific plugin is written

Yes, though this is the status quo exactly, nobody has precise code intelligence for nix files. It's possible to dump an export of most NixOS option locations though, which we could use to start building a precise code intel system of some kind possibly. or at least put some stuff into the index usefully idk.

The other mentioned systems seem so deeply unserious that they are just ctags and one won't expect any precise code intel in them at all.

> From what I can see it will not work on nix files, unless a specific plugin is written Yes, though this is the status quo exactly, nobody has precise code intelligence for nix files. It's possible to dump an export of most NixOS option locations though, which we could use to start building a precise code intel system of some kind possibly. or at least put some stuff into the index usefully idk. The other mentioned systems seem so deeply unserious that they are just ctags and one won't expect any precise code intel in them at all.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: the-distro/infra#88
No description provided.