Ctags illegal option on fresh brew untar

I’m attempting to extract Homebrew from the tarball into ~/homebrew, but running into conflicts with the xtools version of ctags creating a circular dependency - namely I can’t ‘brew install ctags’ because it needs ctags.

Here’s the process I followed:

  1. Download the latest tarball https://github.com/Homebrew/brew/tarball/master and extract to ~/homebrew
  2. brew update
  3. brew install ctags

The last step fails here:
==> Tapping homebrew/core Cloning into '/Users/justin/homebrew/Library/Taps/homebrew/homebrew-core'... remote: Enumerating objects: 5039, done. remote: Counting objects: 100% (5039/5039), done. remote: Compressing objects: 100% (4837/4837), done. remote: Total 5039 (delta 49), reused 620 (delta 11), pack-reused 0 Receiving objects: 100% (5039/5039), 4.03 MiB | 64.00 KiB/s, done. Resolving deltas: 100% (49/49), done. /Library/Developer/CommandLineTools/usr/bin/ctags: illegal option -- - usage: ctags [-BFadtuwvx] [-f tagsfile] file ... Error: Failure while executing;git clone https://github.com/Homebrew/homebrew-core /Users/justin/homebrew/Library/Taps/homebrew/homebrew-core --depth=1exited with 1. Error: Failure while executing;/Users/justin/homebrew/bin/brew tap homebrew/coreexited with 1.

I renamed my .bashrc to make sure I wasn’t messing things up there and reopened my terminal, nothing unusual there.

Is there a way to bypass or correct the loading so I can bootstrap ctags?

I’ve tried a couple different approaches to solve this - so far the most promising was to manually rerun the failed step explicitly:

git clone https://github.com/Homebrew/homebrew-core /Users/justin/homebrew/Library/Taps/homebrew/homebrew-core --depth=1

After that is complete I can then execute normal commands without running into the homebrew-core dependency.

Hopefully this helps anyone else that might run into this scenarios!

Final update - manually doing the git clone did get me into a working state and I was able to ‘brew install’ all the remaining components I was missing.

I think the core of the problem is the mutual dependency between Apple’s git/ctags, homebrew’s git/ctags, and the homebrew-core package. I suspect this will only occur with clone-style installs and may be related to the non-admin/non-usr/bin/local install location as well.

The only place I still see warnings is during ‘brew upgrade’:

Updating Homebrew…
/Library/Developer/CommandLineTools/usr/bin/ctags: illegal option – -
usage: ctags [-BFadtuwvx] [-f tagsfile] file …
/Library/Developer/CommandLineTools/usr/bin/ctags: illegal option – -
usage: ctags [-BFadtuwvx] [-f tagsfile] file …

This doesn’t seem to have any impact, but is worth noting.