1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-04 23:51:47 +02:00

* Substitutes now should produce a path with the same id as they are

substituting for (obvious, really).

* For greater efficiency, nix-pull/unnar will place the output in a
  path that is probably the same as what is actually needed, thus
  preventing a path copy.

* Even if a output id is given in a Fix package expression, ensure
  that the resulting Nix derive expression has a different id.  This
  is because Nix expressions that are semantically equivalent (i.e.,
  build the same result) might be different w.r.t. efficiency or
  divergence.  It is absolutely vital for the substitute mechanism
  that such expressions are not used interchangeably.
This commit is contained in:
Eelco Dolstra 2003-07-22 15:15:15 +00:00
parent df648c4967
commit e877c69d78
8 changed files with 86 additions and 50 deletions

View file

@ -24,7 +24,7 @@ static FSId storeSuccessor(const FSId & id1, ATerm sc)
typedef set<FSId> FSIdSet;
Slice normaliseFState(FSId id)
Slice normaliseFState(FSId id, FSIdSet pending)
{
debug(format("normalising fstate %1%") % (string) id);
Nest nest(true);
@ -57,8 +57,8 @@ Slice normaliseFState(FSId id)
for (FSIds::iterator i = fs.derive.inputs.begin();
i != fs.derive.inputs.end(); i++) {
Slice slice = normaliseFState(*i);
realiseSlice(slice);
Slice slice = normaliseFState(*i, pending);
realiseSlice(slice, pending);
for (SliceElems::iterator j = slice.elems.begin();
j != slice.elems.end(); j++)
@ -93,7 +93,7 @@ Slice normaliseFState(FSId id)
i != outPaths.end(); i++)
{
try {
expandId(i->second, i->first);
expandId(i->second, i->first, "/", pending);
} catch (Error & e) {
debug(format("fast build failed: %1%") % e.what());
fastBuild = false;
@ -175,7 +175,7 @@ Slice normaliseFState(FSId id)
}
void realiseSlice(const Slice & slice)
void realiseSlice(const Slice & slice, FSIdSet pending)
{
debug(format("realising slice"));
Nest nest(true);
@ -209,7 +209,7 @@ void realiseSlice(const Slice & slice)
{
SliceElem elem = *i;
debug(format("expanding %1% in %2%") % (string) elem.id % elem.path);
expandId(elem.id, elem.path);
expandId(elem.id, elem.path, "/", pending);
}
}