gobuffalo / buffalo

Rapid Web Development w/ Go
http://gobuffalo.io
MIT License
8.08k stars 578 forks source link

Install Buffalo on Windows with multi GOPATH. #1460

Closed frederikhors closed 6 years ago

frederikhors commented 6 years ago

Description

I'm new to Buffalo and I want to install it in my Windows environment with a multi GOPATH env like this:

GOPATH=C:\Users\fred\go;C:\Users\fred\Desktop\projects\Go;

Steps to Reproduce the Problem

I'm using the custom installation without SQLite (https://gobuffalo.io/en/docs/installation#custom-installation-without-sqlite3-support) with:

go get -u -v github.com/gobuffalo/buffalo/buffalo

But my project is in folder C:\Users\fred\Desktop\projects\Go\src\newProject not in C:\Users\fred\go (where it is also /bin).

Expected Behavior

Everything should be good, but...

Actual Behavior

Using this commands:

it, after the npm part which seems OK, gives an error saying:

...
create  grifts\db.go
  run  go get github.com/gobuffalo/buffalo-pop
[DEPRECATED] generate.Config has been deprecated.
  Use github.com/gobuffalo/pop/genny/config instead.
  run  goimports -w C:\Users\fred\Desktop\projects\Go\src\new_project\actions\actions_test.go C:\Users\fred\Desktop\projects\Go\src\new_project\actions\app.go C:\Users\fred\Desktop\projects\Go\src\new_project\actions\home.go C:\Users\fred\Desktop\projects\Go\src\new_project\actions\home_test.go C:\Users\fred\Desktop\projects\Go\src\new_project\actions\render.go C:\Users\fred\Desktop\projects\Go\src\new_project\grifts\db.go C:\Users\fred\Desktop\projects\Go\src\new_project\grifts\init.go C:\Users\fred\Desktop\projects\Go\src\new_project\main.go C:\Users\fred\Desktop\projects\Go\src\new_project\models\models.go C:\Users\fred\Desktop\projects\Go\src\new_project\models\models_test.go
  run  go get -t ./...
main.go:6:2: local import "../../Desktop/projects/go/src/new_project/actions" in non-local package
actions\app.go:10:2: local import "../../Desktop/projects/go/src/new_project/models" in non-local package
grifts\init.go:4:2: local import "../../Desktop/projects/go/src/new_project/actions" in non-local package
...

Info

``` ### Buffalo Version v0.13.6 ### App Information Pwd=C:\Users\fred\Desktop\projects\go\src Root=C:\Users\fred\Desktop\projects\go\src GoPath=C:\Users\fred\go;C:\Users\fred\Desktop\projects\go; Name=src Bin=bin\src.exe PackagePkg=../../Desktop/projects/Go/src ActionsPkg=../../Desktop/projects/Go/src/actions ModelsPkg=../../Desktop/projects/Go/src/models GriftsPkg=../../Desktop/projects/Go/src/grifts VCS= WithPop=false WithSQLite=false WithDep=false WithWebpack=false WithYarn=false WithDocker=false WithGrifts=false WithModules=false ### Go Version go version go1.11.2 windows/amd64 ### Go Env set GOARCH=amd64 set GOBIN= set GOCACHE=C:\Users\fred\AppData\Local\go-build set GOEXE=.exe set GOFLAGS= set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOOS=windows set GOPATH=C:\Users\fred\go;C:\Users\fred\Desktop\projects\go; set GOPROXY= set GORACE= set GOROOT=C:\Go set GOTMPDIR= set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64 set GCCGO=gccgo set CC=gcc set CXX=g++ set CGO_ENABLED=1 set GOMOD= set CGO_CFLAGS=-g -O2 set CGO_CPPFLAGS= set CGO_CXXFLAGS=-g -O2 set CGO_FFLAGS=-g -O2 set CGO_LDFLAGS=-g -O2 set PKG_CONFIG=pkg-config set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\fred\AppData\Local\Temp\go-build593158554=/tmp/go-build -gno-record-gcc-switches ### Node Version v10.13.0 ### NPM Version 6.4.1 ### Yarn Version 1.10.1 ### PostgreSQL Version PostgreSQL Not Found ### MySQL Version MySQL Not Found ### SQLite Version SQLite Not Found ### Dep Version could not find a Gopkg.toml file ### Dep Status could not find a Gopkg.toml file ```
markbates commented 6 years ago

https://gobuffalo.io/en/docs/troubleshooting

Don’t use multiple gopaths. It’s a go anti pattern and causes major problems and bugs.

frederikhors commented 6 years ago

@markbates thanks for you immediately answer. Buffalo is great because you're great.

I'm new to Buffalo but I love it a lot. I'm using other tools and "eco-systems" with Go using the multi GOPATH pattern without problems until now, until Buffalo new command.

Can I just suggests you to read this https://dmitri.shuralyov.com/blog/18? It's a 2014 old article which describes very well the multi GOPATH pattern we are using.

I'm newbie but I'll try to find why Buffalo new command can't use the first path in the multi GOPATH, the one which contains /bin folder. And maybe I'll make a PR.

Thanks you for your opinion.

markbates commented 6 years ago

I'm well aware of that article; since then multiple GOPATHs have become frowned upon.

We officially don't support multiple GOPATHs. We don't support their use, but with GOPATH going away, and the communities general negative feeling towards multiple GOPATHs, we probably wouldn't accept anymore patches in that area.