kamilchm / go2nix

Reproducible builds and development environment for Go
MIT License
94 stars 17 forks source link

leaps packaging fail #42

Closed qknight closed 7 years ago

qknight commented 7 years ago

i've tried multipe hours to get a deps.nix from leaps which i once even got working.

can you please advice how to approach the problem?

https://github.com/Jeffail/leaps

concept

nix-shell -p go2nix git go
mkdir /tmp/l
cd /tmp/l
export GOPATH=`pwd`:`pwd`/vendor/
go get github.com/jeffail/leaps/cmd/...
cd src/github.com/jeffail/leaps/cmd/leaps
go2nix save

deps.nix

# This file was generated by go2nix.
[
]
kamilchm commented 7 years ago

You don't need to add vendor to GOPATH. This would be included automatically. I ran https://github.com/kamilchm/go2nix/blob/master/test/test_leaps.sh with current go2nix 1.1.1 and it produces deps.nix like:

# This file was generated by go2nix.
[
  {
    goPackagePath = "golang.org/x/net";
    fetch = {
      type = "git";
      url = "https://go.googlesource.com/net";
      rev = "5d997795f7bb1d2de5edc1f5d64af2562401c82d";
      sha256 = "1kcqn4lninavavlspcn6gn621cvn2skyc9jwfwy8052ys8p1r2kg";
    };
  }
]
kamilchm commented 7 years ago

I also did:

nix-shell -p go2nix git go
cd `mktemp -d`
export GOPATH=`pwd`
go get github.com/jeffail/leaps/cmd/...
cd src/github.com/jeffail/leaps/cmd/leaps
go2nix save

and I got deps.nix:

# This file was generated by go2nix.
[
  {
    goPackagePath = "golang.org/x/net";
    fetch = {
      type = "git";
      url = "https://go.googlesource.com/net";
      rev = "5d997795f7bb1d2de5edc1f5d64af2562401c82d";
      sha256 = "1kcqn4lninavavlspcn6gn621cvn2skyc9jwfwy8052ys8p1r2kg";
    };
  }
]

Could you try it exactly like that?

qknight commented 7 years ago

yeah, that works! i want to add this example to the README.md soon.

thanks!