Skip to content

git2/sys/cred.h: No such file or directory #535

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

Closed
utkarsh2102 opened this issue Feb 15, 2020 · 6 comments
Closed

git2/sys/cred.h: No such file or directory #535

utkarsh2102 opened this issue Feb 15, 2020 · 6 comments

Comments

@utkarsh2102
Copy link

While building the latest release in Debian, I get the following build failure:

gopkg.in/libgit2/git2go.v28
# gopkg.in/libgit2/git2go.v28
src/gopkg.in/libgit2/git2go.v28/credentials.go:5:10: fatal error: git2/sys/cred.h: No such file or directory
    5 | #include <git2/sys/cred.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
dh_auto_build: error: cd obj-x86_64-linux-gnu && go install -trimpath -v -p 8 gopkg.in/libgit2/git2go.v28 returned exit code 2

Any idea how to go about it?

@lhchavez
Copy link
Contributor

seems like you have two choices:

  1. Debian's stable currently has v27, so you might need to use git2go.v27 instead if you want to use the dynamically-linked library.
  2. If you are okay with bundling a statically-linked version of libgit2, you can try running ./script/build-libgit2-static.sh. afterwards, you need to invoke all go commands (like go run, go build, go test) with -tags=static so that it will use the static version of libgit2.

@utkarsh2102
Copy link
Author

Hi @lhchavez,

I'm the libgit2 maintainer. And we're not using Debian stable for development, we use unstable (and from which, packages migrate to testing).
libgit2 0.28.4.1 is already in unstable and testing (which is the next stable), see https://tracker.debian.org/libgit2 :)

So I'm getting this error while building against 0.28.4.1. Any clue how to go about it now?

@lhchavez
Copy link
Contributor

libgit2 0.28.4.1 is already in unstable and testing (which is the next stable), see https://tracker.debian.org/libgit2 :)

oh! sorry, i'm not very familiar with non-stable Debian ^^;;

So I'm getting this error while building against 0.28.4.1. Any clue how to go about it now?

let me try to spin up a Docker container.

@lhchavez
Copy link
Contributor

welp, i cannot reproduce this :S here's what I tried

cat > Dockerfile<<EOF
FROM debian:unstable  # debian:testing yields the same results

RUN apt-get update -y
RUN apt-get install -y curl libgit2-dev gcc git pkg-config
RUN curl --location https://dl.google.com/go/go1.13.8.linux-amd64.tar.gz | tar -xz
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/go/bin
WORKDIR /root/go

RUN go get gopkg.in/libgit2/git2go.v28
EOF
docker run -it --rm $(docker build -q .) go test -test.v gopkg.in/libgit2/git2go.v28/...

the other weird thing is that the line that you shared does not match the current state of the v28 branch: https://github.com/libgit2/git2go/blob/v28/credentials.go

is there anything I could have missed?

@utkarsh2102
Copy link
Author

Hi @lhchavez,

the other weird thing is that the line that you shared does not match the current state of the v28 branch: https://github.com/libgit2/git2go/blob/v28/credentials.go

This is indeed a nice catch! Seems like I was pulling from the master instead of the v28 branch.
This was a stupid mistake at my end :)

I fixed that, pulled the right tar ball and everything worked! :D
Many thanks for your help (and a nice catch)! ❤️

@lhchavez
Copy link
Contributor

Hi @lhchavez,

the other weird thing is that the line that you shared does not match the current state of the v28 branch: https://github.com/libgit2/git2go/blob/v28/credentials.go

This is indeed a nice catch! Seems like I was pulling from the master instead of the v28 branch.
This was a stupid mistake at my end :)

I fixed that, pulled the right tar ball and everything worked! :D
Many thanks for your help (and a nice catch)!

whew! glad that it all worked out in the end!

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