+1
-1
doc/build-helpers/special.md
+1
-1
doc/build-helpers/special.md
+28
doc/build-helpers/special/checkpoint-build.section.md
+28
doc/build-helpers/special/checkpoint-build.section.md
···+`pkgs.checkpointBuildTools` provides a way to build derivations incrementally. It consists of two functions to make checkpoint builds using nix possible.+For hermeticity, Nix derivations do not allow any state to carry over between builds, making a transparent incremental build within a derivation impossible.+However, we can tell Nix explicitly what the previous build state was, by representing that previous state as a derivation output. This allows the passed build state to be used for an incremental build.+* e.G `checkpointArtifacts = (pkgs.checkpointBuildTools.prepareCheckpointBuild pkgs.virtualbox);`+As Nix has no builtin support for the detection of the previous built derivation, a base version needs to be declared.+To create the outputs later used as base version for checkpoint builds, the function `pkgs.checkpointBuildTools.prepareCheckpointBuild` is used.+The function takes the original derivation as an argument and transforms the output to a base version for an checkpoint build build.+While doing so, the original output is not created and the installation phase is overwritten to produce the checkpoint artifacts.+When the built artifacts of the base version of the derivation are created, the code can be modified and changes are built using the `pkgs.checkpointBuildTools.mkCheckpointedBuild` function.+The `pkgs.checkpointBuildTools.mkCheckpointedBuild` function detects the changes in the code and places the output of the base version derivation within the build folder.+Then, the build tool is able to detect the changes and makes the decision of which parts of the derivation needs to be recompiled and produces the output, as expected in the derivation, without checkpoint build support.
-28
doc/build-helpers/special/incremental-build.section.md
-28
doc/build-helpers/special/incremental-build.section.md
···-`pkgs.buildIncremental` provides a way to build derivations incrementally. It consists of two functions to make incremental builds using nix possible.-For hermeticity, Nix derivations do not allow any state to carry over between builds, making a transparent incremental build within a derivation impossible.-However, we can tell Nix explicitly what the previous build state was, by representing that previous state as a derivation output. This allows the passed build state to be used for an incremental build.-* e.G `incrementalBuildArtifacts = (pkgs.buildIncremental.prepareIncrementalBuild pkgs.virtualbox);`-As Nix has no builtin support for the detection of the previous built derivation, a base version needs to be declared.-To create the outputs later used as base version for incremental builds, the function `pkgs.buildIncremental.prepareIncrementalBuild` is used.-The function takes the original derivation as an argument and transforms the output to a base version for an incremental build.-While doing so, the original output is not created and the installation phase is overwritten to produce the incremental build artifacts.-When the built artifacts of the base version of the derivation are created, the code can be modified and changes are built using the `pkgs.buildIncremental.mkIncrementalBuild` function.-The `pkgs.buildIncremental.mkIncrementalBuild` function detects the changes in the code and places the output of the base version derivation within the build folder.-Then, the build tool is able to detect the changes and makes the decision of which parts of the derivation needs to be recompiled and produces the output, as expected in the derivation, without incremental build support.
+14
-14
pkgs/build-support/build-incremental.nix
pkgs/build-support/checkpoint-build.nix
+14
-14
pkgs/build-support/build-incremental.nix
pkgs/build-support/checkpoint-build.nix
···-* e.G `incrementalBuildArtifacts = (pkgs.buildIncremental.prepareIncrementalBuild pkgs.virtualbox);`+* e.G `incrementalBuildArtifacts = (pkgs.checkpointBuildTools.prepareCheckpointBuild pkgs.virtualbox);`···# Afterwards we clean the build directory to copy the previous output files (Including the sources)
+1
-1
pkgs/test/default.nix
+1
-1
pkgs/test/default.nix
+8
-8
pkgs/test/incrementalBuild/default.nix
pkgs/test/checkpointBuild/default.nix
+8
-8
pkgs/test/incrementalBuild/default.nix
pkgs/test/checkpointBuild/default.nix
······-incrementalBuiltHello = incrementalBuildTools.mkIncrementalBuild patchedHello baseHelloArtifacts;+checkpointBuiltHello = checkpointBuildTools.mkCheckpointedBuild patchedHello baseHelloArtifacts;···-baseHelloRemoveFileArtifacts = incrementalBuildTools.prepareIncrementalBuild (hello.overrideAttrs (old: {+baseHelloRemoveFileArtifacts = checkpointBuildTools.prepareCheckpointBuild (hello.overrideAttrs (old: {···-incrementalBuiltHelloWithRemovedFile = incrementalBuildTools.mkIncrementalBuild patchedHelloRemoveFile baseHelloRemoveFileArtifacts;+checkpointBuiltHelloWithRemovedFile = checkpointBuildTools.mkCheckpointedBuild patchedHelloRemoveFile baseHelloRemoveFileArtifacts;···
pkgs/test/incrementalBuild/hello-additionalFile.patch
pkgs/test/checkpointBuild/hello-additionalFile.patch
pkgs/test/incrementalBuild/hello-additionalFile.patch
pkgs/test/checkpointBuild/hello-additionalFile.patch
pkgs/test/incrementalBuild/hello-removeFile.patch
pkgs/test/checkpointBuild/hello-removeFile.patch
pkgs/test/incrementalBuild/hello-removeFile.patch
pkgs/test/checkpointBuild/hello-removeFile.patch
pkgs/test/incrementalBuild/hello.patch
pkgs/test/checkpointBuild/hello.patch
pkgs/test/incrementalBuild/hello.patch
pkgs/test/checkpointBuild/hello.patch
+1
-1
pkgs/top-level/all-packages.nix
+1
-1
pkgs/top-level/all-packages.nix
···