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

Compile gittar module error #357

Closed
liuhaoyang opened this issue May 16, 2021 · 2 comments
Closed

Compile gittar module error #357

liuhaoyang opened this issue May 16, 2021 · 2 comments

Comments

@liuhaoyang
Copy link
Contributor

When I compile the gittar module, it throws the following error

------------ Start Build Version Details ------------
AppName: gittar
Arch: arm64
OS: darwin
Version: 4.0
BuildTime: 2021-05-16 23:20:58
GoVersion: go version go1.16.4 darwin/arm64
CommitID: 0c4e0654b9e934164f1ea03e2e5b0de0fb8775ed
DockerImage:
------------ End Build Version Details ------------
git submodule update --init
go mod tidy: already have vendor dir, skip tidy
cd "/Users/liuhaoyang/projects/github/erda/erda/cmd/gittar" && \
        PROJ_PATH=/Users/liuhaoyang/projects/github/erda/erda GOPRIVATE= go build -ldflags " -X 'github.com/erda-project/erda-infra/base/version.Version=4.0' -X 'github.com/erda-project/erda-infra/base/version.BuildTime=2021-05-16 23:20:58' -X 'github.com/erda-project/erda-infra/base/version.CommitID=0c4e0654b9e934164f1ea03e2e5b0de0fb8775ed' -X 'github.com/erda-project/erda-infra/base/version.GoVersion=go version go1.16.4 darwin/arm64' -X 'github.com/erda-project/erda-infra/base/version.DockerImage='" -tags dynamic -o "/Users/liuhaoyang/projects/github/erda/erda/bin/gittar"
# github.com/libgit2/git2go/v30
../../vendor/github.com/libgit2/git2go/v30/blame.go:4:10: fatal error: 'git2.h' file not found
#include <git2.h>
         ^~~~~~~~
1 error generated.
make: *** [build] Error 2

I have confirmed that I have installed libgit2 with reference to https://github.com/odewahn/git2go-test.
How should I solve this problem next ?

@sfwn
Copy link
Member

sfwn commented May 16, 2021

@littlejiancc take a look at it.

@sfwn
Copy link
Member

sfwn commented May 17, 2021

@liuhaoyang Please install the correct version of libgit2. The git2go version is v30 in code.

Reference: https://github.com/libgit2/git2go#which-go-version-to-use

@sfwn sfwn closed this as completed May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants