Re: [gtk-osx-users] [Gramps-devel] python version mismatch while attempting clean build.
- From: Ronan Waide <waider gmail com>
- To: gtk-osx-users-list gnome org
- Subject: Re: [gtk-osx-users] [Gramps-devel] python version mismatch while attempting clean build.
- Date: Thu, 01 Aug 2013 17:30:40 +0100
On 08/01/2013 05:04 PM, John Ralls wrote:
On Aug 1, 2013, at 7:59 AM, Ronan Waide <waider gmail com> wrote:
On 08/01/2013 03:48 PM, John Ralls wrote:
On Aug 1, 2013, at 12:07 AM, Ronan Waide <waider gmail com> wrote:
On 30 Jul 2013, at 17:17, Ronan Waide <waider gmail com> wrote:
On 07/30/2013 05:03 PM, Ronan Waide wrote:
On 07/30/2013 03:08 PM, John Ralls wrote:
On Jul 30, 2013, at 6:39 AM, John Ralls <jralls ceridwen us> wrote:
On Jul 30, 2013, at 1:02 AM, Ronan Waide <waider gmail com> wrote:
Hi,
running in my usual clean-build environment, the build is failing in
rsvg with the following:
GISCAN Rsvg-2.0.gir
Traceback (most recent call last):
File "/Users/waider/gtk/inst/bin/g-ir-scanner", line 44, in <module>
from giscanner.scannermain import scanner_main
File
"/Users/waider/gtk/inst/lib/gobject-introspection/giscanner/scannermain.py",
line 29, in <module>
import tempfile
File "/Users/waider/gtk/inst/lib/python2.7/tempfile.py", line 34, in
<module>
from random import Random as _Random
File "/Users/waider/gtk/inst/lib/python2.7/random.py", line 47, in
<module>
from os import urandom as _urandom
ImportError: cannot import name urandom
make[2]: *** [Rsvg-2.0.gir] Error 1
This is basically down to the fact that the system python is 2.7.2 and
the jhbuild python is 2.7.3. jhbuild used have an option to ignore the
system-provided tools, but that appears to have vanished with the recent
upgrade to jhbuild 3.x; however, I've managed a clean build since that
update, so something else has triggered this failure. I can investigate
hacking around this (seems like the problem is the g-ir-scanner
script/build rather than Rsvg) but wanted to bring it up here in case
there's already a known fix.
Thanks for bringing it up, but this is the wrong list. Please use gtk-osx-users-list gnome org for build
issues not
related directly to Gramps code
I think I bumped up against this yesterday; it was just as my wife called me to dinner, so I didn't have time
to investigate. I suspect that a search path is getting whacked.
The only option in jhbuild to ignore system-provided tools that I know about is the --ignore-system option to
jhbuild bootstrap, which tells jhbuild to build a program even if it's already available on the path. Was
there something else that I've missed?
Hi John,
that's the option I was referring to - it seems like it's no longer available in jhbuild since you upgraded
it:
lumpy:gramps waider$ jhbuild bootstrap --ignore-system
Usage: jhbuild bootstrap [ options ... ] [ modules ... ]
jhbuild: error: no such option: --ignore-system
cheers,
Waider
I edited the #! line for the installed g-ir-scanner and the build now seems to be working again (I say 'seems
to be' as it's running, and will continue to run for quite some time before I know if it worked or not!)
Realising this morning that this is not a sustainable hack, as the jhbuild-built python binary that I
modified g-ir-scanner to use might not have been built by the time I need it :) So, I've two ideas for how
this should be fixed: if the script is using /usr/bin/python, make sure that there's no element in sys.path
that points to the jhbuild-built core python library directory, or (verified this overnight) use 'defaults
write com.apple.versioner.python Version 2.6' to force /usr/bin/python to have a different minor version from
the jhbuild-built one, which prevents this issue from happening.
Ah! You must have set versioner.python to 2.7 at some point. The default is 2.6, even in 10.8. I've never
changed it on my system, which is probably why I've never seen that problem. I should have realized that from
your original, where you said that the system python is 2.7.2.
This makes sense, since when I looked at the Apple manpage for python, it indicated that 2.6 is the default.
However:
c82a14542fe4:~ waider$ defaults read com.apple.versioner.python
2013-08-01 15:51:07.778 defaults[2763:707]
Domain com.apple.versioner.python does not exist
c82a14542fe4:~ waider$ python --version
Python 2.7.2
c82a14542fe4:~ waider$ defaults write com.apple.versioner.python Version 2.6
c82a14542fe4:~ waider$ defaults read com.apple.versioner.python
2013-08-01 15:51:07.778 defaults[2763:707]
{
Version = "2.6";
}
c82a14542fe4:~ waider$ python --version
Python 2.6.7
...and just to be sure...
c82a14542fe4:~ waider$ defaults delete com.apple.versioner.python
c82a14542fe4:~ waider$ python --version
Python 2.7.2
This seems to suggest that the manual page is not accurate, and 2.7 is now the default.
Interesting, and that's the case on my system as well.
If you're going to build python, you should do so early, before or at the same time as
meta-gtk-osx-bootstrap. Otherwise you'll get some modules building their python stuff for the Apple version
and others building for the version you built, and much pain will ensue, as you've discovered.
I reiterate my recommendation that you build all the modules you want in a single invocation of jhbuild: That
affords jhbuild the best opportunity to sequence the building correctly to satisfy all of the soft
dependencies.
Oh but I do :) my build script, cleaning of existing builds aside, reduces to this:
fetch gtk-osx setup script and run it
jhbuild bootstrap
jhbuild --modules gramps.modules all_the_things_including_python
So that gets us back to why do you have this problem and I don't. Maybe something in my jhbuildrc-custom, which is
pretty complicated because of all of the ways I build things, or perhaps because of something in gramps.modules, since
I usually don't build that "native". Have you edited the .jhbuildrc-custom than gtk-osx-build-setup.sh
installs?
I build with an unmodified .jhbuildrc-custom most of the time. I've
mucked around with it from time to time while trying to figure out that
GtkTextBuffer crash, but right now I'm using the default version.
Cheers,
Waider.
--
waider gmail com / It's about as impersonal as you can get.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]