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

Check for available packages with homebrew #5372

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gridbugs
Copy link
Contributor

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

@rjbou
Copy link
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
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
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
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
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