rahulrai-in / vsc-remote-docker-compose

Companion source code for my blog: https://thecloudblog.net/post/vs-code-remote-development-with-docker-compose-developing-services-in-standalone-and-integrated-modes/
8 stars 2 forks source link

Golang container doesn't seem to build now #1

Open dboreham opened 3 years ago

dboreham commented 3 years ago

Some googling suggests this is to do with gometalinter being now deprecated:

github.com/alecthomas/gometalinter
# github.com/alecthomas/gometalinter
pkg/mod/github.com/alecthomas/gometalinter@v3.0.0+incompatible/main.go:36:94: cannot use loadConfig (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.ParseConte
xt) error) as type kingpin.Action in argument to app.cmdMixin.flagGroup.Flag("config", "Load JSON configuration from file.").Envar("GOMETALINTER_CONFIG").Action
pkg/mod/github.com/alecthomas/gometalinter@v3.0.0+incompatible/main.go:38:100: cannot use disableAction (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.ParseC
ontext) error) as type kingpin.Action in argument to app.cmdMixin.flagGroup.Flag("disable", "Disable previously enabled linters.").PlaceHolder("LINTER").Short('D').Action
pkg/mod/github.com/alecthomas/gometalinter@v3.0.0+incompatible/main.go:39:99: cannot use enableAction (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.ParseCon
text) error) as type kingpin.Action in argument to app.cmdMixin.flagGroup.Flag("enable", "Enable previously disabled linters.").PlaceHolder("LINTER").Short('E').Action
pkg/mod/github.com/alecthomas/gometalinter@v3.0.0+incompatible/main.go:40:83: cannot use cliLinterOverrides (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.Pa
rseContext) error) as type kingpin.Action in argument to app.cmdMixin.flagGroup.Flag("linter", "Define a linter.").PlaceHolder("NAME:COMMAND:PATTERN").Action
pkg/mod/github.com/alecthomas/gometalinter@v3.0.0+incompatible/main.go:43:56: cannot use disableAllAction (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.Pars
eContext) error) as type kingpin.Action in argument to app.cmdMixin.flagGroup.Flag("disable-all", "Disable all linters.").Action
pkg/mod/github.com/alecthomas/gometalinter@v3.0.0+incompatible/main.go:44:54: cannot use enableAllAction (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.Parse
Context) error) as type kingpin.Action in argument to app.cmdMixin.flagGroup.Flag("enable-all", "Enable all linters.").Action
pkg/mod/github.com/alecthomas/gometalinter@v3.0.0+incompatible/main.go:200:12: cannot use loadDefaultConfig (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.Pa
rseContext) error) as type kingpin.Action in argument to app.Action
ERROR: Service 'pong' failed to build : The command '/bin/sh -c apt-get update     && apt-get -y install --no-install-recommends apt-utils dialog 2>&1     && apt-get -y instal
l git openssh-client less iproute2 procps lsb-release     && mkdir -p /tmp/gotools     && cd /tmp/gotools     && GOPATH=/tmp/gotools GO111MODULE=on go get -v golang.org/x/tool
s/gopls@latest 2>&1     && GOPATH=/tmp/gotools GO111MODULE=on go get -v     honnef.co/go/tools/...@latest     golang.org/x/tools/cmd/gorename@latest     golang.org/x/tools/cmd
/goimports@latest     golang.org/x/tools/cmd/guru@latest     golang.org/x/lint/golint@latest     github.com/mdempsky/gocode@latest     github.com/cweill/gotests/...@latest
 github.com/haya14busa/goplay/cmd/goplay@latest     github.com/sqs/goreturns@latest     github.com/josharian/impl@latest     github.com/davidrjenni/reftools/cmd/fillstruct@lat
est     github.com/uudashr/gopkgs/v2/cmd/gopkgs@latest      github.com/ramya-rao-a/go-outline@latest      github.com/acroca/go-symbols@latest      github.com/godoctor/godoctor
@latest      github.com/rogpeppe/godef@latest      github.com/zmb3/gogetdoc@latest     github.com/fatih/gomodifytags@latest      github.com/mgechev/revive@latest      github.c
om/go-delve/delve/cmd/dlv@latest 2>&1     && GOPATH=/tmp/gotools go get -v github.com/alecthomas/gometalinter 2>&1     && GOPATH=/tmp/gotools go get -x -d github.com/stamblerr
e/gocode 2>&1     && GOPATH=/tmp/gotools go build -o gocode-gomod github.com/stamblerre/gocode     && mv /tmp/gotools/bin/* /usr/local/bin/     && mv gocode-gomod /usr/local/b
in/     && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/local/bin 2>&1     && groupadd --gid $USER_GID $USERNAME
  && useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME     && apt-get install -y sudo     && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAM
E     && chmod 0440 /etc/sudoers.d/$USERNAME     && apt-get autoremove -y     && apt-get clean -y     && rm -rf /var/lib/apt/lists/* /tmp/gotools' returned a non-zero code: 2
[109923 ms] Command failed: docker-compose --project-name vsc-remote-docker-compose -f /home/david/projects/play/vsc-remote-docker-compose/docker-compose-pong.yml up -d --build
[166914 ms] Start: Run: docker context show
rahulrai-in commented 3 years ago

Tanks for identifying the issue @dboreham. Since you have investigated the issue, would you like to PR a fix? I will take a look at it over the weekend otherwise. Thanks again.

dboreham commented 3 years ago

My golang-fu is weak, but sure I'll take a look.

dboreham commented 3 years ago

So...I'm on the verge of random flailing here, but I found what appears to be the current MS go dev container here : https://github.com/microsoft/vscode-remote-try-go/blob/master/.devcontainer/Dockerfile , and when I replace the existing Dockerfile with that one, it seems to work in that I can build and debug pong.go in it. If this sounds reasonable I will make a PR.

rahulrai-in commented 3 years ago

You are heading in the right direction. As you must have seen that the Dockerfiles in the project are created by VS Code and are not written by me.

This is the repo used by VS Code to scaffold GoLang dev containers: https://github.com/microsoft/vscode-dev-containers/tree/master/containers/go/.devcontainer

I would recommend that you update your remote development extension and then use VS Code to generate devcontainer Dockerfiles for a simple GoLang project. You can then update the Dockerfile of this project with what VSCode generates for you.

HTH.

dboreham commented 3 years ago

Actually I began looking around that repo before I found your blog post. I had no idea VSCode would auto-generate projects with the Dockerfiles and all. They seem to not like using "discoverable" UI these days.