The intent of #287 was to allow users on arm64 architectures to download amd64 binaries if there was no arm64 binary available. However, it was mostly tested against Linux, which had arm64 support implemented earlier than Macs. As such, I get the following issues when I try to download older Terraform versions on my M1 Mac:
$ tfenv install 0.12.30
Installing Terraform v0.12.30
Downloading release tarball from https://releases.hashicorp.com/terraform/0.12.30/terraform_0.12.30_darwin_arm64.zip
curl: (22) The requested URL returned error: 404
Tarball download failed
There is a terraform_0.12.30_linux_arm64.zip but no terraform_0.12.30_darwin_arm64.zip. If I try installing 0.12.29, which doesn't have arm64 support at all, I get the amd64 binary as expected:
This should be fixed by separating the TFENV_ARCH logic for Linux and MacOS. The MacOS regex should be much simpler, since M1 builds started from version 1.0.2.
The intent of #287 was to allow users on
arm64
architectures to downloadamd64
binaries if there was noarm64
binary available. However, it was mostly tested against Linux, which hadarm64
support implemented earlier than Macs. As such, I get the following issues when I try to download older Terraform versions on my M1 Mac:There is a
terraform_0.12.30_linux_arm64.zip
but noterraform_0.12.30_darwin_arm64.zip
. If I try installing0.12.29
, which doesn't havearm64
support at all, I get theamd64
binary as expected:This should be fixed by separating the
TFENV_ARCH
logic for Linux and MacOS. The MacOS regex should be much simpler, since M1 builds started from version1.0.2
.