Skip to content

Check for available packages with homebrew#5372

Open
gridbugs wants to merge 1 commit intoocaml:masterfrom
gridbugs:homebrew-available-packages
Open

Check for available packages with homebrew#5372
gridbugs wants to merge 1 commit intoocaml:masterfrom
gridbugs:homebrew-available-packages

Conversation

@gridbugs
Copy link
Copy Markdown
Contributor

Signed-off-by: Stephen Sherratt stephen@sherra.tt

@rjbou
Copy link
Copy Markdown
Collaborator

rjbou commented Dec 1, 2022

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

@rjbou rjbou self-requested a review December 1, 2022 16:19
@kit-ty-kate
Copy link
Copy Markdown
Member

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.

@gridbugs
Copy link
Copy Markdown
Contributor Author

gridbugs commented Dec 2, 2022

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|...)$/'

Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
@gridbugs gridbugs force-pushed the homebrew-available-packages branch from e14de16 to 0a35872 Compare December 2, 2022 02:26
@gridbugs
Copy link
Copy Markdown
Contributor Author

gridbugs commented Dec 2, 2022

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"
]

@kit-ty-kate
Copy link
Copy Markdown
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants