-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't write a json, but write nix files
we write 3 files to the nix closure: -> default.nix: just imports the other two and can be imported to get the exact reproducable output we want to have -> nix-support/recording.nix: recordings of all impurities i. e. function calls and imported files -> nix-support/expressions.nix: the expression that will be executed for the expression, a primop __findAlongAttrPath that does the supplies the autobindings along the attrpath. for the playback, a new primop prim_playback has been introduced. It's first parameter is a description of all impurities (as written to expression.nix). After this function is invoked, all subsequent calls can use the functions introduced here. In general, we allow multiple prim_playback when they don't conflict (not in all cases conflicts are found yet) It would also be cool to make the prim_playback more local, e. g. it should only apply to a specific term, but it's unclear to me how this can be achieved in a lazy language.
- Loading branch information
Showing
5 changed files
with
258 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
result: | ||
{ recording, expressions}: | ||
with import ./config.nix; | ||
derivation { | ||
name = "source-closure"; | ||
builder = shell; | ||
args = ["-e" (__toFile "name" '' | ||
#!/bin/bash | ||
${coreutils}/mkdir -p $out/nix-support | ||
${coreutils}/cp ${__toFile "result" result} $out/nix-support/source | ||
${coreutils}/cp ${__toFile "deterministic-recording" recording} $out/nix-support/recording.nix | ||
${coreutils}/cp ${__toFile "expressions" expressions} $out/nix-support/expressions.nix | ||
echo "__playback { sources = { \"$out\" = ./.; }; functions = []; }" > $out/default.nix | ||
echo "(__playback (import ./nix-support/recording.nix) (import ./nix-support/expressions.nix))" >> $out/default.nix | ||
'')]; | ||
system = builtins.currentSystem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.