From 5010678492eddb9f6d076082bd912d726abf5e82 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Wed, 13 Mar 2024 19:38:07 +0800 Subject: [PATCH 1/2] checkpointBuildTools.prepareCheckpointBuild: stop at install Switch off phases following installPhase, including fixupPhase, installCheckPhase, distPhase and postPhases. --- pkgs/build-support/checkpoint-build.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/build-support/checkpoint-build.nix b/pkgs/build-support/checkpoint-build.nix index c9bee45005a1..f1202ca1ce0a 100644 --- a/pkgs/build-support/checkpoint-build.nix +++ b/pkgs/build-support/checkpoint-build.nix @@ -53,7 +53,12 @@ rec { mkdir -p $out/outputs cp -r ./* $out/outputs/ runHook postCheckpointInstall + unset postPhases ''; + + dontFixup = true; + doInstallCheck = false; + doDist = false; }); /* Build a derivation based on the checkpoint output generated by From 05491696c54969386968d43771db19ffb36f689a Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Wed, 13 Mar 2024 23:16:06 +0800 Subject: [PATCH 2/2] hello: add postInstallCheck Set doInstallCheck = true. Test the existence of main program in postInstallCheck. --- pkgs/by-name/he/hello/package.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/by-name/he/hello/package.nix b/pkgs/by-name/he/hello/package.nix index f1b056faf640..68fdcf7e408c 100644 --- a/pkgs/by-name/he/hello/package.nix +++ b/pkgs/by-name/he/hello/package.nix @@ -18,6 +18,13 @@ stdenv.mkDerivation (finalAttrs: { doCheck = true; + doInstallCheck = true; + + # Give hello some install checks for testing purpose. + postInstallCheck = '' + stat "''${!outputBin}/bin/${finalAttrs.meta.mainProgram}" + ''; + passthru.tests = { version = testers.testVersion { package = hello; };