kamilchm / go2nix

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

Cannot find branch of package #78

Closed Chiiruno closed 5 years ago

Chiiruno commented 5 years ago

go2nix save

2019/08/22 02:07:41 cannot find package "github.com/bakape/thumbnailer/v2" in any of:
        /nix/store/q6b1ywhnvmrfd84azzqnrb4mchkihsvb-go-1.12.7/share/go/src/github.com/bakape/thumbnailer/v2 (from $GOROOT)
        /run/user/1000/tmp.pY8OMnWUi5/src/github.com/bakape/thumbnailer/v2 (from $GOPATH)

I'm not really familiar with how this works, so if more information is needed, I'll try to provide it.

kamilchm commented 5 years ago

What's the working directory?

Chiiruno commented 5 years ago

I used this: https://github.com/kamilchm/go2nix#example-leaps, so I cd into src/github.com/bakape/meguca (the package I was attempting to save) and used go2nix save.

kamilchm commented 5 years ago

Is src/github.com/bakape/meguca inside /run/user/1000/tmp.pY8OMnWUi5/ (the $GOPATH)? Did you run go build in src/github.com/bakape/meguca before go2nix save?

Chiiruno commented 5 years ago

Indirectly, yes. https://github.com/bakape/meguca/blob/master/Makefile#L29

/run/user/1000/tmp.pY8OMnWUi5/ is in fact the $GOPATH.

Chiiruno commented 5 years ago

Is src/github.com/bakape/meguca inside /run/user/1000/tmp.pY8OMnWUi5/ (the $GOPATH)?

Misread, the answer is no, /run/user/1000/tmp.pY8OMnWUi5/ is the $GOPATH, however the makefile may modify it.

Edit: ...or not, that's old behavior, makefile shouldn't be messing it up.

Chiiruno commented 5 years ago

Right, I had forgotten. The same thing will happen with hydron.

kamilchm commented 5 years ago

go2nix requires the package you save and all its dependencies to reside inside the GOPATH

Chiiruno commented 5 years ago

As far as I'm aware, that is the case, and this used to work in the past, but I believe @bakape changed to go modules and is requiring the v2 branch of thumbnailer now instead of master.

kamilchm commented 5 years ago

Seeing the go.mod in the repo I would suggest to try the new https://nixos.org/nixpkgs/manual/#ssec-go-modules or https://github.com/adisbladis/vgo2nix

Chiiruno commented 5 years ago

For the first link, can I assume that means I could just convert the entire meguca derivation to buildGoModule, or is it something else? Also thank you for referring me to those two links.

kamilchm commented 5 years ago

Converting the meguca derivation would be a move in the right direction, although I'm not sure if there's no corner cases in maguca not handled in buildGoModule.

Chiiruno commented 5 years ago

Well I think I have enough information to fix this now. Is this something planned to be implemented or fixed in this project, or should the issue be closed?

kamilchm commented 5 years ago

This project will not support go modules in any way so I would close it.

Chiiruno commented 5 years ago

Thank you for the help.

bakape commented 5 years ago

@Chiiruno I'm still using the master branch of thumbnailer. The difference is master being properly marked as the v2 branch now as required by the Go module system.