After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 574501 - build script looks for site-packages instead of dist-packages folder
build script looks for site-packages instead of dist-packages folder
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2009-03-07 21:50 UTC by Igor Vatavuk
Modified: 2015-02-07 16:52 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
Bug 574501 - Install giscanner Python module to private directory (29.62 KB, patch)
2009-03-09 19:11 UTC, Colin Walters
none Details | Review

Description Igor Vatavuk 2009-03-07 21:50:44 UTC
Please describe the problem:
'jhbuild run g-ir-scanner' fails using python 2.6 on Ubuntu Jaunty.
 
Traceback (most recent call last):  
  • File "/home/jaybee/gnome-shell/install/bin/g-ir-scanner", line 44 in <module>
    from giscanner.annotationparser import AnnotationParser, InvalidAnnotationError ImportError: No module named giscanner.annotationparser

annotationparser.py (and other files) is in ~/gnome-shell/install/lib/python2.6/dist-packages/giscanner/
but script looks for it in ~/gnome-shell/install/lib/python2.6/site-packages/giscanner/

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Owen Taylor 2009-03-09 16:45:01 UTC
There's some mention of a rationale at https://wiki.ubuntu.com/Python2.6And3.0

As far as I can tell, the point is to be able to have both:

 Distributed Python 2.6 look in /usr/local/python-2.6/dist-packages for extra localy installed modules

 Locally installed (configure && make && make install) Python 2.6 look in /usr/local/python-2.6/site-packages for extra locally installed moduless

It sounds a bit crazy to me - a huge divergence from upstream and other operating systems to support something very marginal, so I'm probably missing something. 

Two possible fixes:

 1) In the python code scan the sys.path for strings with dist-packages in them and use that to figure out what the setup is.
 2) Config-substitute $pythondir into g-ir-scanner rather than basing off of argv[0]. 

2) is probably the more robust approach and avoids the need to comment a bunch of weird looking code.
Comment 2 Colin Walters 2009-03-09 17:49:38 UTC
I'd suggest a different fix - install the python module into e.g. /usr/lib/gobject-introspection/scanner/giscanner, and config-substitute that ($pkglibdir) in the g-ir-scanner script.

I've always thought that while python's module system is nice and convenient for development, it does encourage pollution of the global namespace for internal components when installed.

Comment 3 Colin Walters 2009-03-09 19:11:42 UTC
Created attachment 130344 [details] [review]
Bug 574501 - Install giscanner Python module to private directory

We don't want to pollute the global namespace with our private
libraries.  Also, this sidesteps all the craziness that is happening
with OS vendors changing how Python installs modules.
Comment 4 Johan (not receiving bugmail) Dahlin 2009-03-15 14:58:49 UTC
(In reply to comment #3)
> Created an attachment (id=130344) [edit]
> Bug 574501 - Install giscanner Python module to private directory
> 
> We don't want to pollute the global namespace with our private
> libraries.  Also, this sidesteps all the craziness that is happening
> with OS vendors changing how Python installs modules.
> 

Okay, looks pretty good except that there's always something which bothers me about editing .in files. Can you move over the bulk of tools/g-ir-scanner to giscanner/scannermain.py or so? So the .in script is basically only setting up the path and importing the main entry point. That way we'll avoid editing .in files most of the time.
Comment 5 André Klapper 2015-02-07 16:52:16 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]