nix icon indicating copy to clipboard operation
nix copied to clipboard

nix build --keep-going doesn't report what failed

Open viperML opened this issue 1 year ago • 3 comments

Describe the bug

When using --keep-going, nix reports build failures as they come. At the end, it only reports the number of packages that failed, but not their names. The names will be hidden in log history.

Steps To Reproduce

with import <nixpkgs> {}; let
  mkFailing = name:
    pkgs.runCommandLocal name {} ''
      exit 1
    '';
in
  linkFarmFromDrvs "farm" [
    (mkFailing "drv-a")
    (mkFailing "drv-b")
    (mkFailing "drv-c")
    (runCommandLocal "many-logs" {} ''
      for i in $(seq 1 10); do
        echo ":: doing stuff"
      done
      touch $out
    '')
  ]
$ nix build -f ./test.nix --keep-going -L
error: builder for '/nix/store/pyh081a8vvhcar6m2qip5q3i8gzqinm6-drv-a.drv' failed with exit code 1
error: builder for '/nix/store/6mbsj7b18ww8mr21ac8k5jnhd65lravh-drv-b.drv' failed with exit code 1
error: builder for '/nix/store/jyz83cbvqni6ck8j06rpd9zg1j0hfnb0-drv-c.drv' failed with exit code 1
many-logs> :: doing stuff
many-logs> :: doing stuff
many-logs> :: doing stuff
many-logs> :: doing stuff
many-logs> :: doing stuff
many-logs> :: doing stuff
many-logs> :: doing stuff
many-logs> :: doing stuff
many-logs> :: doing stuff
many-logs> :: doing stuff
error: 3 dependencies of derivation '/nix/store/jx7wa9qv6dkqb1kjwvmhwqpn4syd9q3j-farm.drv' failed to build

Expected behavior

This report is generated by nix-output-monitor, so I would expect something similar:

┃ ├─ ⚠ drv-a failed with exit code 1 after ⏱ 0s
┃ ├─ ⚠ drv-c failed with exit code 1 after ⏱ 0s
┃ ├─ ⚠ drv-b failed with exit code 1 after ⏱ 0s

Additional context

Priorities

Add :+1: to issues you find important.

viperML avatar Aug 21 '24 10:08 viperML

Shouldn't this do the job? https://github.com/NixOS/nix/pull/10734 (it's in 2.24)

Kranzes avatar Aug 25 '24 09:08 Kranzes

Could you try if that's the case?

viperML avatar Aug 25 '24 10:08 viperML

hmm, output looks the same, sorry maybe that's just for FODs.

Kranzes avatar Aug 25 '24 11:08 Kranzes