asdf-community / asdf-hashicorp

HashiCorp plugin for the asdf version manager
https://github.com/asdf-vm/asdf
MIT License
234 stars 54 forks source link

Can't install terraform 0.x #73

Closed obregonia1 closed 1 year ago

obregonia1 commented 1 year ago

I tried to install version 0.x, but I failed with the following message being displayed. In case installing version 1.x, then successed. Which cause of this?

$ asdf install terraform 0.12.18

Downloading terraform version 0.12.18 from https://releases.hashicorp.com/terraform/0.12.18/terraform_0.12.18_darwin_arm.zip
Error: terraform version 0.12.18 not found
Check documentation for alternatives https://github.com/asdf-community/asdf-hashicorp#usage

macOS: 13.3.1 (a)

radditude commented 1 year ago

It looks like you're on a Mac with an Apple Silicon/ARM processor! The plugin is attempting to find a 0.12.18 binary that was compiled for arm Macs and not finding one, since Terraform 0.12 predates Apple Silicon. Later versions of Terraform added that support, so installing later versions succeeds.

If you need Terraform 0.12.18 specifically, you should still be able to run the amd64 binary using Rosetta. You can use the ASDF_HASHICORP_OVERWRITE_ARCH variable to tell asdf to download the amd64 binary instead of trying to find one that matches your system architecture.

obregonia1 commented 1 year ago

@radditude Thanks for the answer. I successfully installed with that variable.