Opened 4 years ago

Last modified 4 years ago

#16537 new enhancement

Setup a code cross reference server

Reported by: pulkomandy Owned by: haiku-web
Priority: normal Milestone: Unscheduled
Component: Sys-Admin Version: R1/beta2
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by pulkomandy)

xref.landonf.org is offline. It would be nice to have a tool we host ourselves for this instead.

I had some success with setting up woboq at http://pulkomandy.tk/woboq/haiku/ It uses a static generation approach: generating a lot of html files at build time and then we just have to serve that.

Here are some quick notes on what I did:

You need a jam with the -c option to generate compile_commands.json (https://review.haiku-os.org/c/buildtools/+/3260). You need woboq installed on the build machine to generate the things.

Checkout Haiku and buildtools as usual. You need to build with gcc8 (because with gcc2 you get some errors with unrecognized compiler options).

Do a clean build adding the -c option to the jam command line (I used jam -cj2 without -q to let it build as much files as possible even in case of build fails). A clean build is required because the compile_commands is only written when the commands are actually run.

mkdir woboq/haiku
codebrowser_generator -a -b=compile_commands.json -o=woboq/haiku -p Haiku:/home/pulkomandy/haiku/haiku/ -d https://pulkomandy.tk/woboq/data/
codebrowser_indexgenerator woboq/haiku/ 
sudo cp -r /usr/share/woboq/data woboq/

Replace /home/pulkomandy/haiku/haiku with the path to Haiku sources (anything outside that directory will not be indexed), replace https://pulkomandy.tk/woboq/data/ with where the data will be served from (it's javascript files that can be shared between different generated projects if we decide to do that for more than just haiku).

Then the woboq/ directory can be published using any webserver that can publish html files.

I think we could integrate this with the Haiku buildsystem.

I also patched the css to set the tab size for Haiku code rendering by adding this to data/common.css:

.code { tab-size: 4; }

Change History (3)

comment:1 by pulkomandy, 4 years ago

Description: modified (diff)

comment:2 by waddlesplash, 4 years ago

Woboq is "okay", but lacks some of the really powerful querying features OpenGrok has, which I find extremely useful.

Note: See TracTickets for help on using tickets.