1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 20:01:15 +02:00

import, builtins.readFile: Handle diverted stores

Fixes #1791
This commit is contained in:
Eelco Dolstra 2018-01-12 17:31:08 +01:00
parent 435ccc7980
commit 74f75c8558
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
4 changed files with 33 additions and 8 deletions

View file

@ -112,6 +112,15 @@ public:
void checkURI(const std::string & uri);
/* When using a diverted store and 'path' is in the Nix store, map
'path' to the diverted location (e.g. /nix/store/foo is mapped
to /home/alice/my-nix/nix/store/foo). However, this is only
done if the context is not empty, since otherwise we're
probably trying to read from the actual /nix/store. This is
intended to distinguish between import-from-derivation and
sources stored in the actual /nix/store. */
Path toRealPath(const Path & path, const PathSet & context);
/* Parse a Nix expression from the specified file. */
Expr * parseExprFromFile(const Path & path);
Expr * parseExprFromFile(const Path & path, StaticEnv & staticEnv);