kreuzwerker / m1-terraform-provider-helper

CLI to support with downloading and compiling terraform providers for Mac with M1 chip

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cant install hashicorp/random or hashicorp/null no such file or directory

duxbuse opened this issue · comments

commented

Cant install hashicorp/random or hashicorp/null

Expected Behavior

Should install v3.5.1 fine

Actual Behavior

TF_HELPER_LOG=debug m1-terraform-provider-helper activate                          
Already activated
TF_HELPER_LOG=debug m1-terraform-provider-helper install hashicorp/random  -v v3.5.1
Getting provider data from terraform registry
INFO[0000] Provider data: {https://github.com/hashicorp/terraform-provider-random terraform-provider-random} 
Getting source code...
INFO[0000] Resetting /Users/s126070/.m1-terraform-provider-helper/terraform-provider-random and pulling latest changes 
INFO[0003] Bash execution output: Your branch is up to date with 'origin/main'.
Already up to date. 
INFO[0003] Checking out v3.5.1                          
Compiling...
INFO[0003] Using build command: make build              
INFO[0005] Bash execution output: go build -v ./...     
INFO[0005] Bash execution output: Terraform v1.5.1
on darwin_arm64
+ provider registry.terraform.io/hashicorp/google v4.70.0
+ provider registry.terraform.io/hashicorp/google-beta v4.70.0
+ provider registry.terraform.io/hashicorp/time v0.9.1 
INFO[0005] Installed Terraform version: 1.5.1           
INFO[0005] No custom build path found                   
INFO[0005] Move from /Users/s126070/go/bin/terraform-provider-random to /Users/s126070/.terraform.d/plugins/registry.terraform.io/hashicorp/random/3.5.1/darwin_arm64/terraform-provider-random_3.5.1_x5 
2023/06/27 11:18:25 rename /Users/s126070/go/bin/terraform-provider-random /Users/s126070/.terraform.d/plugins/registry.terraform.io/hashicorp/random/3.5.1/darwin_arm64/terraform-provider-random_3.5.1_x5: no such file or directory
TF_HELPER_LOG=debug m1-terraform-provider-helper install hashicorp/null  -v v3.2.1
Getting provider data from terraform registry
INFO[0000] Provider data: {https://github.com/hashicorp/terraform-provider-null terraform-provider-null} 
Getting source code...
INFO[0000] Resetting /Users/s126070/.m1-terraform-provider-helper/terraform-provider-null and pulling latest changes 
INFO[0004] Bash execution output: Your branch is up to date with 'origin/main'.
Updating af9b0ed..673806b
Fast-forward
 .copywrite.hcl                     |  11 +-
 .github/CONTRIBUTING.md            |   9 +-
 .github/dependabot.yml             |   4 +
 .github/workflows/compliance.yml   |   3 +-
 .github/workflows/issue-opened.yml |   3 +-
 .github/workflows/pull-request.yml |   2 +-
 .github/workflows/release.yml      |   6 +-
 .github/workflows/test.yml         |  10 +-
 .golangci.yml                      |   6 +-
 GNUmakefile                        |   3 +-
 go.mod                             |  55 +--
 go.sum                             | 225 +++-------
 main.go                            |  10 -
 tools/go.mod                       |  93 ++++
 tools/go.sum                       | 864 +++++++++++++++++++++++++++++++++++++
 tools/tools.go                     |  14 +-
 16 files changed, 1084 insertions(+), 234 deletions(-)
 create mode 100644 tools/go.mod
 create mode 100644 tools/go.sum 
INFO[0004] Checking out v3.2.1                          
Compiling...
INFO[0004] Using build command: make build              
INFO[0007] Bash execution output: go build -v ./...     
INFO[0007] Bash execution output: Terraform v1.5.1
on darwin_arm64
+ provider registry.terraform.io/hashicorp/google v4.70.0
+ provider registry.terraform.io/hashicorp/google-beta v4.70.0
+ provider registry.terraform.io/hashicorp/time v0.9.1 
INFO[0007] Installed Terraform version: 1.5.1           
INFO[0007] No custom build path found                   
INFO[0007] Move from /Users/s126070/go/bin/terraform-provider-null to /Users/s126070/.terraform.d/plugins/registry.terraform.io/hashicorp/null/3.2.1/darwin_arm64/terraform-provider-null_3.2.1_x5 
2023/06/27 11:24:48 rename /Users/s126070/go/bin/terraform-provider-null /Users/s126070/.terraform.d/plugins/registry.terraform.io/hashicorp/null/3.2.1/darwin_arm64/terraform-provider-null_3.2.1_x5: no such file or directory

Your Environment

  • OS: 13.3.1 (22E261)
  • m1-terraform-provider-helper version: 0.8.2
commented

Hmm looks like it was some weirdness with installing go via brew.

if i manually go into /Users/s126070/.m1-terraform-provider-helper/terraform-provider-random and run go build
then it correctly builds the binary into /Users/s126070/go/bin/terraform-provider-random
For some reason when run through the make file it doesn't work even though export GOPATH=$HOME/go

You do not need to this for the provider version v3.5.1 as it's compiled for arm already. See release config: https://github.com/hashicorp/terraform-provider-random/blob/v3.5.1/.goreleaser.yml#L25

Should work the normal way via terraform init. Feel free to close the issue if this solves it :)

commented

Hmm thanks I guess i was also having some lock file issues that prevented it working initially. but deleting the .terraform and starting from scratch seemed to do the trick thanks