Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Buffalo build with tags failing #1592

Closed
EdwardSokol opened this issue Feb 15, 2019 · 0 comments
Closed

Buffalo build with tags failing #1592

EdwardSokol opened this issue Feb 15, 2019 · 0 comments
Assignees
Milestone

Comments

@EdwardSokol
Copy link

EdwardSokol commented Feb 15, 2019

Suppose that there has some issue with build tags

Description / Steps to reproduce

  1. Take coke project (https://gobuffalo.io/en/docs/new-project)
  2. According to README file create db (buffalo db create -a)

Good case
3) buffalo build --output cokeapp
4) PORT=3030 ./cokeapp - works fine as expected

Bad case
3) change actions/home.go - set build tag at the top of the file

// +build ttt

package actions

import "github.com/gobuffalo/buffalo"

// HomeHandler is a default handler to serve up
// a home page.
func HomeHandler(c buffalo.Context) error {
	return c.Render(200, r.HTML("index.html"))
}
  1. buffalo build --tags "ttt" --output cokeapp - and here I get the following error
github.com/edvard/coke/actions
actions/app.go:61:16: undefined: HomeHandler
Usage:
  buffalo build [flags]

Aliases:
  build, b, bill

Flags:
  -c, --compress                   compress static files in the binary (default true)
  -d, --debug                      print debugging information
      --environment string         set the environment for the binary (default "development")
  -e, --extract-assets             extract the assets and put them in a distinct archive
  -h, --help                       help for build
      --ldflags string             set any ldflags to be passed to the go build
  -o, --output string              set the name of the binary (default "bin/coke")
  -k, --skip-assets                skip running webpack and building assets
      --skip-template-validation   skip validating plush templates
  -s, --static                     build a static binary using  --ldflags '-linkmode external -extldflags "-static"'
  -t, --tags string                compile with specific build tags

ERRO[0000] Error: exit status 2

But I expect that app should be built successfully and HomeHandler can be visible.

Info

### Buffalo Version v0.13.13

App Information

Pwd=/home/edvard/go/src/github.com/edvard/coke
Root=/home/edvard/go/src/github.com/edvard/coke
GoPath=/home/edvard/go/
Name=coke
Bin=bin/coke
PackagePkg=github.com/edvard/coke
ActionsPkg=github.com/edvard/coke/actions
ModelsPkg=github.com/edvard/coke/models
GriftsPkg=github.com/edvard/coke/grifts
VCS=git
WithPop=true
WithSQLite=false
WithDep=false
WithWebpack=false
WithYarn=false
WithDocker=true
WithGrifts=true
WithModules=true

Go Version

go version go1.11.1 linux/amd64

Go Env

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/edvard/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/edvard/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/edvard/go/src/github.com/edvard/coke/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-build383517335=/tmp/go-build -gno-record-gcc-switches"

Node Version

Node Not Found

NPM Version

NPM Not Found

Yarn Version

Yarn Not Found

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

go.mod

module github.com/edvard/coke

require (
github.com/gobuffalo/buffalo v0.13.12
github.com/gobuffalo/buffalo-pop v1.6.0
github.com/gobuffalo/envy v1.6.12
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.21.9
github.com/gobuffalo/pop v4.9.5+incompatible
github.com/markbates/grift v1.0.5
github.com/markbates/inflect v1.0.4
github.com/unrolled/secure v0.0.0-20181022170031-4b6b7cf51606
)

@markbates markbates self-assigned this Feb 15, 2019
@markbates markbates added this to the v0.14.0 milestone Feb 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants