On Wednesday, 27 June 2012 20:47:28 David Naylor wrote:
> On Monday, 25 June 2012 23:33:12 Ronny Pfannschmidt wrote:
> > Hi David,
> > 
> > i created the kill-import_from_lib_pypy branch,
> > which should fix the issue - its still in testing,
> > please take a look if any issue comes up

With the changes below your patch works (also, unpatched the translation 
works, whereas before it did not).  

> Alas, the changes you made to pypy/tool/compat.py and
> pypy/translator/goal/targetpypystandalone.py didn't work in my setup...

I believe that, due to my relocation of lib_pypy, I didn't catch all the cases 
(specifically autopath.py), and due to my error these errors have been 
occuring... Sorry!

> I have the following changes:

And these additions to get a "properly" working environment

> # cd pypy
> # mkdir lib
> # mv lib-python/2.7 lib/pypy1.9
> # mv lib_pypy lib/pypy1.9/lib_pypy

# ln lib/pypy1.9/lib_pypy lib_pypy

> # patch << _EOF
> --- lib/pypy1.9/lib_pypy/ctypes_config_cache/rebuild.py~        2012-06-22
> 11:42:55.000000000 +0200 +++
> lib/pypy1.9/lib_pypy/ctypes_config_cache/rebuild.py 2012-06-22
> 11:43:12.000000000 +0200 @@ -6,7 +6,7 @@
>  # get the correct path
>  import os.path
>  this_dir = os.path.dirname(__file__)
> -autopath_py = os.path.join(this_dir, '../../pypy/tool/autopath.py')
> +autopath_py = os.path.join(this_dir, '../../../../pypy/tool/autopath.py')
>  autopath_py = os.path.abspath(autopath_py)
>  execfile(autopath_py, dict(__name__='autopath', __file__=autopath_py))
> 

Using your patches the above change is not needed.  

> --- pypy/module/sys/state.py.orig       2012-06-07 14:24:48.000000000 +0200
> +++ pypy/module/sys/state.py    2012-06-22 14:45:23.000000000 +0200
> @@ -36,14 +36,12 @@
>  platform = sys.platform
> 
>  def getinitialpath(state, prefix):
> -    from pypy.module.sys.version import CPYTHON_VERSION
> -    dirname = '%d.%d' % (CPYTHON_VERSION[0],
> -                         CPYTHON_VERSION[1])
> -    lib_python = os.path.join(prefix, 'lib-python')
> -    python_std_lib = os.path.join(lib_python, dirname)
> +    from pypy.module.sys.version import PYPY_VERSION
> +    libpath = os.path.join(prefix, 'lib')
> +    python_std_lib = os.path.join(libpath, 'pypy%d.%d' % PYPY_VERSION[:2])
>      checkdir(python_std_lib)
> 
> -    lib_pypy = os.path.join(prefix, 'lib_pypy')
> +    lib_pypy = os.path.join(python_std_lib, 'lib_pypy')
>      checkdir(lib_pypy)
> 
>      importlist = []
> --- pypy/tool/lib_pypy.py.orig  2012-06-07 14:24:48.000000000 +0200
> +++ pypy/tool/lib_pypy.py       2012-06-22 14:46:42.000000000 +0200
> @@ -1,12 +1,11 @@
>  import py
>  import pypy
>  import pypy.module
> -from pypy.module.sys.version import CPYTHON_VERSION
> +from pypy.module.sys.version import PYPY_VERSION
> 
>  LIB_ROOT = py.path.local(pypy.__path__[0]).dirpath()
> -LIB_PYPY =  LIB_ROOT.join('lib_pypy')
> -LIB_PYTHON = LIB_ROOT.join('lib-python', '%d.%d' % CPYTHON_VERSION[:2])
> -
> +LIB_PYTHON =  LIB_ROOT.join('lib', 'pypy%d.%d' % PYPY_VERSION[:2])
> +LIB_PYPY = LIB_PYTHON.join('lib_pypy')
> 
>  def import_from_lib_pypy(modname):
>      modname = LIB_PYPY.join(modname+'.py')
> _EOF

And with just the above translation works successfully for me.

Regards

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
http://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to