1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-30 07:33:16 +02:00

Decode virtual paths in user-thrown errors

E.g. instead of

  error: Package ‘steam’ in /__virtual__/4/pkgs/games/steam/steam.nix:43 has an unfree license (‘unfreeRedistributable’), refusing to evaluate.

you now get

  error: Package ‘steam’ in «github:nixos/nixpkgs/b82ccafb54163ab9024e893e578d840577785fea»/pkgs/games/steam/steam.nix:43 has an unfree license (‘unfreeRedistributable’), refusing to evaluate.
This commit is contained in:
Eelco Dolstra 2022-09-12 12:52:07 +02:00
parent b293b33322
commit 48a5879b63
4 changed files with 39 additions and 4 deletions

View file

@ -231,6 +231,11 @@ public:
/* Decode a path encoded by `encodePath()`. */
SourcePath decodePath(std::string_view s, PosIdx pos = noPos);
/* Decode all virtual paths in a string, i.e. all
/__virtual__/... substrings are replaced by the corresponding
input accessor. */
std::string decodePaths(std::string_view s);
/* Allow access to a path. */
void allowPath(const Path & path);