Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packer 1.5.4 build error #8846

Closed
IPv4v6 opened this issue Mar 5, 2020 · 5 comments · Fixed by #9805
Closed

packer 1.5.4 build error #8846

IPv4v6 opened this issue Mar 5, 2020 · 5 comments · Fixed by #9805
Labels
build Relating to aspects of compilation or continuous integration core Core components of Packer

Comments

@IPv4v6
Copy link

IPv4v6 commented Mar 5, 2020

Overview of the Issue

When trying to build packer 1.5.4 from source (go get) I'm experiencing the following errors:

# github.com/hashicorp/packer/hcl2template
go/pkg/mod/github.com/hashicorp/packer@v1.5.4/hcl2template/functions.go:37:22: undefined: stdlib.CeilFunc
go/pkg/mod/github.com/hashicorp/packer@v1.5.4/hcl2template/functions.go:38:22: undefined: stdlib.ChompFunc
go/pkg/mod/github.com/hashicorp/packer@v1.5.4/hcl2template/functions.go:39:22: undefined: stdlib.ChunklistFunc
go/pkg/mod/github.com/hashicorp/packer@v1.5.4/hcl2template/functions.go:45:22: undefined: stdlib.CoalesceListFunc
go/pkg/mod/github.com/hashicorp/packer@v1.5.4/hcl2template/functions.go:46:22: undefined: stdlib.CompactFunc
go/pkg/mod/github.com/hashicorp/packer@v1.5.4/hcl2template/functions.go:48:22: undefined: stdlib.ContainsFunc
go/pkg/mod/github.com/hashicorp/packer@v1.5.4/hcl2template/functions.go:52:22: undefined: stdlib.DistinctFunc
go/pkg/mod/github.com/hashicorp/packer@v1.5.4/hcl2template/functions.go:53:22: undefined: stdlib.ElementFunc
go/pkg/mod/github.com/hashicorp/packer@v1.5.4/hcl2template/functions.go:57:22: undefined: stdlib.FlattenFunc
go/pkg/mod/github.com/hashicorp/packer@v1.5.4/hcl2template/functions.go:58:22: undefined: stdlib.FloorFunc
go/pkg/mod/github.com/hashicorp/packer@v1.5.4/hcl2template/functions.go:58:22: too many errors

Reproduction Steps

$ go version
go version go1.13.8 linux/amd64

export CGO_ENABLED=0
export GO111MODULE=on
go get -v -a -ldflags '-extldflags "-static"' github.com/hashicorp/packer@v1.5.4

Packer version

1.5.4

Operating system and Environment details

Linux amd64
Go version 1.13.8

@IPv4v6 IPv4v6 added the bug label Mar 5, 2020
@jhawk28
Copy link
Contributor

jhawk28 commented Mar 5, 2020

I think the issue is that the go get is not respecting the package overrides:

replace git.apache.org/thrift.git => github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999

replace github.com/gofrs/flock => github.com/azr/flock v0.0.0-20190823144736-958d66434653

replace github.com/zclconf/go-cty => github.com/azr/go-cty v1.1.1-0.20200203143058-28fcda2fe0cc

@jhawk28
Copy link
Contributor

jhawk28 commented Mar 5, 2020

this issue explains why: golang/go#30354

@nywilken
Copy link
Member

nywilken commented Mar 5, 2020

hi @IPv4v6 thanks for bubbling this up; @jhawk28 thanks adding the link to the respective golang/go issue. This is something to keep an eye for the future if things should change with the Go tooling.

The preferred and tested method for installing from source is to clone the project into $GOPATH/src/github.com/hashicorp, checkout out the respective tag git checkout v1.5.4 and use the make dev command to install the binary.

The forked go-cty pkg in the go.mod file will be removed in #8837 (comment) but you still may want to look into using the preferred method as the continued work in improving HCL support for Packer may result in future replace statements.

@nywilken nywilken added build-failure For issues compiling Packer build Relating to aspects of compilation or continuous integration core Core components of Packer and removed bug build-failure For issues compiling Packer labels Mar 5, 2020
dominikborkowski added a commit to dominikborkowski/packer-aws-runner that referenced this issue Mar 18, 2020
Thanks to the following issue hashicorp/packer#8846, and the fact that they’ll be removing abiity to use a simple ‘go get’ (hashicorp/packer#8837 (comment)), it makes no sense to try to build it locally anymore.
@azr
Copy link
Contributor

azr commented Aug 24, 2020

Hello there, #9805 removes the last replace call which should help here 🙂 .

@azr azr closed this as completed in #9805 Aug 24, 2020
@ghost
Copy link

ghost commented Oct 13, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Oct 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build Relating to aspects of compilation or continuous integration core Core components of Packer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants