aboutsummaryrefslogtreecommitdiff
path: root/ChangeLog
diff options
context:
space:
mode:
authorNicolas Graves <ngraves@ngraves.fr>2024-01-27 19:21:31 +0100
committerSharlatan Hellseher <sharlatanus@gmail.com>2024-01-31 21:20:17 +0000
commita27d0f975b1c9ab87e2d2659f426feb5de018bce (patch)
tree698cea5fa45e3c461ebd360bbd6b33009924890c /ChangeLog
parent98651390a75609106464b80a35b0b8be745cb2a3 (diff)
downloadguix-a27d0f975b1c9ab87e2d2659f426feb5de018bce.tar.gz
guix-a27d0f975b1c9ab87e2d2659f426feb5de018bce.zip
gnu: Add go-structlayout-pretty.
* gnu/packages/golang-check.scm (go-structlayout-pretty): New variable. Change-Id: I622a991b12708ee52eb412a3c6b3fbeeb512843d Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Diffstat (limited to 'ChangeLog')
0 files changed, 0 insertions, 0 deletions
hashPath() if <type> = "output:out": for non-fixed derivation outputs: the derivation (see hashDerivationModulo() in primops.cc) for paths copied by addToStore() or produced by fixed-output derivations: the string "fixed:out:<rec><algo>:<hash>:", where <rec> = "r:" for recursive (path) hashes, or "" or flat (file) hashes <algo> = "md5", "sha1" or "sha256" <hash> = base-16 representation of the path or flat hash of the contents of the path (or expected contents of the path for fixed-output derivations) It would have been nicer to handle fixed-output derivations under "source", e.g. have something like "source:<rec><algo>", but we're stuck with this for now... The main reason for this way of computing names is to prevent name collisions (for security). For instance, it shouldn't be feasible to come up with a derivation whose output path collides with the path for a copied source. The former would have a <s> starting with "output:out:", while the latter would have a <2> starting with "source:". */ Path makeStorePath(const string & type, const Hash & hash, const string & name) { /* e.g., "source:sha256:1abc...:/nix/store:foo.tar.gz" */ string s = type + ":sha256:" + printHash(hash) + ":" + settings.nixStore + ":" + name; checkStoreName(name); return settings.nixStore + "/" + printHash32(compressHash(hashString(htSHA256, s), 20)) + "-" + name; } Path makeOutputPath(const string & id, const Hash & hash, const string & name) { return makeStorePath("output:" + id, hash, name + (id == "out" ? "" : "-" + id)); } Path makeFixedOutputPath(bool recursive, HashType hashAlgo, Hash hash, string name) { return hashAlgo == htSHA256 && recursive ? makeStorePath("source", hash, name) : makeStorePath("output:out", hashString(htSHA256, "fixed:out:" + (recursive ? (string) "r:" : "") + printHashType(hashAlgo) + ":" + printHash(hash) + ":"), name); } Path computeStorePathForText(const string & name, const string & s, const PathSet & references) { Hash hash = hashString(htSHA256, s); /* Stuff the references (if any) into the type. This is a bit hacky, but we can't put them in `s' since that would be ambiguous. */ string type = "text"; foreach (PathSet::const_iterator, i, references) { type += ":"; type += *i; } return makeStorePath(type, hash, name); } /* Return a string accepted by decodeValidPathInfo() that registers the specified paths as valid. Note: it's the responsibility of the caller to provide a closure. */ string StoreAPI::makeValidityRegistration(const PathSet & paths, bool showDerivers, bool showHash) { string s = ""; foreach (PathSet::iterator, i, paths) { s += *i + "\n"; ValidPathInfo info = queryPathInfo(*i); if (showHash) { s += printHash(info.hash) + "\n"; s += (format("%1%\n") % info.narSize).str(); } Path deriver = showDerivers ? info.deriver : ""; s += deriver + "\n"; s += (format("%1%\n") % info.references.size()).str(); foreach (PathSet::iterator, j, info.references) s += *j + "\n"; } return s; } string showPaths(const PathSet & paths) { string s; foreach (PathSet::const_iterator, i, paths) { if (s.size() != 0) s += ", "; s += "`" + *i + "'"; } return s; } Path readStorePath(Source & from) { Path path = readString(from); assertStorePath(path); return path; } template<class T> T readStorePaths(Source & from) { T paths = readStrings<T>(from); foreach (typename T::iterator, i, paths) assertStorePath(*i); return paths; } template PathSet readStorePaths(Source & from); } #include "local-store.hh" #include "serialise.hh" namespace nix { std::shared_ptr<StoreAPI> store; }