Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
G
git-backup
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 3
    • Issues 3
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 1
    • Merge Requests 1
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • Kirill Smelkov
  • git-backup
  • Issues
  • #5

Closed
Open
Opened Sep 15, 2016 by iv@iv
  • Report abuse
  • New issue
Report abuse New issue

Unable to import git2go when building git-backup

I wanted to use the latest version of git-backup, so I ran:

golang16/bin/go build -o git-backup  *.go

but then, go complained about an import requiring a git repo to be cloned and built: github.com/libgit2/git2go. After some research, I did the following steps:

mkdir gopath
export GOPATH=$(pwd)/gopath
mkdir $GOPATH/{src,bin,pkg} # git-backup is cloned in src
export PATH="$PATH:$(pwd)/srv/runner/software/f7445a0b1019dad7cbae9b7eaeedb0b0/parts/pkgconfig/bin/" # pkgconfig is required by go get
[...]/go get "github.com/libgit2/git2go"

but this last one seems to be able to clone the repo in gopath/src/ but then fails:

$ ./srv/runner/software/f7445a0b1019dad7cbae9b7eaeedb0b0/parts/golang16/bin/go get "github.com/libgit2/git2go"
# 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

I found on my system a file called libgit2.pc in /srv/slapgrid/slappart18/srv/runner/software/f7445a0b1019dad7cbae9b7eaeedb0b0/parts/gitlab/vendor/bundle/ruby/2.1.0/gems/rugged-0.24.0/vendor/libgit2/build/ so I appended this path to PKG_CONFIG_PATH environment variable.

then, I get:

$ ./srv/runner/software/f7445a0b1019dad7cbae9b7eaeedb0b0/parts/golang16/bin/go get "github.com/libgit2/git2go"
# github.com/libgit2/git2go
gopath/src/github.com/libgit2/git2go/blame.go:4:18: fatal error: git2.h: No such file or directory       
compilation terminated.

which is in ./srv/runner/software/f7445a0b1019dad7cbae9b7eaeedb0b0/parts/gitlab/vendor/bundle/ruby/2.1.0/gems/rugged-0.24.0/vendor/libgit2/include/git2.h

I tried to add its parent directory to GOPATH but it didn't help much, so I don't know how I am supposed to do to be able to import git2go and build the new git-backup. Do you have any clue?

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
0
Labels
None
Assign labels
  • View project labels
Reference: kirr/git-backup#5
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备14008524号