Skip to content

Commit

Permalink
Revert "prim_toPath: Actually make the string a path"
Browse files Browse the repository at this point in the history
This reverts commit 2980d1f.  It
causes a regression in NixOS evaluation:

string `/nix/store/ya3s5gmj3b28170fpbjhgsk8wzymkpa1-pommed-1.39/etc/pommed.conf' cannot refer to other paths
  • Loading branch information
edolstra committed Nov 15, 2012
1 parent f794465 commit 17dc306
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/libexpr/primops.cc
Expand Up @@ -517,9 +517,7 @@ static void prim_toPath(EvalState & state, Value * * args, Value & v)
{
PathSet context;
Path path = state.coerceToPath(*args[0], context);
if (!context.empty())
throw EvalError(format("string `%1%' cannot refer to other paths") % path);
mkPath(v, canonPath(path).c_str());
mkString(v, canonPath(path), context);
}


Expand Down

3 comments on commit 17dc306

@shlevy
Copy link
Member

@shlevy shlevy commented on 17dc306 Aug 31, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edolstra can we re-revert this? That eval failure suggests that a configuration file refers to some path but, due to the brokenness of toPath, doesn't actually hold a reference!

@domenkozar
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shlevy it would probably help to have an example for it

@shlevy
Copy link
Member

@shlevy shlevy commented on 17dc306 Aug 31, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's obsolete and shouldn't be used at all. The reverted commit just fixed the remaining uses to actually do what the original developer almost certainly intended.

Please sign in to comment.