[Nix-dev] nix store: hardlink vs symlink

Florian Friesdorf flo at chaoflow.net
Sat Sep 24 17:51:24 CEST 2011


On Sat, 24 Sep 2011 17:15:08 +0200, Peter Simons <simons at cryp.to> wrote:
> Hi Florian,
> 
>  > If ./bin/python is a symlink, python will resolve it to find its home
>  > and set sys.prefix accordingly.
> 
> it seems to me like Python is behaving perfectly reasonable. The prefix of
> Python is at /nix/store/vzpvrymynp4n93bznxha6hadj0ww68vx-python-2.7.1. The
> other paths, /tmp/cfl/bad or /tmp/cfl/good1, are not its prefix.
> 
> Why would you want Python to believe that its prefix would be at one of those
> paths?

The prefix determines where python searches for site-packages.

I currently see two ways python is called:

Python applications with an isolated environment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
They call python as:
/nix/store/vzpvrymynp4n93bznxha6hadj0ww68vx-python-2.7.1/bin/python

the prefix is:
/nix/store/vzpvrymynp4n93bznxha6hadj0ww68vx-python-2.7.1

and python will load its empty site-packages in there.
Modules needed by the application are made available via PYTHONPATH.


Python development
~~~~~~~~~~~~~~~~~~
You currently can install python modules into a profile, together with a
python interpreter (of the same python version) they can build a python
environment. Not meant for running applications, but for example
development.

For this environment to function properly python needs to treat the
profile as its home. virtualenv for example currently breaks because of
modules coming from different prefixes.

If I install ipdb and ipython into a profile, I'd expect them to see
all modules I added to the profile.

-- 
Florian Friesdorf <flo at chaoflow.net>
  GPG FPR: 7A13 5EEE 1421 9FC2 108D  BAAF 38F8 99A3 0C45 F083
Jabber/XMPP: flo at chaoflow.net
IRC: chaoflow on freenode,ircnet,blafasel,OFTC
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20110924/0b55c1ba/attachment.bin 


More information about the nix-dev mailing list