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

Issues with helm provider - failure to move/rename?

et304383 opened this issue · comments

Sorry for not using the template, but this is much faster to just show what's happening:

$ m1-terraform-provider-helper install hashicorp/helm -v v2.4.1
Repo: https://github.com/hashicorp/terraform-provider-helm
GitRepo: git@github.com:hashicorp/terraform-provider-helm
2022/01/12 08:34:05 Executingcd /Users/et304383/.m1-terraform-provider-helper && git clone git@github.com:hashicorp/terraform-provider-helm
Cloning into 'terraform-provider-helm'...
Cancel
Updating files: 100% (6301/6301), done.
2022/01/12 08:34:39 Cloning into 'terraform-provider-helm'...
Updating files: 100% (6301/6301), done.

HEAD is now at ac4d18cc1 .github/workflows: Fix waiting-response label removal (#758)
2022/01/12 08:34:39 version: v2.4.1
==> Checking that code complies with gofmt requirements...
go build -v .
2022/01/12 08:35:16 Move from /Users/et304383/go/bin/terraform-provider-helm to /Users/et304383/.terraform.d/plugins/registry.terraform.io/hashicorp/helm/v2.4.1/darwin_arm64/terraform-provider-helm_v2.4.1_x5
2022/01/12 08:35:16 rename /Users/et304383/go/bin/terraform-provider-helm /Users/et304383/.terraform.d/plugins/registry.terraform.io/hashicorp/helm/v2.4.1/darwin_arm64/terraform-provider-helm_v2.4.1_x5: no such file or directory
$ ll ~/.m1-terraform-provider-helper/terraform-provider-helm/terraform-provider-helm
-rwxr-xr-x  1 et304383  staff    69M 12 Jan 08:35 /Users/et304383/.m1-terraform-provider-helper/terraform-provider-helm/terraform-provider-helm
$

So it looks like the file is there, in the git directory. Perhaps the helm devs aren't following a standard for binary generation?

I think the issue is that the helm build is just doing go build and not actually installing the binary to the expected home directory under go/bin.

Yeah, that could be the reason. We expect the binary to be placed in the $GOPATH/bin/ (https://github.com/kreuzwerker/m1-terraform-provider-helper/blob/main/internal/app/install.go#L230) and copy it from there.

If that's not the case then we would need to implement a custom buildCommand which executes make build and then copies the binary to $GOPATH/bin/ so that we can successfully copy it.
Would be quite easy to implement, as we already have custom build commands in place (https://github.com/kreuzwerker/m1-terraform-provider-helper/blob/main/internal/app/install.go#L188)

Released v0.3.1 which should enable you to install the helm provider :) @et304383

@Junkern thank you! I worked around it already by just manually copying the file from ~/.m1-terraform-provider-helper/terraform-provider-helm but at least I'm covered in the future!