andrewkroh / gvm

Go Version Manager (written in Go for cross-platform usability)
Apache License 2.0
195 stars 24 forks source link

build failing #18

Closed joeblew99 closed 5 years ago

joeblew99 commented 5 years ago

I can do go get -u github.com/andrewkroh/gvm/cmd/gvm and it works.

GO111MODULE=on go get -u github.com/andrewkroh/gvm/cmd/gvm
go: finding github.com/andrewkroh/gvm/cmd/gvm latest
go: finding github.com/andrewkroh/gvm/cmd latest
go: finding github.com/alecthomas/template latest
go: finding github.com/alecthomas/units latest
go: finding golang.org/x/sys latest
go: downloading github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4
go: downloading github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
go: extracting github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4
go: extracting github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751

But i cant do a build the normal way, it fails to see the Commands at compile time. Any ideas ?

cd /Users/apple/workspace/go/src/github.com/andrewkroh/gvm && GO111MODULE=on go build -o /Users/apple/workspace/go/bin/gvm /Users/apple/workspace/go/src/github.com/andrewkroh/gvm/cmd/gvm/gvm.go
# command-line-arguments
cmd/gvm/gvm.go:57:10: undefined: useCommand
cmd/gvm/gvm.go:59:10: undefined: initCommand
cmd/gvm/gvm.go:60:10: undefined: installCommand
cmd/gvm/gvm.go:61:10: undefined: availCommand
cmd/gvm/gvm.go:62:10: undefined: listCommand
cmd/gvm/gvm.go:63:10: undefined: removeCommand
cmd/gvm/gvm.go:64:10: undefined: purgeCommand
andrewkroh commented 5 years ago

When you run go build it builds what you tell it to build. And in your command you are only telling it to build cmd/gvm/gvm.go and are not including the other files in the package. See go help build.

joeblew99 commented 5 years ago

thanks for the tip. works now -

GO111MODULE=on go build -o /Users/apple/workspace/go/bin/gvm /Users/apple/workspace/go/src/github.com/andrewkroh/gvm/cmd/gvm
stefanjarina commented 4 years ago

Same error from freshly built from source:

> pwd

Path
----
E:\code\golang\src\github.com\andrewkroh\gvm\cmd\gvm

> $Env:GO111MODULE
on
> go build .
> ls gvm.exe

    Directory: E:\code\golang\src\github.com\andrewkroh\gvm\cmd\gvm

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          01.11.2020    16:06       10940928 gvm.exe

> .\gvm.exe available
Exception 0xc0000005 0x0 0x7fffcd632fff 0x1290000
PC=0x1290000

syscall.Syscall6(0x7fffcc645b20, 0x4, 0xc0000c80f0, 0x0, 0xc000035f18, 0xc000035e88, 0x0, 0x0, 0x0, 0x0, ...)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/runtime/syscall_windows.go:201 +0xf2
syscall.GetAddrInfoW(0xc0000c80f0, 0x0, 0xc000035f18, 0xc000035e88, 0x17, 0x0)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/syscall/zsyscall_windows.go:1718 +0xb3
net.(*Resolver).lookupIP.func1(0x0, 0x0, 0x0, 0x0, 0x0)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/lookup_windows.go:109 +0x245
net.(*Resolver).lookupIP.func2(0xc000096d00, 0xc0001127e0)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/lookup_windows.go:146 +0x32
created by net.(*Resolver).lookupIP
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/lookup_windows.go:145 +0x400

goroutine 1 [select]:
net/http.(*Transport).getConn(0xba8bc0, 0xc00014a270, 0x0, 0x865aa5, 0x5, 0xc00009ea60, 0x1a, 0x0, 0x0, 0x0, ...)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/http/transport.go:1291 +0x582
net/http.(*Transport).roundTrip(0xba8bc0, 0xc00011e100, 0xe, 0x8, 0x40d14f)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/http/transport.go:552 +0x72d
net/http.(*Transport).RoundTrip(0xba8bc0, 0xc00011e100, 0xba8bc0, 0x0, 0x0)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/http/roundtrip.go:17 +0x3c
net/http.send(0xc00011e100, 0x8e91e0, 0xba8bc0, 0x0, 0x0, 0x0, 0xc0000ca200, 0xc000096c40, 0x1, 0x0)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/http/client.go:252 +0x445
net/http.(*Client).send(0xc00014a0c0, 0xc00011e100, 0x0, 0x0, 0x0, 0xc0000ca200, 0x0, 0x1, 0x5d18db)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/http/client.go:176 +0x101
net/http.(*Client).do(0xc00014a0c0, 0xc00011e100, 0x0, 0x0, 0x0)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/http/client.go:699 +0x451
net/http.(*Client).Do(...)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/http/client.go:567
github.com/andrewkroh/gvm.iterXMLDirListing(0x865aa5, 0x25, 0xc0000c7a28, 0x0, 0x0)
        E:/code/golang/src/github.com/andrewkroh/gvm/binrepo.go:103 +0x2cf
github.com/andrewkroh/gvm.(*Manager).AvailableBinaries(0xc00013c000, 0x733000, 0xc00009ea00, 0x18, 0x800001ed, 0x0)
        E:/code/golang/src/github.com/andrewkroh/gvm/binrepo.go:47 +0x169
github.com/andrewkroh/gvm.(*Manager).Available(0xc00013c000, 0xc00009ea00, 0x18, 0xc00009e9a0, 0x13, 0x857172, 0x4, 0xc00009e9a0, 0x13)
        E:/code/golang/src/github.com/andrewkroh/gvm/gvm.go:96 +0x26d
main.availCommand.func1(0xc00013c000, 0x0, 0x0)
        E:/code/golang/src/github.com/andrewkroh/gvm/cmd/gvm/avail.go:12 +0x47
main.main()
        E:/code/golang/src/github.com/andrewkroh/gvm/cmd/gvm/gvm.go:100 +0xed1

goroutine 19 [select]:
net.(*Resolver).lookupIPAddr(0xbae540, 0x8f06c0, 0xc000112660, 0x856d58, 0x3, 0xc00009ea60, 0x16, 0x1bb, 0x0, 0x0, ...)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/lookup.go:274 +0x66b
net.(*Resolver).internetAddrList(0xbae540, 0x8f06c0, 0xc000112660, 0x856d58, 0x3, 0xc00009ea60, 0x1a, 0x0, 0x0, 0x0, ...)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/ipsock.go:280 +0x4e1
net.(*Resolver).resolveAddrList(0xbae540, 0x8f06c0, 0xc000112660, 0x8570c6, 0x4, 0x856d58, 0x3, 0xc00009ea60, 0x1a, 0x0, ...)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/dial.go:222 +0x4a5
net.(*Dialer).DialContext(0xc0001120c0, 0x8f0680, 0xc0000a00a0, 0x856d58, 0x3, 0xc00009ea60, 0x1a, 0x0, 0x0, 0x0, ...)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/dial.go:404 +0x231
net/http.(*Transport).dial(0xba8bc0, 0x8f0680, 0xc0000a00a0, 0x856d58, 0x3, 0xc00009ea60, 0x1a, 0x0, 0x0, 0x0, ...)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/http/transport.go:1085 +0x1fc
net/http.(*Transport).dialConn(0xba8bc0, 0x8f0680, 0xc0000a00a0, 0x0, 0x865aa5, 0x5, 0xc00009ea60, 0x1a, 0x0, 0xc0000e4ea0, ...)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/http/transport.go:1519 +0x19f5
net/http.(*Transport).dialConnFor(0xba8bc0, 0xc0000f4370)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/http/transport.go:1365 +0xcd
created by net/http.(*Transport).queueForDial
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/http/transport.go:1334 +0x405

goroutine 20 [select]:
net.(*Resolver).lookupIP(0xbae540, 0x8f0640, 0xc0000f0800, 0x856d58, 0x3, 0xc00009ea60, 0x16, 0x0, 0x0, 0x0, ...)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/lookup_windows.go:151 +0x1a0
net.glob..func1(0x8f0640, 0xc0000f0800, 0xc000089340, 0x856d58, 0x3, 0xc00009ea60, 0x16, 0xc0000a00a0, 0x0, 0x865aa5, ...)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/hook.go:23 +0x79
net.(*Resolver).lookupIPAddr.func1(0x0, 0x0, 0x0, 0x0)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/net/lookup.go:268 +0xc0
internal/singleflight.(*Group).doCall(0xbae550, 0xc0000e2410, 0xc00009eb60, 0x1a, 0xc0000f0840)
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/internal/singleflight/singleflight.go:95 +0x35
created by internal/singleflight.(*Group).DoChan
        C:/Users/stefa/.gvm/versions/go1.14.3.windows.amd64/src/internal/singleflight/singleflight.go:88 +0x2c3
rax     0x7fffca360b92
rbx     0x7fffca360b90
rcx     0x77
rdi     0xffffffffffbadd11
rsi     0x0
rbp     0x0
rsp     0x10aeac0
r8      0x97c
r9      0x97c
r10     0x97c
r11     0x97c
r12     0xc000007a
r13     0x0
r14     0x7fffca360b92
r15     0x7fffcd430000
rip     0x1290000
rflags  0x10202
cs      0x33
fs      0x53
gs      0x2b

Unfortunately don't have any other windows machine to test it there, so I can't say if this is limited to my pc