go version) and dep (git describe --tags) are you using?go version go1.9rc1 darwin/amd64
dep v0.3.0-34-gc80fab8
dep command did you run?$ git clone https://github.com/VojtechVitek/dep-test.git
$ cd dep-test
$ cat Gopkg.toml
[[constraint]]
name = "github.com/go-chi/docgen/raml"
version = "^1.0.2"
$ dep ensure -v
Root project is "github.com/VojtechVitek/dep-test"
1 transitively valid internal packages
1 external packages imported from 1 projects
(0) โ select (root)
(1) ? attempt github.com/go-chi/docgen/raml with 1 pkgs; 4 versions to try
(1) try github.com/go-chi/docgen/[email protected]
(1) โ select github.com/go-chi/docgen/[email protected] w/1 pkgs
(2) ? attempt github.com/go-chi/chi with 1 pkgs; 16 versions to try
(2) try github.com/go-chi/[email protected]
(2) โ select github.com/go-chi/[email protected] w/1 pkgs
โ found solution with 2 packages from 2 projects
Solver wall times by segment:
b-source-exists: 1.731622899s
b-list-pkgs: 477.610861ms
b-gmal: 448.395904ms
satisfy: 366.948ยตs
select-atom: 328.329ยตs
new-atom: 137.822ยตs
select-root: 63.428ยตs
b-list-versions: 56.773ยตs
b-deduce-proj-root: 28.949ยตs
other: 13.635ยตs
TOTAL: 2.658625548s
github.com/go-chi/docgen/raml subpkggithub.com/go-chi/docgen transitive dependency pkgvendor/
โโโ github.com
โโโ go-chi
โโโ docgen
โโโ raml <=== This directory is wrong. All the files should have been in the parent directory instead.
โโโ LICENSE
โโโ builder.go
โโโ docgen.go
โโโ docgen_test.go
โโโ funcinfo.go
โโโ markdown.go
โโโ raml <=== Um, what? Yet another raml subdirectory?
โย ย โโโ raml.go
โย ย โโโ raml_test.go
โโโ util.go
$ dep status
PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED
github.com/go-chi/chi * v3.1.5 25354a5 25354a5 1
github.com/go-chi/docgen/raml ^1.0.2 v1.0.2 ac43d9a ac43d9a 1
Reproducer repo: https://github.com/VojtechVitek/dep-test
hi hi - so this is the problem:
$ cat Gopkg.toml
[[constraint]]
name = "github.com/go-chi/docgen/raml"
version = "^1.0.2"
that's not a project root; github.com/go-chi/docgen is. all constraints declared in Gopkg.toml have to be on a root, or we see _weird_ behavior, like this.
clearly this is something that needs enforcement - which is why we have...huh. weird. i thought we did this in #697, but it seems not. @ibrasho, do we have something open for this?
@sdboyer yea, I figured the problem would be the non-root dependency path in Gopkg.toml.
So, how do I vendor github.com/go-chi/docgen/raml subpkg again? Do I need to vendor root package and then dep prune to get rid of any unused pkgs? Imho, this needs better documentation and error messages.
So, how do I vendor
github.com/go-chi/docgen/ramlsubpkg again?
you just import it, and dep ensure (and dep prune if that matters for your use pattern). you're overthinking it ๐
the rules declared in Gopkg.toml are only for applying version constraints or alternate sources. they don't _have_ to be there at all for your dependencies to be satisfied, though it's generally preferable that they're there.
what kind of doc heading would you expect to find this information under?
@sdboyer How about adding root path check in manifest validation function?
When ensure and status try to load manifest via dep.Ctx they can fail to load with error message.
@darkowlzz yes, we definitely need that. what's weird is, i thought we'd added it in an earlier PR by @ibrasho - but it seems to not be there :/
$ dep ensure -v
The following issues were found in Gopkg.toml:
โ the name for "github.com/go-chi/docgen/raml" should be changed to "github.com/go-chi/docgen"
ProjectRoot name validation failed
Thanks for fixing this!
Most helpful comment
Thanks for fixing this!