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

hashicorp/tap/terraform formula not Idempotent when used with Brewfile #53

Open
adyang opened this issue Sep 21, 2020 · 3 comments
Open

Comments

@adyang
Copy link

adyang commented Sep 21, 2020

Hi Team,

Given that hashicorp/tap/terraform is already installed, creating a Brewfile at /tmp/Brewfile with the following contents:

brew "hashicorp/tap/terraform"

and running brew bundle --file=/tmp/Brewfile --verbose results in the following output:

Unlinking terraform formula.
It is currently installed and conflicts with terraform.
Unlinking /usr/local/Cellar/terraform/0.13.3... 1 symlinks removed
Skipping install of terraform formula. It is already up-to-date.
Using hashicorp/tap/terraform

Running terraform would then result in: terraform: command not found.

Expected result would be that the symlink is not removed and that running terraform would print usage.

Thanks for the attention.

@radeksimko
Copy link
Member

Hi @adyang
It looks like this may be a result of a slightly confusing conflict between the community-maintained terraform formula and the one we maintain here. I admit I haven't tried bundling with taps myself though, so I may be wrong.

Have you tried brew uninstall terraform before bundling it?

@adyang
Copy link
Author

adyang commented Sep 21, 2020

Hi @radeksimko

I have tried brew uninstall terraform before bundling but it ended up uninstalling hashicorp/tap/terraform (the homebrew core terraform was not installed in the 1st place).

I tried bundling again but it seems like repeated runs would alternate between removing the symlink and creating the symlink.

@dexterous
Copy link

Hi guys,
This is a quirk of Homebrew; Formulas/Casks are not really namespaced by their Tap, the Tap name is only relevant during Formula/Cask lookup.

Refer Homebrew Taps Docs.

This is (most likely) further aggravated by how the install sub-command reports Formula/Cask names fully qualified even if the lookup in the Cellar is performed with just the unqualified name.

There should be some workaround to this that doesn't require us to rename the Formulas altogether (as suggested in the Homebrew Docs). I'll spend some time spelunking through the brew code when I get a spare hour or so.

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

3 participants