* Fix the build hook mechanism; pass the pointer graph to the hook.
This commit is contained in:
parent
52bf9b86bb
commit
581fc47783
3 changed files with 27 additions and 5 deletions
|
@ -769,15 +769,20 @@ DerivationGoal::HookReply DerivationGoal::tryBuildHook()
|
||||||
|
|
||||||
/* Write the information that the hook needs to perform the
|
/* Write the information that the hook needs to perform the
|
||||||
build, i.e., the set of input paths, the set of output
|
build, i.e., the set of input paths, the set of output
|
||||||
paths, and [!!!]. */
|
paths, and the references (pointer graph) in the input
|
||||||
|
paths. */
|
||||||
|
|
||||||
Path inputListFN = tmpDir + "/inputs";
|
Path inputListFN = tmpDir + "/inputs";
|
||||||
Path outputListFN = tmpDir + "/outputs";
|
Path outputListFN = tmpDir + "/outputs";
|
||||||
|
Path referencesFN = tmpDir + "/references";
|
||||||
|
|
||||||
string s;
|
string s;
|
||||||
for (PathSet::iterator i = inputPaths.begin();
|
for (PathSet::iterator i = inputPaths.begin();
|
||||||
i != inputPaths.end(); ++i)
|
i != inputPaths.end(); ++i)
|
||||||
s += *i + "\n";
|
s += *i + "\n";
|
||||||
|
for (DerivationInputs::iterator i = drv.inputDrvs.begin();
|
||||||
|
i != drv.inputDrvs.end(); ++i)
|
||||||
|
s += i->first + "\n";
|
||||||
writeStringToFile(inputListFN, s);
|
writeStringToFile(inputListFN, s);
|
||||||
|
|
||||||
s = "";
|
s = "";
|
||||||
|
@ -786,6 +791,23 @@ DerivationGoal::HookReply DerivationGoal::tryBuildHook()
|
||||||
s += i->second.path + "\n";
|
s += i->second.path + "\n";
|
||||||
writeStringToFile(outputListFN, s);
|
writeStringToFile(outputListFN, s);
|
||||||
|
|
||||||
|
s = "";
|
||||||
|
for (PathSet::iterator i = inputPaths.begin();
|
||||||
|
i != inputPaths.end(); ++i)
|
||||||
|
{
|
||||||
|
s += *i;
|
||||||
|
PathSet references;
|
||||||
|
queryReferences(*i, references);
|
||||||
|
for (PathSet::iterator j = references.begin();
|
||||||
|
j != references.end(); ++j)
|
||||||
|
{
|
||||||
|
s += " ";
|
||||||
|
s += *j;
|
||||||
|
}
|
||||||
|
s += "\n";
|
||||||
|
}
|
||||||
|
writeStringToFile(referencesFN, s);
|
||||||
|
|
||||||
/* Tell the hook to proceed. */
|
/* Tell the hook to proceed. */
|
||||||
writeLine(toHook.writeSide, "okay");
|
writeLine(toHook.writeSide, "okay");
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
set -x
|
#set -x
|
||||||
|
|
||||||
drv=$4
|
drv=$4
|
||||||
|
|
||||||
echo "HOOK for $drv" >&2
|
echo "HOOK for $drv" >&2
|
||||||
|
|
||||||
outPath=$(sed 's/Derive(\[\"\([^\"]*\)\".*/\1/' $drv)
|
outPath=$(sed 's/Derive(\[("out",\"\([^\"]*\)\".*/\1/' $drv)
|
||||||
|
|
||||||
echo "output path is $outPath" >&2
|
echo "output path is $outPath" >&2
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ storeExpr=$($TOP/src/nix-instantiate/nix-instantiate build-hook.nix)
|
||||||
|
|
||||||
echo "store expr is $storeExpr"
|
echo "store expr is $storeExpr"
|
||||||
|
|
||||||
outPath=$($TOP/src/nix-store/nix-store -qnfvvvvv "$storeExpr")
|
outPath=$($TOP/src/nix-store/nix-store -quf "$storeExpr")
|
||||||
|
|
||||||
echo "output path is $outPath"
|
echo "output path is $outPath"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue