[gobolinux-users] Issues while building Mercurial

Daed Lee daed at thoughtsofcode.com
Fri Apr 3 11:32:43 NZDT 2009


I ran into a few problems while building Mercurial on Rootless on Mac OS X.

First, Compile gave me the following errors:

Compile: Compiling Mercurial version 1.2.1, revision r1.
Traceback (most recent call last):
  File "/Users/daed/GoboLinux/System/Links/Executables/GuessLatest",
line 9, in <module>
    from PythonUtils import *
ImportError: No module named PythonUtils
/Users/daed/GoboLinux/System/Links/Executables/Compile: line 481: [:
too many arguments
Traceback (most recent call last):
  File "/Users/daed/GoboLinux/System/Links/Executables/GuessLatest",
line 9, in <module>
    from PythonUtils import *
ImportError: No module named PythonUtils
/Users/daed/GoboLinux/System/Links/Executables/FetchArchive: line 47:
[: too many arguments

and

Compile: Stripping executables...
Traceback (most recent call last):
  File "/Users/daed/GoboLinux/System/Links/Executables/CheckDependencies",
line 6, in <module>
    from GuessProgramCase import *
ImportError: No module named GuessProgramCase

Seems like the error is caused by the Mercurial recipe resetting PYTHONPATH:

environment=(
  "PYTHONPATH=$target/lib/python"
)

I also found this bug report: http://bugs.gobolinux.org/view.php?id=378

Despite the Compile errors, the build went through, however when
trying hg debuginstall, I got the following error:

abort: couldn't find mercurial libraries in
[/Users/daed/GoboLinux/Programs/Mercurial/1.2.1/bin
/Users/daed/GoboLinux/System/Links/Libraries/python2.3/site-packages
/Users/daed/GoboLinux/System/Links/Libraries/python2.4/site-packages
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python25.zip
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac/lib-scriptpackages
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload
/Library/Python/2.5/site-packages
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/PyObjC]
(check your install and PYTHONPATH)

Fixed by editing StartRootless:

export PYTHONPATH="${goboPrefix}/System/Links/Libraries/python2.3/site-packages:${goboPrefix}/System/Links/Libraries/python2.4/site-packages${PYTHONPATH:+:$PYTHONPATH}"

changed to:

export PYTHONPATH="${goboPrefix}/System/Links/Libraries/python2.3/site-packages:${goboPrefix}/System/Links/Libraries/python2.4/site-packages:${goboPrefix}/System/Links/Libraries/python2.5/site-packages${PYTHONPATH:+:$PYTHONPATH}"

Is this required every for every new version of Python? Is there a way
to specify that the current version of Python be used?

Lastly, I was prompted during the Mercurial build to install Python
3.0.1 as a dependency. As far as I can tell Python 3.0 isn't backward
compatible with Python 2.x. Should the recipe be changed so that the
Dependency file reads "Python < 3.0" (not sure if that's the correct
syntax)?


More information about the gobolinux-users mailing list