Homebrew / brew

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

Installing formulas from taps with a dot in the tap name does not work #3811

Closed muellermartin closed 6 years ago

muellermartin commented 6 years ago

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

To help us debug your issue please explain:

Features

Please replace this section with:

We will close this issue or ask you to create a pull-request if it's something the maintainers are not actively planning to work on.


Description

I wanted to install a formula from a tap with a custom URL as the repository is not prefixed with homebrew-. Adding the tap worked, but installing failed by stating the formula does not exist (see "Actual Result"). This seems to be due to a dot character in the name of the tap. Note: This issue also seems to affect GitHub repositories with a dot in the name (e.g. when not using a custom name).

Expected result

Formula gets installed as with using a tap name without a dot. If this issue might not get fixed/not be fixable a more descriptive error message would be helpful as a tap maintainer could think this issue is caused by the tap.

Actual result

Homebrew does fail with an error message stating that the formula is not available. Funnily it tries to search for a similar formula, finds the exact same one to be installed and suggests the command which actually caused the error.

Error: No available formula with the name "foobar/foo.bar/crunch" 
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
==> Searching local taps...
This similarly named formula was found:
foobar/foo.bar/crunch
To install it, run:
  brew install foobar/foo.bar/crunch

Steps to reproduce

  1. Tap a repository with a custom tap name containing a dot, e.g. brew tap foobar/foo.bar https://github.com/sidaf/homebrew-pentest.git
  2. Try to install an arbitrary formula, e.g. brew install foobar/foo.bar/crunch

Workaround

Do not use dot characters in tap names.

Attachments

brew config

HOMEBREW_VERSION: 1.5.4-40-g988e805
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 988e8054482c3458c387c5e589292144f2b26e50
Last commit: 12 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 39e72cdec0cadefbdf17bccea59f7f23b5837639
Core tap last commit: 84 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_BUILD_FROM_SOURCE: 1
HOMEBREW_DEV_CMD_RUN: 1
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_NO_ANALYTICS_THIS_RUN: 1
CPU: octa-core 64-bit haswell
Homebrew Ruby: 2.3.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/bin/ruby
Clang: 9.0 build 900
Git: 2.16.1 => /usr/local/bin/git
Curl: 7.54.0 => /usr/bin/curl
Perl: /usr/local/bin/perl => /usr/local/Cellar/perl/5.26.1/bin/perl
Python: /usr/local/opt/python/libexec/bin/python => /usr/local/Cellar/python/2.7.14_3/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/local/bin/ruby => /usr/local/Cellar/ruby/2.5.0/bin/ruby
Java: 1.8.0_45, 1.6.0_65-b14-468
macOS: 10.12.6-x86_64
Xcode: 9.2
CLT: 9.2.0.0.1.1510905681
X11: 2.7.11 => /opt/X11

brew doctor

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: You have HOMEBREW_BUILD_FROM_SOURCE set. This environment variable is
intended for use by Homebrew developers. If you are encountering errors,
please try unsetting this. Please do not file issues if you encounter
errors when using this environment variable.

Warning: Your default Python does not recognize the Homebrew site-packages
directory as a special site-packages directory, which means that .pth
files will not be followed. This means you will not be able to import
some modules after installing them with Homebrew, like wxpython. To fix
this for the current user, you can run:
  mkdir -p /Users/martin/Library/Python/2.7/lib/python/site-packages
  echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/martin/Library/Python/2.7/lib/python/site-packages/homebrew.pth

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
  /usr/local/lib/libactivboardex.dylib
  /usr/local/lib/libactivlog.dylib
  /usr/local/lib/libdetectcoll.dylib
  /usr/local/lib/libgnuradio-paint.dylib
  /usr/local/lib/libhackrf.0.3.0.dylib
  /usr/local/lib/libpolyclipping.19.0.0.dylib
  /usr/local/lib/libsha1detectcoll.0.dylib

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/paint/api.h
  /usr/local/include/paint/paint_bc.h
  /usr/local/include/python2.7/greenlet/greenlet.h
  /usr/local/include/python3.5m/persistent/cPersistence.h
  /usr/local/include/python3.5m/persistent/ring.h
  /usr/local/include/python3.6m/persistent/cPersistence.h
  /usr/local/include/python3.6m/persistent/ring.h

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
  /usr/local/lib/pkgconfig/kismet.pc

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
  /usr/local/lib/libquiet_static.a

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  avr-gcc
  clingo
  gnome-common
  gnupg
  kcoreaddons
  lesstif
  numpy
  rarian
  vim
Warning: Use numpy instead of deprecated homebrew/python/numpy
Warning: Use numpy instead of deprecated homebrew/python/numpy

Warning: Some keg-only formulae are linked into the Cellar.
Linking a keg-only formula, such as gettext, into the cellar with
`brew link <formula>` will cause other formulae to detect them during
the `./configure` step. This may cause problems when compiling those
other formulae.

Binaries provided by keg-only formulae may override system binaries
with other strange results.

You may wish to `brew unlink` these brews:
  gettext
MikeMcQuaid commented 6 years ago

Do not use dot characters in tap names.

This seems to be an acceptable workaround.

muellermartin commented 6 years ago

What about a better error message?

MikeMcQuaid commented 6 years ago

We would accept a pull request to add one.