gobuffalo / buffalo

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

Buffalo dev tries to rebuild Go shipped dependencies #1441

Closed stanislas-m closed 6 years ago

stanislas-m commented 6 years ago

Description

I'm using Go modules with go 1.11.1. When using buffalo dev with a go modules project, the command fails trying to rebuild the Go standard lib.

Steps to Reproduce the Problem

  1. Create a buffalo project using go modules. (tested on both current master version - v0.13.3 - and development branch).
  2. Clear the go cache: go clean -cache (I tested something on an unrelated project before)
  3. Use buffalo dev to build the project.

Expected Behavior

The project builds with no error.

Actual Behavior

The command crashes trying to recompile Go standard lib. It seems this is a known behavior: https://github.com/golang/go/issues/27285.

go build -v -i -tags development -o tmp/app-build

Produces the same output, but removing the -i flag work.

buffalo dev
buffalo: 2018/11/03 16:18:56 === Rebuild on: :start: ===
buffalo: 2018/11/03 16:18:56 === Running: go build -v -i -tags development -o tmp/app-build  (PID: 14555) ===
go build golang_org/x/net/dns/dnsmessage: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/net/dns/dnsmessage.a: permission denied
go build golang_org/x/crypto/cryptobyte/asn1: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/crypto/cryptobyte/asn1.a: permission denied
go build golang_org/x/crypto/curve25519: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/crypto/curve25519.a: permission denied
go build golang_org/x/text/transform: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/text/transform.a: permission denied
go build golang_org/x/crypto/internal/chacha20: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/crypto/internal/chacha20.a: permission denied
go build golang_org/x/crypto/poly1305: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/crypto/poly1305.a: permission denied
go build golang_org/x/net/http2/hpack: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/net/http2/hpack.a: permission denied
go build golang_org/x/text/unicode/bidi: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/text/unicode/bidi.a: permission denied
buffalo: 2018/11/03 16:18:56 === Error! ===
buffalo: 2018/11/03 16:18:56 === exit status 1
go build golang_org/x/net/dns/dnsmessage: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/net/dns/dnsmessage.a: permission denied
go build golang_org/x/crypto/cryptobyte/asn1: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/crypto/cryptobyte/asn1.a: permission denied
go build golang_org/x/crypto/curve25519: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/crypto/curve25519.a: permission denied
go build golang_org/x/text/transform: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/text/transform.a: permission denied
go build golang_org/x/crypto/internal/chacha20: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/crypto/internal/chacha20.a: permission denied
go build golang_org/x/crypto/poly1305: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/crypto/poly1305.a: permission denied
go build golang_org/x/net/http2/hpack: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/net/http2/hpack.a: permission denied
go build golang_org/x/text/unicode/bidi: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/text/unicode/bidi.a: permission denied
 ===

Info

``` buffalo info ### Buffalo Version v0.13.3 ### App Information Pwd=/home/michalakst/Bureau/app-v2 Root=/home/michalakst/Bureau/app-v2 GoPath=/home/michalakst/go Name=app-v2 Bin=bin/app-v2 PackagePkg=../../Bureau/app-v2 ActionsPkg=../../Bureau/app-v2/actions ModelsPkg=../../Bureau/app-v2/models GriftsPkg=../../Bureau/app-v2/grifts VCS=git WithPop=true WithSQLite=false WithDep=false WithWebpack=true WithYarn=true WithDocker=true WithGrifts=true WithModules=false ### Go Version go version go1.11.1 linux/amd64 ### Go Env GOARCH="amd64" GOBIN="" GOCACHE="/home/michalakst/.cache/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/michalakst/go" GOPROXY="" GORACE="" GOROOT="/usr/local/go" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/home/michalakst/Bureau/app-v2/go.mod" 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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build562948944=/tmp/go-build -gno-record-gcc-switches" ### Node Version v8.12.0 ### NPM Version 6.4.1 ### Yarn Version 1.10.1 ### PostgreSQL Version PostgreSQL Not Found ### MySQL Version mysql Ver 14.14 Distrib 5.7.24, for Linux (x86_64) using EditLine wrapper ### SQLite Version SQLite Not Found ### Dep Version could not find a Gopkg.toml file ### Dep Status could not find a Gopkg.toml file ### go.mod module gitlab.com/stanislas-m/app-v2 require ( github.com/Microsoft/go-winio v0.4.11 // indirect github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 // indirect github.com/cockroachdb/apd v1.1.0 // indirect github.com/cockroachdb/cockroach-go v0.0.0-20181001143604-e0a95dfd547c // indirect github.com/docker/distribution v2.6.2+incompatible // indirect github.com/docker/docker v1.13.1 github.com/docker/go-connections v0.4.0 github.com/docker/go-units v0.3.3 // indirect github.com/eclipse/paho.mqtt.golang v1.1.1 github.com/gobuffalo/buffalo v0.13.3 github.com/gobuffalo/buffalo-pop v1.1.8 github.com/gobuffalo/envy v1.6.7 github.com/gobuffalo/events v1.1.5 github.com/gobuffalo/gocraft-work-adapter v0.0.0-20180714213200-7d6504f1dffe github.com/gobuffalo/mw-csrf v0.0.0-20180802151833-446ff26e108b github.com/gobuffalo/mw-forcessl v0.0.0-20180802152810-73921ae7a130 github.com/gobuffalo/mw-i18n v0.0.0-20181027200759-09e0c99be4d3 github.com/gobuffalo/mw-paramlogger v0.0.0-20181005191442-d6ee392ec72e github.com/gobuffalo/packr v1.17.0 github.com/gobuffalo/plush v3.7.22+incompatible github.com/gobuffalo/pop v4.8.8+incompatible github.com/gobuffalo/suite v2.1.6+incompatible github.com/gobuffalo/tags v2.0.11+incompatible github.com/gobuffalo/uuid v2.0.5+incompatible github.com/gobuffalo/validate v2.0.3+incompatible github.com/gocraft/work v0.5.1 // indirect github.com/gogo/protobuf v1.1.1 // indirect github.com/gomodule/redigo v2.0.0+incompatible github.com/jackc/fake v0.0.0-20150926172116-812a484cc733 // indirect github.com/jackc/pgx v3.2.0+incompatible // indirect github.com/markbates/goth v1.47.1 github.com/markbates/grift v1.0.5 github.com/markbates/inflect v1.0.4 github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/pkg/errors v0.8.0 github.com/prometheus/client_golang v0.9.0 github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 // indirect github.com/prometheus/common v0.0.0-20181020173914-7e9e6cabbd39 // indirect github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d // indirect github.com/robfig/cron v0.0.0-20180505203441-b41be1df6967 // indirect github.com/satori/go.uuid v1.2.0 // indirect github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24 // indirect github.com/stanislas-m/mocksmtp v1.0.0 github.com/stevvooe/resumable v0.0.0-20180830230917-22b14a53ba50 // indirect github.com/stretchr/testify v1.2.2 github.com/unrolled/secure v0.0.0-20181022170031-4b6b7cf51606 golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16 ) ```
stanislas-m commented 6 years ago

I tried to create another app using the same steps to reproduce, and it solved my problem. I don't know why, but eh, it works.

Jumanjii commented 5 years ago

I had the same issue today. In my case, it was because I forgot to export GO111MODULE=on and my project is using go module.

I am putting this here because I was digging from 2 hours now and maybe it could help someone else :-)