hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io/
Other
42.1k stars 9.47k forks source link

Can't build Terraform due to hcldec and stringer related error #16887

Closed xiaozhu36 closed 6 years ago

xiaozhu36 commented 6 years ago

I cloned terraform on master and want to develop new backend, but when I building terraform got the following error:

$ make
==> Checking that code complies with gofmt requirements...
go generate ./...
2017/12/11 09:48:21 Generated command/internal_plugin_list.go
stringer: checking package: decoder_spec.go:4:2: could not import github.com/hashicorp/hcl2/hcldec (reading export data: /Users/heguimin/Projects/go/pkg/darwin_amd64/github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl2/hcldec.a: invalid encoding format in export data: got 'v'; want 'c' or 'd')
config/configschema/schema.go:80: running "stringer": exit status 1
stringer: checking package: diagnostics.go:4:2: could not import bytes (reading export data: /usr/local/go/pkg/darwin_amd64/bytes.a: invalid encoding format in export data: got 'v'; want 'c' or 'd')
tfdiags/diagnostic.go:11: running "stringer": exit status 1
make: *** [generate] Error 1

I've tried:

What am I doing wrong?

Go version 1.9.2 macOS 10.12.3 make 3.81

jbardin commented 6 years ago

Hi @xiaozhu36,

You still seem to have some old build artifacts in there. Try just installing terrafrom itself, which should rebuild any outdated packages as well.

xiaozhu36 commented 6 years ago

@jbardin thanks for your suggestion, it's my local directory permission issue when I build new package.

ghost commented 4 years ago

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.