Add `builtins.warn`
Motivation
A variation of trace, but
- with the correct log level
- no ANSI codes in expressions
- can be debugged without stopping for actual
tracecalls (ie intentional "info level" or trace logging). - logs warnings without
trace:in front of it - follows the Nix color scheme.
Context
I'd planned to add this a long time ago but forgot to eventually follow up on it.
This Nixpkgs PR reminded me to complete it, and I would like to avoid an unnecessary deprecation.
It proposes to rename the environment variable, which would make the current lib.warn not an (anachronistic) polyfill of the Nix feature anymore. That'd be unfortunate.
- https://github.com/NixOS/nixpkgs/pull/306026
Priorities and Process
Add :+1: to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.
Let me just note here @roberth according to https://github.com/NixOS/nixpkgs/pull/306026#issuecomment-2070774079 seems to be in support of also
add[ing] a Nix config option
abort-on-warnthat defaults to theNIX_ABORT_ON_WARNvalue
to extend the functionality of builtins.warn in the future.
Trivial rebase for CI :crossed_fingers:
Can you add a release note for this?
This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/2024-06-03-nix-team-meeting-minutes-149/46582/1