Install a prebuilt binary
To install the srclib program, download one of the prebuilt binaries or build it from source (see next section).
srclib binary downloads:
After downloading the file, unzip it and place the
srclib program in your
srclib --help to verify that it's installed.
Building from source
First, install install Go (version 1.5 or newer).
go get -u -v sourcegraph.com/sourcegraph/srclib/cmd/srclib
If this command fails, please file an issue or skip one of the languages if you don't need it.
srclib toolchain list helps to verify the currently installed language toolchains like the following example
$ srclib toolchain list sourcegraph.com/sourcegraph/srclib-python sourcegraph.com/sourcegraph/srclib-go
In order to test srclib we can use it to analyze the already fetched source code for the Go toolchain
First, you need to initialize the git submodules in the root directory of srclib-go
cd src/sourcegraph.com/sourcegraph/srclib-go git submodule update --init
Now you can test the srclib-go toolchain with:
srclib config && srclib make
You should have a .srclib-cache directory inside srclib-go that has all of the build data for the repository.