#pragma once #include "hash.hh" #include "serialise.hh" #include #include #include namespace nix { typedef std::map Roots; struct GCOptions { /* Garbage collector operation: - `gcReturnLive': return the set of paths reachable from (i.e. in the closure of) the roots. - `gcReturnDead': return the set of paths not reachable from the roots. - `gcDeleteDead': actually delete the latter set. - `gcDeleteSpecific': delete the paths listed in `pathsToDelete', insofar as they are not reachable. */ typedef enum { gcReturnLive, gcReturnDead, gcDeleteDead, gcDeleteSpecific, } GCAction; GCAction action; /* If `ignoreLiveness' is set, then reachability from the roots is ignored (dangerous!). However, the paths must still be unreferenced *within* the store (i.e., there can be no other store paths that depend on them). */ bool ignoreLiveness; /* For `gcDeleteSpecific'
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2022-11-24 15:36:18 +0100
committerRicardo Wurmus <rekado@elephly.net>2022-11-24 15:36:18 +0100
commitfa59a22140bcb98fa6e5cf895deaa5f2fbdb9bcf (patch)
tree388dec729e8c1b13b5e9822e8fe1311f649e1105 /gnu/packages/compton.scm
parent2e85d26ebb5be6f7c52a9f2d780e0ae34fd40692 (diff)
downloadguix-fa59a22140bcb98fa6e5cf895deaa5f2fbdb9bcf.tar.gz
guix-fa59a22140bcb98fa6e5cf895deaa5f2fbdb9bcf.zip
gnu: r-aims: Update to 1.30.0.
* gnu/packages/bioconductor.scm (r-aims): Update to 1.30.0.
Diffstat (limited to 'gnu/packages/compton.scm')
0 files changed, 0 insertions, 0 deletions
Sink & sink) = 0; /* Import a sequence of NAR dumps created by exportPaths() into the Nix store. */ virtual Paths importPaths(bool requireSignature, Source & source) = 0; /* For each path, if it's a derivation, build it. Building a derivation means ensuring that the output paths are valid. If they are already valid, this is a no-op. Otherwise, validity can be reached in two ways. First, if the output paths is substitutable, then build the path that way. Second, the 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; /* Ensure that a path is valid. If it is not currently valid, it may be made valid by running a substitute (if defined for the path). */ virtual void ensurePath(const Path & path) = 0; /* Add a store path as a temporary root of the garbage collector. The root disappears as soon as we exit. */ virtual void addTempRoot(const Path & path) = 0; /* Add an indirect root, which is merely a symlink to `path' from /nix/var/nix/gcroots/auto/. `path' is supposed to be a symlink to a store path. The garbage collector will automatically remove the indirect root when it finds that `path' has disappeared. */ virtual void addIndirectRoot(const Path & path) = 0; /* Acquire the global GC lock, then immediately release it. This function must be called after registering a new permanent root, but before exiting. Otherwise, it is possible that a running garbage collector doesn't see the new root and deletes the stuff we've just built. By acquiring the lock briefly, we ensure that either: - The collector is already running, and so we block until the collector is finished. The collector will know about our *temporary* locks, which should include whatever it is we want to register as a permanent lock. - The collector isn't running, or it's just started but hasn't acquired the GC lock yet. In that case we get and release the lock right away, then exit. The collector scans the permanent root and sees our's. In either case the permanent root is seen by the collector. */ virtual void syncWithGC() = 0; /* Find the roots of the garbage collector. Each root is a pair (link, storepath) where `link' is the path of the symlink outside of the Nix store that point to `storePath'. */ virtual Roots findRoots() = 0; /* Perform a garbage collection. */ virtual void collectGarbage(const GCOptions & options, GCResults & results) = 0; /* Return the set of paths that have failed to build.*/ virtual PathSet queryFailedPaths() = 0; /* Clear the "failed" status of the given paths. The special value `*' causes all failed paths to be cleared. */ virtual void clearFailedPaths(const PathSet & paths) = 0; /* Return a string representing information about the path that can be loaded into the database using `nix-store --load-db' or `nix-store --register-validity'. */ string makeValidityRegistration(const PathSet & paths, bool showDerivers, bool showHash); /* Optimise the disk space usage of the Nix store by hard-linking files with the same contents. */ virtual void optimiseStore() = 0; /* Check the integrity of the Nix store. Returns true if errors remain. */ virtual bool verifyStore(bool checkContents, bool repair) = 0; }; /* !!! These should be part of the store API, I guess. */ /* Throw an exception if `path' is not directly in the Nix store. */ void assertStorePath(const Path & path); bool isInStore(const Path & path); bool isStorePath(const Path & path); /* Extract the name part of the given store path. */ string storePathToName(const Path & path); void checkStoreName(const string & name); /* Chop off the parts after the top-level store name, e.g., /nix/store/abcd-foo/bar => /nix/store/abcd-foo. */ Path toStorePath(const Path & path); /* Constructs a unique store path name. */ Path makeStorePath(const string & type, const Hash & hash, const string & name); Path makeOutputPath(const string & id, const Hash & hash, const string & name); Path makeFixedOutputPath(bool recursive, HashType hashAlgo, Hash hash, string name); /* Preparatory part of addTextToStore(). !!! Computation of the path should take the references given to addTextToStore() into account, otherwise we have a (relatively minor) security hole: a caller can register a source file with bogus references. If there are too many references, the path may not be garbage collected when it has to be (not really a problem, the caller could create a root anyway), or it may be garbage collected when it shouldn't be (more serious). Hashing the references would solve this (bogus references would simply yield a different store path, so other users wouldn't be affected), but it has some backwards compatibility issues (the hashing scheme changes), so I'm not doing that for now. */ Path computeStorePathForText(const string & name, const string & s, const PathSet & references); /* Remove the temporary roots file for this process. Any temporary root becomes garbage after this point unless it has been registered as a (permanent) root. */ void removeTempRoots(); /* Register a permanent GC root. */ Path addPermRoot(StoreAPI & store, const Path & storePath, const Path & gcRoot, bool indirect, bool allowOutsideRootsDir = false); /* Sort a set of paths topologically under the references relation. If p refers to q, then p preceeds q in this list. */ Paths topoSortPaths(StoreAPI & store, const PathSet & paths); /* For now, there is a single global store API object, but we'll purify that in the future. */ extern std::shared_ptr store; /* Factory method: open the Nix database, either through the local or remote implementation. */ std::shared_ptr openStore(bool reserveSpace = true); /* Display a set of paths in human-readable form (i.e., between quotes and separated by commas). */ string showPaths(const PathSet & paths); /* Export multiple paths in the format expected by ‘nix-store --import’. */ void exportPaths(StoreAPI & store, const Paths & paths, bool sign, Sink & sink); MakeError(SubstError, Error) MakeError(BuildError, Error) /* denotes a permanent build failure */ }