Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libgit2/git2go fails to build due to pkg-config error #38

Closed
raylu opened this issue Feb 7, 2018 · 2 comments
Closed

libgit2/git2go fails to build due to pkg-config error #38

raylu opened this issue Feb 7, 2018 · 2 comments

Comments

@raylu
Copy link

raylu commented Feb 7, 2018

on my mac:

$ go version
go version go1.9.4 darwin/amd64

$ git show
commit ffbd489206c5e76b5c2e7ac251f088880678ea06 (HEAD -> master, tag: v0.1.2, origin/master, origin/HEAD)
[...]
Date:   Wed Feb 7 20:15:05 2018 +0000
[...]

$ make
[...]
go build github.com/rgburke/grv/cmd/grv/vendor/gopkg.in/libgit2/git2go.v25: invalid pkg-config package name: --static
make[1]: *** [install-static] Error 1
make: *** [build-libgit2] Error 2

$ go build --tags static -ldflags "-X 'main.version=v0.1.2-0-gffbd489' -X 'main.headOid=ffbd489' -X 'main.buildDateTime=2018-02-07 13:37:56 PST'" -o grv ./cmd/grv
go build github.com/rgburke/grv/cmd/grv/vendor/gopkg.in/libgit2/git2go.v25: invalid pkg-config package name: --static
@rgburke
Copy link
Owner

rgburke commented Feb 8, 2018

Thanks for reporting this issue. It should now be fixed on master. Could you please pull the latest code and confirm?

Go 1.9.4 has introduced flag checks for cgo build directives. git2go uses pkg-config: --static ... and go 1.9.4 doesn't recognise --static as a valid argument. So as I can't directly fix this a workaround has been implemented instead as described here

@raylu
Copy link
Author

raylu commented Feb 9, 2018

it builds! thanks!

@raylu raylu closed this as completed Feb 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants