che: Go sample `permission denied` issues with dependencies

Description

There are issues with current Go devfile sample https://github.com/eclipse/che-devfile-registry/tree/master/devfiles/go. This is the sample project: https://github.com/golang/example. We have tasks just for its outyet part, which works ok. However, there are many other Go files with main functions. Problematic ones are those with 3rd party dependencies, like this one https://github.com/golang/example/blob/master/gotypes/skeleton/main.go. When theia tries to build the file, it fails with permission denied to /go directory, when it try to download dependency there. go_permissiondenied

Reproduction Steps

There is another issue with clone path #13796 which affects also this devfile. This patch has to be applied to the devfile. Without that, project is cloned to ... golang/example/example. Once the issue is fixed, this patch must not be needed.

diff --git a/devfiles/go/devfile.yaml b/devfiles/go/devfile.yaml
index 8c09ff9..508a8c7 100644
--- a/devfiles/go/devfile.yaml
+++ b/devfiles/go/devfile.yaml
@@ -8,7 +8,7 @@ projects:
   source: 
     type: git
     location: https://github.com/golang/example.git
-  clonePath: src/github.com/golang/example/
+  clonePath: src/github.com/golang/
 components:
 -
   type: chePlugin

OS and version:
7.0.0-rc-4.0-SNAPSHOT

Diagnostics: running go: Current GOPATH task say /go:/projects is the current GOPATH. I believe this is the issue. GOPATH set in the plugin here https://github.com/eclipse/che-plugin-registry/blob/master/v3/plugins/ms-vscode/go/0.11.0/meta.yaml#L20 have /go as first and this is where it tries to download the dependency, but has no permissions there.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 25 (25 by maintainers)

Most upvoted comments

yes, works now. thanks.