[Nix-dev] builtins.toPath returns ... a string?

Shea Levy shea at shealevy.com
Thu May 22 21:45:57 CEST 2014


Possibly relevant discussion: https://github.com/NixOS/nix/pull/47
On Thu, May 22, 2014 at 09:04:19PM +0400, Kirill Elagin wrote:
> The relevant commit is this:
> https://github.com/NixOS/nix/commit/d7efd7639420f4c840cbfdfcbbb3c45292f3ac54
> Looks like `toPath` is not only obsolete, but prohibited since semantics of
> paths changed and now it makes no sense no convert something to a path.
> 
> 
> --
> Кирилл Елагин
> 
> 
> On Thu, May 22, 2014 at 7:49 PM, Marc Weber <marco-oweber at gmx.de> wrote:
> 
> > --eval-only --strict -xml output:
> >
> > of
> >
> >   {
> >     s = "/home";
> >     p = /home;
> >     to_p = builtins.toPath "/home";
> >   }
> >
> > Same
> >
> >   || <?xml version='1.0' encoding='utf-8'?>
> >   || <expr>
> >   ||   <attrs>
> >   ||     <attr column="3" line="3" name="p" path="/tmp/test.nix">
> >   ||       <path value="/home" />
> >   ||     </attr>
> >   ||     <attr column="3" line="2" name="s" path="/tmp/test.nix">
> >   ||       <string value="/home" />
> >   ||     </attr>
> >   ||     <attr column="3" line="4" name="to_p" path="/tmp/test.nix">
> >   ||       <string value="/home" />
> >   ||     </attr>
> >   ||   </attrs>
> >   || </expr>
> >
> >
> > primops.cc
> >
> >   /* Convert the argument to a path.  !!! obsolete? */
> >   static void prim_toPath(EvalState & state, const Pos & pos, Value * *
> > args, Value & v)
> >   {
> >       PathSet context;
> >       Path path = state.coerceToPath(pos, *args[0], context);
> >       mkString(v, canonPath(path), context);
> >   }
> >
> > You may want to talk about your use case.
> >
> > Marc Weber
> > _______________________________________________
> > nix-dev mailing list
> > nix-dev at lists.science.uu.nl
> > http://lists.science.uu.nl/mailman/listinfo/nix-dev
> >

> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev



More information about the nix-dev mailing list