Homebrew / brew

🍺 The missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
41.36k stars 9.73k forks source link

Dependency collector does not recognise multiple renames to one formula as a single formula #15488

Closed kevinuav closed 1 year ago

kevinuav commented 1 year ago

brew doctor output

% brew doctor             
Your system is ready to brew.

Verification

brew config output

% brew config
HOMEBREW_VERSION: 4.0.19
ORIGIN: https://github.com/Homebrew/brew
HEAD: 4446fe603cc19316036fd07e5df1124c4d15ead2
Last commit: 5 days ago
Core tap JSON: 27 May 06:39 UTC
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.8Fr1luGOi6/org.xquartz:0
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit kabylake
Clang: 14.0.3 build 1403
Git: 2.39.2 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.86.0 => /usr/bin/curl
macOS: 13.2-x86_64
CLT: 14.3.0.0.1.1679647830
Xcode: 14.3

What were you trying to do (and why)?

I wanna install the px4-sim-gazebo. However it always says there is another active Homebrew process is already using gstreamer.formula. This make the installation fails.

What happened (include all command output)?

% brew install px4-sim-gazebo ...... ==> Fetching px4/px4/px4-sim-gazebo ==> Downloading https://raw.githubusercontent.com/PX4/PX4-Autopilot/master/Tools Already downloaded: /Users/kevin/Library/Caches/Homebrew/downloads/be4aff9b473b8b0c6bae0ff08a6611885de9d56ee3a477c05453bb6bbcaab246--px4.py ==> Installing px4-sim-gazebo from px4/px4 Warning: Formula gst-libav was renamed to gstreamer. Warning: Formula gst-plugins-bad was renamed to gstreamer. Warning: Formula gst-plugins-base was renamed to gstreamer. Warning: Formula gst-plugins-good was renamed to gstreamer. Warning: Formula gst-plugins-ugly was renamed to gstreamer. Error: Operation already in progress for gstreamer.formula Another active Homebrew process is already using gstreamer.formula. Please wait for it to finish or terminate it to continue.

What did you expect to happen?

The error should be fixed. The installation should be successful.

Step-by-step reproduction instructions (by running brew commands)

% brew install --cask temurin 
% brew install --cask xquartz 
% brew install px4-sim-gazebo
carlocab commented 1 year ago

What's the output of

lsof +d "$(brew --prefix)/var/homebrew/locks"

?

kevinuav commented 1 year ago

What's the output of

lsof +d "$(brew --prefix)/var/homebrew/locks"

?

Tried, there is no any output with this command.

Bo98 commented 1 year ago

Upstream should probably update their formula to stop using the old names for those renamed formulae.

Though there is technically a bug here in that the dependency collector doesn't recognise multiple renames into one formula as being a single formula, so it tries to install gstreamer multiple times.

A workaround might be to brew install gstreamer beforehand.

kevinuav commented 1 year ago

Upstream should probably update their formula to stop using the old names for those renamed formulae.

Though there is technically a bug here in that the dependency collector doesn't recognise multiple renames into one formula as being a single formula, so it tries to install gstreamer multiple times.

A workaround might be to brew install gstreamer beforehand.

Tried. I have installed gstreamer with "brew install gstreamer" first. Then reinstall "brew install px4-sim-gazebo". Unfortunately, it still fails. "


==> Caveats
==> gstreamer
All gst-* GStreamer plugins are now bundled in this formula.
For GStreamer to find your own plugins, add their paths to `GST_PLUGIN_PATH`.
For example, if you have plugins in `~/.local/lib/gstreamer-1.0`:
  export GST_PLUGIN_PATH="~/.local/lib/gstreamer-1.0"

Do not install plugins into GStreamer's prefix. They will be deleted
by `brew upgrade`.
kevin@chenqirongdeMacBook-Pro ~ % brew install px4-sim-gazebo        
==> Downloading https://formulae.brew.sh/api/cask.jws.json

==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Enumerating objects: 1500685, done.
remote: Counting objects: 100% (74/74), done.
remote: Compressing objects: 100% (37/37), done.
remote: Total 1500685 (delta 42), reused 63 (delta 37), pack-reused 1500611
Receiving objects: 100% (1500685/1500685), 392.96 MiB | 674.00 KiB/s, done.
Resolving deltas: 100% (1053710/1053710), done.
Updating files: 100% (7031/7031), done.
Tapped 3 commands and 6678 formulae (7,042 files, 450MB).
Warning: Formula gst-libav was renamed to gstreamer.
Warning: Formula gst-plugins-bad was renamed to gstreamer.
Warning: Formula gst-plugins-base was renamed to gstreamer.
Warning: Formula gst-plugins-good was renamed to gstreamer.
Warning: Formula gst-plugins-ugly was renamed to gstreamer.
Warning: Formula gst-libav was renamed to gstreamer.
Warning: Formula gst-plugins-bad was renamed to gstreamer.
Warning: Formula gst-plugins-base was renamed to gstreamer.
Warning: Formula gst-plugins-good was renamed to gstreamer.
Warning: Formula gst-plugins-ugly was renamed to gstreamer.
Warning: Formula gst-libav was renamed to gstreamer.
Warning: Formula gst-plugins-bad was renamed to gstreamer.
Warning: Formula gst-plugins-base was renamed to gstreamer.
Warning: Formula gst-plugins-good was renamed to gstreamer.
Warning: Formula gst-plugins-ugly was renamed to gstreamer.
Warning: Formula gst-libav was renamed to gstreamer.
Warning: Formula gst-plugins-bad was renamed to gstreamer.
Warning: Formula gst-plugins-base was renamed to gstreamer.
Warning: Formula gst-plugins-good was renamed to gstreamer.
Warning: Formula gst-plugins-ugly was renamed to gstreamer.
Warning: Formula gst-libav was renamed to gstreamer.
Warning: Formula gst-plugins-bad was renamed to gstreamer.
Warning: Formula gst-plugins-base was renamed to gstreamer.
Warning: Formula gst-plugins-good was renamed to gstreamer.
Warning: Formula gst-plugins-ugly was renamed to gstreamer.
Warning: Formula gst-libav was renamed to gstreamer.
Warning: Formula gst-libav was renamed to gstreamer.
Warning: Formula gst-libav was renamed to gstreamer.
Warning: Formula gst-plugins-bad was renamed to gstreamer.
Warning: Formula gst-plugins-bad was renamed to gstreamer.
Warning: Formula gst-plugins-bad was renamed to gstreamer.
Warning: Formula gst-plugins-base was renamed to gstreamer.
Warning: Formula gst-plugins-base was renamed to gstreamer.
Warning: Formula gst-plugins-base was renamed to gstreamer.
Warning: Formula gst-plugins-good was renamed to gstreamer.
Warning: Formula gst-plugins-good was renamed to gstreamer.
Warning: Formula gst-plugins-good was renamed to gstreamer.
Warning: Formula gst-plugins-ugly was renamed to gstreamer.
Warning: Formula gst-plugins-ugly was renamed to gstreamer.
Warning: Formula gst-plugins-ugly was renamed to gstreamer.
Warning: Formula gst-libav was renamed to gstreamer.
Warning: Formula gst-libav was renamed to gstreamer.
Warning: Formula gst-plugins-bad was renamed to gstreamer.
Warning: Formula gst-plugins-bad was renamed to gstreamer.
Warning: Formula gst-plugins-base was renamed to gstreamer.
Warning: Formula gst-plugins-base was renamed to gstreamer.
Warning: Formula gst-plugins-good was renamed to gstreamer.
Warning: Formula gst-plugins-good was renamed to gstreamer.
Warning: Formula gst-plugins-ugly was renamed to gstreamer.
Warning: Formula gst-plugins-ugly was renamed to gstreamer.
==> Fetching dependencies for px4/px4/px4-sim-gazebo: exiftool, gflags, glog, libavif, gd, jasper, netpbm, gts, librsvg, m4, libtool, graphviz, eigen, metis, isl, mpfr, libmpc, gcc, openblas, suite-sparse, tbb, ceres-solver, numpy, protobuf, boost, double-conversion, gl2ps, glew, libaec, hdf5, jsoncpp, netcdf, pugixml, qt@5, pyqt@5, utf8cpp, vtk, opencv, bullet,
........
==> Installing px4-sim-gazebo from px4/px4
Warning: Formula gst-libav was renamed to gstreamer.
Warning: Formula gst-plugins-bad was renamed to gstreamer.
Warning: Formula gst-plugins-base was renamed to gstreamer.
Warning: Formula gst-plugins-good was renamed to gstreamer.
Warning: Formula gst-plugins-ugly was renamed to gstreamer.
Error: Operation already in progress for gstreamer.formula
Another active Homebrew process is already using gstreamer.formula.
Please wait for it to finish or terminate it to continue.
```"
carlocab commented 1 year ago

Try doing brew edit px4-sim-gazebo and deleting these lines:

  depends_on "gst-libav"
  depends_on "gst-plugins-bad"
  depends_on "gst-plugins-base"
  depends_on "gst-plugins-good"
  depends_on "gst-plugins-ugly"

It would probably help if you opened a pull request at px4/px4 to do the same.

kevinuav commented 1 year ago

Try doing brew edit px4-sim-gazebo and deleting these lines:

  depends_on "gst-libav"
  depends_on "gst-plugins-bad"
  depends_on "gst-plugins-base"
  depends_on "gst-plugins-good"
  depends_on "gst-plugins-ugly"

It would probably help if you opened a pull request at px4/px4 to do the same.

Thank you. The problem has been fixed in this way.

carlocab commented 1 year ago

Edited title from the above comment:

Though there is technically a bug here in that the dependency collector doesn't recognise multiple renames into one formula as being a single formula, so it tries to install gstreamer multiple times.

carlocab commented 1 year ago

Related to this issue: if you install a formula that depends (possibly recursively) on both glib and python@3.11 (other than through glib), then you see python@3.11 installed twice. For example, from brew install aws-google-auth:

[snip]
==> Installing aws-google-auth dependency: python
==> Pouring python@3.11--3.11.4_1.x86_64_linux.bottle.tar.gz
==> /home/linuxbrew/.linuxbrew/Cellar/python@3.11/3.11.4_1/bin/python3.11 -m ensurepip
==> /home/linuxbrew/.linuxbrew/Cellar/python@3.11/3.11.4_1/bin/python3.11 -m pip install -v --no-deps --no-index --upgrade --isolated --target=/home/l
🍺  /home/linuxbrew/.linuxbrew/Cellar/python@3.11/3.11.4_1: 2,845 files, 67.3MB
[snip]
==> Installing aws-google-auth dependency: python@3.11
==> Pouring python@3.11--3.11.4_1.x86_64_linux.bottle.tar.gz
==> /home/linuxbrew/.linuxbrew/Cellar/python@3.11/3.11.4_1/bin/python3.11 -m ensurepip
==> /home/linuxbrew/.linuxbrew/Cellar/python@3.11/3.11.4_1/bin/python3.11 -m pip install -v --no-deps --no-index --upgrade --isolated --target=/home/l
🍺  /home/linuxbrew/.linuxbrew/Cellar/python@3.11/3.11.4_1: 2,845 files, 67.3MB