mirror of
https://github.com/NixOS/nix
synced 2025-07-07 06:01:48 +02:00
Add NAR / Store accessor abstraction
This is primary to allow hydra-queue-runner to extract files like "nix-support/hydra-build-products" from NARs in binary caches.
This commit is contained in:
parent
152b1d6bf9
commit
1042c10fd0
11 changed files with 352 additions and 13 deletions
|
@ -140,9 +140,10 @@ struct BuildResult
|
|||
|
||||
struct BasicDerivation;
|
||||
struct Derivation;
|
||||
struct FSAccessor;
|
||||
|
||||
|
||||
class Store
|
||||
class Store : public std::enable_shared_from_this<Store>
|
||||
{
|
||||
public:
|
||||
|
||||
|
@ -314,6 +315,9 @@ public:
|
|||
remain. */
|
||||
virtual bool verifyStore(bool checkContents, bool repair) = 0;
|
||||
|
||||
/* Return an object to access files in the Nix store. */
|
||||
virtual ref<FSAccessor> getFSAccessor() = 0;
|
||||
|
||||
/* Utility functions. */
|
||||
|
||||
/* Read a derivation, after ensuring its existence through
|
||||
|
@ -345,6 +349,12 @@ public:
|
|||
};
|
||||
|
||||
|
||||
class LocalFSStore : public Store
|
||||
{
|
||||
ref<FSAccessor> getFSAccessor() override;
|
||||
};
|
||||
|
||||
|
||||
/* !!! These should be part of the store API, I guess. */
|
||||
|
||||
/* Throw an exception if `path' is not directly in the Nix store. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue