Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue where --all-dependencies flag stopped working #601

Merged
merged 1 commit into from
Sep 9, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions dependency/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,8 @@ func (r *Resolver) resolveList(queue *list.List, testDeps, addTest bool) ([]stri
}

var failedDep string
var failedDepPath string
var pkgPath string
for e := queue.Front(); e != nil; e = e.Next() {
dep := e.Value.(string)
t := strings.TrimPrefix(dep, r.VendorDir+string(os.PathSeparator))
Expand All @@ -683,8 +685,10 @@ func (r *Resolver) resolveList(queue *list.List, testDeps, addTest bool) ([]stri
//msg.Warn("#### %s ####", dep)
//msg.Info("Seen Count: %d", len(r.seen))
// Catch the outtermost dependency.
failedDep = dep
err := filepath.Walk(dep, func(path string, fi os.FileInfo, err error) error {
pkgPath = r.Handler.PkgPath(t)
failedDep = t
failedDepPath = pkgPath
err := filepath.Walk(pkgPath, func(path string, fi os.FileInfo, err error) error {
if err != nil && err != filepath.SkipDir {
return err
}
Expand All @@ -703,14 +707,14 @@ func (r *Resolver) resolveList(queue *list.List, testDeps, addTest bool) ([]stri
// the queue.
r.alreadyQ[path] = true
e := r.queueUnseen(path, queue, testDeps, addTest)
if err != nil {
failedDep = path
if e != nil {
failedDepPath = path
//msg.Err("Failed to fetch dependency %s: %s", path, err)
}
return e
})
if err != nil && err != filepath.SkipDir {
msg.Err("Dependency %s failed to resolve: %s.", failedDep, err)
msg.Err("Dependency %s (%s) failed to resolve: %s.", failedDep, failedDepPath, err)
return []string{}, err
}
}
Expand Down Expand Up @@ -806,7 +810,7 @@ func (r *Resolver) imports(pkg string, testDeps, addTest bool) ([]string, error)
// FIXME: On error this should try to NotFound to the dependency, and then import
// it again.
var imps []string
p, err := r.BuildContext.ImportDir(r.Handler.PkgPath(pkg), 0)
p, err := r.BuildContext.ImportDir(pkg, 0)
if err != nil && strings.HasPrefix(err.Error(), "found packages ") {
// If we got here it's because a package and multiple packages
// declared. This is often because of an example with a package
Expand Down