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

Fails to build on Go 1.5.3 on darwin/amd64 #92

Closed
tduzan-te opened this issue Feb 9, 2016 · 6 comments
Closed

Fails to build on Go 1.5.3 on darwin/amd64 #92

tduzan-te opened this issue Feb 9, 2016 · 6 comments

Comments

@tduzan-te
Copy link

Looks like there might be a conflict between the dependency on golang.org/x/tools/go/types and the built-in go/types in 1.5.3. Has the functionality of the tools library been incorporated into the core?

❯ go get github.com/kisielk/errcheck
# github.com/kisielk/errcheck/internal/errcheck
../../kisielk/errcheck/internal/errcheck/errcheck.go:234: impossible type switch case: v.pkg.Info.Types[call].Type (type "golang.org/x/tools/go/types".Type) cannot have dynamic type *"go/types".Named (wrong type for Underlying method)
    have Underlying() "go/types".Type
    want Underlying() "golang.org/x/tools/go/types".Type
../../kisielk/errcheck/internal/errcheck/errcheck.go:237: impossible type switch case: v.pkg.Info.Types[call].Type (type "golang.org/x/tools/go/types".Type) cannot have dynamic type *"go/types".Pointer (wrong type for Underlying method)
    have Underlying() "go/types".Type
    want Underlying() "golang.org/x/tools/go/types".Type
../../kisielk/errcheck/internal/errcheck/errcheck.go:240: impossible type switch case: v.pkg.Info.Types[call].Type (type "golang.org/x/tools/go/types".Type) cannot have dynamic type *"go/types".Tuple (wrong type for Underlying method)
    have Underlying() "go/types".Type
    want Underlying() "golang.org/x/tools/go/types".Type
../../kisielk/errcheck/internal/errcheck/errcheck.go:275: impossible type assertion:
    *"go/types".Builtin does not implement "golang.org/x/tools/go/types".Object (wrong type for Parent method)
        have Parent() *"go/types".Scope
        want Parent() *"golang.org/x/tools/go/types".Scope
❯ go version
go version go1.5.3 darwin/amd64
@dmitshur
Copy link
Contributor

dmitshur commented Feb 9, 2016

One of your dependencies is out of date. Using -u flag will fix that and allow it to work.

go get -u github.com/kisielk/errcheck

This issue is very similar to grpc-ecosystem/grpc-gateway#103 (and many others like it).

@tduzan-te
Copy link
Author

I wish this had resolved it, but unfortunately I see the same behavior regardless of whether I pass the -u flag or not. Also, in this case I was starting on a fresh environment so no dependencies should have been present anyhow.

❯ go get -u github.com/kisielk/errcheck
# github.com/kisielk/errcheck/internal/errcheck
projects/go/src/github.com/kisielk/errcheck/internal/errcheck/errcheck.go:234: impossible type switch case: v.pkg.Info.Types[call].Type (type "golang.org/x/tools/go/types".Type) cannot have dynamic type *"go/types".Named (wrong type for Underlying method)
    have Underlying() "go/types".Type
    want Underlying() "golang.org/x/tools/go/types".Type
projects/go/src/github.com/kisielk/errcheck/internal/errcheck/errcheck.go:237: impossible type switch case: v.pkg.Info.Types[call].Type (type "golang.org/x/tools/go/types".Type) cannot have dynamic type *"go/types".Pointer (wrong type for Underlying method)
    have Underlying() "go/types".Type
    want Underlying() "golang.org/x/tools/go/types".Type
projects/go/src/github.com/kisielk/errcheck/internal/errcheck/errcheck.go:240: impossible type switch case: v.pkg.Info.Types[call].Type (type "golang.org/x/tools/go/types".Type) cannot have dynamic type *"go/types".Tuple (wrong type for Underlying method)
    have Underlying() "go/types".Type
    want Underlying() "golang.org/x/tools/go/types".Type
projects/go/src/github.com/kisielk/errcheck/internal/errcheck/errcheck.go:275: impossible type assertion:
    *"go/types".Builtin does not implement "golang.org/x/tools/go/types".Object (wrong type for Parent method)
        have Parent() *"go/types".Scope
        want Parent() *"golang.org/x/tools/go/types".Scope

@dmitshur
Copy link
Contributor

dmitshur commented Feb 9, 2016

I just did that (when I made the comment above), and it worked without any issues for me in a fresh environment. I can reproduce it again now:

image

How can that be? Are you sure your environment is clean and Go is correctly installed?

Perhaps you've previously had a different version of Go, and then you extracted a .tar.gz in place without first removing the old Go installation. Try reinstalling Go cleanly.

@dmitshur
Copy link
Contributor

@tduzan, any luck figuring out what could be different about your setup?

@tduzan-te
Copy link
Author

I apologize, I hadn't had an opportunity today to investigate further. I'll reply to the issue tomorrow with more information after I troubleshoot more deeply.

@tduzan-te
Copy link
Author

It looks like the underlying cause is a failure for go get to retrieve the errcheck dependencies. I'm unsure /why/ that's happening, but it is and has nothing to do with errcheck. It does in fact happen in a clean GOPATH as well. Looks like something is broken on my system with cert validation causing the issue.

❯ cd gotest

~GOPATH
❯ go list all | wc -l
     208

~GOPATH
❯ go get -u github.com/kisielk/errcheck
# cd .; git clone https://go.googlesource.com/tools /Users/tduzan/gotest/src/golang.org/x/tools
Cloning into '/Users/tduzan/gotest/src/golang.org/x/tools'...
fatal: unable to access 'https://go.googlesource.com/tools/': SSL certificate problem: unable to get local issuer certificate
package golang.org/x/tools/go/loader: exit status 128

I'm going to go ahead and close this issue, it doesn't appear to be an issue here, but an issue on my system. I apologize for taking your time with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants