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

golang linter install failing during docker image build #28291

Closed
vinayb21 opened this issue Oct 20, 2018 · 9 comments
Closed

golang linter install failing during docker image build #28291

vinayb21 opened this issue Oct 20, 2018 · 9 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@vinayb21
Copy link

vinayb21 commented Oct 20, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.11

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"

What did you do?

In a dockerfile, the following command fails during the docker image build
go get golang.org/x/lint/golint

Error
# golang.org/x/tools/go/internal/gcimporter /go/src/golang.org/x/tools/go/internal/gcimporter/bexport.go:212: obj.IsAlias undefined (type *types.TypeName has no field or method IsAlias)

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

What did you expect to see?

Successful docker image build.

What did you see instead?

Error with exit status 2 for the failed installation of golang linter with the following error

/go/src/golang.org/x/tools/go/internal/gcimporter/bexport.go:212: obj.IsAlias undefined (type *types.TypeName has no field or method IsAlias)```
@mvdan
Copy link
Member

mvdan commented Oct 20, 2018

That method was added in 1.9: https://golang.org/pkg/go/types/#TypeName.IsAlias

Are you positive you're building on 1.11?

@mvdan mvdan added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Oct 20, 2018
@ChTimTsubasa
Copy link

Having the same problem with golang 1.8. What is your solution to this issue?

@vinayb21
Copy link
Author

vinayb21 commented Oct 23, 2018 via email

@agnivade
Copy link
Contributor

I would request you to upgrade to 1.11. We do not support more than 2 releases behind. So the <1.9 kludge may be removed at some point.

@mvdan
Copy link
Member

mvdan commented Oct 23, 2018

I'm confused by this issue - it started mentioning Go 1.11, and now concerns Go 1.8.

Please see the documentation, which clearly shows that the last two Go releases are supported: https://github.com/golang/go/wiki/SubRepositories

@rubensayshi
Copy link

I'm having this issue with go1.8, how would we go get a version of golang.org/x/lint/golint that isn't breaking o.O?

@mvdan
Copy link
Member

mvdan commented Oct 24, 2018

The subrepositories, including x/tools, only support the two latest Go versions. See the link I posted above. That currently means at least Go 1.10.

This issue is just going in circles, so I'm going to close it for now. Feel free to open another issue to propose changing the two-version policy. /cc @griesemer @alandonovan

@mvdan mvdan closed this as completed Oct 24, 2018
@rubensayshi
Copy link

rubensayshi commented Oct 24, 2018

@mvdan what would be the best place to start a discussion about this?

from my naive point of view it seems like it shouldn't be this hard to keep using a compatible version of golint in older go versions, but my background is in programming languages with package managers / repositories that take care of this (nodejs, php, python and the like)
and I do realize that the situation / problem is different here.

@mvdan
Copy link
Member

mvdan commented Oct 24, 2018

On newer Go versions, you would use Go modules to use a specific version of all dependencies, including the x/tools repository. On older Go versions, you can achieve the same with third party dependency management tools like dep or govendor, which can set up vendor directories.

utkarshmani1997 added a commit to utkarshmani1997/longhorn-engine that referenced this issue Oct 30, 2018
This commit fixes the following:
1. Docker has forbidden the older download url so `make` is failing
2. `go get golang.org/x/lint/golint` command fails while running `make`
  error
  ```
golang.org/x/tools/go/internal/gcimporter /go/src/golang.org/x/tools/go/internal/gcimporter/bexport.go:212: obj.IsAlias undefined (type *types.TypeName has no field or method IsAlias)
  ```
Ref: golang/go#28291

So this commit update the url to download docker and dependencies
required to run docker (1).
It also update the go version which is used to build the binary (2).

Signed-off-by: Utkarsh Mani Tripathi <utkarshmani1997@gmail.com>
yasker pushed a commit to longhorn/longhorn-engine that referenced this issue Oct 31, 2018
This commit fixes the following:
1. Docker has forbidden the older download url so `make` is failing
2. `go get golang.org/x/lint/golint` command fails while running `make`
  error
  ```
golang.org/x/tools/go/internal/gcimporter /go/src/golang.org/x/tools/go/internal/gcimporter/bexport.go:212: obj.IsAlias undefined (type *types.TypeName has no field or method IsAlias)
  ```
Ref: golang/go#28291

So this commit update the url to download docker and dependencies
required to run docker (1).
It also update the go version which is used to build the binary (2).

Signed-off-by: Utkarsh Mani Tripathi <utkarshmani1997@gmail.com>
hellais added a commit to ooni/orchestra that referenced this issue Nov 22, 2018
hellais added a commit to ooni/orchestra that referenced this issue Nov 22, 2018
richvdh added a commit to matrix-org/rageshake that referenced this issue Jun 18, 2019
golint no longer supports 1.7. (golang/go#28291).

It's time to update.
richvdh added a commit to matrix-org/rageshake that referenced this issue Jun 18, 2019
golint no longer supports 1.7. (golang/go#28291).

It's time to update.

(1.12 doesn't seem to work yet)
@golang golang locked and limited conversation to collaborators Oct 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

6 participants