nix icon indicating copy to clipboard operation
nix copied to clipboard

Add `builtins.warn`

Open roberth opened this issue 1 year ago • 3 comments

Motivation

A variation of trace, but

  • with the correct log level
  • no ANSI codes in expressions
  • can be debugged without stopping for actual trace calls (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.

roberth avatar Apr 22 '24 23:04 roberth

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-warn that defaults to the NIX_ABORT_ON_WARN value

to extend the functionality of builtins.warn in the future.

lorenzleutgeb avatar Apr 23 '24 08:04 lorenzleutgeb

Trivial rebase for CI :crossed_fingers:

roberth avatar May 06 '24 16:05 roberth

Can you add a release note for this?

edolstra avatar May 06 '24 19:05 edolstra

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

nixos-discourse avatar Jun 06 '24 08:06 nixos-discourse