Comment 6 for bug 1432497

Revision history for this message
In , Boger-e (boger-e) wrote :

When using the go tool provided with gccgo in gcc 5.0, the use of 'go get' doesn't always find and build the dependent packages correctly.

Here is an example:

go get -u github.com/mitchellh/gox

There is a dependent package github.com/mitchellh/iochan but that never gets downloaded or built and as a result neither does github.com/mitchellh/gox. I can make it work by downloading them in separate steps this way:

go get -u github.com/mitchellh/uchan
go get -u github.com/mitchellh/gox

After further debugging I found the problem has to do with the code in libgo/go/cmd/go/pkg.go in the load function where it does this check:

....

  p1 := loadImport(path, p.Dir, stk, p.build.ImportPos[path])
  if !reqPkgSrc && p1.Root == "" {
    continue
  }

....

When it tries to load the github.com/mitchellh/uchan package, p1.Root == "" so it skips the rest of the code in the loop that loads the package. Isn't this a case where p1.Root should have a non-null string and therefore not continue/skip the rest of the body of the loop and get it loaded?