1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-27 12:41:00 +01:00

* We now actually do hash rewriting. Builders build temporary store

paths (e.g., `/nix/store/...random-hash...-aterm'), which are
  subsequently rewritten to actual content-addressable store paths
  (i.e., the hash part of the store path equals the hash of the
  contents).

  A complication is that the temporary output paths have to be passed
  to the builder (e.g., in $out).  Likewise, other environment
  variables and command-line arguments cannot contain fixed store
  paths because their names are no longer known in advance.
  
  Therefore, we now put placeholder store paths in environment
  variables and command-line arguments, which we *rewrite* to the
  actual paths prior to running the builder.

  TODO: maintain the mapping of derivation placeholder outputs
  ("output path equivalence classes") to actual output paths in the
  database.  Right now the first build succeeds and all its
  dependencies fail because they cannot find the output of the first.

  TODO: locking is no longer an issue with random temporary paths, but
  at the cost of having no blocking if we build the same thing twice
  in parallel.  Maybe the "random" path should actually be a hash of
  the placeholder and the name of the user who started the build.
This commit is contained in:
Eelco Dolstra 2005-05-25 16:04:28 +00:00
parent cfbd495049
commit f2802aa7ba
15 changed files with 456 additions and 317 deletions

View file

@ -96,6 +96,7 @@ static void opAdd(Strings opFlags, Strings opArgs)
}
#if 0
/* Preload the output of a fixed-output derivation into the Nix
store. */
static void opAddFixed(Strings opFlags, Strings opArgs)
@ -141,8 +142,10 @@ static void opPrintFixedPath(Strings opFlags, Strings opArgs)
cout << format("%1%\n") %
makeFixedOutputPath(recursive, hashAlgo, h, name);
}
#endif
#if 0
/* Place in `paths' the set of paths that are required to `realise'
the given store path, i.e., all paths necessary for valid
deployment of the path. For a derivation, this is the union of
@ -393,8 +396,10 @@ static void opQuery(Strings opFlags, Strings opArgs)
abort();
}
}
#endif
#if 0
static void opRegisterSubstitutes(Strings opFlags, Strings opArgs)
{
if (!opFlags.empty()) throw UsageError("unknown flag");
@ -441,6 +446,7 @@ static void opClearSubstitutes(Strings opFlags, Strings opArgs)
clearSubstitutes();
}
#endif
static void opRegisterValidity(Strings opFlags, Strings opArgs)
@ -602,6 +608,7 @@ void run(Strings args)
op = opRealise;
else if (arg == "--add" || arg == "-A")
op = opAdd;
#if 0
else if (arg == "--add-fixed")
op = opAddFixed;
else if (arg == "--print-fixed-path")
@ -612,6 +619,7 @@ void run(Strings args)
op = opRegisterSubstitutes;
else if (arg == "--clear-substitutes")
op = opClearSubstitutes;
#endif
else if (arg == "--register-validity")
op = opRegisterValidity;
else if (arg == "--check-validity")