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

Add a dummy Store::buildPaths() method

This default implementation of buildPaths() does nothing if all
requested paths are already valid, and throws an "unsupported
operation" error otherwise. This fixes a regression introduced by
c30330df6f in binary cache and legacy
SSH stores.
This commit is contained in:
Eelco Dolstra 2017-05-01 13:43:34 +02:00
parent b0b81b7500
commit 0dddcf867a
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
5 changed files with 36 additions and 38 deletions

View file

@ -18,6 +18,12 @@
namespace nix {
MakeError(SubstError, Error)
MakeError(BuildError, Error) /* denotes a permanent build failure */
MakeError(InvalidPath, Error)
MakeError(Unsupported, Error)
struct BasicDerivation;
struct Derivation;
class FSAccessor;
@ -414,7 +420,7 @@ public:
output paths can be created by running the builder, after
recursively building any sub-derivations. For inputs that are
not derivations, substitute them. */
virtual void buildPaths(const PathSet & paths, BuildMode buildMode = bmNormal) = 0;
virtual void buildPaths(const PathSet & paths, BuildMode buildMode = bmNormal);
/* Build a single non-materialized derivation (i.e. not from an
on-disk .drv file). Note that drvPath is only used for
@ -584,6 +590,12 @@ protected:
Stats stats;
/* Unsupported methods. */
[[noreturn]] void unsupported()
{
throw Unsupported("requested operation is not supported by store %s", getUri());
}
};
@ -720,10 +732,4 @@ ValidPathInfo decodeValidPathInfo(std::istream & str,
for paths created by makeFixedOutputPath() / addToStore(). */
std::string makeFixedOutputCA(bool recursive, const Hash & hash);
MakeError(SubstError, Error)
MakeError(BuildError, Error) /* denotes a permanent build failure */
MakeError(InvalidPath, Error)
}