Opened 7 years ago

Last modified 5 years ago

#54007 assigned defect

global @6.6.2: Provided /opt/local/share/gtags/script/pygments_parser.py has shebang that points to Apple's Python and this results in failure

Reported by: iqgrande Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: Cc:
Port: global

Description

Greetings:

I recently installed GNU Global via MacPorts and when I tried to run gtags on a source tree that contains Fortran, Python, TeX, and C, I received the following error(s). When I look at /opt/local/share/gtags/script/pygments_parser.py I notice it's shebang is #!/usr/bin/python. I changed this to /opt/local/bin/python and then things worked. So, would you be able to assist me with this? If there are some other environment variables/setup that I need to do to better enable things, then please let me know. If there are no better ways to set things up, then I suspect either a patch would be made to alter the shebang to something more practical like #!/usr/bin/env python so the user can ensure that $PATH-preferred Python has the appropriate Pygments library installed, or gtags would need to be modified to prepend python to its invocation of /opt/local/share/gtags/script/pygments_parser.py. Thank you for any insight you can provide into this.

$ export GTAGSCONF=/opt/local/share/gtags/gtags.conf
$ export GTAGSLABEL=pygments
$ gtags -v --explain
[Thu Apr 20 17:26:30 MDT 2017] Gtags started.
 Using configuration file '/opt/local/share/gtags/gtags.conf'.
 Using configuration label 'pygments'.
 Using plug-in parser.
[Thu Apr 20 17:26:30 MDT 2017] Creating 'GTAGS' and 'GRTAGS'.
 - Directory '.git/' is skipped because the name begins with a dot.
 - File '.gitignore' is skipped because the name begins with a dot.
 [1] extracting tags of Atmos/src/Atmos_ames_mod_source.f
 - File 'foo.f' is handled as follows:
	suffix:   |.f|
	language: |Fortran|
	parser:   |parser|
	library:  |/opt/local/lib/gtags/pygments-parser.so|
Traceback (most recent call last):
  File "/opt/local/share/gtags/script/pygments_parser.py", line 27, in <module>
    import pygments.lexers
ImportError: No module named pygments.lexers
gtags: unexpected EOF.

Change History (6)

comment:1 Changed 7 years ago by mf2k (Frank Schima)

Cc: sean@… removed
Keywords: global removed
Owner: set to seanfarley
Status: newassigned

comment:2 Changed 6 years ago by seanfarley (Sean Farley)

Resolution: fixed
Status: assignedclosed

comment:3 Changed 5 years ago by iqgrande

Resolution: fixed
Status: closedreopened

Greetings:

I just verified that this issue is still present (built with latest everything today) and when I make my proposed change then things work.

Kind regards, Anthony

comment:4 Changed 5 years ago by iqgrande

Greetings:

I was incorrect in my earlier statement. Ultimately, my changes enable it to run without spitting out errors however when the Pygments backend is used things are not correctly found. For example, if I just to simple queries like global main to find main() within main.cpp it is not found. FWIW, GNU Global appears to run correctly with the Pygments backend if it is installed via Homebrew (I wanted to test my usage and methodology).

$ port version ; port installed | grep global ; system_profiler SPSoftwareDataType
Version: 2.5.4
  global @6.6.2_0 (active)
Software:

    System Software Overview:

      System Version: macOS 10.14.3 (18D109)
      Kernel Version: Darwin 18.2.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 2 days 55 minutes

Kind regards, Anthony

comment:5 Changed 5 years ago by iqgrande

Summary: global @6.5.6: Provided /opt/local/share/gtags/script/pygments_parser.py has shebang that points to Apple's Python and this results in failureglobal @6.6.2: Provided /opt/local/share/gtags/script/pygments_parser.py has shebang that points to Apple's Python and this results in failure
Version: 2.4.12.5.4

comment:6 Changed 5 years ago by mf2k (Frank Schima)

Owner: seanfarley deleted
Status: reopenedassigned
Note: See TracTickets for help on using tickets.