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

Skip transitive dependencies during brew bundle dump #1260

Closed
pirj opened this issue Oct 11, 2023 · 3 comments
Closed

Skip transitive dependencies during brew bundle dump #1260

pirj opened this issue Oct 11, 2023 · 3 comments
Labels

Comments

@pirj
Copy link

pirj commented Oct 11, 2023

Previously, I was using brew leaves > .formula and brew install $(< .formulae ) as poor man's Brewfile.
That approach, however, had one benefit - transitive dependencies were not listed.
E.g. brew bundle dump dumps brew "libfido2", while it is required by mysql and mysql-client.

Would it be possible to dump only to dump "installed formulae that are not dependencies of another installed formula" just like brew leaves does?

@MikeMcQuaid
Copy link
Member

Would it be possible to dump only to dump "installed formulae that are not dependencies of another installed formula" just like brew leaves does?

This is already the case. brew leaves (as-is_ is not the right tool for the job here, though; just because something is a leaf does not mean you don't want it listed in your Brewfile. brew bundle effectively runs brew leaves --installed-on-request. If there's something being brew bundle dumpd that you don't want: it's because at some point you or some tool brew installed it.

To resolve this for your particular case e.g. libfido2 you should do something like:

brew uninstall --ignore-dependencies libfido2
brew install --only-dependencies mysql mysql-client

then, if my memory serves me correctly, it'll no longer brew bundle dump libfido2.

@pirj
Copy link
Author

pirj commented Oct 12, 2023

brew bundle effectively runs brew leaves --installed-on-request

👍

I certainly did not install glibc, lib*, python@*, harfbuzz, zlib, jpeg myself, but scripts that run brew install on my behalf, like e.g. RVM autolibs could.

Thanks for the explanation!

--- 1	2023-10-12 23:51:13.000000000 +0300
+++ 2	2023-10-12 23:53:10.000000000 +0300
@@ -1,19 +1,29 @@
 asciidoctor
 asuka
 automake
+avrdude
 awscli
 bombadillo
+bootloadhid
 brightness
+ca-certificates
+cairo
+clang-format
 cmake
 coreutils
 curl
 ddgr
+dfu-programmer
+dfu-util
 diff-so-fancy
 direnv
 dosbox
 exercism
 eza
 fd
+ffmpeg
+fluid-synth
+gawk
 gh
 git
 git-absorb
@@ -22,19 +32,48 @@
 git-flow
 git-hooks-go
 git-imerge
+glib
 gnupg
+gnutls
 go
+guile
+harfbuzz
 helix
 heroku/brew/heroku
+hidapi
 htop
 hub
 hunspell
 imagemagick@6
+jpeg
 jq
 kakoune
 keychain
 khal
+lame
+leptonica
+libass
+libfido2
+libgcrypt
+libgpg-error
+libid3tag
+libksba
+libmpdclient
+libnfs
+libpng
+libsamplerate
+libshout
+libtasn1
+libtiff
+libtool
+libunistring
+libupnp
+libusb
+libvpx
+libyaml
+libzip
 lynx
+make
 markdown
 mpc
 mpd
@@ -44,32 +83,51 @@
 ncdu
 nginx
 node
+openldap
+osx-cross/arm/arm-gcc-bin@8
+osx-cross/avr/avr-gcc@8
+p11-kit
 p7zip
+pinentry
 pirj/noclamshell/noclamshell
 pirj/toreman/toreman
+pkg-config
 postgresql@15
 proctools
 pv
 pwgen
 pyenv
+[email protected]
 [email protected]
+[email protected]
+qmk/qmk/mdloader
 qmk/qmk/qmk
 rbenv
 rbenv/tap/[email protected]
+readline
 redis
 ripgrep
+rlwrap
+rubberband
+ruby-build
 scdoc
 shellcheck
 solargraph
+srt
 ssh-copy-id
+taglib
+teensy_loader_cli
 telnet
 terminal-notifier
 the_silver_searcher
 timewarrior
 tldr
+tmux
 translate-shell
 transmission-cli
 tree
+unbound
+utf8proc
 vale
 vim
 vimpc
@@ -78,5 +136,6 @@
 wget
 yarn
 youtube-dl
+zlib
 zplug
 zsh

@MikeMcQuaid
Copy link
Member

@pirj You're welcome, yup, likely would be those tools.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants