given main.go:
package main
import "github.com/c9s/goprocinfo/linux"
func main() {
linux.ReadStat("/proc/stat")
}
and glide.yaml:
package: demo
import:
- package: github.com/c9s/goprocinfo/linux
glide install works and creates glide.lock:
hash: fe4cb6bd2a948473e3fca37a298728aef1ffa50bd542157f2893fd78f56f5d08
updated: 2017-07-20T13:49:53.844798928+03:00
imports:
- name: github.com/c9s/goprocinfo
version: b34328d6e0cd139894ea7347d2624ccf31fa3c58
subpackages:
- linux
testImports: []
however dep init fails.
I should mention that dep init does support importing remote subpackages (as it should https://golang.org/cmd/go/#hdr-Remote_import_paths), but seems that it gets confused by glide.yaml here
I stumbled upon this issue when playing with dep and trying to run dep init on a popular go repo https://github.com/bcicen/ctop
go version) and dep (git describe --tags) are you using?go version: go1.8.3 linux/amd64
dep version: v0.1.0-236-g98f1d99
dep command did you run?dep init
success
Importing configuration from glide. These are only initial constraints, and are further refined during the solve process.
Detected glide configuration files...
Loading /home/michael/projects/gopath/src/dep-bug/glide.yaml
Loading /home/michael/projects/gopath/src/dep-bug/glide.lock
Converting from glide.yaml and glide.lock...
Using master as initial constraint for imported dep github.com/c9s/goprocinfo/linux
Trying * (b34328d) as initial lock for imported dep github.com/c9s/goprocinfo
Root project is "dep-bug"
1 transitively valid internal packages
1 external packages imported from 1 projects
(0) ✓ select (root)
(1) ? attempt github.com/c9s/goprocinfo/linux with 1 pkgs; 1 versions to try
(1) try github.com/c9s/goprocinfo/linux@master
(2) ✗ github.com/c9s/goprocinfo/linux at master has problem subpkg(s):
(2) github.com/c9s/goprocinfo/linux has err (*build.NoGoError); required by (root).
(1) ← no more versions of github.com/c9s/goprocinfo/linux to try; begin backtrack
✗ solving failed
Solver wall times by segment:
b-source-exists: 977.660627ms
b-list-pkgs: 62.115878ms
select-root: 347.29µs
satisfy: 184.856µs
new-atom: 150.751µs
b-list-versions: 86.203µs
other: 4.744µs
TOTAL: 1.040550349s
No versions of github.com/c9s/goprocinfo/linux met constraints:
master: Could not introduce github.com/c9s/goprocinfo/linux@master, as its subpackage github.com/c9s/goprocinfo/linux does not contain usable Go code (*build.NoGoError).. (Package is required by (root).)
It seems like dep tries to fetch github.com/c9s/goprocinfo/linux url directly instead of fetching the actual repository url github.com/c9s/goprocinfo
This is the same root cause as #843. Thanks for the bug report!
@carolynvs It seem this bug is fixed (probably thanks to https://github.com/golang/dep/pull/1100)
Just tested on the example above and on an older revision of https://github.com/bcicen/ctop that failed for me when I opened this issue (8 days ago they moved to dep anyhow :smile: )
Thanks for the help finding fixed issues!
Most helpful comment
@carolynvs It seem this bug is fixed (probably thanks to https://github.com/golang/dep/pull/1100)
Just tested on the example above and on an older revision of https://github.com/bcicen/ctop that failed for me when I opened this issue (8 days ago they moved to
depanyhow :smile: )