{"action":"created","issue":{"url":"https://api.github.com/repos/constabulary/gb/issues/307","labels_url":"https://api.github.com/repos/constabulary/gb/issues/307/labels{/name}","comments_url":"https://api.github.com/repos/constabulary/gb/issues/307/comments","events_url":"https://api.github.com/repos/constabulary/gb/issues/307/events","html_url":"https://github.com/constabulary/gb/issues/307","id":101276885,"number":307,"title":"gb not working with git2go","user":{"login":"linuxerwang","id":3304478,"avatar_url":"https://avatars.githubusercontent.com/u/3304478?v=3","gravatar_id":"","url":"https://api.github.com/users/linuxerwang","html_url":"https://github.com/linuxerwang","followers_url":"https://api.github.com/users/linuxerwang/followers","following_url":"https://api.github.com/users/linuxerwang/following{/other_user}","gists_url":"https://api.github.com/users/linuxerwang/gists{/gist_id}","starred_url":"https://api.github.com/users/linuxerwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linuxerwang/subscriptions","organizations_url":"https://api.github.com/users/linuxerwang/orgs","repos_url":"https://api.github.com/users/linuxerwang/repos","events_url":"https://api.github.com/users/linuxerwang/events{/privacy}","received_events_url":"https://api.github.com/users/linuxerwang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/constabulary/gb/milestones/2","html_url":"https://github.com/constabulary/gb/milestones/cgo","labels_url":"https://api.github.com/repos/constabulary/gb/milestones/2/labels","id":1113867,"number":2,"title":"cgo","description":"Working cgo support. Including:\r\n\r\n- support for `$CC` env var to choose compiler\r\n- support for clang\r\n- support for non amd64 hosts","creator":{"login":"davecheney","id":7171,"avatar_url":"https://avatars.githubusercontent.com/u/7171?v=3","gravatar_id":"","url":"https://api.github.com/users/davecheney","html_url":"https://github.com/davecheney","followers_url":"https://api.github.com/users/davecheney/followers","following_url":"https://api.github.com/users/davecheney/following{/other_user}","gists_url":"https://api.github.com/users/davecheney/gists{/gist_id}","starred_url":"https://api.github.com/users/davecheney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davecheney/subscriptions","organizations_url":"https://api.github.com/users/davecheney/orgs","repos_url":"https://api.github.com/users/davecheney/repos","events_url":"https://api.github.com/users/davecheney/events{/privacy}","received_events_url":"https://api.github.com/users/davecheney/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":11,"state":"open","created_at":"2015-05-17T10:10:08Z","updated_at":"2015-08-16T21:42:00Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2015-08-16T16:00:10Z","updated_at":"2015-08-17T06:29:33Z","closed_at":null,"body":"My project needs to use https://github.com/libgit2/git2go. To statically compile with git2go, we have to compile libgit2 statically and git2go provides a \"next\" branch and scripts to build.  Since in gb vendor the .git was not reserved I can't use \"git submodule\" to fetch libgit2. Also the scripts provided by git2go doesn't work in vendor mode.  So here is what I did:\r\n\r\n$ mkdir /tmp/test-git2go\r\n$ cd /tmp/test-git2go\r\n$ gb vendor fetch -branch next github.com/libgit2/git2go\r\n\r\nThis fetched git2go \"next\" branch without problem.\r\n\r\n$ mkdir vendor/src/github.com/libgit2/git2go/vendor\r\n$ cd vendor/src/github.com/libgit2/git2go/vendor\r\n$ git clone https://github.com/libgit2/libgit2\r\n$ cd libgit2\r\n$ git co fb84cde81e11947add4ff8bb9b4084f7d76e6567 # libgit2 v0.22+1 for branch \"next\" \r\n$ cd ../..\r\n$ ./script/build-libgit2-static.sh\r\n\r\nNow libgit2 was successfully built under vendor/src/github.com/libgit2/git2go/vendor/libgit2/build.\r\n\r\n$ export CGO_LDFLAGS=\"/tmp/test-git2go/vendor/src/github.com/libgit2/git2go/vendor/libgit2/build/libgit2.a -L/tmp/test-git2go/vendor/src/github.com/libgit2/git2go/vendor/libgit2/build -Wl,-Bsymbolic-functions -Wl,-z,relro -L/tmp/test-git2go/vendor/src/github.com/libgit2/git2go/vendor/libgit2/install/lib -lhttp_parser -lssh2 -lgcrypt -lrt -lgit2 -lssl -lcrypto -ldl -lz\"\r\n\r\n$ export CGO_CFLAGS=-I/tmp/test-git2go/vendor/src/github.com/libgit2/git2go/vendor/libgit2/include\r\n\r\n$ gb build -v github.com/libgit2/git2go\r\n\r\nNow I got this error message:\r\n\r\nhttps://drive.google.com/open?id=0BwrTqzph0i12N0laQ1BHVW9VY2M\r\n\r\nI think the issue here is that gb doesn't honor CGO_LDFLAGS and CGO_CFLAGS.  Any suggestions?\r\n\r\nThanks!\r\n"},"comment":{"url":"https://api.github.com/repos/constabulary/gb/issues/comments/131694782","html_url":"https://github.com/constabulary/gb/issues/307#issuecomment-131694782","issue_url":"https://api.github.com/repos/constabulary/gb/issues/307","id":131694782,"user":{"login":"linuxerwang","id":3304478,"avatar_url":"https://avatars.githubusercontent.com/u/3304478?v=3","gravatar_id":"","url":"https://api.github.com/users/linuxerwang","html_url":"https://github.com/linuxerwang","followers_url":"https://api.github.com/users/linuxerwang/followers","following_url":"https://api.github.com/users/linuxerwang/following{/other_user}","gists_url":"https://api.github.com/users/linuxerwang/gists{/gist_id}","starred_url":"https://api.github.com/users/linuxerwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linuxerwang/subscriptions","organizations_url":"https://api.github.com/users/linuxerwang/orgs","repos_url":"https://api.github.com/users/linuxerwang/repos","events_url":"https://api.github.com/users/linuxerwang/events{/privacy}","received_events_url":"https://api.github.com/users/linuxerwang/received_events","type":"User","site_admin":false},"created_at":"2015-08-17T06:29:33Z","updated_at":"2015-08-17T06:29:33Z","body":"No problem with this point.  I think my issue is caused by how git2go manages its dependency on libgit2.  In git2go source it has a .gitmodule for the correct version of libgit2.  But \"gb vendor fetch\" removed the git information. I guess I can add a git submodule in my project, instead. Will try it later.\r\n\r\nThanks."}}