Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

(golang extensions) Linux<>Linux, uses client home instead of remote home #2981

Closed
Merith-TK opened this issue Jan 13, 2020 · 9 comments
Closed
Labels
needs-investigation vscode-remote Issues found when working with vscode-remote

Comments

@Merith-TK
Copy link

  • VSCode Version:
  • Local OS Version: Archlinux
  • Remote OS Version: Archlinux
  • Remote Extension/Connection Type: SSH

Steps to Reproduce:

  1. Open VSCode
  2. Configure and connect to remote

Does this issue occur when you try this locally?: No
Does this issue occur when you try this locally and all extensions are disabled?: Yes??

go.toolsGopath setting is not set. Using GOPATH /home/merith/.go
Installing 18 tools at /home/merith/.go/bin in module mode.
  gocode
  gopkgs
  go-outline
  go-symbols
  guru
  gorename
  gotests
  gomodifytags
  impl
  fillstruct
  goplay
  godoctor
  dlv
  gocode-gomod
  godef
  goimports
  golint
  gopls

Installing github.com/mdempsky/gocode FAILED
Installing github.com/uudashr/gopkgs/cmd/gopkgs FAILED
Installing github.com/ramya-rao-a/go-outline FAILED
Installing github.com/acroca/go-symbols FAILED
Installing golang.org/x/tools/cmd/guru FAILED
Installing golang.org/x/tools/cmd/gorename FAILED
Installing github.com/cweill/gotests/... FAILED
Installing github.com/fatih/gomodifytags FAILED
Installing github.com/josharian/impl FAILED
Installing github.com/davidrjenni/reftools/cmd/fillstruct FAILED
Installing github.com/haya14busa/goplay/cmd/goplay FAILED
Installing github.com/godoctor/godoctor FAILED
Installing github.com/go-delve/delve/cmd/dlv FAILED
Installing github.com/stamblerre/gocode FAILED
Installing github.com/rogpeppe/godef FAILED
Installing golang.org/x/tools/cmd/goimports FAILED
Installing golang.org/x/lint/golint FAILED
Installing golang.org/x/tools/gopls FAILED

18 tools failed to install.

gocode:
Error: Command failed: /usr/bin/go get -v github.com/mdempsky/gocode
go: failed to create cache directory /home/merith/.go/pkg/mod/cache: mkdir /home/merith: permission denied
go: failed to create cache directory /home/merith/.go/pkg/mod/cache: mkdir /home/merith: permission denied

gopkgs:
Error: Command failed: /usr/bin/go get -v github.com/uudashr/gopkgs/cmd/gopkgs
go: finding github.com/uudashr/gopkgs v2.0.1+incompatible
go: writing stat cache: mkdir /home/merith: permission denied
go: downloading github.com/uudashr/gopkgs v2.0.1+incompatible
go get github.com/uudashr/gopkgs/cmd/gopkgs: mkdir /home/merith: permission denied
go: finding github.com/uudashr/gopkgs v2.0.1+incompatible
go: writing stat cache: mkdir /home/merith: permission denied
go: downloading github.com/uudashr/gopkgs v2.0.1+incompatible
go get github.com/uudashr/gopkgs/cmd/gopkgs: mkdir /home/merith: permission denied

go-outline:
Error: Command failed: /usr/bin/go get -v github.com/ramya-rao-a/go-outline
go: finding github.com/ramya-rao-a/go-outline latest
go: downloading github.com/ramya-rao-a/go-outline v0.0.0-20181122025142-7182a932836a
go get github.com/ramya-rao-a/go-outline: mkdir /home/merith: permission denied
go: finding github.com/ramya-rao-a/go-outline latest
go: downloading github.com/ramya-rao-a/go-outline v0.0.0-20181122025142-7182a932836a
go get github.com/ramya-rao-a/go-outline: mkdir /home/merith: permission denied

go-symbols:
Error: Command failed: /usr/bin/go get -v github.com/acroca/go-symbols
go: finding github.com/acroca/go-symbols v0.1.1
go: writing stat cache: mkdir /home/merith: permission denied
go: downloading github.com/acroca/go-symbols v0.1.1
go get github.com/acroca/go-symbols: mkdir /home/merith: permission denied
go: finding github.com/acroca/go-symbols v0.1.1
go: writing stat cache: mkdir /home/merith: permission denied
go: downloading github.com/acroca/go-symbols v0.1.1
go get github.com/acroca/go-symbols: mkdir /home/merith: permission denied

guru:
Error: Command failed: /usr/bin/go get -v golang.org/x/tools/cmd/guru
go: finding golang.org/x/tools latest
go: downloading golang.org/x/tools v0.0.0-20200113211014-78c17663447c
go get golang.org/x/tools/cmd/guru: mkdir /home/merith: permission denied
go: finding golang.org/x/tools latest
go: downloading golang.org/x/tools v0.0.0-20200113211014-78c17663447c
go get golang.org/x/tools/cmd/guru: mkdir /home/merith: permission denied

gorename:
Error: Command failed: /usr/bin/go get -v golang.org/x/tools/cmd/gorename
go: finding golang.org/x/tools latest
go: downloading golang.org/x/tools v0.0.0-20200113211014-78c17663447c
go get golang.org/x/tools/cmd/gorename: mkdir /home/merith: permission denied
go: finding golang.org/x/tools latest
go: downloading golang.org/x/tools v0.0.0-20200113211014-78c17663447c
go get golang.org/x/tools/cmd/gorename: mkdir /home/merith: permission denied

gotests:
Error: Command failed: /usr/bin/go get -v github.com/cweill/gotests/...
go: finding github.com/cweill/gotests v1.5.3
go: writing stat cache: mkdir /home/merith: permission denied
go: downloading github.com/cweill/gotests v1.5.3
go get github.com/cweill/gotests/...: mkdir /home/merith: permission denied
go: finding github.com/cweill/gotests v1.5.3
go: writing stat cache: mkdir /home/merith: permission denied
go: downloading github.com/cweill/gotests v1.5.3
go get github.com/cweill/gotests/...: mkdir /home/merith: permission denied

gomodifytags:
Error: Command failed: /usr/bin/go get -v github.com/fatih/gomodifytags
go: finding github.com/fatih/gomodifytags v1.0.1
go: writing stat cache: mkdir /home/merith: permission denied
go: downloading github.com/fatih/gomodifytags v1.0.1
go get github.com/fatih/gomodifytags: mkdir /home/merith: permission denied
go: finding github.com/fatih/gomodifytags v1.0.1
go: writing stat cache: mkdir /home/merith: permission denied
go: downloading github.com/fatih/gomodifytags v1.0.1
go get github.com/fatih/gomodifytags: mkdir /home/merith: permission denied

impl:
Error: Command failed: /usr/bin/go get -v github.com/josharian/impl
go: finding github.com/josharian/impl latest
go: downloading github.com/josharian/impl v0.0.0-20191119165012-6b9658ad00c7
go get github.com/josharian/impl: mkdir /home/merith: permission denied
go: finding github.com/josharian/impl latest
go: downloading github.com/josharian/impl v0.0.0-20191119165012-6b9658ad00c7
go get github.com/josharian/impl: mkdir /home/merith: permission denied

fillstruct:
Error: Command failed: /usr/bin/go get -v github.com/davidrjenni/reftools/cmd/fillstruct
go: finding github.com/davidrjenni/reftools latest
go: downloading github.com/davidrjenni/reftools v0.0.0-20191222082827-65925cf01315
go get github.com/davidrjenni/reftools/cmd/fillstruct: mkdir /home/merith: permission denied
go: finding github.com/davidrjenni/reftools latest
go: downloading github.com/davidrjenni/reftools v0.0.0-20191222082827-65925cf01315
go get github.com/davidrjenni/reftools/cmd/fillstruct: mkdir /home/merith: permission denied

goplay:
Error: Command failed: /usr/bin/go get -v github.com/haya14busa/goplay/cmd/goplay
go: finding github.com/haya14busa/goplay v1.0.0
go: writing stat cache: mkdir /home/merith: permission denied
go: downloading github.com/haya14busa/goplay v1.0.0
go get github.com/haya14busa/goplay/cmd/goplay: mkdir /home/merith: permission denied
go: finding github.com/haya14busa/goplay v1.0.0
go: writing stat cache: mkdir /home/merith: permission denied
go: downloading github.com/haya14busa/goplay v1.0.0
go get github.com/haya14busa/goplay/cmd/goplay: mkdir /home/merith: permission denied

godoctor:
Error: Command failed: /usr/bin/go get -v github.com/godoctor/godoctor
go: finding github.com/godoctor/godoctor latest
go: downloading github.com/godoctor/godoctor v0.0.0-20181123222458-69df17f3a6f6
go get github.com/godoctor/godoctor: mkdir /home/merith: permission denied
go: finding github.com/godoctor/godoctor latest
go: downloading github.com/godoctor/godoctor v0.0.0-20181123222458-69df17f3a6f6
go get github.com/godoctor/godoctor: mkdir /home/merith: permission denied

dlv:
Error: Command failed: /usr/bin/go get -v github.com/go-delve/delve/cmd/dlv
go: finding github.com/go-delve/delve v1.3.2
go: writing stat cache: mkdir /home/merith: permission denied
go: downloading github.com/go-delve/delve v1.3.2
go get github.com/go-delve/delve/cmd/dlv: mkdir /home/merith: permission denied
go: finding github.com/go-delve/delve v1.3.2
go: writing stat cache: mkdir /home/merith: permission denied
go: downloading github.com/go-delve/delve v1.3.2
go get github.com/go-delve/delve/cmd/dlv: mkdir /home/merith: permission denied

gocode-gomod:
Error: Command failed: /usr/bin/go get -v -d github.com/stamblerre/gocode
go: finding github.com/stamblerre/gocode v1.0.0
go: writing stat cache: mkdir /home/merith: permission denied
go: downloading github.com/stamblerre/gocode v1.0.0
go get github.com/stamblerre/gocode: mkdir /home/merith: permission denied
go: finding github.com/stamblerre/gocode v1.0.0
go: writing stat cache: mkdir /home/merith: permission denied
go: downloading github.com/stamblerre/gocode v1.0.0
go get github.com/stamblerre/gocode: mkdir /home/merith: permission denied

godef:
Error: Command failed: /usr/bin/go get -v github.com/rogpeppe/godef
go: finding github.com/rogpeppe/godef v1.1.1
go: writing stat cache: mkdir /home/merith: permission denied
go: downloading github.com/rogpeppe/godef v1.1.1
go get github.com/rogpeppe/godef: mkdir /home/merith: permission denied
go: finding github.com/rogpeppe/godef v1.1.1
go: writing stat cache: mkdir /home/merith: permission denied
go: downloading github.com/rogpeppe/godef v1.1.1
go get github.com/rogpeppe/godef: mkdir /home/merith: permission denied

goimports:
Error: Command failed: /usr/bin/go get -v golang.org/x/tools/cmd/goimports
go: finding golang.org/x/tools latest
go: downloading golang.org/x/tools v0.0.0-20200113211014-78c17663447c
go get golang.org/x/tools/cmd/goimports: mkdir /home/merith: permission denied
go: finding golang.org/x/tools latest
go: downloading golang.org/x/tools v0.0.0-20200113211014-78c17663447c
go get golang.org/x/tools/cmd/goimports: mkdir /home/merith: permission denied

golint:
Error: Command failed: /usr/bin/go get -v golang.org/x/lint/golint
go: finding golang.org/x/lint latest
go: downloading golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f
go get golang.org/x/lint/golint: mkdir /home/merith: permission denied
go: finding golang.org/x/lint latest
go: downloading golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f
go get golang.org/x/lint/golint: mkdir /home/merith: permission denied

gopls:
Error: Command failed: /usr/bin/go get -v golang.org/x/tools/gopls
go: finding golang.org/x/tools latest
go: finding golang.org/x/tools/gopls v0.2.2
go: writing stat cache: mkdir /home/merith: permission denied
go: downloading golang.org/x/tools/gopls v0.2.2
go: downloading golang.org/x/tools v0.0.0-20200113211014-78c17663447c
go get golang.org/x/tools/gopls: mkdir /home/merith: permission denied
go: finding golang.org/x/tools latest
go: finding golang.org/x/tools/gopls v0.2.2
go: writing stat cache: mkdir /home/merith: permission denied
go: downloading golang.org/x/tools/gopls v0.2.2
go: downloading golang.org/x/tools v0.0.0-20200113211014-78c17663447c
go get golang.org/x/tools/gopls: mkdir /home/merith: permission denied

when i am updating the tools

i operate over lan by remote accessing my dev server alot
the golang extension messes with this because when you "update the tools" it appears to use the client gopath instead of the remote gopath

my personal gopath is /home/merith/.go
my remote gopath is /home/developer/go

both client and server are running go 1.13.6 and the latest updates of both extensions.

@Merith-TK
Copy link
Author

the only workaround i found for this is to set go.gopath in the remote settings.json

@egamma
Copy link
Member

egamma commented Jan 15, 2020

Given the discussion in #2576 I conclude that the go extension revert the machine scope for some settings.

@sandy081 I assume this has been addressed on the VS Code side with the introduction of the scope machine-overridable and go extension should now adopt this new scope.

the only workaround i found for this is to set go.gopath in the remote settings.json

@sandy081
Copy link
Member

Yes, looks to me Go extension shall fix this by making the setting machine-overridable so that the client user value is ignored.

Please file issue against Go extension.

@sandy081 sandy081 transferred this issue from microsoft/vscode-remote-release Jan 15, 2020
@sandy081 sandy081 removed their assignment Jan 15, 2020
@sandy081 sandy081 reopened this Jan 15, 2020
@sandy081
Copy link
Member

Moved to Go extension repo.

@Merith-TK
Copy link
Author

oh thank you @sandy081 ! didnt even know that was possibe to move issues

@stamblerre stamblerre added needs-investigation vscode-remote Issues found when working with vscode-remote labels Feb 12, 2020
@Merith-TK
Copy link
Author

okay yeah this is still an issue

go.toolsGopath setting is not set. Using GOPATH /home/merith/.go
Installing 1 tool at /home/merith/.go/bin in module mode.
  gocode

Installing github.com/mdempsky/gocode FAILED

1 tools failed to install.

gocode:
Error: Command failed: /usr/bin/go get -v github.com/mdempsky/gocode
go: downloading github.com/mdempsky/gocode v0.0.0-20191202075140-939b4a677f2f
go get github.com/mdempsky/gocode: mkdir /home/merith: permission denied
go: downloading github.com/mdempsky/gocode v0.0.0-20191202075140-939b4a677f2f
go get github.com/mdempsky/gocode: mkdir /home/merith: permission denied

While it clearly states that there is a way to change it, it is still an issue as it still utilizes the Clients home directory when it should use the remotes home directory, (in this case, it is /home/developer)

hyangah added a commit to hyangah/vscode-go-old that referenced this issue Jun 4, 2020
By setting them machine-overridable, client user values can be
ignored in remote settings and the remote side can pick up the right
value.

I think go.alternateTools should be machine-overridable as well
but will get to it next time.

Manually tested by

1) setting go.gopath in user settings, vsce package,
connecting to the remote host, sideloading vsix (do it after connecting,
so the remote host can pick up the vsix), and checking the GOPATH
with "Go: Current GOPATH" and also, by reinstalling all tools.

2) setting go.gopath in workspace settings and checking it's still doable.

Fixes microsoft#2981
Updates microsoft#2576

Change-Id: I3390355d186280c13353d210adb51edfa3858032
@hyangah
Copy link
Contributor

hyangah commented Jun 4, 2020

I made a change in the new repo. (https://go-review.googlesource.com/c/vscode-go/+/236539). Once the cl is approved and merged, we will release a nightly version and ping this thread to ask to test.

cc/ @ramya-rao-a

gopherbot pushed a commit to golang/vscode-go that referenced this issue Jun 4, 2020
By setting them machine-overridable, client user values can be
ignored in remote settings and the remote side can pick up the right
value.

I think go.alternateTools should be machine-overridable as well
but will get to it next time.

Manually tested by

1) setting go.gopath in user settings, vsce package,
connecting to the remote host, sideloading vsix (do it after connecting,
so the remote host can pick up the vsix), and checking the GOPATH
with "Go: Current GOPATH" and also, by reinstalling all tools.

2) setting go.gopath in workspace settings and checking it's still doable.

Fixes microsoft/vscode-go#2981
Updates microsoft/vscode-go#2576

Change-Id: I3390355d186280c13353d210adb51edfa3858032

Change-Id: I3390355d186280c13353d210adb51edfa3858032
GitHub-Last-Rev: 0463b84
GitHub-Pull-Request: #175
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/236539
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
@hyangah
Copy link
Contributor

hyangah commented Jun 8, 2020

This change is now available in Go Nightly (2020.6.716). Please test if it works as you expected.
https://github.com/golang/vscode-go/blob/master/docs/nightly.md#installation

If it works as expected, I hope to get it included in the next stable release (0.15.0).

@hyangah hyangah closed this as completed Jun 8, 2020
@Merith-TK
Copy link
Author

Unable to test as of this moment, as i have no compatible remotes availible to me at the moment, will test when i get the chance

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-investigation vscode-remote Issues found when working with vscode-remote
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants