checkpointBuildTools: mkCheckpointedBuild -> mkCheckpointBuild

All other functions are in the form of `*{c,C}heckpointBuild*`, so we
deprecate the `mkCheckpointedBuild` function in favor of `mkCheckpointBuild`.

Also address some inconsistencies in the docs: some `buildOutput` should
actually be `incrementalBuildArtifacts`.
This commit is contained in:
Bryan Lai 2024-01-07 18:47:47 +08:00
parent 9ff61712cb
commit df62c3c87f
4 changed files with 11 additions and 7 deletions

View File

@ -18,7 +18,7 @@ changedVBox = pkgs.virtualbox.overrideAttrs (old: {
src = path/to/vbox/sources;
}
```
- use `mkCheckpointedBuild changedVBox buildOutput`
- use `mkCheckpointBuild changedVBox incrementalBuildArtifacts`
- enjoy shorter build times
## Example {#sec-checkpoint-build-example}

View File

@ -14,7 +14,7 @@ rec {
* changedVBox = pkgs.virtuabox.overrideAttrs (old: {
* src = path/to/vbox/sources;
* }
* - use `mkCheckpointedBuild changedVBox buildOutput`
* - use `mkCheckpointBuild changedVBox incrementalBuildArtifacts`
* - enjoy shorter build times
*/
prepareCheckpointBuild = drv: drv.overrideAttrs (old: {
@ -49,9 +49,9 @@ rec {
* Usage:
* let
* checkpointArtifacts = prepareCheckpointBuild drv
* in mkCheckpointedBuild drv checkpointArtifacts
* in mkCheckpointBuild drv checkpointArtifacts
*/
mkCheckpointedBuild = drv: previousBuildArtifacts: drv.overrideAttrs (old: {
mkCheckpointBuild = drv: previousBuildArtifacts: drv.overrideAttrs (old: {
# The actual checkpoint build phase.
# We compare the changed sources from a previous build with the current and create a patch
# Afterwards we clean the build directory to copy the previous output files (Including the sources)
@ -66,4 +66,8 @@ rec {
patch -p 1 -i sourceDifference.patch
'';
});
mkCheckpointedBuild = pkgs.lib.warn
"`mkCheckpointedBuild` is deprecated, use `mkCheckpointBuild` instead!"
mkCheckpointBuild;
}

View File

@ -10,7 +10,7 @@ let
patch -p1 < ${./hello.patch}
'';
});
checkpointBuiltHello = checkpointBuildTools.mkCheckpointedBuild patchedHello baseHelloArtifacts;
checkpointBuiltHello = checkpointBuildTools.mkCheckpointBuild patchedHello baseHelloArtifacts;
checkpointBuiltHelloWithCheck = checkpointBuiltHello.overrideAttrs (old: {
doCheck = true;
@ -41,7 +41,7 @@ let
'';
});
checkpointBuiltHelloWithRemovedFile = checkpointBuildTools.mkCheckpointedBuild patchedHelloRemoveFile baseHelloRemoveFileArtifacts;
checkpointBuiltHelloWithRemovedFile = checkpointBuildTools.mkCheckpointBuild patchedHelloRemoveFile baseHelloRemoveFileArtifacts;
in
stdenv.mkDerivation {
name = "patched-hello-returns-correct-output";

View File

@ -113,7 +113,7 @@ with pkgs;
install-shell-files = callPackage ./install-shell-files {};
checkpoint-build = callPackage ./checkpointBuild {};
checkpointBuildTools = callPackage ./checkpointBuild {};
kernel-config = callPackage ./kernel.nix {};