XimeraProject / xake

The new build system for Ximera content written in Go
Other
8 stars 10 forks source link

Go version and libgit2.pc #5

Closed xronosuf closed 7 years ago

xronosuf commented 7 years ago

Just an fyi, on Ubuntu 16.04 the default apt-get install for go is version 1.6 which returns a "context" error. Updating to 1.8.3 fixed the problem, but you have to do it manually either by downloading the tar or adding an unofficial repo.

After I got that to work however, I am now getting the following error on the go get . command:

~/go/src/github.com/ximeraproject/xake $ go get .
# pkg-config --cflags libgit2
Package libgit2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libgit2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libgit2' found
pkg-config: exit status 1

Not sure what this is, or where I should find it. Continuing to look into it but I figure if I have the problem, others will too. Will update if I find a solution.

xronosuf commented 7 years ago

Resolved the issue by installing libgit2 manually (also fun, requires make to install from source I think) Stuck at the following error:

~/go/src/github.com/ximeraproject/xake $ go get .
# github.com/libgit2/git2go
could not determine kind of name for C.git_blob_create_fromstream
could not determine kind of name for C.git_blob_create_fromstream_commit

The main causes (according to Google) is go version (I'm at most recent), version of librdkafka (I'm at most recent), and error in the script somewhere (which seems unlikely if this works for others). Any ideas?

bwramsey commented 7 years ago

I had these issues, too. What worked for me was following the "For NEXT" directions in the README file for git2go branch v25 (after deleting the git2go folder I had already downloaded). The instructions in that branch seem different from the other branches, but worked for me.

kisonecat commented 7 years ago

Instead of trying to build xake, I would recommend trying to install the .deb at https://github.com/XimeraProject/xake/releases which is statically linked to libgit2.

kisonecat commented 7 years ago

The build commands in the .travis.yml file are a good place to look since they are enough to build xake on the trusty environment. Specifically the commands below build a xake binary statically linked to the master branch of libgit2. Tracking the master branch of libgit2 seems reasonable, given how hard it would be otherwise to get the right version of libgit2 installed everywhere.

mkdir -p ${GOPATH}/bin
export PKG_CONFIG_PATH=$GOPATH/src/github.com/libgit2/git2go/vendor/libgit2/build
go get -d github.com/libgit2/git2go
cd $GOPATH/src/github.com/libgit2/git2go
git submodule update --init
export CGO_CFLAGS="-I$GOPATH/src/github.com/libgit2/git2go/vendor/libgit2/include"
make install-static
cd $GOPATH/src/github.com/XimeraProject/xake
go get -tags static .