As an alternative to abort in NixOS/nixpkgs#22096, it would be perfectly acceptable to have nix-build print a list of warnings at the end of the evaluation.
I image that a log primop could be used to build this functionality, which would behave the same as builtins.trace; it will generate some (non-observable) side effect and then continue with evaluating the second argument.
builtins.log { showToUser = true; severity = "warning"; message = "Your nixpkgs is deprecated";} restOfExpression
$ nix-build ...
<some build output>
Warning: your nixpkgs is deprecated
<more build output>
There were some warnings during building:
- Warning: your nixpkgs is deprecated
/nix/store/asdf-pkg-1.0/
builtins.log { showToUser = true; severity = "critical"; message = "Your nixpkgs is unsupported";} restOfExpression
$ nix-build ...
<some build output>
CRITICAL: your nixpkgs is unsupported
<more build output>
There were some CRITICAL errors during building:
- CRITICAL: your nixpkgs is unsupported
/nix/store/asdf-pkg-1.0/
As an alternative to
abortin NixOS/nixpkgs#22096, it would be perfectly acceptable to have nix-build print a list of warnings at the end of the evaluation.I image that a
logprimop could be used to build this functionality, which would behave the same asbuiltins.trace; it will generate some (non-observable) side effect and then continue with evaluating the second argument.