Skip to content

error: cannot find package "github.com/libgit2/git2go/v34" #73

Description

@bshaffer

I am getting the following error when compiling splitsh on github. here is my script:

+ go get github.com/splitsh/lite
cannot find package "github.com/libgit2/git2go/v34" in any of:
	/opt/hostedtoolcache/go/1.20.11/x64/src/github.com/libgit2/git2go/v34 (from $GOROOT)
	/home/runner/work/google-cloud-php/google-cloud-php/.split/go/src/github.com/libgit2/git2go/v34 (from $GOPATH)
mkdir $1
export GOPATH=$1/go

go env -w GO111MODULE=off
go get -d github.com/libgit2/git2go
cd $GOPATH/src/github.com/libgit2/git2go
git checkout next
git submodule update --init
make install

go get github.com/splitsh/lite
go build -o $1/splitsh-lite github.com/splitsh/lite

My github action is using ubuntu-latest. I think the issue has to do with the new tag for v2.0.0. I am actively debugging it, and plan to either follow the guide in #64 or try to roll it back.

I just wanted to submit this issue here also, in case it's helpful to someone else!

Activity

  1. fabpot commented on Nov 30, 2023

    @fabpot
    Contributor

    You need to follow the instructions from https://github.com/splitsh/lite#manual-installation

  2. bshaffer commented on Nov 30, 2023

    @bshaffer
    Author
  3. bshaffer commented on Dec 1, 2023

    @bshaffer
    Author

    I was able to fix this by compiling libgit2 from source so that I could install 1.5 (rather than 1.1, which is the version installed by default via apt on Ubuntu 22.06, which is the latest version supported by Github Actions).

    In case it's helpful to anyone else, this is what worked for me:

    jobs:
      splitsh:
        name: SplitSH
        runs-on: ubuntu-latest
        env:
          LD_LIBRARY_PATH: /usr/local/lib
        steps:
        - name: Clone libgit2
          uses: actions/checkout@master
          with:
            repository: libgit2/libgit2
            ref: v1.5.1
            path: libgit2
        - name: Install libgit2
          run: |
            mkdir libgit2/build && cd libgit2/build
            cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local
            sudo cmake --build . --target install
        - name: Compile splitsh
          run: |
            go env -w GO111MODULE=off
            go get github.com/splitsh/lite
            go build -o /usr/local/bin/splitsh-lite github.com/splitsh/lite

    This places the splitsh-lite binary in /usr/local/bin, and everything worked as expected from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions