Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide darwin_arm64 build #2

Closed
davidcaste opened this issue Feb 4, 2022 · 2 comments
Closed

Provide darwin_arm64 build #2

davidcaste opened this issue Feb 4, 2022 · 2 comments

Comments

@davidcaste
Copy link

Hi!!

One of our developers has a new shiny Apple M1 laptop, and when he tries to do a terraform init it fails to download the provider. These new Apple M1 laptops aren't using anymore the darwin_amd64, but the darwin_arm64 architecture.

The problem is very easy to replicate with the following configuration:

  1. Create a new root module and define the provider in the following way:

    terraform {
      required_providers {
        elasticsearch = {
          source  = "petoju/mysql"
          version = "~> 3.0"
        }
      }
    }
    
  2. Create a temporary directory, e.g. /tmp/terraform.d/plugins, and try to mirror there the different architectures our team is using:

    ❯ terraform providers mirror -platform=linux_amd64 -platform=darwin_amd64 -platform=darwin_arm64 "/tmp/foo/plugins"
    - Mirroring petoju/mysql...
      - Selected v3.0.9 to meet constraints ~> 3.0
      - Downloading package for linux_amd64...
      - Package authenticated: self-signed
      - Downloading package for darwin_amd64...
      - Package authenticated: self-signed
      - Downloading package for darwin_arm64...
    ╷
    │ Error: Provider release not available
    │ 
    │ Failed to download registry.terraform.io/petoju/mysql v3.0.9 for darwin_arm64: provider registry.terraform.io/petoju/mysql 3.0.9 is not available for darwin_arm64.
    ╵
    

I have very little knowledge of golang, but in order to generate this architecture implies bump golang to version >= 1.16. There's another fork of https://github.com/hashicorp/terraform-provider-mysql which already did that, if I'm not wrong this is the PR winebarrel#30.

Thanks!!

petoju added a commit that referenced this issue Feb 16, 2022
Newer version could help with cross-compilation. I cannot test it, but
we have integration tests to verify nothing breaks, so this change is
safe.

Also run go mod tidy.

Issue: #2
@petoju
Copy link
Owner

petoju commented Feb 16, 2022

Hi @davidcaste !
Thanks for the detailed description.

I've updated go version and as of v3.0.11, you should be able to use this provider on Darwin+ARM64.
I could not test it, so please test it and come back with the result.

@petoju
Copy link
Owner

petoju commented Mar 3, 2022

No reply came from davidcaste, but I got one "thumbs up" - so I'm closing this. Feel free to open another issue in case it doesn't work.

@petoju petoju closed this as completed Mar 3, 2022
petoju pushed a commit that referenced this issue Feb 23, 2023
docs: add mysql_retention_period docs for terraform registry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants