-
Notifications
You must be signed in to change notification settings - Fork 22
Packages erroneously fail with multiple package main
& build +ignore
files #138
Description
Hi,
I'm the author of https://github.com/kamilchm/go2nix which tries to generate Nix dependency manager derivations for Go projects. go2nix
is a little hacky tool but it gets job done for almost all Go programs in Nix/NixOS https://github.com/NixOS/nixpkgs/search?utf8=%E2%9C%93&q=go2nix
I'm very happy with the new Go package management movement and I want to rewrite go2nix
to use one common dependency solving code, which gps
looks to be.
I tried to run gps
example and it failed on my 2 first test cases:
- Root project is
github.com/cerana/cerana/cmd/bootserver
| | | | | | ✓ select github.com/spf13/afero@master w/1 pkgs
| | | | | | | ? attempt golang.org/x/text with 2 pkgs; 1 versions to try
| | | | | | | | try golang.org/x/text@master
| | | | | | | | ✗ golang.org/x/text at master has problem subpkg(s):
| | | | | | | | | golang.org/x/text/unicode/norm has err (*build.MultiplePackageError); required by github.com/spf13/afero@master.
- Root project is
github.com/miekg/coredns
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | ? attempt golang.org/x/text with 2 pkgs; 1 versions to try
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | try golang.org/x/text@master
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ✗ golang.org/x/text at master has problem subpkg(s):
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | golang.org/x/text/unicode/norm has err (*build.MultiplePackageError); required by github.com/PuerkitoBio/purell@v1.1.0. golang.org/x/text/width has err (*build.MultiplePackageError); required by github.com/PuerkitoBio/purell@v1.1.0.
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ← no more versions of golang.org/x/text to try; begin backtrack
panic: canary - *should* be impossible to have a pkg-only selection here
goroutine 1 [running]:
panic(0x7501c0, 0xc4201b69e0)
/nix/store/kvs0532mn4ajscf43bkq2dbjry8cbb9f-go-1.7.4/share/go/src/runtime/panic.go:500 +0x1a1
github.com/kamilchm/gps2nix/vendor/github.com/sdboyer/gps.(*solver).backtrack(0xc420162900, 0xc420f97b40)
/home/kamil/src/github.com/kamilchm/gps2nix/vendor/github.com/sdboyer/gps/solver.go:961 +0xaba
github.com/kamilchm/gps2nix/vendor/github.com/sdboyer/gps.(*solver).solve(0xc420162900, 0x0, 0x0, 0x80)
/home/kamil/src/github.com/kamilchm/gps2nix/vendor/github.com/sdboyer/gps/solver.go:384 +0x7af
github.com/kamilchm/gps2nix/vendor/github.com/sdboyer/gps.(*solver).Solve(0xc420162900, 0x30, 0xc4200120dc, 0x18, 0xc420142cc0)
/home/kamil/src/github.com/kamilchm/gps2nix/vendor/github.com/sdboyer/gps/solver.go:330 +0x8e
main.main()
/home/kamil/src/github.com/kamilchm/gps2nix/main.go:44 +0x395
Is there something obvious in my examples that makes them fail?
I'm willing to help fixing gps
and I think that good integration test based on a few real packages could help here. Is there something like that, which I can run and be sure I don't break anything?