Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
G git-backup
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • git-backup
  • Issues
  • #5

Closed
Open
Created Sep 15, 2016 by iv@iv

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?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7