Skip to content

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

Closed
@MikeMcQuaid

Description

@MikeMcQuaid
Member

Verification

  • This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

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.

Activity

SMillerDev

SMillerDev commented on Jun 25, 2024

@SMillerDev
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

krehel commented on Jun 25, 2024

@krehel
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.

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

MikeMcQuaid commented on Jun 25, 2024

@MikeMcQuaid
MemberAuthor

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

cho-m commented on Sep 25, 2024

@cho-m
Member

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

MikeMcQuaid commented on Sep 26, 2024

@MikeMcQuaid
MemberAuthor

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

Rylan12 commented on Sep 26, 2024

@Rylan12
Member
  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

danielbayley

danielbayley commented on May 28, 2025

@danielbayley
Contributor

@MikeMcQuaid This might sound stupidly simple, but when there is a conflict—and there is no obviously better alternative name—why not just add a cask-* prefix?

MikeMcQuaid

MikeMcQuaid commented on May 28, 2025

@MikeMcQuaid
MemberAuthor

@danielbayley Yes, a prefix or a suffix would make sense here. I believe we've used -app as a suffix in the past for this.

self-assigned this
on Jun 17, 2025
added
in progressMaintainers are working on this
and removed
help wantedWe want help addressing this
on Jun 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

featuresNew featuresin progressMaintainers are working on this

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @MikeMcQuaid@SMillerDev@danielbayley@cho-m@Rylan12

    Issue actions

      Avoid duplicate names/"shadowing" in homebrew/core and homebrew/cask · Issue #17560 · Homebrew/brew