dashlane-cli icon indicating copy to clipboard operation
dashlane-cli copied to clipboard

Brew install fails if corepack is install via brew

Open joshmeads opened this issue 1 year ago • 1 comments

Describe the bug If corepack is installed via brew (brew install corepack) the install will fail with the following:

==> Installing dashlane/tap/dashlane-cli dependency: yarn
Error: Cannot install yarn because conflicting formulae are installed.
  corepack: because both install `yarn` and `yarnpkg` binaries

Please `brew unlink corepack` before continuing.

Unlinking removes a formula's symlinks from /opt/homebrew. You can
link the formula again after the install finishes. You can `--force` this
install, but the build may fail or cause obscure side effects in the
resulting software.

To Reproduce Steps to reproduce the behavior:

  1. brew install corepack
  2. brew install dashlane/tap/dashlane-cli
  3. See error

Expected behavior dashlane cli installs

Environment (please complete the following information):

  • OS: MacOS 14.2.1

joshmeads avatar Feb 20 '24 20:02 joshmeads

Thanks for sharing this issue, I'll work on it when I have some time/

Mikescops avatar Feb 27 '24 11:02 Mikescops

I've looked around and this issue is not directly linked to our package.

We need yarn to build the CLI, but as specified in the code source of yarn.rb package, yarn is not compatible with corepack and hadoop because it's already shipped inside.

One of the solution I'm looking at is to allow a flag to be set if you have corepack installed.

Generic syntax example:

option 'with-Q', 'Depend on Q instead of P'

depends_on 'P' if !build.with?('Q')
depends_on 'Q' if  build.with?('Q')

So something like:

option 'with-corepack', 'Use yarn from corepack instead of installing it'

depends_on 'yarn' if !build.with?('corepack')
depends_on 'corepack' if  build.with?('corepack')

Mikescops avatar Apr 19 '24 12:04 Mikescops