universal-ctags / homebrew-universal-ctags

Homebrew Tap for Universal Ctags on OSX
https://ctags.io
GNU General Public License v2.0
326 stars 19 forks source link

No libyaml support when installed with homebrew #61

Closed Daoenti closed 3 years ago

Daoenti commented 3 years ago

I installed the homebrew package using the tap as documented on this page:

brew install --HEAD universal-ctags/universal-ctags/universal-ctags

I am running MacOS Big Sur, however that upgrade was VERY recently (about two hours ago) and this was also ran earlier today on Catalina with the same results. FYI, usernames have been obfuscated to protect the innocent.

After completing the install above it does not have support for languages requiring libyaml.

# ctags --list-languages
Abaqus
Abc
Ada
Ant
Asciidoc
Asm
Asp
Autoconf
AutoIt
Automake
Awk
Basic

As one of the major reasons I was moving to Universal ctags was AnsiblePlaybook support I was a little stumped by this. I do have libyaml installed via brew:

# brew info libyaml
libyaml: stable 0.2.5 (bottled)
YAML Parser
https://github.com/yaml/libyaml
/usr/local/Cellar/libyaml/0.2.5 (10 files, 323.6KB) *
  Poured from bottle on 2020-07-07 at 17:49:59
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libyaml.rb
License: MIT
==> Dependencies
Build: autoconf ✔, automake ✔, libtool ✔
==> Analytics
install: 96,267 (30 days), 291,806 (90 days), 1,306,687 (365 days)
install-on-request: 20,700 (30 days), 60,935 (90 days), 303,190 (365 days)
build-error: 0 (30 days)

Verbose build log through brew:

https://gist.github.com/Daoenti/f252efb9087ba25be2a06616d520e5a2

To troubleshoot I downloaded universal ctags straight from the github at https://github.com/universal-ctags/ctags and ran the following to build and install it:

# autogen.sh
# ./configure --prefix=/Users/XXXXXXX/.local
# make
# make install

This left me with a version of universal ctags that works completely normally and has libyaml support as can see by the inclusion of AnsiblePlaybook:

# ~/.local/bin/ctags --list-languages
Abaqus
Abc
Ada
AnsiblePlaybook
Ant
Asciidoc
Asm
Asp
Autoconf
AutoIt
Automake
Awk
Basic

Full output of hand build:

https://gist.github.com/Daoenti/89bc5a36e3a87b83671adb8d06fdd38b

The major thing I can see between the verbose output of both builds is:

Now I've obviously fixed my personal issue by just using my hand compiled version, however I wanted to report it and will happily help troubleshoot the issue. As an aside, languages requiring libxml support are also working fine in the hand compiled version however I did see the issue that had been opened and saw that libxml support is excluded with option "without-xml" in the build file.

equal-l2 commented 3 years ago

TL;DR Try with the following command instead. (--with-libyaml added)

brew install --HEAD universal-ctags/universal-ctags/universal-ctags --with-libyaml

Details I saw a line indicating libyaml is an optional dependency. https://github.com/universal-ctags/homebrew-universal-ctags/blob/841bdf137939c293c0a26a068c0bbc0e5be3fc1a/universal-ctags.rb#L11

Optional dependencies are disabled by default. When you want to enable them, libyaml for example, you need respective options like --with-libyaml. brew info will show you the list of such options.

Daoenti commented 3 years ago

I'll close this issue then. I was under the impression that optional dependencies would be enabled if the dependency was already present, I didn't realize that additional steps had to be taken. As a note though, it would be nice if this was mentioned in the README.md somewhere.