theia-ide / theia-apps

Theia applications examples - docker images, desktop apps, packagings
Apache License 2.0
1.04k stars 344 forks source link

main redeclared in this block #504

Closed zbm0711 closed 2 years ago

zbm0711 commented 2 years ago

when I build image error,

this is error:

#11 531.7 honnef.co/go/tools/cmd/structlayout
#11 531.8 honnef.co/go/tools/cmd/structlayout-optimize
#11 532.2 honnef.co/go/tools/internal/passes/buildir
#11 532.2 honnef.co/go/tools/go/ir/irutil
#11 532.3 honnef.co/go/tools/analysis/facts/nilness
#11 532.3 honnef.co/go/tools/cmd/structlayout-pretty
#11 532.5 honnef.co/go/tools/analysis/facts
#11 532.6 honnef.co/go/tools/analysis/facts/typedness
#11 532.7 honnef.co/go/tools/analysis/code
#11 532.8 honnef.co/go/tools/analysis/report
#11 532.8 honnef.co/go/tools/internal/cmd/gogrep
#11 532.8 honnef.co/go/tools/internal/cmd/irdump
#11 532.9 honnef.co/go/tools/unused
#11 532.9 honnef.co/go/tools/internal/sharedcheck
#11 533.1 honnef.co/go/tools/quickfix
#11 533.3 honnef.co/go/tools/simple
#11 533.4 honnef.co/go/tools/staticcheck
#11 533.4 honnef.co/go/tools/lintcmd/runner
#11 533.6 honnef.co/go/tools/stylecheck
#11 533.8 honnef.co/go/tools/analysis/lint/testutil
#11 533.9 honnef.co/go/tools/lintcmd
#11 534.1 honnef.co/go/tools/internal/gosmith
#11 534.3 honnef.co/go/tools/internal/testenv
#11 534.7 honnef.co/go/tools/cmd/staticcheck
#11 534.7 honnef.co/go/tools/website
#11 534.7 # honnef.co/go/tools/website
#11 534.7 usr/local/go-packages/src/honnef.co/go/tools/website/generate_config.go:19:6: main redeclared in this block
#11 534.7   previous declaration at usr/local/go-packages/src/honnef.co/go/tools/website/generate_checks.go:29:6
------
executor failed running [/bin/sh -c go get -u -v github.com/mdempsky/gocode &&     go get -u -v github.com/uudashr/gopkgs/cmd/gopkgs &&     go get -u -v github.com/ramya-rao-a/go-outline &&     go get -u -v github.com/acroca/go-symbols &&     go get -u -v golang.org/x/tools/cmd/guru &&     go get -u -v golang.org/x/tools/cmd/gorename &&     go get -u -v github.com/fatih/gomodifytags &&     go get -u -v github.com/haya14busa/goplay/cmd/goplay &&     go get -u -v github.com/josharian/impl &&     go get -u -v github.com/tylerb/gotype-live &&     go get -u -v github.com/rogpeppe/godef &&     go get -u -v github.com/zmb3/gogetdoc &&     go get -u -v golang.org/x/tools/cmd/goimports &&     go get -u -v github.com/sqs/goreturns &&     go get -u -v winterdrache.de/goformat/goformat &&     go get -u -v golang.org/x/lint/golint &&     go get -u -v github.com/cweill/gotests/... &&     go get -u -v github.com/alecthomas/gometalinter &&     go get -u -v honnef.co/go/tools/... &&     GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint &&     go get -u -v github.com/mgechev/revive &&     go get -u -v github.com/sourcegraph/go-langserver &&     go get -u -v github.com/go-delve/delve/cmd/dlv &&     go get -u -v github.com/davidrjenni/reftools/cmd/fillstruct &&     go get -u -v github.com/godoctor/godoctor]: exit code: 2

please help me thanks. in theia-full-docker
shell:docker build --no-cache -t theia-full:1111 .

BMRana94 commented 2 years ago

docker build --build-arg "version=latest" --build-arg "NODE_VERSION=12.18.3" --build-arg . -t theia-full --no-cache

@zbm0711 you can try the following docker command I have posted above when building the theia-full docker file. Please let me know if it works for you or not.

Thank you.

zbm0711 commented 2 years ago

the problem still exists. When i run build in 'go get -u -v honnef.co/go/tools/... && \'

11 534.7 usr/local/go-packages/src/honnef.co/go/tools/website/generate_config.go:19:6: main redeclared in this block

11 534.7 previous declaration at usr/local/go-packages/src/honnef.co/go/tools/website/generate_checks.go:29:6

I think it's like a problem with this library.

I want to know what this library does and whether I can delete it.

marcdumais-work commented 2 years ago

I want to know what this library does

We're not sure. There's a lot of tools in this image and we are not very familiar with a lot of them.

and whether I can delete it.

I think that's something you should try. Do you intend to use the image for go development?

marcdumais-work commented 2 years ago

11 534.7 usr/local/go-packages/src/honnef.co/go/tools/website/generate_config.go:19:6: main redeclared in this block

I am able to reproduce locally.

BMRana94 commented 2 years ago

@zbm0711 are you using an updated version of GO lang? If the version in the docker file is 1.15, it should be working on your end too when you try to build the image. If you do not intend to use GO in your development environment, then you can omit those libraries, and see if the image still builds. Please let me know if it works if you decide to delete that portion of the code.

BMRana94 commented 2 years ago

docker build --build-arg "version=latest" --build-arg "NODE_VERSION=12.18.3" --build-arg "GITHUB_TOKEN=$GH_TOKEN". -t theia-full --no-cache

Another thing you can try, is adding a github token while processing this command like shown above. To generate a token you can use the following link: https://github.com/settings/tokens. Then you can add your token in the above command, where $GH_TOKEN is.

dominikh commented 2 years ago

https://github.com/dominikh/go-tools/commit/8307a415ab7a8c59d9c8b1d9f3547aefadbd43b9 should fix your problems.

zbm0711 commented 2 years ago

dominikh/go-tools@8307a41 should fix your problems.

Yes, I see that I can continue to compile.But there was a new error,This is the error log.

11 490.9 go: downloading github.com/kisielk/gotool v1.0.0

11 490.9 go: downloading github.com/sanposhiho/wastedassign/v2 v2.0.6

11 490.9 go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1

11 490.9 go: downloading mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed

11 490.9 go: downloading github.com/chavacava/garif v0.0.0-20210405164556-e8a0a408d6af

11 491.1 go: downloading github.com/cespare/xxhash/v2 v2.1.1

11 491.1 go: downloading github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613

11 491.1 go: downloading github.com/mattn/go-runewidth v0.0.9

11 491.1 go: downloading github.com/esimonov/ifshort v1.0.3

11 491.2 go: downloading github.com/kisielk/errcheck v1.6.0

11 491.3 go: downloading mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b

11 496.4 # github.com/golangci/golangci-lint/internal/robustio

11 496.4 usr/local/go-packages/pkg/mod/github.com/golangci/golangci-lint@v1.43.0/internal/robustio/robustio_other.go:18:9: undefined: os.ReadFile

11 496.4 note: module requires Go 1.16

11 504.1 # github.com/golangci/golangci-lint/pkg/fsutils

11 504.1 usr/local/go-packages/pkg/mod/github.com/golangci/golangci-lint@v1.43.0/pkg/fsutils/filecache.go:27:20: undefined: os.ReadFile

11 504.1 note: module requires Go 1.16

11 508.1 # github.com/go-critic/go-critic/checkers

11 508.1 usr/local/go-packages/pkg/mod/github.com/go-critic/go-critic@v0.6.1/checkers/ruleguard_checker.go:149:17: undefined: os.ReadFile

11 512.4 # github.com/breml/bidichk/pkg/bidichk

11 512.4 usr/local/go-packages/pkg/mod/github.com/breml/bidichk@v0.1.1/pkg/bidichk/bidichk.go:46:15: undefined: os.ReadFile

#11 512.4 note: module requires Go 1.16

executor failed running [/bin/sh -c go get -u -v github.com/mdempsky/gocode && go get -u -v github.com/uudashr/gopkgs/cmd/gopkgs && go get -u -v github.com/ramya-rao-a/go-outline && go get -u -v github.com/acroca/go-symbols && go get -u -v golang.org/x/tools/cmd/guru && go get -u -v golang.org/x/tools/cmd/gorename && go get -u -v github.com/fatih/gomodifytags && go get -u -v github.com/haya14busa/goplay/cmd/goplay && go get -u -v github.com/josharian/impl && go get -u -v github.com/tylerb/gotype-live && go get -u -v github.com/rogpeppe/godef && go get -u -v github.com/zmb3/gogetdoc && go get -u -v golang.org/x/tools/cmd/goimports && go get -u -v github.com/sqs/goreturns && go get -u -v winterdrache.de/goformat/goformat && go get -u -v golang.org/x/lint/golint && go get -u -v github.com/cweill/gotests/... && go get -u -v github.com/alecthomas/gometalinter && go get -u -v honnef.co/go/tools/... && GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint && go get -u -v github.com/mgechev/revive && go get -u -v github.com/sourcegraph/go-langserver && go get -u -v github.com/go-delve/delve/cmd/dlv && go get -u -v github.com/davidrjenni/reftools/cmd/fillstruct && go get -u -v github.com/godoctor/godoctor]: exit code: 2

If I choose go version 1.16, there will be other errors. This is the error log

=> CANCELED [theia 3/3] RUN if [ "false" = "true" ]; then yarn --pure-lockfile && NODE_OPTIONS="--max_old_space_size=4096" yarn theia build && yarn theia download:plugins && yarn 31.6s

[stage-2 2/20] RUN go get -u -v github.com/mdempsky/gocode && go get -u -v github.com/uudashr/gopkgs/cmd/gopkgs && go get -u -v github.com/ramya-rao-a/go-outline && go get -u -v github.com/acroca/go-symbols && go get -u -v golang.org/x/tools/cmd/guru && go get -u -v golang.org/x/tools/cmd/gorename && go get -u -v github.com/fatih/gomodifytags && go get -u -v github.com/haya14busa/goplay/cmd/goplay && go get -u -v github.com/josharian/impl && go get -u -v github.com/tylerb/gotype-live && go get -u -v github.com/rogpeppe/godef && go get -u -v github.com/zmb3/gogetdoc && go get -u -v golang.org/x/tools/cmd/goimports && go get -u -v github.com/sqs/goreturns && go get -u -v winterdrache.de/goformat/goformat && go get -u -v golang.org/x/lint/golint && go get -u -v github.com/cweill/gotests/... && go get -u -v github.com/alecthomas/gometalinter && go get -u -v honnef.co/go/tools/... && GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint && go get -u -v github.com/mgechev/revive && go get -u -v github.com/sourcegraph/go-langserver && go get -u -v github.com/go-delve/delve/cmd/dlv && go get -u -v github.com/davidrjenni/reftools/cmd/fillstruct && go get -u -v github.com/godoctor/godoctor:

11 3.060 go: downloading github.com/mdempsky/gocode v0.0.0-20200405233807-4acdcbdea79d

11 5.321 go: downloading golang.org/x/tools v0.1.7

11 22.95 golang.org/x/tools/internal/typeparams

11 22.95 github.com/mdempsky/gocode/internal/lookdot

11 23.07 github.com/mdempsky/gocode/internal/suggest

11 23.09 golang.org/x/tools/go/internal/gcimporter

11 23.65 golang.org/x/tools/go/gcexportdata

11 23.70 github.com/mdempsky/gocode/internal/cache

11 23.76 github.com/mdempsky/gocode/internal/gbimporter

11 23.80 github.com/mdempsky/gocode

11 25.85 go: downloading github.com/uudashr/gopkgs v1.3.2

11 27.63 go: downloading github.com/uudashr/gopkgs/cmd/gopkgs v0.0.0-20191024034442-58e9141cd7d6

11 28.02 go: downloading github.com/uudashr/gopkgs v2.0.1+incompatible

11 31.38 go get: github.com/uudashr/gopkgs/cmd/gopkgs@none updating to

11 31.38 github.com/uudashr/gopkgs/cmd/gopkgs@v0.0.0-20191024034442-58e9141cd7d6 requires

11 31.38 github.com/uudashr/gopkgs/v2@v2.1.0 requires

11 31.38 github.com/uudashr/gopkgs@v0.0.0: reading github.com/uudashr/gopkgs/go.mod at revision v0.0.0: unknown revision v0.0.0


executor failed running [/bin/sh -c go get -u -v github.com/mdempsky/gocode && go get -u -v github.com/uudashr/gopkgs/cmd/gopkgs && go get -u -v github.com/ramya-rao-a/go-outline && go get -u -v github.com/acroca/go-symbols && go get -u -v golang.org/x/tools/cmd/guru && go get -u -v golang.org/x/tools/cmd/gorename && go get -u -v github.com/fatih/gomodifytags && go get -u -v github.com/haya14busa/goplay/cmd/goplay && go get -u -v github.com/josharian/impl && go get -u -v github.com/tylerb/gotype-live && go get -u -v github.com/rogpeppe/godef && go get -u -v github.com/zmb3/gogetdoc && go get -u -v golang.org/x/tools/cmd/goimports && go get -u -v github.com/sqs/goreturns && go get -u -v winterdrache.de/goformat/goformat && go get -u -v golang.org/x/lint/golint && go get -u -v github.com/cweill/gotests/... && go get -u -v github.com/alecthomas/gometalinter && go get -u -v honnef.co/go/tools/... && GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint && go get -u -v github.com/mgechev/revive && go get -u -v github.com/sourcegraph/go-langserver && go get -u -v github.com/go-delve/delve/cmd/dlv && go get -u -v github.com/davidrjenni/reftools/cmd/fillstruct && go get -u -v github.com/godoctor/godoctor]: exit code: 1

BMRana94 commented 2 years ago

@zbm0711 The best option it seems now, is to remove the GO commands from the docker file and then attempt to build it, (if you have not already done so). Omitting the block of code might allow the rest of the application to build.

zbm0711 commented 2 years ago

@zbm0711 The best option it seems now, is to remove the GO commands from the docker file and then attempt to build it, (if you have not already done so). Omitting the block of code might allow the rest of the application to build.

I gave up,ths.