summaryrefslogtreecommitdiff
path: root/nix/libstore
diff options
context:
space:
mode:
Diffstat (limited to 'nix/libstore')
-rw-r--r--nix/libstore/globals.cc44
-rw-r--r--nix/libstore/globals.hh4
-rw-r--r--nix/libstore/misc.cc114
-rw-r--r--nix/libstore/misc.hh7
-rw-r--r--nix/libstore/store-api.cc31
-rw-r--r--nix/libstore/store-api.hh17
6 files changed, 0 insertions, 217 deletions
diff --git a/nix/libstore/globals.cc b/nix/libstore/globals.cc
index 4ab6c3a0f9..fcafac2df6 100644
--- a/nix/libstore/globals.cc
+++ b/nix/libstore/globals.cc
@@ -78,39 +78,6 @@ void Settings::processEnvironment()
}
-void Settings::loadConfFile()
-{
- Path settingsFile = (format("%1%/%2%") % nixConfDir % "nix.conf").str();
- if (!pathExists(settingsFile)) return;
- string contents = readFile(settingsFile);
-
- unsigned int pos = 0;
-
- while (pos < contents.size()) {
- string line;
- while (pos < contents.size() && contents[pos] != '\n')
- line += contents[pos++];
- pos++;
-
- string::size_type hash = line.find('#');
- if (hash != string::npos)
- line = string(line, 0, hash);
-
- vector<string> tokens = tokenizeString<vector<string> >(line);
- if (tokens.empty()) continue;
-
- if (tokens.size() < 2 || tokens[1] != "=")
- throw Error(format("illegal configuration line `%1%' in `%2%'") % line % settingsFile);
-
- string name = tokens[0];
-
- vector<string>::iterator i = tokens.begin();
- advance(i, 2);
- settings[name] = concatStringsSep(" ", Strings(i, tokens.end())); // FIXME: slow
- };
-}
-
-
void Settings::set(const string & name, const string & value)
{
settings[name] = value;
@@ -256,17 +223,6 @@ string Settings::pack()
}
-void Settings::unpack(const string & pack) {
- Strings lines = tokenizeString<Strings>(pack, "\n");
- foreach (Strings::iterator, i, lines) {
- string::size_type eq = i->find('=');
- if (eq == string::npos)
- throw Error("illegal option name/value");
- set(i->substr(0, eq), i->substr(eq + 1));
- }
-}
-
-
Settings::SettingsMap Settings::getOverrides()
{
return overrides;
diff --git a/nix/libstore/globals.hh b/nix/libstore/globals.hh
index 2439936959..1293625e1f 100644
--- a/nix/libstore/globals.hh
+++ b/nix/libstore/globals.hh
@@ -26,8 +26,6 @@ struct Settings {
void processEnvironment();
- void loadConfFile();
-
void set(const string & name, const string & value);
string get(const string & name, const string & def);
@@ -42,8 +40,6 @@ struct Settings {
string pack();
- void unpack(const string & pack);
-
SettingsMap getOverrides();
/* The directory where we store sources and derived files. */
diff --git a/nix/libstore/misc.cc b/nix/libstore/misc.cc
index 22363af126..97618089bd 100644
--- a/nix/libstore/misc.cc
+++ b/nix/libstore/misc.cc
@@ -67,120 +67,6 @@ Path findOutput(const Derivation & drv, string id)
}
-void queryMissing(StoreAPI & store, const PathSet & targets,
- PathSet & willBuild, PathSet & willSubstitute, PathSet & unknown,
- unsigned long long & downloadSize, unsigned long long & narSize)
-{
- downloadSize = narSize = 0;
-
- PathSet todo(targets.begin(), targets.end()), done;
-
- /* Getting substitute info has high latency when using the binary
- cache substituter. Thus it's essential to do substitute
- queries in parallel as much as possible. To accomplish this
- we do the following:
-
- - For all paths still to be processed (‘todo’), we add all
- paths for which we need info to the set ‘query’. For an
- unbuilt derivation this is the output paths; otherwise, it's
- the path itself.
-
- - We get info about all paths in ‘query’ in parallel.
-
- - We process the results and add new items to ‘todo’ if
- necessary. E.g. if a path is substitutable, then we need to
- get info on its references.
-
- - Repeat until ‘todo’ is empty.
- */
-
- while (!todo.empty()) {
-
- PathSet query, todoDrv, todoNonDrv;
-
- foreach (PathSet::iterator, i, todo) {
- if (done.find(*i) != done.end()) continue;
- done.insert(*i);
-
- DrvPathWithOutputs i2 = parseDrvPathWithOutputs(*i);
-
- if (isDerivation(i2.first)) {
- if (!store.isValidPath(i2.first)) {
- // FIXME: we could try to substitute p.
- unknown.insert(*i);
- continue;
- }
- Derivation drv = derivationFromPath(store, i2.first);
-
- PathSet invalid;
- foreach (DerivationOutputs::iterator, j, drv.outputs)
- if (wantOutput(j->first, i2.second)
- && !store.isValidPath(j->second.path))
- invalid.insert(j->second.path);
- if (invalid.empty()) continue;
-
- todoDrv.insert(*i);
- if (settings.useSubstitutes && substitutesAllowed(drv))
- query.insert(invalid.begin(), invalid.end());
- }
-
- else {
- if (store.isValidPath(*i)) continue;
- query.insert(*i);
- todoNonDrv.insert(*i);
- }
- }
-
- todo.clear();
-
- SubstitutablePathInfos infos;
- store.querySubstitutablePathInfos(query, infos);
-
- foreach (PathSet::iterator, i, todoDrv) {
- DrvPathWithOutputs i2 = parseDrvPathWithOutputs(*i);
-
- // FIXME: cache this
- Derivation drv = derivationFromPath(store, i2.first);
-
- PathSet outputs;
- bool mustBuild = false;
- if (settings.useSubstitutes && substitutesAllowed(drv)) {
- foreach (DerivationOutputs::iterator, j, drv.outputs) {
- if (!wantOutput(j->first, i2.second)) continue;
- if (!store.isValidPath(j->second.path)) {
- if (infos.find(j->second.path) == infos.end())
- mustBuild = true;
- else
- outputs.insert(j->second.path);
- }
- }
- } else
- mustBuild = true;
-
- if (mustBuild) {
- willBuild.insert(i2.first);
- todo.insert(drv.inputSrcs.begin(), drv.inputSrcs.end());
- foreach (DerivationInputs::iterator, j, drv.inputDrvs)
- todo.insert(makeDrvPathWithOutputs(j->first, j->second));
- } else
- todoNonDrv.insert(outputs.begin(), outputs.end());
- }
-
- foreach (PathSet::iterator, i, todoNonDrv) {
- done.insert(*i);
- SubstitutablePathInfos::iterator info = infos.find(*i);
- if (info != infos.end()) {
- willSubstitute.insert(*i);
- downloadSize += info->second.downloadSize;
- narSize += info->second.narSize;
- todo.insert(info->second.references.begin(), info->second.references.end());
- } else
- unknown.insert(*i);
- }
- }
-}
-
-
static void dfsVisit(StoreAPI & store, const PathSet & paths,
const Path & path, PathSet & visited, Paths & sorted,
PathSet & parents)
diff --git a/nix/libstore/misc.hh b/nix/libstore/misc.hh
index d3e31d51f7..edbf24047e 100644
--- a/nix/libstore/misc.hh
+++ b/nix/libstore/misc.hh
@@ -25,13 +25,6 @@ void computeFSClosure(StoreAPI & store, const Path & path,
given derivation. */
Path findOutput(const Derivation & drv, string id);
-/* Given a set of paths that are to be built, return the set of
- derivations that will be built, and the set of output paths that
- will be substituted. */
-void queryMissing(StoreAPI & store, const PathSet & targets,
- PathSet & willBuild, PathSet & willSubstitute, PathSet & unknown,
- unsigned long long & downloadSize, unsigned long long & narSize);
-
bool willBuildLocally(const Derivation & drv);
bool substitutesAllowed(const Derivation & drv);
diff --git a/nix/libstore/store-api.cc b/nix/libstore/store-api.cc
index 30af5f5fed..6742d2ed49 100644
--- a/nix/libstore/store-api.cc
+++ b/nix/libstore/store-api.cc
@@ -48,26 +48,6 @@ Path toStorePath(const Path & path)
}
-Path followLinksToStore(const Path & _path)
-{
- Path path = absPath(_path);
- while (!isInStore(path)) {
- if (!isLink(path)) break;
- string target = readLink(path);
- path = absPath(target, dirOf(path));
- }
- if (!isInStore(path))
- throw Error(format("path `%1%' is not in the Nix store") % path);
- return path;
-}
-
-
-Path followLinksToStorePath(const Path & path)
-{
- return toStorePath(followLinksToStore(path));
-}
-
-
string storePathToName(const Path & path)
{
assertStorePath(path);
@@ -200,17 +180,6 @@ Path makeFixedOutputPath(bool recursive,
}
-std::pair<Path, Hash> computeStorePathForPath(const Path & srcPath,
- bool recursive, HashType hashAlgo, PathFilter & filter)
-{
- HashType ht(hashAlgo);
- Hash h = recursive ? hashPath(ht, srcPath, filter).first : hashFile(ht, srcPath);
- string name = baseNameOf(srcPath);
- Path dstPath = makeFixedOutputPath(recursive, hashAlgo, h, name);
- return std::pair<Path, Hash>(dstPath, h);
-}
-
-
Path computeStorePathForText(const string & name, const string & s,
const PathSet & references)
{
diff --git a/nix/libstore/store-api.hh b/nix/libstore/store-api.hh
index fa78d595f2..e957cedebc 100644
--- a/nix/libstore/store-api.hh
+++ b/nix/libstore/store-api.hh
@@ -311,15 +311,6 @@ void checkStoreName(const string & name);
Path toStorePath(const Path & path);
-/* Follow symlinks until we end up with a path in the Nix store. */
-Path followLinksToStore(const Path & path);
-
-
-/* Same as followLinksToStore(), but apply toStorePath() to the
- result. */
-Path followLinksToStorePath(const Path & path);
-
-
/* Constructs a unique store path name. */
Path makeStorePath(const string & type,
const Hash & hash, const string & name);
@@ -331,14 +322,6 @@ Path makeFixedOutputPath(bool recursive,
HashType hashAlgo, Hash hash, string name);
-/* This is the preparatory part of addToStore() and addToStoreFixed();
- it computes the store path to which srcPath is to be copied.
- Returns the store path and the cryptographic hash of the
- contents of srcPath. */
-std::pair<Path, Hash> computeStorePathForPath(const Path & srcPath,
- bool recursive = true, HashType hashAlgo = htSHA256,
- PathFilter & filter = defaultPathFilter);
-
/* Preparatory part of addTextToStore().
!!! Computation of the path should take the references given to