https://garden.io logo
terraform provider and arm macs
a

ancient-diamond-80011

05/17/2023, 11:54 AM
anyone else running into issues with our
terraform
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
examples/terraform-gke
directory in
0.13
branch, i see it should be downloading the arm-specific version
[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
arm64
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
sha256
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
terraform
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
f

freezing-pharmacist-34446

05/17/2023, 12:23 PM
@purple-oyster-28927 do you also encounter this on your arm computer with terraform 1.2.9 ?
a

ancient-diamond-80011

05/17/2023, 12:43 PM
another friction point:
β•·
β”‚ 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
required_providers
i'm also slightly confused where that dependency is coming from. running
terraform providers
lists it at the root level, even though the
versions.tf
does not mention it. i have also removed the
.terraform.lock.hcl
(and the cache
.terraform
directory) so it shouldn't be coming from there either
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
p

purple-oyster-28927

05/17/2023, 3:34 PM
@ancient-diamond-80011 were you able to resolve this otherwise I'm up for pairing?
a

ancient-diamond-80011

05/17/2023, 3:35 PM
hopping on discord in a moment!