gobuffalo / packr

The simple and easy way to embed static files into Go binaries.
MIT License
3.41k stars 196 forks source link

Buffalo build fails on Windows #277

Open hdm opened 4 years ago

hdm commented 4 years ago

Description

The buffalo build command fails on Windows. It succeeds when GOOS=linux is set or when run on a Linux system.

Steps to Reproduce the Problem

  1. Create a new buffalo application on Windows.

  2. Run buffalo build -o t.exe

  3. Notice an error like the following:

    # With vendor/
    $ buffalo build -o t.exe
    a\a-packr.go:8:8: cannot find package "." in:
        C:\Users\Developer\go\project\vendor\myproject\packrd
# Without vendor/
$ buffalo build -o t.exe
a\a-packr.go:8:8: package myproject/packrd is not in GOROOT (c:\go\src\myproject\packrd)

Expected Behavior

A successful build, as seen with GOOS=linux

Actual Behavior

Ugly packr error, hard to debug as well.

Info

Please run buffalo info and paste the information below where it says "PASTE_HERE".

``` -> Go: Checking installation ✓ The `go` executable was found on your system at: C:\Go\bin\go.exe -> Go: Checking minimum version requirements ✓ Your version of Go, 1.14.2, meets the minimum requirements. -> Go: Checking Package Management ✓ You are using Go Modules (`go`) for package management. -> Go: Checking PATH ✓ Your PATH contains C:\Users\Developer\go/bin. -> Node: Checking installation ✓ The `node` executable was found on your system at: C:\Program Files\nodejs\node.exe -> Node: Checking minimum version requirements ✓ Your version of Node, v12.13.1, meets the minimum requirements. -> NPM: Checking installation ✓ The `npm` executable was found on your system at: C:\Program Files\nodejs\npm.cmd -> NPM: Checking minimum version requirements ✓ Your version of NPM, 6.12.1, meets the minimum requirements. -> Yarn: Checking installation ✓ The `yarnpkg` executable was found on your system at: C:\Program Files (x86)\Yarn\bin\yarnpkg.cmd -> Yarn: Checking minimum version requirements ✓ Your version of Yarn, 1.21.1, meets the minimum requirements. -> PostgreSQL: Checking installation ✘ The `postgres` executable could not be found on your system. For help setting up your Postgres environment please follow the instructions for you platform at: https://www.postgresql.org/download/ -> MySQL: Checking installation ✘ The `mysql` executable could not be found on your system. For help setting up your MySQL environment please follow the instructions for you platform at: https://www.mysql.com/downloads/ -> SQLite3: Checking installation ✘ The `sqlite3` executable could not be found on your system. For help setting up your SQLite3 environment please follow the instructions for you platform at: https://www.sqlite.org/download.html -> Cockroach: Checking installation ✘ The `cockroach` executable could not be found on your system. For help setting up your Cockroach environment please follow the instructions for you platform at: https://www.cockroachlabs.com/docs/stable/ -> Buffalo (CLI): Checking installation ✓ The `buffalo` executable was found on your system at: C:\Users\Developer\go\bin\buffalo.exe -> Buffalo (CLI): Checking minimum version requirements ✓ Your version of Buffalo (CLI), v0.16.8, meets the minimum requirements. -> Buffalo: Application Details Pwd C:\Users\Developer\go\myproject-console Root C:\Users\Developer\go\myproject-console GoPath C:\Users\Developer\go PackagePkg github.com/hdm/myproject-console ActionsPkg github.com/hdm/myproject-console/actions ModelsPkg github.com/hdm/myproject-console/models GriftsPkg github.com/hdm/myproject-console/grifts WithModules true Name myproject-console Bin bin\myproject-console.exe VCS git WithPop true WithSQLite false WithDep false WithWebpack true WithNodeJs true WithYarn true WithDocker false WithGrifts true AsWeb true AsAPI false InApp true PackageJSON {map[build:webpack -p --progress dev:webpack --watch]} -> Buffalo: config/buffalo-app.toml name = "myproject-console" bin = "bin\\myproject-console.exe" vcs = "git" with_pop = true with_sqlite = false with_dep = false with_webpack = true with_nodejs = true with_yarn = true with_docker = false with_grifts = true as_web = true as_api = false -> Buffalo: config/buffalo-plugins.toml [[plugin]] binary = "buffalo-pop" go_get = "github.com/gobuffalo/buffalo-pop" -> Buffalo: go.mod module github.com/hdm/myproject-console go 1.14 replace github.com/google/gopacket v1.1.18-0.20190802175136-ecf406cc1fe2 => github.com/google/gopacket v1.1.18-0.20191009163724-0ad7f2610e34 replace github.com/hdm/myproject => ../myproject replace github.com/nicksnyder/go-i18n v2.0.3+incompatible => github.com/nicksnyder/go-i18n v1.10.1 replace github.com/coreos/bbolt v1.3.4 => go.etcd.io/bbolt v1.3.4 require ( github.com/aws/aws-sdk-go v1.30.19 github.com/aws/aws-sdk-go-v2 v0.22.0 github.com/cloudflare/cfssl v1.4.1 // indirect github.com/coreos/bbolt v1.3.4 // indirect github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect github.com/duo-labs/webauthn v0.0.0-20200408163612-425dee8942f4 github.com/dustin/go-humanize v1.0.0 github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/go-critic/go-critic v0.4.3 // indirect github.com/gobuffalo/buffalo v0.16.8 github.com/gobuffalo/buffalo-pop/v2 v2.0.6 github.com/gobuffalo/envy v1.9.0 github.com/gobuffalo/events v1.4.1 github.com/gobuffalo/logger v1.0.3 github.com/gobuffalo/mw-csrf v1.0.0 github.com/gobuffalo/mw-i18n v1.1.0 github.com/gobuffalo/mw-paramlogger v1.0.0 github.com/gobuffalo/nulls v0.4.0 github.com/gobuffalo/packr/v2 v2.8.0 github.com/gobuffalo/plush/v4 v4.0.0 github.com/gobuffalo/pop v4.13.1+incompatible github.com/gobuffalo/pop/v5 v5.1.1 github.com/gobuffalo/suite/v3 v3.0.0 github.com/gobuffalo/tags/v3 v3.1.0 github.com/gobuffalo/validate/v3 v3.3.0 github.com/gobuffalo/x v0.1.0 github.com/gofrs/uuid v3.2.0+incompatible github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect github.com/google/certificate-transparency-go v1.1.0 // indirect github.com/google/monologue v0.0.0-20200310112848-e585696c5f1b // indirect github.com/gorilla/sessions v1.2.0 github.com/grpc-ecosystem/go-grpc-middleware v1.2.0 // indirect github.com/hdm/myproject v1.6.10 github.com/lib/pq v1.5.0 github.com/markbates/errx v1.1.0 github.com/markbates/grift v1.5.0 github.com/mattn/go-runewidth v0.0.9 // indirect github.com/mmcloughlin/professor v0.0.0-20170922221822-6b97112ab8b3 github.com/olekukonko/tablewriter v0.0.4 // indirect github.com/oschwald/geoip2-golang v1.4.0 github.com/pariz/gountries v0.0.0-20200430155801-1c6a393df9c7 github.com/pkg/errors v0.9.1 github.com/russellhaering/gosaml2 v0.4.0 github.com/russellhaering/goxmldsig v0.0.0-20180430223755-7acd5e4a6ef7 github.com/sendgrid/rest v2.4.1+incompatible // indirect github.com/sendgrid/sendgrid-go v3.5.0+incompatible github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd github.com/sirupsen/logrus v1.6.0 github.com/soniah/gosnmp v1.25.0 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/stanislas-m/mocksmtp v1.1.0 github.com/stripe/stripe-go v70.15.0+incompatible golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79 gopkg.in/ini.v1 v1.55.0 // indirect honnef.co/go/tools v0.0.1-2020.1.3 // indirect sigs.k8s.io/yaml v1.2.0 // indirect ) ```
Innokentiy-Alaytsev commented 4 years ago

I stumbled in the same issue. In my case, the latest version of packr2 was the reason for the failure. Using the v2.7.1. version fixed the problem for me.

paganotoni commented 4 years ago

Moving this one to Packr. thanks for reporting it @hdm