linux-on-ibm-z / scripts

16 stars 48 forks source link

Terraform Error Installing v0.11.13 #6

Closed james-crowley closed 5 years ago

james-crowley commented 5 years ago

When changing the PACKAGE_VERSION from 0.11.11 to 0.11.13 the install no longer works.

==> Checking that code complies with gofmt requirements...
GO111MODULE=off go get -u golang.org/x/tools/cmd/stringer
GO111MODULE=off go get -u golang.org/x/tools/cmd/cover
GO111MODULE=off go get -u github.com/golang/mock/mockgen
GOFLAGS=-mod=vendor go generate ./...
2019/04/24 15:01:11 Generated command/internal_plugin_list.go
# go fmt doesn't support -mod=vendor but it still wants to populate the
# module cache with everything in go.mod even though formatting requires
# no dependencies, and so we're disabling modules mode for this right
# now until the "go fmt" behavior is rationalized to either support the
# -mod= argument or _not_ try to install things.
GO111MODULE=off go fmt command/internal_plugin_list.go > /dev/null
go list -mod=vendor ./... | xargs -t -n4 go test  -mod=vendor -timeout=2m -parallel=4
build flag -mod=vendor only valid when using modules
go test -mod=vendor -timeout=2m -parallel=4
build flag -mod=vendor only valid when using modules
Makefile:35: recipe for target 'test' failed
make: *** [test] Error 123

I found this error referenced here, https://github.com/hashicorp/terraform/issues/20208 . It looks like this issue has to do with the change in the Makefile. Instead of calling a script to do the install, it looks like they are now calling a go command.

The suggested fixes did not see to work. I tired setting environment vars and even manually changing the Makefile.

I still could not get make and make tools to work but was able to get make bin to work fine.

All I did was edit the build_terraform.sh script. My edit were:

https://github.com/linux-on-ibm-z/scripts/blob/97d14e44215c70354b335c5839936ac6d8a33a43/Terraform/build_terraform.sh#L75

Change that to bash build_go.sh -v 1.11.5

https://github.com/linux-on-ibm-z/scripts/blob/97d14e44215c70354b335c5839936ac6d8a33a43/Terraform/build_terraform.sh#L103

Changed that to #make tools

https://github.com/linux-on-ibm-z/scripts/blob/97d14e44215c70354b335c5839936ac6d8a33a43/Terraform/build_terraform.sh#L104

Changed that to #make

After those changes I was able to install terraform 0.11.13 just fine.

cwsolee commented 5 years ago

Thanks for your comment, our latest verified was 0.11.11, we didn't start currency with 0.11.13 yet, we'll probably hit the same problem and will use your experience as reference.

james-crowley commented 5 years ago

@cwsolee No problem.

@aborkar-ibm if you working on the terraform script could you add a version parameter like you added in the Go script? Like https://github.com/linux-on-ibm-z/scripts/blob/fe04f47a509d71950c244931a879d90932a8ce96/Go/build_go.sh#L142-L144

james-crowley commented 5 years ago

@cwsolee Did you run into problems with Provider Plugins for Terraform? Terraform seems to build fine, but without Provider Plugins, it kind of moot.

Above I referenced the issue I ran into.