aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/fod-failing.nix
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2024-05-13 20:58:54 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2024-05-15 15:35:18 +0200
commite1463931833670970fbcebd9bece326ac7146205 (patch)
treeca32bd8009d50101d7731866de07a520f5d182e9 /tests/functional/fod-failing.nix
parentf6dc40cd1c3cdb38d104fb18ca76b9acf374190a (diff)
nix3-build: show all FOD errors with `--keep-going`
Basically I'd expect the same behavior as with `nix-build`, i.e. with `--keep-going` the hash-mismatch error of each failing fixed-output derivation is shown. The approach is derived from `Store::buildPaths` (`entry-point.cc`): instead of throwing the first build-result, check if there are any build errors and if so, display all of them and throw after that. Unfortunately, the BuildResult struct doesn't have an `ErrorInfo` (there's a FIXME for that at least), so I have to construct my own here. This is a rather cheap bugfix and I decided against touching too many parts of libstore for that (also I don't know if that's in line with the ongoing refactoring work). Closes https://git.lix.systems/lix-project/lix/issues/302 Change-Id: I378ab984fa271e6808c6897c45e0f070eb4c6fac
Diffstat (limited to 'tests/functional/fod-failing.nix')
-rw-r--r--tests/functional/fod-failing.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/functional/fod-failing.nix b/tests/functional/fod-failing.nix
new file mode 100644
index 000000000..37c04fe12
--- /dev/null
+++ b/tests/functional/fod-failing.nix
@@ -0,0 +1,39 @@
+with import ./config.nix;
+rec {
+ x1 = mkDerivation {
+ name = "x1";
+ builder = builtins.toFile "builder.sh"
+ ''
+ echo $name > $out
+ '';
+ outputHashMode = "recursive";
+ outputHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
+ };
+ x2 = mkDerivation {
+ name = "x2";
+ builder = builtins.toFile "builder.sh"
+ ''
+ echo $name > $out
+ '';
+ outputHashMode = "recursive";
+ outputHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
+ };
+ x3 = mkDerivation {
+ name = "x3";
+ builder = builtins.toFile "builder.sh"
+ ''
+ echo $name > $out
+ '';
+ outputHashMode = "recursive";
+ outputHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
+ };
+ x4 = mkDerivation {
+ name = "x4";
+ inherit x2 x3;
+ builder = builtins.toFile "builder.sh"
+ ''
+ echo $x2 $x3
+ exit 1
+ '';
+ };
+}