Skip to content

Nix search path doesn't seem to handle long paths correctly #114

Closed

Description

@shlevy
$ stat /run/current-system/sw/lib/python2.7/site-packages/charon-0.1-py2.7.egg/charon/../../../../../share/nix/charon
  File: ‘/run/current-system/sw/lib/python2.7/site-packages/charon-0.1-py2.7.egg/charon/../../../../../share/nix/charon’
  Size: 458             Blocks: 0          IO Block: 4096   directory
Device: 10h/16d Inode: 29002768    Links: 1
Access: (0555/dr-xr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2013-04-15 15:08:38.000000000 -0400
Modify: 1969-12-31 19:00:01.000000000 -0500
Change: 2013-04-15 15:08:38.128795240 -0400
 Birth: -

but

$ nix-instantiate -vvv -I charon=/run/current-system/sw/lib/python2.7/site-packages/charon-0.1-py2.7.egg/charon/../../../../../share/nix/charon --find-file charon
setting initial heap size to 402653184 bytes
adding path `/home/shlevy/dotfiles-private' to the search path
adding path `/home/shlevy/src' to the search path
adding path `/etc/nixos/configuration.nix' to the search path
adding path `/nix/store/qkj5cxknwspz8ak0ganm97zfr2bhksgn-nix-1.5.2pre3082_2398417/share/nix/corepkgs' to the search path
/home/shlevy/src/charon

I am currently trying to find the root cause.

Activity

  1. shlevy commented on Apr 22, 2013

    @shlevy
    MemberAuthor

    OK, it looks like the bug (if it is a bug) is in absPath. It absolutlizes /run/current-system/sw/lib/python2.7/site-packages/charon-0.1-py2.7.egg/charon/../../../../../share/nix/charon to /run/current-system/sw/share/nix/charon instead of /nix/store/fqfnzh68z0vpjw0sn2nimj1pm905vnwh-charon-0.1pre635_60c5266/share/nix/charon (following symlinks properly).

    @edolstra is this behavior of absPath desired?

  2. shlevy commented on Apr 22, 2013

    @shlevy
    MemberAuthor

    OK, now I see that canonPath has a resolveSymlinks parameter, so this behavior is expected. The real fix is to either have charon pass an absolute path to the expressions or to include /share/nix in my system configuration.

  3. added a commit that references this issue on Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions