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

Avoid duplicate names/"shadowing" in homebrew/core and homebrew/cask #17560

Open
1 task done
MikeMcQuaid opened this issue Jun 25, 2024 · 6 comments
Open
1 task done
Labels
features New features help wanted We want help addressing this

Comments

@MikeMcQuaid
Copy link
Member

Verification

Provide a detailed description of the proposed feature

Doing brew install docker will install the Docker formula (and output a warning). brew install --cask docker will install the Docker cask. This may make sense to Homebrew maintainers but, to many of our users, this is unnecessarily confusing. It also has resulted (and will, most likely) continue to result in many bugs over the years.

We now have the ability to rename both formulae and casks. We should make use of this to pick a better name for each of the formulae and casks with overlapping names and add an audit/cop to ensure that we do not backslide and accidentally add more in future.

More often than not, this should involve renaming the cask. Casks are (generally) much less popular than the formula. If the cask has higher analytics usage (or perhaps just "higher in the rankings" than the formula, however, it may make more sense to rename the formula. Docker has half the cask installs in 365 days than formula but: it's the 4th highest installed cask and the 38th formula. Possible renames could be docker-cli or docker-desktop.

Note: this will almost certainly require making changing to existing audits, documentation and name/token format.

CC @Homebrew/maintainers @Homebrew/core and @homebrew/cask for thoughts

What is the motivation for the feature?

Less confusion and fewer bugs on overlapping formulae/casks.

How will the feature be relevant to at least 90% of Homebrew users?

Removing the ability to fully understand the concept of formula and cask to just use Homebrew.

What alternatives to the feature have been considered?

  • Do nothing
  • Keep the shadowing but don't default to the formula and always require disambiguation.
  • Only rename formulae.
  • Only rename casks.
  • Remove all shadowing casks.
@MikeMcQuaid MikeMcQuaid added help wanted We want help addressing this features New features labels Jun 25, 2024
@SMillerDev
Copy link
Member

Keep the shadowing but don't default to the formula and always require disambiguation.

I like this approach, though a combination with the rename is probably good. For example: the software in the Docker cask is referred to as "Docker Desktop" everywhere on the Docker website, so that's probably a better name.

@krehel
Copy link
Member

krehel commented Jun 25, 2024

Keep the shadowing but don't default to the formula and always require disambiguation.

I like this approach, though a combination with the rename is probably good. For example: the software in the Docker cask is referred to as "Docker Desktop" everywhere on the Docker website, so that's probably a better name.

I second this. It may not make sense to rename all variations, but probably does for some, Docker being the notable example. I think keeping disambiguation is a good idea if it doesn't cause continued confusion, and does force a user decision.

If there's a desire to rename conflicting items: it's probably worthwhile to have a consistent scheme, TBD if this is a route decided. Keep the formula as-is with name, and have cask be name-prebuilt, name-upstream or something.

@MikeMcQuaid
Copy link
Member Author

Keep the shadowing but don't default to the formula and always require disambiguation.

I like this approach

The reason I don't like this approach: we will need to pick a date when we start breaking e.g. brew install docker for everyone which sucks (given how much effort we go to e.g. handle renames, aliases, etc. gracefully).

For example: the software in the Docker cask is referred to as "Docker Desktop" everywhere on the Docker website, so that's probably a better name.

Agreed here. I think that's an easy case to fix.

and does force a user decision.

We should avoid forcing user decisions in cases like this, particularly when we have analytics. We should decide for them and, if we install the wrong thing, they can choose to uninstall and install the right one.

If there's a desire to rename conflicting items: it's probably worthwhile to have a consistent scheme, TBD if this is a route decided. Keep the formula as-is with name, and have cask be name-prebuilt, name-upstream or something.

I don't think it makes sense universally.

I know Homebrew/cask doesn't historically like foo-app but: this feels most appropriate when installing a .app, to me.

Docker is a nice example, though, of where "Docker Desktop" is actually the name that upstream uses, too.

@cho-m
Copy link
Member

cho-m commented Sep 25, 2024

More often than not, this should involve renaming the cask.

In the current loader implementation, this is likely required as the old formula name will still be found before trying casks.

In order to rename a formula, we would want to adjust priority so that we select:

  1. current formula name (and maybe aliases?)
  2. current cask name
  3. old formula names
  4. old cask names

Or automatically drop old names after some timeframe (months/year).

@MikeMcQuaid
Copy link
Member Author

In order to rename a formula, we would want to adjust priority so that we select:

  1. current formula name (and maybe aliases?)
  2. current cask name
  3. old formula names
  4. old cask names

Or automatically drop old names after some timeframe (months/year).

This all sounds ideal and I agree 👍🏻. I think a year should be enough to drop old names; if we want them to outlive that they should be an alias.

@Rylan12
Copy link
Member

Rylan12 commented Sep 26, 2024

  1. current formula name (and maybe aliases?)
  2. current cask name
  3. old formula names
  4. old cask names

FWIW I think this should be the order we load in regardless of the approach since at this point since casks are equally as official as formulae

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
features New features help wanted We want help addressing this
Projects
None yet
Development

No branches or pull requests

5 participants