DisposaBoy / GoSublime

A Golang plugin collection for SublimeText 3, providing code completion and other IDE-like features.
MIT License
3.42k stars 302 forks source link

Configure for WSL #824

Open ghost opened 6 years ago

ghost commented 6 years ago

Hello,

It would be nice if GoSublime could be configured to use WSL (Windows Subsystem for Linux). I've tried the following settings but am coming up with errors. It appears to still try to install the windows flavor, even though I'm specifying Linux. I should mention I'm using the debian WSL version.

Settings

{
    "shell": ["C:/Windows/System32/bash.exe", "--login", "-c", "${CMD}"],
    "env": {
        "shell": "/bin/bash",
        "GOROOT": "/usr/local/go",
        "GOPATH": "/mnt/c/Users/hawk/go"
    }
}

Error:

| GoSublime error: MarGo build failed
|                > This is possibly a bug or miss-configuration of your environment.
|                > For more help, please file an issue with the following build output
|                > at: https://github.com/DisposaBoy/GoSublime/issues/new
|                > or alternatively, you may send an email to: gosublime@dby.me
|                > 
|                > 
|                > cmd: `['', 'build', '-tags', '', '-v', '-o', 'gosublime.margo_r18.03.23-1_go?.exe', 'gosublime/cmd/margo']`
|                > stdout: `
|                > 
|                > `
|                > stderr: `
|                > 
|                > `
|                > exception: `Cannot find command `go``
|   install state: busy
| sublime.version: 3143
| sublime.channel: stable
|       about.ann: a18.03.23-1
|   about.version: r18.03.23-1
|         version: r18.03.23-1
|        platform: windows-x64
|            ~bin: ~\AppData\Roaming\Sublime Text 3\Packages\User\GoSublime\windows-x64\bin
|       margo.exe: ~bin\gosublime.margo_r18.03.23-1_go?.exe (missing)
|          go.exe: go (missing)
|      go.version: go?
|          GOROOT: /usr/local/go
|          GOPATH: /mnt/c/Users/hawk/go
|           GOBIN: (not set)
|       set.shell: ['C:/Windows/System32/bash.exe', '--login', '-c', '${CMD}']
|       env.shell: 
|       shell.cmd: ['C:/Windows/System32/bash.exe', '--login', '-c', '${CMD}']
|    sh.bootstrap: 
|                >  error building gosubl\sh-bootstrap.go: stat gosublsh-bootstrap.go: no such file or directory
|                > 
|                >  error running bin\gosubl-sh-bootstrap.exe: /bin/bash: bingosubl-sh-bootstrap.exe: command not found
|                > 
|                >  go version: `` (raw version string ``)
|                >  shell bootstrap took 1.124s
|                > 
DisposaBoy commented 6 years ago

I believe this specific issue can be fixed, but the rest of the code is just gonna call the go command directly and bring us back to square 1.

I plan to make the new version of margo run from inside of rkt, docker, etc. but there are no solid plans for that yet; maybe I can re-visit this when that happens.