terraform provider and arm macs
# 💻|contributing
anyone else running into issues with our
provider on an arm-based mac?
in theory, we should have added support for arm-native tools in this PR https://github.com/garden-io/garden/pull/3185
and when i run
gdev --env=dev -l5 plugins terraform plan-module -- gke
in the
directory in
branch, i see it should be downloading the arm-specific version
Copy code
[silly] Found 'getEnvironmentStatus' handler on 'terraform'
ℹ providers            → Fetching terraform-1-2-9...
ℹ providers [debug]    → Downloading https://releases.hashicorp.com/terraform/1.2.9/terraform_1.2.9_darwin_arm64.zip...
✔ providers [debug]    → Done
✔ providers            → Fetched terraform-1-2-9
ℹ providers [silly]    → Execing '/Users/walther/.garden/tools/terraform-1-2-9/8ee4dc2174e5ecb9/terraform validate -json' in /Users/walther/git/garden/examples/terraform-gke/terraform
ℹ providers [silly]    → Completing node resolve-provider.terraform:process. aborted=false, error=Command "/Users/walther/.garden/tools/terraform-1-2-9/8ee4dc2174e5ecb9/terraform validate -json" failed with code Unknown system error -8:
but running
/Users/walther/.garden/tools/terraform-1-2-9/8ee4dc2174e5ecb9/terraform --help
results in
zsh: exec format error: /Users/walther/.garden/tools/terraform-1-2-9/8ee4dc2174e5ecb9/terraform
this is interesting because a) the downloading log message does say
in it b) trying to run in x86 mode with
arch -x86_64 terraform
also results in
cannot execute binary file
c) we should be using
verification for the downloads so in theory we should be validating things d) but manually downloading the zip, extracting, and comparing the resulting binary files differ
i can temporarily work around this by copying the manually-downloaded-and-extracted
binary to the correct directory, so this is not blocking, but it is slightly curious
also this might not even be an arm issue, it could be we fail at the extracting somehow
@purple-oyster-28927 do you also encounter this on your arm computer with terraform 1.2.9 ?
another friction point:
Copy code
│ Error: Incompatible provider version
│ Provider registry.terraform.io/hashicorp/template v2.2.0 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.
this provider has been archived and last released 3 years ago https://registry.terraform.io/providers/hashicorp/template/latest sadly it seems to be some transitive dependency - didn't find it in our examples under any
i'm also slightly confused where that dependency is coming from. running
terraform providers
lists it at the root level, even though the
does not mention it. i have also removed the
(and the cache
directory) so it shouldn't be coming from there either
Copy code
terraform providers

Providers required by configuration:
├── provider[registry.terraform.io/hashicorp/google] ~> 4.65
├── provider[registry.terraform.io/hashicorp/kubernetes] ~> 2.20
├── provider[registry.terraform.io/hashicorp/local]
├── provider[registry.terraform.io/hashicorp/template]
├── module.gcp-network
│   ├── provider[registry.terraform.io/hashicorp/google-beta] >= 3.45.0, < 5.0.0
│   ├── provider[registry.terraform.io/hashicorp/google] >= 3.83.0, < 5.0.0
│   ├── module.vpc
│   │   ├── provider[registry.terraform.io/hashicorp/google-beta] >= 3.45.0
│   │   └── provider[registry.terraform.io/hashicorp/google] >= 3.45.0
│   ├── module.firewall_rules
│   │   └── provider[registry.terraform.io/hashicorp/google] >= 3.33.0, < 5.0.0
│   ├── module.routes
│   │   └── provider[registry.terraform.io/hashicorp/google] >= 3.83.0, < 5.0.0
│   └── module.subnets
│       └── provider[registry.terraform.io/hashicorp/google] >= 4.25.0, < 5.0.0
└── module.gke
    ├── provider[registry.terraform.io/hashicorp/kubernetes] ~> 2.10
    ├── provider[registry.terraform.io/hashicorp/random] >= 2.1.0
    └── provider[registry.terraform.io/hashicorp/google] >= 4.51.0, < 5.0.0
@ancient-diamond-80011 were you able to resolve this otherwise I'm up for pairing?
hopping on discord in a moment!