dnsimple / terraform-provider-dnsimple

Terraform DNSimple provider.
https://www.terraform.io/docs/providers/dnsimple/
Mozilla Public License 2.0
22 stars 20 forks source link

Adds arm64 builds so it can run on macs with Apple Silicon. #33

Closed chakrit closed 3 years ago

chakrit commented 3 years ago

Terraform Version

Terraform v0.14.7
+ provider registry.terraform.io/dnsimple/dnsimple v0.5.1
+ provider registry.terraform.io/linode/linode v1.14.3

Affected Resource(s)

(n/a)

Terraform Configuration Files

terraform {
  required_providers {
    dnsimple = {
      source  = "dnsimple/dnsimple"
      version = "0.5.1"
    }
  }
}

Debug Output

(n/a)

Panic Output

(n/a)

Expected Behavior

tf init should pass, normally.

Actual Behavior

Initializing the backend...

Initializing provider plugins...
- Reusing previous version of linode/linode from the dependency lock file
- Reusing previous version of dnsimple/dnsimple from the dependency lock file

Error: Incompatible provider version

Provider registry.terraform.io/linode/linode v1.14.3 does not have a package
available for your current platform, darwin_arm64.

Provider releases are separate from Terraform CLI releases, so not all
providers are available for all platforms. Other versions of this provider may
have different platforms supported.

Error: Incompatible provider version

Provider registry.terraform.io/dnsimple/dnsimple v0.5.1 does not have a
package available for your current platform, darwin_arm64.

Provider releases are separate from Terraform CLI releases, so not all
providers are available for all platforms. Other versions of this provider may
have different platforms supported.

Steps to Reproduce

  1. terraform init on M1 macs with dnsimple provider.

Important Factoids

$ uname -a
Darwin 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 arm64

References

https://github.com/hashicorp/terraform-provider-aws/issues/16948

bkuhlmann commented 3 years ago

I would welcome ARM 64 (Apple Silicon - M1) support too. I thought, originally, the issue was due to Go not supporting ARM but looks like, with the 1.16.0 release, that Go fully supports ARM now. Would this only require this provider be built with the new Go version or is there something else at stake here that makes this not possible so those of us on Apple Silicon to use this provider?

chakrit commented 3 years ago

@bkuhlmann Yes, I think we just need an official ARM64 builds built and released on proper channels (terraform registry and such)

Right now manually building with an arm-supported version of go locally does work and is quite snappy as well.

bkuhlmann commented 3 years ago

:bow: Chakrit. That's good to hear. :wink: I'm not a Go engineer but would definitely love to have a new release since this is the only provider left -- at least for my infrastructure -- that doesn't support Apple Silicon yet.

OleMchls commented 3 years ago

Hey there,

Thanks for your patience. I've tried to reproduce the problem you described, but I can not reproduce it with the latest terraform version:

Setup

ole@Oles-MBP test-m1-33 % uname -a           
Darwin Oles-MBP.fritz.box 20.4.0 Darwin Kernel Version 20.4.0: Thu Apr 22 21:46:41 PDT 2021; root:xnu-7195.101.2~1/RELEASE_ARM64_T8101 arm64
ole@Oles-MBP test-m1-33 % terraform --version
Terraform v0.15.3
on darwin_amd64
ole@Oles-MBP test-m1-33 % cat main.tf 
terraform {
  required_providers {
    dnsimple = {
      source  = "dnsimple/dnsimple"
      version = "0.5.1"
    }
  }
}

Init

ole@Oles-MBP test-m1-33 % terraform init     

Initializing the backend...

Initializing provider plugins...
- Finding dnsimple/dnsimple versions matching "0.5.1"...
- Installing dnsimple/dnsimple v0.5.1...
- Installed dnsimple/dnsimple v0.5.1 (signed by a HashiCorp partner, key ID EB50CA1D5B23D0A5)

Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

Can you please verify if you are also still encountering this problem with the most recent version of terraform? If so, please provide the detailed steps and software versions you use.

bkuhlmann commented 3 years ago

Hey Ole. :wave: Sorry, nope, still getting the following issue:

Initializing the backend...

Initializing provider plugins...
- Finding hashicorp/aws versions matching "3.37.0"...
- Finding dnsimple/dnsimple versions matching "0.5.1"...
- Using hashicorp/aws v3.37.0 from the shared cache directory
╷
│ Error: Incompatible provider version
│
│ Provider registry.terraform.io/dnsimple/dnsimple v0.5.1 does not have a package available for your current platform, darwin_arm64.
│
│ Provider releases are separate from Terraform CLI releases, so not all providers are available for all platforms. Other versions of this provider may have different platforms supported.

Here's what I'm using:

terraform --version

Terraform v0.15.3
on darwin_arm64
terraform {
  required_version = ">= 0.14"

  required_providers {
    dnsimple = {
      source = "dnsimple/dnsimple"
      version = "0.5.1"
    }
  }
}
chakrit commented 3 years ago

@OleMchls Have you removed your locally built version? This issue is about the missing arm64 build on the registry.

We just need someone with the access to publish arm builds to the registry.

bkuhlmann commented 3 years ago

:bulb: Ole/Chakrit: Forgot to mention this earlier but did write up an article on how to workaround this if you want to build the binary locally. That's how I solved this.

OleMchls commented 3 years ago

Revisiting this, I noticed that my local terraform is build for amd64 see the log I posted.

I installed it via homebrew tap and noticed there:

$~ brew info hashicorp/tap/terraform
hashicorp/tap/terraform: stable 0.15.3
[...]
==> Caveats
The darwin_arm64 architecture is not supported for this product
at this time, however we do plan to support this in the future. The
darwin_amd64 binary has been installed and may work in
compatibility mode, but it is not fully supported.

I'll try to see if I can reproduce it and get a build and upload it./

OleMchls commented 3 years ago

🎉 we just shipped 0.5.3 with support for darwin_arm64 thanks for your patience and support @chakrit @bkuhlmann

ole@Oles-MBP example % terraform version
Terraform v0.15.0-dev
on darwin_arm64
+ provider registry.terraform.io/dnsimple/dnsimple v0.5.3

Your version of Terraform is out of date! The latest version
is 0.15.3. You can update by downloading from https://www.terraform.io/downloads.html

ole@Oles-MBP example % terraform init

Initializing the backend...

Initializing provider plugins...
- Finding dnsimple/dnsimple versions matching "0.5.3"...
- Installing dnsimple/dnsimple v0.5.3...
- Installed dnsimple/dnsimple v0.5.3 (signed by a HashiCorp partner, key ID EB50CA1D5B23D0A5)

Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!
[...]
bkuhlmann commented 3 years ago

:bow: Ole. Confirmed. This is great!

chakrit commented 3 years ago

@OleMchls thank you!