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

JSON output not available on OSX/Debian #2013

Closed
fabiensabatie opened this issue Feb 20, 2019 · 3 comments
Closed

JSON output not available on OSX/Debian #2013

fabiensabatie opened this issue Feb 20, 2019 · 3 comments

Comments

@fabiensabatie
Copy link

fabiensabatie commented Feb 20, 2019

Hi guys,

I have just installed Universal ctags using homebrew on OSX, and as I was getting an error with the
--output-format=json option, so I decided to build it from sources on Debian after cloning the current master branch. But I get the same error :

ctags: unknown output format name supplied for "output-format=json"

when using the command

ctags --output-format=json myfile.c

Everything else seems to work perfectly, so is the JSON output format not supported anymore ?

Have a nice one guys !

@masatake
Copy link
Member

I guess libjansson.so, backend library for --output-format=json, was not available on your PC or not properly linked to your ctags executable.

If the option is available, you can verify it with the other option:

[yamato@slave]$ u-ctags --help | grep -e --output-format
  --output-format=u-ctags|e-ctags|etags|xref|json

"json" is included in the help message -of --output-format.

[yamato@slave]$ u-ctags --list-features                 
#NAME             DESCRIPTION
aspell            linked with code for spell checking (internal use)
debug             TO BE WRITTEN
iconv             can convert input/output encodings
interactive       accepts source code from stdin
json              supports json format output
option-directory  TO BE WRITTEN
regex             can use regular expression based pattern matching
sandbox           linked with code for system call level sandbox
wildcards         can use glob matching
xpath             linked with library for parsing xml input
yaml              linked with library for parsing yaml input

"json" is included in the output of --list-features option.

To use the feature, you must install libjansson.so first.
The you must restart the build-procedures from "./configure ...".
If a tool run in the build-process recognizes the installation of libjansson.so properly, you will see follwoing message:

[yamato@slave]~/var/ctags-github% ./configure
...
checking for JANSSON... yes
...

I don't know well Debian (I'm using Fedora daily), however, you can install libjansson as a package.
I guess libjansson-devel or libjansson-dev package is also needed.

It seems that u-ctags debian package is also available.
#1785
If --output-format=json of the executable in the binary package doesn't work, let me know.
I will try to fix it with @hnakamur.

@fabiensabatie
Copy link
Author

fabiensabatie commented Feb 20, 2019

@masatake Thank you for your support !

libjansson was indeed missing, so here is what I did :

On Debian, I installed the libjansson-dev package, then rebuilt from sources using automake :

[user@vps:~/ctags] ~$ sudo apt-get install libjansson-dev && ./autogen.sh && ./configure && make && sudo make install

And it worked properly.

On OSX, I had to use the --with-jansson option as such :

[user@macosx:~/ctags] ~$  brew install jansson
[user@macosx:~/ctags] ~$  brew install --with-jansson --HEAD universal-ctags/universal-ctags/universal-ctags

Now both binaries show :

[user@vps:~/ctags] ~$ ./ctags --list-features

#NAME                       DESCRIPTION
[...]
json                        supports json format output
[...]

Thank you so much for your help mate !

@hnakamur
Copy link

@fabiensabatie FYI, I sent the following merge requests to Debian and they were merged with some tweaks.

Here is the latest Build-Depends
https://salsa.debian.org/debian/universal-ctags/blob/cedf9a1c5106d371398b35031409ae09caecf3e6/debian/control#L5-13

So I think universal-ctags in the next release of Debian will have json support out of the box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants