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

Terraform conflicting with tfenv when both installed via brew #386

Open
grv231 opened this issue Mar 17, 2023 · 2 comments
Open

Terraform conflicting with tfenv when both installed via brew #386

grv231 opened this issue Mar 17, 2023 · 2 comments

Comments

@grv231
Copy link

grv231 commented Mar 17, 2023

Recently installed latest version of terraform, version v1.4.1 on Mac, using Brew. Then tried installing tfenv using brew, but ran into conflict error w.r.t symlinks removal.

  terraform: because tfenv symlinks terraform binaries

Please `brew unlink terraform` before continuing.

Please add the steps in readme on how to troubleshoot/better way of dealing with this so that it doesn't break existing stuff

@reegnz
Copy link
Contributor

reegnz commented Mar 20, 2023

That's as expected, as both provide the same executable. You should uninstall (or at least unlink) terraform, and install tfenv, and set a default version (with tfenv use 1.4.1)
I think you should not have both installed at the same time, as tfenv replaces the terraform command, and it manages terraform installation from that point, so managing terraform with homebrew makes little sense when using tfenv.

I think the README should mention this though (eg. that you should uninstall terraform that is managed by your package manager).

@reegnz
Copy link
Contributor

reegnz commented Mar 20, 2023

As to why go through all this trouble: because historically terraform sucked when it comes to backward-compatibility, so anyone using it should be pinning the terraform version they are using. The state file also depends on the exact terraform version used, which is why you'd want to ensure everyone is using the exact same terraform version for your project and not upgrade to the latest instantly.

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

No branches or pull requests

2 participants