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

No arm64 builds for terraform < 1.0.2 #384

Open
alex-shafer-1002 opened this issue Mar 3, 2023 · 6 comments
Open

No arm64 builds for terraform < 1.0.2 #384

alex-shafer-1002 opened this issue Mar 3, 2023 · 6 comments

Comments

@alex-shafer-1002
Copy link

Installs for terraform version < 1.0.2 fail on my M1 mac unless TFENV_ARCH=amd64 is specified.

% tfenv install 1.0.2
Installing Terraform v1.0.2
Downloading release tarball from https://releases.hashicorp.com/terraform/1.0.2/terraform_1.0.2_darwin_arm64.zip
###################################################################################################################################### 100.0%
Downloading SHA hash file from https://releases.hashicorp.com/terraform/1.0.2/terraform_1.0.2_SHA256SUMS
Not instructed to use Local PGP (/opt/homebrew/Cellar/tfenv/3.0.0/use-{gpgv,gnupg}) & No keybase install found, skipping OpenPGP signature verification
Archive:  /var/folders/18/dd_564kj0mx9njswprq1tg6m0000gn/T/tfenv_download.XXXXXX.25rviT3E/terraform_1.0.2_darwin_arm64.zip
  inflating: /opt/homebrew/Cellar/tfenv/3.0.0/versions/1.0.2/terraform  
Installation of terraform v1.0.2 successful. To make this your default version, run 'tfenv use 1.0.2'
% tfenv install 1.0.1
Installing Terraform v1.0.1
Downloading release tarball from https://releases.hashicorp.com/terraform/1.0.1/terraform_1.0.1_darwin_arm64.zip
curl: (22) The requested URL returned error: 404                                                                                            

Tarball download failed
% TFENV_ARCH=amd64 tfenv install 1.0.1
Installing Terraform v1.0.1
Downloading release tarball from https://releases.hashicorp.com/terraform/1.0.1/terraform_1.0.1_darwin_amd64.zip
###################################################################################################################################### 100.0%
Downloading SHA hash file from https://releases.hashicorp.com/terraform/1.0.1/terraform_1.0.1_SHA256SUMS
Not instructed to use Local PGP (/opt/homebrew/Cellar/tfenv/3.0.0/use-{gpgv,gnupg}) & No keybase install found, skipping OpenPGP signature verification
Archive:  /var/folders/18/dd_564kj0mx9njswprq1tg6m0000gn/T/tfenv_download.XXXXXX.Yxrr9RXM/terraform_1.0.1_darwin_amd64.zip
  inflating: /opt/homebrew/Cellar/tfenv/3.0.0/versions/1.0.1/terraform  
Installation of terraform v1.0.1 successful. To make this your default version, run 'tfenv use 1.0.1'

Not shown: fishing for the lowest version with arm64 support

@reegnz
Copy link
Contributor

reegnz commented Mar 20, 2023

That's because hashicorp didn't publish any binaries for M1 macs before 1.0.2. The same problem applies to using older provider versions.

If you need to use earlier terraform (or provider ) versions all the time, that hashicorp didn't build a darwin_arm64 binary for, I'd suggest you put export TFENV_ARCH=amd64 into your bashrc/zshrc and just keep using amd64 binaries for all of your terraform. Have rosetta2 handle it for you. (This is what I'm doing).

@alex-shafer-1002
Copy link
Author

Hello,

I agree and have done so already, however I see we have some logic that attempts to handle this and appears to be faulty somehow given that this fails: https://github.com/tfutils/tfenv/blob/master/libexec/tfenv-install#L125

@reegnz
Copy link
Contributor

reegnz commented Mar 30, 2023

Yeah, I poked around that bash logic last week and indeed it seems to be flaky.

@iomarcovalente
Copy link

iomarcovalente commented May 15, 2023

it would be handy for this to be documented here

even just a one-liner quick mention that

Installs for terraform version < 1.0.2 fail on Arm based mac unless TFENV_ARCH=amd64 is specified as multi-arch binaries aren't published before that version

@alex-shafer-1002
Copy link
Author

@iomarcovalente there is logic in place that does this automatically, it's just not been released to homebrew. It seems we're way behind on releases, merging, etc. I'm getting concerned about the maintenance of this project myself.

@reegnz
Copy link
Contributor

reegnz commented Jun 30, 2023

it's just not been released to homebrew

It just not been released period. It's not homebrew-s fault that there's no tfenv release of that feature.
If tfenv has a release of that feature, I'm 100% sure it shows up in homebrew within a day or two.

BTW you can still install with homebrew from HEAD to have that feature: brew install --HEAD tfenv.

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

Successfully merging a pull request may close this issue.

3 participants