Location of binaries after building from source

So I run go install -v github.com/dgraph-io/dgraph/dgraph/cmd/... to build from source and I can see dgraph-converter in ~/go/bin but I’m not able to locate the other binaries. Any help would be greatly appreciated. New to go.

Run go install -v github.com/dgraph-io/dgraph/dgraph to get the dgraph binary.

Once you have the dgraph binary, you can run dgraph --help to see all the available subcommands.

1 Like

That did it thank you! Can we update the README.md on github to show this?

The contribution docs state this already: https://docs.dgraph.io/contribute/#setup-dgraph-from-source-repo.

For most users we recommend using the release binaries or the Docker image (as per the installation docs). They have the version tags embedded in the binary (e.g., dgraph version ).

1 Like

I build a lot of open source code and it is usually easier to find instructions on building from source from a github repo tbh. Not everyone who builds is going to contribute. I always build from source if I can just because I want the speedup and I’ve found binaries don’t work for me 1/2 the time. I guess I can understand pushing binaries onto most users. Just a little difficult to locate.

I’d add to the README.md:

The quickest way to install Dgraph is to run this command on Linux or Mac.

curl https://get.dgraph.io -sSf | bash

or you can build from source with

go install -v github.com/dgraph-io/dgraph/dgraph

Is there a way to specify which branch of a github repo you want to build for go? Just checked and I guess not. Well that is a PITA i see where you’re coming from. Make installing software from github with go too sleek and easy and lose branch control lol.

Good point. I just created a PR inspired by your suggestion to update README.

We’re planning on adding the version tags (the commit SHA, timestamp, and branch) to dgraph version for source builds so the binary has some indication of the source from which it was built.

No way to do it from the go get or go install commands, but you can checkout a branch on the repo beforehand and then run go build or go install to build from the checked out git branch.