local development
The first step to contributing to the noxide project is to get your local development environment setup. Most folks familiar with Go project development should feel right at home.
Install Go compiler
The go.dev
website instructions will get you
setup with a Go compiler for your system. Use the go version
command to make
sure you have a working Go compiler on your $PATH
.
go version
Set $GOPATH
to a location where you wish to keep Go source files. Technically
the GO compiler can work without this environment variable set, but noxide uses
it for knowing where protobuf files are. Typically this will be set to $HOME/go
but the choice is yours.
env | grep GOPATH # must be set
Install GCC and Make
Since noxide uses CGO for certain operating system features as well as the sqlite3 database, you’ll need the GCC compiler installed in addition to the Go compiler. We also use a Makefile for making complex builds easy. These two components can usually be installed pretty easily on any platform.
apt-get install gcc make # ubuntu
brew install gcc make # macOS
Install SQLite
The database noxide uses is sqlite3 which
is linked into the noxide
binary at compile time. For this to work sqlite3
must be installed on the system.
apt-get install sqlite3 # ubuntu
brew install sqlite # macOS
Setup Cap’n Proto
The RPC layer of noxide is powered by Cap’n Proto
protobufs. To generate Go source code from protobuf definitions
the capnp
compiler is needed, along with the Go plugin and the Go protobuf
standard library. Checkout the Go specific instructions
if you’re interested, but make init
will automatically run through
the steps to get setup.
make init
Now everything should be ready for generating the source files generated from
the protobufs. To do so, run the make protos
target.
make protos
Start Compiling!
At this point you should have everything needed to build noxide
. The
Makefile contains several targets to
simplify local development.
make clean
- deletes an existing previously compilednoxide
binarymake protos
- compile protobufs withcapnp
to produce Go source filesmake compile
- compile thenoxide
binary usinggo install
make demo
- compilenoxide
and also run it using a simple “demo” configurationmake tidy
- run thego mod tidy
command on Go modulesmake copywrite
- run thecopywrite
command to generate BSD license headers
➜ make protos demo
==> Generating Cap'n Proto files
==> Clean
==> Compile
...
==> Running hack/demo.cue
doing fresh cluster bootstrap steps
...