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

GoSublime error: MarGo build failed #829

Closed salJoker closed 5 years ago

salJoker commented 6 years ago

| 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: ['C:/Program Files (x86)/Go\\bin\\go.exe', 'build', '-tags', '', '-v', '-o', 'gosublime.margo_r18.04.19-1_go?.exe', 'gosublime/cmd/margo'] | > stdout: | > | > | > stderr: | > gosublime/margo | > net | > gosublime/something-borrowed/types | > gosublime/margo/meth/importpaths | > vendor/golang_org/x/net/lex/httplex | > crypto/x509 | > net/textproto | > mime/multipart | > crypto/tls | > net/http/httptrace | > net/http | > net/http/pprof | > net/rpc | > gosublime/something-borrowed/gocode | > gosublime/cmd/margo_pkg | > gosublime/cmd/margo | > go install gosublime/cmd/margo: open gosublime.margo_r18.04.19-1_go?.exe: The filename, directory name, or volume label syntax is incorrect. | > | > exception: None | install state: busy | sublime.version: 3143 | sublime.channel: stable | about.ann: a18.04.19-1 | about.version: r18.04.19-1 | version: r18.04.19-1 | platform: windows-x64 | ~bin: ~\AppData\Roaming\Sublime Text 3\Packages\User\GoSublime\windows-x64\bin | margo.exe: ~bin\gosublime.margo_r18.04.19-1_go?.exe (missing) | go.exe: C:/Program Files (x86)/Go\bin\go.exe (ok) | go.version: go? | GOROOT: C:/Program Files (x86)/Go | GOPATH: E:/gowork;e:/gowork/goweb | GOBIN: (not set) | set.shell: [] | env.shell: | shell.cmd: ['C:\Windows\system32\cmd.exe', '/C', '${CMD}'] | sh.bootstrap: | > error building gosubl\sh-bootstrap.go: [WinError 740] 请求的操作需要提升。 | > error running bin\gosubl-sh-bootstrap.exe: [WinError 740] 请求的操作需要提升。 | > go version: (raw version string) | > shell bootstrap took 0.034s | > Look this ,please!

DisposaBoy commented 6 years ago

IIUC, that error means something needs higher priviledges but I'm not a Windows user so I don't know why that would be the case.

Can you compile ...\AppData\Roaming\Sublime Text 3\Packages\GoSublime\gosubl\sh-bootstrap.go manually?

gmichokostas commented 6 years ago

Getting a similar error on my MacBook

| 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: `['/usr/local/bin/go', 'build', '-tags', '', '-v', '-o', 'gosublime.margo_r18.04.19-1_go1.10.exe', 'gosublime/cmd/margo']`
|                > stdout: `
|                > 
|                > `
|                > stderr: `
|                > go: cannot find GOROOT directory: /usr/local/Cellar/go/1.10/libexec
|                > `
|                > exception: `None`
|   install state: busy
| sublime.version: 3143
| sublime.channel: stable
|       about.ann: a18.04.19-1
|   about.version: r18.04.19-1
|         version: r18.04.19-1
|        platform: osx-x64
|            ~bin: ~/Library/Application Support/Sublime Text 3/Packages/User/GoSublime/osx-x64/bin
|       margo.exe: ~bin/gosublime.margo_r18.04.19-1_go1.10.exe (missing)
|          go.exe: /usr/local/bin/go (ok)
|      go.version: go1.10
|          GOROOT: /usr/local/Cellar/go/1.10/libexec
|          GOPATH: ~/go
|           GOBIN: (not set)
|       set.shell: []
|       env.shell: /bin/zsh
|       shell.cmd: ['/bin/zsh', '-l', '-c', '${CMD}']
|    sh.bootstrap: 
|                >  GOPATH is not set... setting it to the default: ~/go
|                >  using shell env GOPATH=~/go
|                >  using shell env GOROOT=/usr/local/Cellar/go/1.10/libexec
|                >  using shell env PATH=~/.rvm/gems/ruby-2.5.1/bin:~/.rvm/gems/ruby-2.5.1@global/bin:~/.rvm/rubies/ruby-2.5.1/bin:~/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/share/dotnet:/usr/local/MacGPG2/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin:/Applications/Wireshark.app/Contents/MacOS:~/bin:~/go/bin:/usr/local/go/bin:/usr/local/opt/go/bin:~/.rvm/bin
|                >  go version: `go1.10` (raw version string `go1.10`)
|                >  shell bootstrap took 0.369s
|                > 
DisposaBoy commented 6 years ago

@gmichokostas I think that's a different issue. The line using shell env GOROOT= suggests that you're setting GOROOT and the error suggests you're setting it to the wrong value. If that's the case, the easiest fix is probably to stop setting it.

gmichokostas commented 6 years ago

@DisposaBoy I don't set the GOROOT manually on my machine.

echo $GOROOT returns nothing but

go go env GOROOT
/usr/local/Cellar/go/1.10.1/libexec

Another issue that I can see from the error message is, I currently have install go version 1.10.1 but the message prints a wrong version (/usr/local/Cellar/go/1.10/libexec)

DisposaBoy commented 6 years ago

@gmichokostas Maybe you have multiple versions of Go installed? The version as printed (raw version string go1.10) comes directly from runtime.Version() https://github.com/DisposaBoy/GoSublime/blob/master/gosubl/sh-bootstrap.go#L15

gmichokostas commented 6 years ago

@DisposaBoy

package main

import (
    "fmt"
    "runtime"
)

func main() {
    fmt.Println(runtime.Version())
}

returns go1.10.1

gmichokostas commented 6 years ago

@DisposaBoy I've removed and reinstalled the package and now I don't get any errors anymore. Thanks for your comments ✌️

DisposaBoy commented 6 years ago

@gmichokostas I found the issue, it was because the binary wasn't re-compiled so it contained the old Go version. It should be fixed in the latest release.