leoliu / ggtags

Emacs frontend to GNU Global source code tagging system.
http://elpa.gnu.org
577 stars 56 forks source link

Error calling global: "GTAGSDBPATH must be an absolute path" #196

Closed jlowenz closed 5 years ago

jlowenz commented 5 years ago

After creating a GTAGS file in my project root and installing ggtags, any find operation (e.g. ggtags-find-tag-dwim) fails with the following error:

-*- mode: ggtags-global; default-directory: "~/path/to/project/" -*-
Global started at Fri Sep 13 08:21:20

global -v --result=grep --color=always --path-style=shorter -- GRTAGS
global: GTAGSDBPATH must be an absolute path.

Global exited abnormally with code 1 at Fri Sep 13 08:21:20

I do not have GTAGSDBPATH set, but I do have GTAGSLABEL=new-ctags set. Running the same command in the shell does not produce the error.

Debugging seemed to indicate that the gtags-project-root was correctly set to an absolute path, but it's interesting the modeline shows that default-directory is set to a shortened / relative path.

Any ideas on how to get this working?

global version: 6.6.3 ggtags version: 20190320.2208

leoliu commented 5 years ago

Do you have GTAGSDBPATH set in emacs? To check M-: (getenv "GTAGSDBPATH"). I just checked ggtags and it doesn't set GTAGSDBPATH.

jlowenz commented 5 years ago

Oy! You are correct. I had some old setting buried deep in my Emacs configuration files. Removed it and things behave as expected. Sorry about that.