vugu / vgrun

Command line Vugu runner utility
MIT License
4 stars 3 forks source link

vgrun -install-tools fails #3

Closed joe-getcouragenow closed 3 years ago

joe-getcouragenow commented 3 years ago
/Users/apple/workspace/go/bin/vugugen
vgrun -install-tools
2020/08/24 11:51:08 Installing vugugen
2020/08/24 11:51:12 Error installing vugugen: exit status 1; full output:
cannot find module providing package github.com/vugu/vugu/cmd/vugugen: working directory is not part of a module
make: *** [build] Error 1

The other bits still work though because i installed vugugen manually, but for others it wont work.


mkdir test
➜  tinygo-ex git:(master) ✗ cd test
➜  test git:(master) ✗ vgrun -new-from-example=simple .
2020/08/24 11:52:43 Running command: [git clone -q --depth=1 https://github.com/vugu-examples/simple .]
2020/08/24 11:52:45 Removing .git directory from example
➜  test git:(master) ✗ vgrun devserver.go
2020/08/24 11:53:07 Starting HTTP Server at "127.0.0.1:8844"
WasmCompiler: Successful generate
WasmCompiler: Successful build
joe-getcouragenow commented 3 years ago

also my env because this error might be due to a change in golang and modules, but not sure.

I have GO111MODULE="on" of course.

go version
go version go1.15 darwin/amd64

go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN="/Users/apple/workspace/go/bin"
GOCACHE="/Users/apple/Library/Caches/go-build"
GOENV="/Users/apple/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/apple/workspace/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/apple/workspace/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/opt/go/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/wp/ff6sz9qs6g71jnm12nj2kbyw0000gp/T/go-build891913238=/tmp/go-build -gno-record-gcc-switches -fno-common"
joe-getcouragenow commented 3 years ago

Just doing the calls manually also fails. Not sure why its complaining about the github.com/vugu/vugu repo and "working directory is not part of a module", because it is.

go get -u github.com/vugu/vugu/cmd/vugugen
go: found github.com/vugu/vugu/cmd/vugugen in github.com/vugu/vugu v0.3.2
➜  tinygo-ex git:(master) ✗ go install github.com/vugu/vugu/cmd/vugugen
cannot find module providing package github.com/vugu/vugu/cmd/vugugen: working directory is not part of a module
bradleypeabody commented 3 years ago

Interesting. I believe this is because GO111MODULE is set to on. If you set it to auto things should work correctly.

From reading here though https://blog.golang.org/modules2019 it looks like the intention is for on to be the new default at some point. So vgrun should probably be updated to work properly with the various GO111MODULE values.

Let me know if auto fixes the problem, and then we can take a look at what an appropriate fix would be.

joe-getcouragenow commented 3 years ago

Yep you were right !

I changed GO111MODULE to "auto", and its all working.


vgrun -install-tools
2020/08/25 06:51:36 Installing vugugen
2020/08/25 06:51:47 Installing vgrgen

env:

go env
GO111MODULE="auto"
GOARCH="amd64"
GOBIN="/Users/apple/workspace/go/bin"
GOCACHE="/Users/apple/Library/Caches/go-build"
GOENV="/Users/apple/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/apple/workspace/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/apple/workspace/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/opt/go/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/wp/ff6sz9qs6g71jnm12nj2kbyw0000gp/T/go-build241480537=/tmp/go-build -gno-record-gcc-switches -fno-common"
bradleypeabody commented 3 years ago

Okay great. I also just pushed a fix for this which should make it work regardless of GO111MODULE env setting. I'll close this now, let me know if you run into more issues.