summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nix/libstore/build.cc4
-rw-r--r--tests/store.scm13
2 files changed, 17 insertions, 0 deletions
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index f4a866c68f..06bc7601b9 100644
--- a/nix/libstore/build.cc
+++ b/nix/libstore/build.cc
@@ -2502,6 +2502,10 @@ void DerivationGoal::registerOutputs()
                     throw Error(format("derivation `%1%' may not be deterministic: output `%2%' differs")
                         % drvPath % path);
             }
+
+            if (settings.printBuildTrace)
+                printMsg(lvlError, format("@ build-succeeded %1% -") % drvPath);
+
             continue;
         }
 
diff --git a/tests/store.scm b/tests/store.scm
index e28c0c5aaa..df66feaebb 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -917,6 +917,19 @@
                                 (build-mode check))
                   #f))))))))
 
+(test-assert "build-succeeded trace in check mode"
+  (string-contains
+   (call-with-output-string
+     (lambda (port)
+       (let ((d (build-expression->derivation
+                 %store "foo" '(mkdir (assoc-ref %outputs "out"))
+                 #:guile-for-build
+                 (package-derivation %store %bootstrap-guile))))
+         (build-derivations %store (list d))
+         (parameterize ((current-build-output-port port))
+           (build-derivations %store (list d) (build-mode check))))))
+   "@ build-succeeded"))
+
 (test-assert "build multiple times"
   (with-store store
     ;; Ask to build twice.