cloudamqp / terraform-provider-cloudamqp

Terraform Provider for CloudAMQP
https://registry.terraform.io/providers/cloudamqp/cloudamqp
Mozilla Public License 2.0
35 stars 39 forks source link

make install does not work #63

Closed philipp-hb closed 4 years ago

philipp-hb commented 4 years ago
  1. make does not recognize the Makefile which is called GNUMakefile

  2. Make install fails due to missing target "install" in makefile.

~/go/src/github.com/cloudamqp/terraform-provider-cloudamqp$ make install make: *** No rule to make target 'install'. Stop.

  1. Make build does not produce any results ~/go/src/github.com/cloudamqp/terraform-provider-cloudamqp$ cp GNUMakefile Makefile ~/go/src/github.com/cloudamqp/terraform-provider-cloudamqp$ make build ==> Checking that code complies with gofmt requirements... go install -ldflags "-X 'github.com/cloudamqp/terraform-provider-cloudamqp/cloudamqp.version=1.7.0'" ~/go/src/github.com/cloudamqp/terraform-provider-cloudamqp$ ls CHANGELOG.md GNUMakefile LICENSE Makefile README.md cloudamqp example.tf go.mod go.sum main.go sample scripts vendor versions.tf website

Environment: Ubuntu 18.04 go version go1.14.4 linux/amd64 GNU Make 4.1

tbroden84 commented 4 years ago
  1. Had named the GNUmakefile wrong (GNUMakefile). Been using make -f GNUMakefile before to point out the correct file. Fixed this and now make should work.

  2. Have removed the old makefile and created a new GNUmakefile instead from the feedback received on our request for Terraform Developer program. Also updated the installation instruction.

  3. If you have declared $GOPATH, make build should install the provider under $GOPATH/bin. For my understanding Terraform (when running terraform init) should also look in $GOPATH/bin if it's added to $PATH. This doesn't occur for me and I need to manually move it to $HOME/.terraform.d/plugins

philipp-hb commented 4 years ago

Thank you. I tried it again and it still seems to not produce any binaries

`philipp@hp:~/go/src/github.com/cloudamqp/terraform-provider-cloudamqp (master)$ make build ==> Checking that code complies with gofmt requirements... go install -ldflags "-X 'github.com/cloudamqp/terraform-provider-cloudamqp/cloudamqp.version=1.7.0'"

philipp@hp:~/go/src/github.com/cloudamqp/terraform-provider-cloudamqp (master)$ ls CHANGELOG.md cloudamqp example.tf GNUmakefile go.mod go.sum LICENSE main.go Makefile README.md sample scripts vendor versions.tf website

philipp@hp:~/go/src/github.com/cloudamqp/terraform-provider-cloudamqp (master)$ ls ~/.terraform.d/plugins ls: cannot access '/home/philipp/.terraform.d/plugins': No such file or directory ` I'm now using your provided binaries, so I'm fine with closing this issue, if I'm the only one with this problem

tbroden84 commented 4 years ago

So far only heard from you after v1.7.0 release, but the old makefile contained actions (e.g. create directory ~/.terraform.d/plugins etc). Actions contributed by other users or issues found by me.

Out of curiosity, have you set the environmental variable $GOPATH? For what I know, this should be set manually after go have been installed and also added to $PATH.

  1. export GOPATH=$HOME/go
  2. export PATH=$GOPATH:$PATH

When running make build, this will trigger go install. Which makes go first run go build then automatically moves the binary to $GOPATH/bin. Since you list the files in the provider folder, could you try the same from $GOPATH/bin (philipp@hp:~/go/bin in your case). There you should find the binary you installed.

philipp-hb commented 4 years ago

my GOPATH is set:

philipp@hp:~/go/src/github.com/cloudamqp/terraform-provider-cloudamqp (master)$ echo $GOPATH /home/philipp/go

and inside, there is the old provider without version number that I've build a while ago:

philipp@hp:~/go/src/github.com/cloudamqp/terraform-provider-cloudamqp (master)$ ls $GOPATH/bin dep terraform-provider-cloudamqp

tbroden84 commented 4 years ago

Ok strange but thanks. Will continue to add binaries to the new releases.