opam icon indicating copy to clipboard operation
opam copied to clipboard

Check for available packages with homebrew

Open gridbugs opened this issue 3 years ago • 5 comments

Signed-off-by: Stephen Sherratt [email protected]

gridbugs avatar Nov 29 '22 06:11 gridbugs

Thanks for the PR! Do you have average time for the new command?

rjbou avatar Dec 01 '22 16:12 rjbou

Does it take aliases into account? The reason why https://github.com/ocaml/opam/pull/4548 didn't get merged is because i couldn't find any ways of detecting aliases properly and quickly enough.

kit-ty-kate avatar Dec 01 '22 16:12 kit-ty-kate

Thanks for the PR! Do you have average time for the new command?

It takes about 3 seconds for me. It uses a single invocation of `brew search --formula '/^(pkg1|pkg2|...)$/'

gridbugs avatar Dec 02 '22 02:12 gridbugs

Does it take aliases into account? The reason why #4548 didn't get merged is because i couldn't find any ways of detecting aliases properly and quickly enough.

Yep it handles aliases. I tested with sqlite3 which doesn't show up in the output of brew formulae.

$ brew search --formula '/^sqlite3$/'
==> Formulae
sqlite3

and

$ dune exec ./src/client/opamMain.exe -- install --depext-only --dry-run /tmp/a.opam 2> /dev/null

The following system packages will first need to be installed:
    neovim sqlite3 tmux

<><> Handling external dependencies <><><><><><><><><><><><><><><><><><><><>  🐫

$ cat /tmp/a.opam
opam-version: "2.0"
maintainer: "foo"
description: "bar"
depends: [
]
depexts: [
  "sqlite3"
  "tmux"
  "neovim"
]

gridbugs avatar Dec 02 '22 02:12 gridbugs

It takes about 3 seconds for me. It uses a single invocation of `brew search --formula '/^(pkg1|pkg2|...)$/'

3 seconds sounds like quite a lot. We're usually aiming for something < 1 second in the worst case. This command is ran during many opam commands such as opam show which would be a dealbreaker for many users if it was that slow.

kit-ty-kate avatar Dec 02 '22 19:12 kit-ty-kate