Re: [Nix-dev] PYTHONPATH and eggs

2012-08-07 Thread Florian Friesdorf
On Sun, 5 Aug 2012 14:06:30 +0200, Mathijs Kwik  
wrote:
> I fixed it.
> pyxattrs and pylibacl depend on setuptools, so that needed to be
> included in the wrapper too.
> See 
> https://github.com/NixOS/nixpkgs/commit/107f5e3560e446d690ab62bc5b8f3d86f7032459

Sorry - that was an obvious one! Great that you figured it out.

regards
florian

> On Fri, Jul 27, 2012 at 6:24 PM, Mathijs Kwik  
> wrote:
> > On Fri, Jul 27, 2012 at 3:30 PM, Florian Friesdorf  
> > wrote:
> >> On Fri, 27 Jul 2012 14:32:47 +0200, Cillian de Róiste 
> >>  wrote:
> >>> On Fri, Jul 27, 2012 at 1:42 PM, Florian Friesdorf  
> >>> wrote:
> >>> > On Fri, 27 Jul 2012 13:29:03 +0200, Mathijs Kwik 
> >>> >  wrote:
> >>> >> That's strange then :)
> >>> >>
> >>> >> I disabled the test too, but the problem remains.
> >>> >> Just to be clear, it's a warning, not an error:
> >>> >>
> >>> >> % bup meta
> >>> >> Warning: Linux xattr support missing; install python-pyxattr.
> >>> >> Warning: POSIX ACL support missing; install python-pylibacl.
> >>> >> usage: bup meta --create [OPTION ...] 
> >>> >>or: bup meta --extract [OPTION ...]
> >>> >>or: bup meta --start-extract [OPTION ...]
> >>> >>or: bup meta --finish-extract [OPTION ...]
> >>> >
> >>> > sorry - I have the same - was looking out for python import errors.
> >>> >
> >>> >> How can I debug this further?
> >>> >
> >>> > % 
> >>> > /nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py
> >>> >  .nix-profile/bin/bup
> >>> > Traceback (most recent call last):
> >>> >   File 
> >>> > "/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py",
> >>> >  line 1314, in main
> >>> > pdb._runscript(mainpyfile)
> >>> >   File 
> >>> > "/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py",
> >>> >  line 1233, in _runscript
> >>> > self.run(statement)
> >>> >   File 
> >>> > "/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/bdb.py",
> >>> >  line 387, in run
> >>> > exec cmd in globals, locals
> >>> >   File "", line 1, in 
> >>> >   File ".nix-profile/bin/bup", line 2
> >>> > export 
> >>> > PYTHONPATH=/nix/store/ixp90035n4xrr6y4kcvcb36cd6rpcz0a-python-pyxattr-0.5.1/lib/python2.7/site-packages:/nix/store/kczagr8sv3yx355jy63byv7i7jngbx9v-python-pylibacl-0.5.1/lib/python2.7/site-packages:/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/site-packages:/nix/store/93lbhnm76wlkmq7r0z8lwk3g9ch76hjp-git-1.7.11/lib/python2.7/site-packages${PYTHONPATH:+:}$PYTHONPATH
> >>> > ^
> >>> > SyntaxError: invalid syntax
> >>> > Uncaught exception. Entering post mortem debugging
> >>> > Running 'cont' or 'step' will restart the program
> >>> >> (1)()
> >>> > (Pdb)
> >>> >
> >>> > So the wrapper actually is not good.
> >>>
> >>> If I understand correctly, you've run pdb on the wrapper, which is a
> >>> shell script, rather than the wrapped python code, is that right?
> >>
> >> hihi - yes
> >>
> >> correct is:
> >>
> >> % 
> >> /nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py\
> >>>  
> >>> /nix/store/c4inzdbs8ckpd22sm928kqywnz9xpknj-bup-0.25git20120722/bin/.bup-wrapped\
> >>>  meta
> >>
> >> then check sys.path
> >>
> >>> /nix/store/c4inzdbs8ckpd22sm928kqywnz9xpknj-bup-0.25git20120722/bin/.bup-wrapped(2)()
> >> -> import sys, os, subprocess, signal, getopt
> >> (Pdb) import sys,pprint
> >> (Pdb) pprint.pprint(sys.path)
> >> ['/nix/store/c4inzdbs8ckpd22sm928kqywnz9xpknj-bup-0.25git20120722/bin',
> >>  
> >> '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/site-packages',
> >>  
> >> '/nix/store/9vx5rqgbmjvp8320kv2xzd9pg27r8i2n-python-bsddb-2.7.3/lib/python2.7/site-packages',
> >>  
> >> '/nix/store/l76wlc1pimd372hwff6c1mxrc5bm3ym6-python-curses-2.7.3/lib/python2.7/site-packages',
> >>  
> >> '/nix/store/vmbzx7h0pvvcvrisj1bgvrhb3q9xkgs8-python-gdbm-2.7.3/lib/python2.7/site-packages',
> >>  
> >> '/nix/store/36yvgidmiwsdl8cz9xh1zwfpaqxgfslh-python-readline-2.7.3/lib/python2.7/site-packages',
> >>  
> >> '/nix/store/a3rc404sxi4d4adwr6r0rsphbal1qai5-python-sqlite3-2.7.3/lib/python2.7/site-packages',
> >>  
> >> '/nix/store/i1idllnq0130b89cjwjn0s926bzlihsy-python-tkinter-2.7.3/lib/python2.7/site-packages',
> >>  
> >> '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python27.zip',
> >>  '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7',
> >>  
> >> '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/plat-linux2',
> >>  
> >> '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/lib-tk',
> >>  
> >> '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/lib-old',
> >>  
> >> '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/lib-dynload']
> >> (Pdb) print sys.exec_prefix
> >> /nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3
> >>
> >> pyxattr and pylibacl are not in sys.path. At least their site-packages
> 

Re: [Nix-dev] PYTHONPATH and eggs

2012-08-05 Thread Mathijs Kwik
I fixed it.
pyxattrs and pylibacl depend on setuptools, so that needed to be
included in the wrapper too.
See 
https://github.com/NixOS/nixpkgs/commit/107f5e3560e446d690ab62bc5b8f3d86f7032459

Regards,
Mathijs

On Fri, Jul 27, 2012 at 6:24 PM, Mathijs Kwik  wrote:
> On Fri, Jul 27, 2012 at 3:30 PM, Florian Friesdorf  wrote:
>> On Fri, 27 Jul 2012 14:32:47 +0200, Cillian de Róiste 
>>  wrote:
>>> On Fri, Jul 27, 2012 at 1:42 PM, Florian Friesdorf  
>>> wrote:
>>> > On Fri, 27 Jul 2012 13:29:03 +0200, Mathijs Kwik 
>>> >  wrote:
>>> >> That's strange then :)
>>> >>
>>> >> I disabled the test too, but the problem remains.
>>> >> Just to be clear, it's a warning, not an error:
>>> >>
>>> >> % bup meta
>>> >> Warning: Linux xattr support missing; install python-pyxattr.
>>> >> Warning: POSIX ACL support missing; install python-pylibacl.
>>> >> usage: bup meta --create [OPTION ...] 
>>> >>or: bup meta --extract [OPTION ...]
>>> >>or: bup meta --start-extract [OPTION ...]
>>> >>or: bup meta --finish-extract [OPTION ...]
>>> >
>>> > sorry - I have the same - was looking out for python import errors.
>>> >
>>> >> How can I debug this further?
>>> >
>>> > % 
>>> > /nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py
>>> >  .nix-profile/bin/bup
>>> > Traceback (most recent call last):
>>> >   File 
>>> > "/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py",
>>> >  line 1314, in main
>>> > pdb._runscript(mainpyfile)
>>> >   File 
>>> > "/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py",
>>> >  line 1233, in _runscript
>>> > self.run(statement)
>>> >   File 
>>> > "/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/bdb.py",
>>> >  line 387, in run
>>> > exec cmd in globals, locals
>>> >   File "", line 1, in 
>>> >   File ".nix-profile/bin/bup", line 2
>>> > export 
>>> > PYTHONPATH=/nix/store/ixp90035n4xrr6y4kcvcb36cd6rpcz0a-python-pyxattr-0.5.1/lib/python2.7/site-packages:/nix/store/kczagr8sv3yx355jy63byv7i7jngbx9v-python-pylibacl-0.5.1/lib/python2.7/site-packages:/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/site-packages:/nix/store/93lbhnm76wlkmq7r0z8lwk3g9ch76hjp-git-1.7.11/lib/python2.7/site-packages${PYTHONPATH:+:}$PYTHONPATH
>>> > ^
>>> > SyntaxError: invalid syntax
>>> > Uncaught exception. Entering post mortem debugging
>>> > Running 'cont' or 'step' will restart the program
>>> >> (1)()
>>> > (Pdb)
>>> >
>>> > So the wrapper actually is not good.
>>>
>>> If I understand correctly, you've run pdb on the wrapper, which is a
>>> shell script, rather than the wrapped python code, is that right?
>>
>> hihi - yes
>>
>> correct is:
>>
>> % 
>> /nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py\
>>>  
>>> /nix/store/c4inzdbs8ckpd22sm928kqywnz9xpknj-bup-0.25git20120722/bin/.bup-wrapped\
>>>  meta
>>
>> then check sys.path
>>
>>> /nix/store/c4inzdbs8ckpd22sm928kqywnz9xpknj-bup-0.25git20120722/bin/.bup-wrapped(2)()
>> -> import sys, os, subprocess, signal, getopt
>> (Pdb) import sys,pprint
>> (Pdb) pprint.pprint(sys.path)
>> ['/nix/store/c4inzdbs8ckpd22sm928kqywnz9xpknj-bup-0.25git20120722/bin',
>>  
>> '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/site-packages',
>>  
>> '/nix/store/9vx5rqgbmjvp8320kv2xzd9pg27r8i2n-python-bsddb-2.7.3/lib/python2.7/site-packages',
>>  
>> '/nix/store/l76wlc1pimd372hwff6c1mxrc5bm3ym6-python-curses-2.7.3/lib/python2.7/site-packages',
>>  
>> '/nix/store/vmbzx7h0pvvcvrisj1bgvrhb3q9xkgs8-python-gdbm-2.7.3/lib/python2.7/site-packages',
>>  
>> '/nix/store/36yvgidmiwsdl8cz9xh1zwfpaqxgfslh-python-readline-2.7.3/lib/python2.7/site-packages',
>>  
>> '/nix/store/a3rc404sxi4d4adwr6r0rsphbal1qai5-python-sqlite3-2.7.3/lib/python2.7/site-packages',
>>  
>> '/nix/store/i1idllnq0130b89cjwjn0s926bzlihsy-python-tkinter-2.7.3/lib/python2.7/site-packages',
>>  '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python27.zip',
>>  '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7',
>>  
>> '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/plat-linux2',
>>  
>> '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/lib-tk',
>>  
>> '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/lib-old',
>>  
>> '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/lib-dynload']
>> (Pdb) print sys.exec_prefix
>> /nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3
>>
>> pyxattr and pylibacl are not in sys.path. At least their site-packages
>> dir should be and the pth file (see below) should then add the egg. I
>> also gave it a quick test with our python branch - same problem.
>>
>> Something is weird. I might have a look during the weekend.
>
> Would be very helpful, thanks!
> If you figure out how to do these 2, I can probably work out more
> optional deps, like python-fuse.
>
> Ha

Re: [Nix-dev] PYTHONPATH and eggs

2012-07-27 Thread Mathijs Kwik
On Fri, Jul 27, 2012 at 3:30 PM, Florian Friesdorf  wrote:
> On Fri, 27 Jul 2012 14:32:47 +0200, Cillian de Róiste 
>  wrote:
>> On Fri, Jul 27, 2012 at 1:42 PM, Florian Friesdorf  wrote:
>> > On Fri, 27 Jul 2012 13:29:03 +0200, Mathijs Kwik 
>> >  wrote:
>> >> That's strange then :)
>> >>
>> >> I disabled the test too, but the problem remains.
>> >> Just to be clear, it's a warning, not an error:
>> >>
>> >> % bup meta
>> >> Warning: Linux xattr support missing; install python-pyxattr.
>> >> Warning: POSIX ACL support missing; install python-pylibacl.
>> >> usage: bup meta --create [OPTION ...] 
>> >>or: bup meta --extract [OPTION ...]
>> >>or: bup meta --start-extract [OPTION ...]
>> >>or: bup meta --finish-extract [OPTION ...]
>> >
>> > sorry - I have the same - was looking out for python import errors.
>> >
>> >> How can I debug this further?
>> >
>> > % 
>> > /nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py
>> >  .nix-profile/bin/bup
>> > Traceback (most recent call last):
>> >   File 
>> > "/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py",
>> >  line 1314, in main
>> > pdb._runscript(mainpyfile)
>> >   File 
>> > "/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py",
>> >  line 1233, in _runscript
>> > self.run(statement)
>> >   File 
>> > "/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/bdb.py",
>> >  line 387, in run
>> > exec cmd in globals, locals
>> >   File "", line 1, in 
>> >   File ".nix-profile/bin/bup", line 2
>> > export 
>> > PYTHONPATH=/nix/store/ixp90035n4xrr6y4kcvcb36cd6rpcz0a-python-pyxattr-0.5.1/lib/python2.7/site-packages:/nix/store/kczagr8sv3yx355jy63byv7i7jngbx9v-python-pylibacl-0.5.1/lib/python2.7/site-packages:/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/site-packages:/nix/store/93lbhnm76wlkmq7r0z8lwk3g9ch76hjp-git-1.7.11/lib/python2.7/site-packages${PYTHONPATH:+:}$PYTHONPATH
>> > ^
>> > SyntaxError: invalid syntax
>> > Uncaught exception. Entering post mortem debugging
>> > Running 'cont' or 'step' will restart the program
>> >> (1)()
>> > (Pdb)
>> >
>> > So the wrapper actually is not good.
>>
>> If I understand correctly, you've run pdb on the wrapper, which is a
>> shell script, rather than the wrapped python code, is that right?
>
> hihi - yes
>
> correct is:
>
> % 
> /nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py\
>>  
>> /nix/store/c4inzdbs8ckpd22sm928kqywnz9xpknj-bup-0.25git20120722/bin/.bup-wrapped\
>>  meta
>
> then check sys.path
>
>> /nix/store/c4inzdbs8ckpd22sm928kqywnz9xpknj-bup-0.25git20120722/bin/.bup-wrapped(2)()
> -> import sys, os, subprocess, signal, getopt
> (Pdb) import sys,pprint
> (Pdb) pprint.pprint(sys.path)
> ['/nix/store/c4inzdbs8ckpd22sm928kqywnz9xpknj-bup-0.25git20120722/bin',
>  
> '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/site-packages',
>  
> '/nix/store/9vx5rqgbmjvp8320kv2xzd9pg27r8i2n-python-bsddb-2.7.3/lib/python2.7/site-packages',
>  
> '/nix/store/l76wlc1pimd372hwff6c1mxrc5bm3ym6-python-curses-2.7.3/lib/python2.7/site-packages',
>  
> '/nix/store/vmbzx7h0pvvcvrisj1bgvrhb3q9xkgs8-python-gdbm-2.7.3/lib/python2.7/site-packages',
>  
> '/nix/store/36yvgidmiwsdl8cz9xh1zwfpaqxgfslh-python-readline-2.7.3/lib/python2.7/site-packages',
>  
> '/nix/store/a3rc404sxi4d4adwr6r0rsphbal1qai5-python-sqlite3-2.7.3/lib/python2.7/site-packages',
>  
> '/nix/store/i1idllnq0130b89cjwjn0s926bzlihsy-python-tkinter-2.7.3/lib/python2.7/site-packages',
>  '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python27.zip',
>  '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7',
>  
> '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/plat-linux2',
>  
> '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/lib-tk',
>  
> '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/lib-old',
>  
> '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/lib-dynload']
> (Pdb) print sys.exec_prefix
> /nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3
>
> pyxattr and pylibacl are not in sys.path. At least their site-packages
> dir should be and the pth file (see below) should then add the egg. I
> also gave it a quick test with our python branch - same problem.
>
> Something is weird. I might have a look during the weekend.

Would be very helpful, thanks!
If you figure out how to do these 2, I can probably work out more
optional deps, like python-fuse.

Have a nice weekend

>
> % cat .nix-profile/bin/bup
> #! /nix/store/043zrsanirjh8nbc5vqpjn93hhrf107f-bash-4.2-p24/bin/bash -e
> export 
> PYTHONPATH=/nix/store/ixp90035n4xrr6y4kcvcb36cd6rpcz0a-python-pyxattr-0.5.1/lib/python2.7/site-packages:/nix/store/kczagr8sv3yx355jy63byv7i7jngbx9v-python-pylibacl-0.5.1/lib/python2.7/site-packages:/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-

Re: [Nix-dev] PYTHONPATH and eggs

2012-07-27 Thread Florian Friesdorf
On Fri, 27 Jul 2012 14:32:47 +0200, Cillian de Róiste 
 wrote:
> On Fri, Jul 27, 2012 at 1:42 PM, Florian Friesdorf  wrote:
> > On Fri, 27 Jul 2012 13:29:03 +0200, Mathijs Kwik  
> > wrote:
> >> That's strange then :)
> >>
> >> I disabled the test too, but the problem remains.
> >> Just to be clear, it's a warning, not an error:
> >>
> >> % bup meta
> >> Warning: Linux xattr support missing; install python-pyxattr.
> >> Warning: POSIX ACL support missing; install python-pylibacl.
> >> usage: bup meta --create [OPTION ...] 
> >>or: bup meta --extract [OPTION ...]
> >>or: bup meta --start-extract [OPTION ...]
> >>or: bup meta --finish-extract [OPTION ...]
> >
> > sorry - I have the same - was looking out for python import errors.
> >
> >> How can I debug this further?
> >
> > % 
> > /nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py
> >  .nix-profile/bin/bup
> > Traceback (most recent call last):
> >   File 
> > "/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py",
> >  line 1314, in main
> > pdb._runscript(mainpyfile)
> >   File 
> > "/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py",
> >  line 1233, in _runscript
> > self.run(statement)
> >   File 
> > "/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/bdb.py",
> >  line 387, in run
> > exec cmd in globals, locals
> >   File "", line 1, in 
> >   File ".nix-profile/bin/bup", line 2
> > export 
> > PYTHONPATH=/nix/store/ixp90035n4xrr6y4kcvcb36cd6rpcz0a-python-pyxattr-0.5.1/lib/python2.7/site-packages:/nix/store/kczagr8sv3yx355jy63byv7i7jngbx9v-python-pylibacl-0.5.1/lib/python2.7/site-packages:/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/site-packages:/nix/store/93lbhnm76wlkmq7r0z8lwk3g9ch76hjp-git-1.7.11/lib/python2.7/site-packages${PYTHONPATH:+:}$PYTHONPATH
> > ^
> > SyntaxError: invalid syntax
> > Uncaught exception. Entering post mortem debugging
> > Running 'cont' or 'step' will restart the program
> >> (1)()
> > (Pdb)
> >
> > So the wrapper actually is not good.
> 
> If I understand correctly, you've run pdb on the wrapper, which is a
> shell script, rather than the wrapped python code, is that right?

hihi - yes

correct is:

% /nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py\
>  
> /nix/store/c4inzdbs8ckpd22sm928kqywnz9xpknj-bup-0.25git20120722/bin/.bup-wrapped\
>  meta

then check sys.path

> /nix/store/c4inzdbs8ckpd22sm928kqywnz9xpknj-bup-0.25git20120722/bin/.bup-wrapped(2)()
-> import sys, os, subprocess, signal, getopt
(Pdb) import sys,pprint
(Pdb) pprint.pprint(sys.path)
['/nix/store/c4inzdbs8ckpd22sm928kqywnz9xpknj-bup-0.25git20120722/bin',
 
'/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/site-packages',
 
'/nix/store/9vx5rqgbmjvp8320kv2xzd9pg27r8i2n-python-bsddb-2.7.3/lib/python2.7/site-packages',
 
'/nix/store/l76wlc1pimd372hwff6c1mxrc5bm3ym6-python-curses-2.7.3/lib/python2.7/site-packages',
 
'/nix/store/vmbzx7h0pvvcvrisj1bgvrhb3q9xkgs8-python-gdbm-2.7.3/lib/python2.7/site-packages',
 
'/nix/store/36yvgidmiwsdl8cz9xh1zwfpaqxgfslh-python-readline-2.7.3/lib/python2.7/site-packages',
 
'/nix/store/a3rc404sxi4d4adwr6r0rsphbal1qai5-python-sqlite3-2.7.3/lib/python2.7/site-packages',
 
'/nix/store/i1idllnq0130b89cjwjn0s926bzlihsy-python-tkinter-2.7.3/lib/python2.7/site-packages',
 '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python27.zip',
 '/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7',
 
'/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/plat-linux2',
 
'/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/lib-tk',
 
'/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/lib-old',
 
'/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/lib-dynload']
(Pdb) print sys.exec_prefix
/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3

pyxattr and pylibacl are not in sys.path. At least their site-packages
dir should be and the pth file (see below) should then add the egg. I
also gave it a quick test with our python branch - same problem.

Something is weird. I might have a look during the weekend.

% cat .nix-profile/bin/bup  

#! /nix/store/043zrsanirjh8nbc5vqpjn93hhrf107f-bash-4.2-p24/bin/bash -e
export 
PYTHONPATH=/nix/store/ixp90035n4xrr6y4kcvcb36cd6rpcz0a-python-pyxattr-0.5.1/lib/python2.7/site-packages:/nix/store/kczagr8sv3yx355jy63byv7i7jngbx9v-python-pylibacl-0.5.1/lib/python2.7/site-packages:/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/site-packages:/nix/store/93lbhnm76wlkmq7r0z8lwk3g9ch76hjp-git-1.7.11/lib/python2.7/site-packages${PYTHONPATH:+:}$PYTHONPATH
exec 
/nix/store/c4inzdbs8ckpd22sm928kqywnz9xpknj-bup-0.25git20120722/bin/.bup-wrapped
 "${extraFlagsArray[@]}" "$@"

% ls -l 
/nix/store/ixp90035

Re: [Nix-dev] PYTHONPATH and eggs

2012-07-27 Thread Cillian de Róiste
On Fri, Jul 27, 2012 at 1:42 PM, Florian Friesdorf  wrote:
> On Fri, 27 Jul 2012 13:29:03 +0200, Mathijs Kwik  
> wrote:
>> That's strange then :)
>>
>> I disabled the test too, but the problem remains.
>> Just to be clear, it's a warning, not an error:
>>
>> % bup meta
>> Warning: Linux xattr support missing; install python-pyxattr.
>> Warning: POSIX ACL support missing; install python-pylibacl.
>> usage: bup meta --create [OPTION ...] 
>>or: bup meta --extract [OPTION ...]
>>or: bup meta --start-extract [OPTION ...]
>>or: bup meta --finish-extract [OPTION ...]
>
> sorry - I have the same - was looking out for python import errors.
>
>> How can I debug this further?
>
> % 
> /nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py 
> .nix-profile/bin/bup
> Traceback (most recent call last):
>   File 
> "/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py",
>  line 1314, in main
> pdb._runscript(mainpyfile)
>   File 
> "/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py",
>  line 1233, in _runscript
> self.run(statement)
>   File 
> "/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/bdb.py",
>  line 387, in run
> exec cmd in globals, locals
>   File "", line 1, in 
>   File ".nix-profile/bin/bup", line 2
> export 
> PYTHONPATH=/nix/store/ixp90035n4xrr6y4kcvcb36cd6rpcz0a-python-pyxattr-0.5.1/lib/python2.7/site-packages:/nix/store/kczagr8sv3yx355jy63byv7i7jngbx9v-python-pylibacl-0.5.1/lib/python2.7/site-packages:/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/site-packages:/nix/store/93lbhnm76wlkmq7r0z8lwk3g9ch76hjp-git-1.7.11/lib/python2.7/site-packages${PYTHONPATH:+:}$PYTHONPATH
> ^
> SyntaxError: invalid syntax
> Uncaught exception. Entering post mortem debugging
> Running 'cont' or 'step' will restart the program
>> (1)()
> (Pdb)
>
> So the wrapper actually is not good.

If I understand correctly, you've run pdb on the wrapper, which is a
shell script, rather than the wrapped python code, is that right?
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] PYTHONPATH and eggs

2012-07-27 Thread Florian Friesdorf
On Fri, 27 Jul 2012 13:29:03 +0200, Mathijs Kwik  
wrote:
> That's strange then :)
> 
> I disabled the test too, but the problem remains.
> Just to be clear, it's a warning, not an error:
> 
> % bup meta
> Warning: Linux xattr support missing; install python-pyxattr.
> Warning: POSIX ACL support missing; install python-pylibacl.
> usage: bup meta --create [OPTION ...] 
>or: bup meta --extract [OPTION ...]
>or: bup meta --start-extract [OPTION ...]
>or: bup meta --finish-extract [OPTION ...]

sorry - I have the same - was looking out for python import errors.

> How can I debug this further?

% /nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py 
.nix-profile/bin/bup 
Traceback (most recent call last):
  File 
"/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py",
 line 1314, in main
pdb._runscript(mainpyfile)
  File 
"/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/pdb.py",
 line 1233, in _runscript
self.run(statement)
  File 
"/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/bdb.py",
 line 387, in run
exec cmd in globals, locals
  File "", line 1, in 
  File ".nix-profile/bin/bup", line 2
export 
PYTHONPATH=/nix/store/ixp90035n4xrr6y4kcvcb36cd6rpcz0a-python-pyxattr-0.5.1/lib/python2.7/site-packages:/nix/store/kczagr8sv3yx355jy63byv7i7jngbx9v-python-pylibacl-0.5.1/lib/python2.7/site-packages:/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/site-packages:/nix/store/93lbhnm76wlkmq7r0z8lwk3g9ch76hjp-git-1.7.11/lib/python2.7/site-packages${PYTHONPATH:+:}$PYTHONPATH
^
SyntaxError: invalid syntax
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> (1)()
(Pdb) 

So the wrapper actually is not good.

-- 
Florian Friesdorf 
  GPG FPR: 7A13 5EEE 1421 9FC2 108D  BAAF 38F8 99A3 0C45 F083
Jabber/XMPP: f...@chaoflow.net
IRC: chaoflow on freenode,ircnet,blafasel,OFTC


pgp7obH39Eojc.pgp
Description: PGP signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] PYTHONPATH and eggs

2012-07-27 Thread Mathijs Kwik
That's strange then :)

I disabled the test too, but the problem remains.
Just to be clear, it's a warning, not an error:

% bup meta
Warning: Linux xattr support missing; install python-pyxattr.
Warning: POSIX ACL support missing; install python-pylibacl.
usage: bup meta --create [OPTION ...] 
   or: bup meta --extract [OPTION ...]
   or: bup meta --start-extract [OPTION ...]
   or: bup meta --finish-extract [OPTION ...]

% cat `which bup`
#! /nix/store/043zrsanirjh8nbc5vqpjn93hhrf107f-bash-4.2-p24/bin/bash -e
export 
PYTHONPATH=/nix/store/ixp90035n4xrr6y4kcvcb36cd6rpcz0a-python-pyxattr-0.5.1/lib/python2.7/site-packages:/nix/store/kczagr8sv3yx355jy63byv7i7jngbx9v-python-pylibacl-0.5.1/lib/python2.7/site-packages:/nix/store/5qmz5wc596kl7rywx56phyl2gb0052w7-python-2.7.3/lib/python2.7/site-packages:/nix/store/93lbhnm76wlkmq7r0z8lwk3g9ch76hjp-git-1.7.11/lib/python2.7/site-packages${PYTHONPATH:+:}$PYTHONPATH
exec 
/nix/store/a8525w6briwiij324lnv425495jr9dcn-bup-0.25git20120722/bin/.bup-wrapped
"${extraFlagsArray[@]}" "$@"

% ls -l 
/nix/store/ixp90035n4xrr6y4kcvcb36cd6rpcz0a-python-pyxattr-0.5.1/lib/python2.7/site-packages
total 40
-r--r--r-- 1 root nixbld   224  1 jan  1970 easy-install.pth
-r--r--r-- 1 root nixbld 25699  1 jan  1970 pyxattr-0.5.1-py2.7-linux-x86_64.egg
-r--r--r-- 1 root nixbld  2362  1 jan  1970 site.py
-r--r--r-- 1 root nixbld  1845  1 jan  1970 site.pyc

% ls -l 
/nix/store/kczagr8sv3yx355jy63byv7i7jngbx9v-python-pylibacl-0.5.1/lib/python2.7/site-packages
total 44
-r--r--r-- 1 root nixbld   225  1 jan  1970 easy-install.pth
-r--r--r-- 1 root nixbld 31620  1 jan  1970
pylibacl-0.5.1-py2.7-linux-x86_64.egg
-r--r--r-- 1 root nixbld  2362  1 jan  1970 site.py
-r--r--r-- 1 root nixbld  1847  1 jan  1970 site.pyc

How can I debug this further?

Thanks,
Mathijs

On Fri, Jul 27, 2012 at 12:07 PM, Florian Friesdorf  wrote:
>
> Hi Mathijs,
>
> On Fri, 27 Jul 2012 09:06:44 +0200, Mathijs Kwik  
> wrote:
>> Hi Florian,
>>
>> I used "buildPythonPackage" for the 2 modules (xattr and acl).
>> Bup itself is not a python package by itself (I think), so I gave that
>> a normal package, and just wrapped the (only) binary with PYTHONPATH
>> prefixes, as I've seen in other packages in the nixpkgs too.
>>
>> Please have a look here:
>> https://github.com/bluescreen303/nixpkgs/commit/4426f0a2c62d42f63cc57e86e80f38b15ac85250
>>
>> To test if it works, you can type "bup meta". That will now warn about
>> the missing libraries.
>
> I had to disable the tests for pylibacl, but bup meta does not give an
> error, also the generated wrapper looks good - do you still have the
> error?
>
> regards
> florian
> --
> Florian Friesdorf 
>   GPG FPR: 7A13 5EEE 1421 9FC2 108D  BAAF 38F8 99A3 0C45 F083
> Jabber/XMPP: f...@chaoflow.net
> IRC: chaoflow on freenode,ircnet,blafasel,OFTC
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] PYTHONPATH and eggs

2012-07-27 Thread Florian Friesdorf

Hi Mathijs,

On Fri, 27 Jul 2012 09:06:44 +0200, Mathijs Kwik  
wrote:
> Hi Florian,
> 
> I used "buildPythonPackage" for the 2 modules (xattr and acl).
> Bup itself is not a python package by itself (I think), so I gave that
> a normal package, and just wrapped the (only) binary with PYTHONPATH
> prefixes, as I've seen in other packages in the nixpkgs too.
> 
> Please have a look here:
> https://github.com/bluescreen303/nixpkgs/commit/4426f0a2c62d42f63cc57e86e80f38b15ac85250
> 
> To test if it works, you can type "bup meta". That will now warn about
> the missing libraries.

I had to disable the tests for pylibacl, but bup meta does not give an
error, also the generated wrapper looks good - do you still have the
error?

regards
florian
-- 
Florian Friesdorf 
  GPG FPR: 7A13 5EEE 1421 9FC2 108D  BAAF 38F8 99A3 0C45 F083
Jabber/XMPP: f...@chaoflow.net
IRC: chaoflow on freenode,ircnet,blafasel,OFTC


pgpaylXas3R3D.pgp
Description: PGP signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] PYTHONPATH and eggs

2012-07-27 Thread Mathijs Kwik
Hi Florian,

I used "buildPythonPackage" for the 2 modules (xattr and acl).
Bup itself is not a python package by itself (I think), so I gave that
a normal package, and just wrapped the (only) binary with PYTHONPATH
prefixes, as I've seen in other packages in the nixpkgs too.

Please have a look here:
https://github.com/bluescreen303/nixpkgs/commit/4426f0a2c62d42f63cc57e86e80f38b15ac85250

To test if it works, you can type "bup meta". That will now warn about
the missing libraries.

Thanks for your help,
Mathijs


On Fri, Jul 27, 2012 at 8:56 AM, Florian Friesdorf  wrote:
> On Thu, 26 Jul 2012 22:31:48 +0200, Mathijs Kwik  
> wrote:
>> Hi all,
>>
>> I'm not familiar with python packaging and module lookup, so I hope
>> someone can help here.
>>
>> I'm trying to add support for xattrs and acls to "bup".
>> I packaged pyxattr and pylibacl.
>> They build fine and leave
>> $out/lib/python2.7/site-packages/*-linux-x86_64.egg files.
>>
>> I checked the source of "bup" and it just tries "import posix1e"
>> (which is in the root of one of the eggs) at runtime (not during
>> install).
>> So I used wrapProgram and "toPythonPath" to prefix these directories
>> to PYTHONPATH at runtime.
>> I both tried adding the directory itself and the path to the egg, but
>> it doesn't work yet.
>>
>> Am I missing something?
>
> If you package python, you should use buildPythonPackage and put it into
> top-level/python-packages.nix. If that does not work, please let me
> know.
>
> Also, if you send your patches or publish them somehow I will take a
> look.
>
> regards
> florian
> --
> Florian Friesdorf 
>   GPG FPR: 7A13 5EEE 1421 9FC2 108D  BAAF 38F8 99A3 0C45 F083
> Jabber/XMPP: f...@chaoflow.net
> IRC: chaoflow on freenode,ircnet,blafasel,OFTC
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] PYTHONPATH and eggs

2012-07-26 Thread Florian Friesdorf
On Thu, 26 Jul 2012 22:31:48 +0200, Mathijs Kwik  
wrote:
> Hi all,
> 
> I'm not familiar with python packaging and module lookup, so I hope
> someone can help here.
> 
> I'm trying to add support for xattrs and acls to "bup".
> I packaged pyxattr and pylibacl.
> They build fine and leave
> $out/lib/python2.7/site-packages/*-linux-x86_64.egg files.
> 
> I checked the source of "bup" and it just tries "import posix1e"
> (which is in the root of one of the eggs) at runtime (not during
> install).
> So I used wrapProgram and "toPythonPath" to prefix these directories
> to PYTHONPATH at runtime.
> I both tried adding the directory itself and the path to the egg, but
> it doesn't work yet.
> 
> Am I missing something?

If you package python, you should use buildPythonPackage and put it into
top-level/python-packages.nix. If that does not work, please let me
know.

Also, if you send your patches or publish them somehow I will take a
look.

regards
florian
-- 
Florian Friesdorf 
  GPG FPR: 7A13 5EEE 1421 9FC2 108D  BAAF 38F8 99A3 0C45 F083
Jabber/XMPP: f...@chaoflow.net
IRC: chaoflow on freenode,ircnet,blafasel,OFTC


pgpqIF2tGMujv.pgp
Description: PGP signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev