Bug#968231: global: does not index definitions with pygments anymore

2020-08-13 Thread Gregory Heytings



Hi Punit,



* When used, pygments only provide reference tags (GRTAGS) not 
definition tags




That's correct AFAIK.



* The definitions were provided by /usr/bin/ctags (in 6.4.4-3). "ctags" 
is usually a symlink pointing to one of few possible ctags 
implementations - ctags.emacs, exuberant-ctags, universal-ctags the ones 
I've come across.




Correct again.



* The pygments plugin script (/usr/share/global/gtags/script) has a 
dependency on exuberant ctags but may also be able compatible with other 
ctags implementations. It is possible to override this by using 
"ctagscom=" in the config file.




That's correct, except that there is no need to make this dependency too 
strict.  Universal Ctags is a fork of Exuberant Ctags, whose development 
has stopped some ten years ago.  Which means that Pygments works with 
Universal Ctags, and that the dependency is in fact "exuberant-ctags | 
universal-ctags".  With only Emacs ctags is installed, gtags with pygments 
displays:


/usr/bin/ctags: unrecognized option '--filter'
Try '/usr/bin/ctags --help' for a complete list of options.



Looking at these, the changes introduced in 6.4.4-4 seem to be headed in 
the right direction.




I do not fully agree with this statement.  I believe that Global should 
honor the choice of the user, who selected an implementation of ctags with 
Debian's "alternatives".  Perhaps there should be a better warning than 
the "unrecognized option '--filter'" when neither exuberant-ctags nor 
universal-ctags is installed.


Gregory



Bug#968231: global: does not index definitions with pygments anymore

2020-08-12 Thread Punit Agrawal
On Wed, Aug 12, 2020 at 7:18 AM Punit Agrawal  wrote:

[...]

> I will look into this (hopefully later today) and look for a way to
> fix the regression.

I looked into this some more and have a somewhat better understanding
of the issue -

* When used, pygments only provide reference tags (GRTAGS) not definition tags

* The definitions were provided by /usr/bin/ctags (in 6.4.4-3).
"ctags" is usually a symlink pointing to one of few possible ctags
implementations - ctags.emacs, exuberant-ctags, universal-ctags the
ones I've come across.

* The pygments plugin script (/usr/share/global/gtags/script) has a
dependency on exuberant ctags but may also be able compatible with
other ctags implementations. It is possible to override this by using
"ctagscom=" in the config file.

Looking at these, the changes introduced in 6.4.4-4 seem to be headed
in the right direction. Users not wanting to install exuberant-ctags
can update the config file to use "ctagscom=" in the pygments fragment
to point global to their preferred "ctags" implementation. This may
lead to compatibility issues in some situation.

I will look to improve the messages in the pygments plugin when
exuberant-ctags binary is not detected in the system.

Let me know if you have any other suggestions.

Thanks,
Punit



Bug#968231: global: does not index definitions with pygments anymore

2020-08-11 Thread Punit Agrawal
Hi Gregory,

On Tue, Aug 11, 2020 at 11:48 PM Gregory Heytings  wrote:

[...]

> The bug is a modification in gtags.conf:
>
>   pygments-parser|Pygments plug-in parser:\
> :tc=common:\
> -   :ctagscom=/usr/bin/ctags:\
> +   :ctagscom=/usr/bin/ctags-exuberant:\
> :pygmentslib=$libdir/gtags/pygments-parser.la:\
> :langmap=ABAP\:.abap:\
> :langmap=ANTLR\:.G.g:\
>
> When exuberant-ctags (which is not a dependency of global) is not
> installed, definitions are not indexed.

Thanks for digging into this. After uninstalling exuberant-ctags,
"main" is no longer in the database.

% gtags -d GTAGS
 __.COMPNAME __.COMPNAME
 __.COMPRESS __.COMPRESS ddefine ttypedef
 __.VERSION  __.VERSION 6

I will look into this (hopefully later today) and look for a way to
fix the regression.

In the meantime, a temporary workaround is to drop the
":ctagscom=/usr/bin/ctags-exuberant" as in your previous post.

Thanks,
Punit



Bug#968231: global: does not index definitions with pygments anymore

2020-08-11 Thread Gregory Heytings



Hi Punit,

The bug is a modification in gtags.conf:

 pygments-parser|Pygments plug-in parser:\
:tc=common:\
-   :ctagscom=/usr/bin/ctags:\
+   :ctagscom=/usr/bin/ctags-exuberant:\
:pygmentslib=$libdir/gtags/pygments-parser.la:\
:langmap=ABAP\:.abap:\
:langmap=ANTLR\:.G.g:\

When exuberant-ctags (which is not a dependency of global) is not 
installed, definitions are not indexed.


Gregory



Bug#968231: global: does not index definitions with pygments anymore

2020-08-11 Thread Gregory Heytings



Hi Punit,

On my computer this is the output:

echo 'int main(){return 0;}' > main.c
export GTAGSLABEL=pygments

sudo dpkg -i global_6.6.4-3_amd64.deb
gtags -v
[Tue Aug 11 12:58:15 UTC 2020] Gtags started.
 Using configuration file '/etc/gtags/gtags.conf'.
 Using configuration label 'pygments'.
 Using plug-in parser.
[Tue Aug 11 12:58:15 UTC 2020] Creating 'GTAGS' and 'GRTAGS'.
 [1] extracting tags of main.c
[Tue Aug 11 12:58:15 UTC 2020] Done.
gtags -d GTAGS
 __.COMPNAME __.COMPNAME
 __.COMPRESS __.COMPRESS ddefine ttypedef
 __.VERSION  __.VERSION 6
main1 @n 1 int @n(){return 0;}

sudo dpkg -i global_6.6.4-4_amd64.deb
gtags -v
[Tue Aug 11 12:59:10 UTC 2020] Gtags started.
 Using configuration file '/etc/gtags/gtags.conf'.
 Using configuration label 'pygments'.
 Using plug-in parser.
[Tue Aug 11 12:59:10 UTC 2020] Creating 'GTAGS' and 'GRTAGS'.
 [1] extracting tags of main.c
[Tue Aug 11 12:59:10 UTC 2020] Done.
gtags -d GTAGS
 __.COMPNAME __.COMPNAME
 __.COMPRESS __.COMPRESS ddefine ttypedef
 __.VERSION  __.VERSION 6

Gregory



Bug#968231: global: does not index definitions with pygments anymore

2020-08-11 Thread Gregory Heytings



Package: global
Version: 6.6.4-4
Severity: important
X-Debbugs-Cc: g...@sdf.org

Dear Maintainer,

Version 6.6.4-4 of the package does not index definitions with 
GTAGSLABEL=pygments.  Version 6.6.4-3 did.  Steps to reproduce the bug:

echo 'int main(){return 0;}' > main.c
export GTAGSLABEL=pygments
gtags
gtags -d GTAGS | grep -v '^ '

The last command displays "main" with 6.6.4-3, and nothing with 6.6.4-4.

-- System Information:
Debian Release: bullseye/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.7.0-2-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages global depends on:
ii  emacsen-common  3.0.4
ii  libc6   2.31-2
ii  libltdl72.4.6-14
ii  libncurses6 6.2-1
ii  libsqlite3-03.32.3-1
ii  libtinfo6   6.2-1

Versions of packages global recommends:
ii  python3  3.8.2-3

Versions of packages global suggests:
pn  doxygen 
pn  exuberant-ctags 
ii  firefox-esr [www-browser]   68.11.0esr-1
pn  id-utils
ii  python3-pygments2.3.1+dfsg-4
ii  w3m [www-browser]   0.5.3-38

-- no debconf information



Bug#968231: global: does not index definitions with pygments anymore

2020-08-11 Thread Punit Agrawal
Hi Gregory,

Thank you for the bug report.

I can't seem to reproduce the failure you are seeing. See excerpt below -

% echo 'int main(){return 0;}' > main.c
export GTAGSLABEL=pygments
gtags
gtags -d GTAGS | grep -v '^ '
main1 @n 1 int @n(){return 0;}

What is the output of gtags -v? For reference, I get -

% gtags -v
[Tue Aug 11 21:36:39 JST 2020] Gtags started.
 Using configuration file '/etc/gtags/gtags.conf'.
 Using configuration label 'pygments'.
 Using plug-in parser.
[Tue Aug 11 21:36:39 JST 2020] Creating 'GTAGS' and 'GRTAGS'.
 [1] extracting tags of main.c
[Tue Aug 11 21:36:39 JST 2020] Done.


On Tue, Aug 11, 2020 at 9:03 PM Gregory Heytings  wrote:
>
>
> Package: global
> Version: 6.6.4-4
> Severity: important
> X-Debbugs-Cc: g...@sdf.org
>
> Dear Maintainer,
>
> Version 6.6.4-4 of the package does not index definitions with 
> GTAGSLABEL=pygments.  Version 6.6.4-3 did.  Steps to reproduce the bug:
>
> echo 'int main(){return 0;}' > main.c
> export GTAGSLABEL=pygments
> gtags
> gtags -d GTAGS | grep -v '^ '
>
> The last command displays "main" with 6.6.4-3, and nothing with 6.6.4-4.
>
> -- System Information:
> Debian Release: bullseye/sid
>APT prefers stable-updates
>APT policy: (500, 'stable-updates'), (500, 'testing'), (500, 'stable')
> Architecture: amd64 (x86_64)
>
> Kernel: Linux 5.7.0-2-amd64 (SMP w/8 CPU threads)
> Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
> LANGUAGE=en_US:en
> Shell: /bin/sh linked to /usr/bin/dash
> Init: systemd (via /run/systemd/system)
> LSM: AppArmor: enabled
>
> Versions of packages global depends on:
> ii  emacsen-common  3.0.4
> ii  libc6   2.31-2
> ii  libltdl72.4.6-14
> ii  libncurses6 6.2-1
> ii  libsqlite3-03.32.3-1
> ii  libtinfo6   6.2-1
>
> Versions of packages global recommends:
> ii  python3  3.8.2-3
>
> Versions of packages global suggests:
> pn  doxygen 
> pn  exuberant-ctags 
> ii  firefox-esr [www-browser]   68.11.0esr-1
> pn  id-utils
> ii  python3-pygments2.3.1+dfsg-4
> ii  w3m [www-browser]   0.5.3-38
>
> -- no debconf information