Port builtins.warn from CppNix #579

Open
opened 2024-11-19 22:23:23 +00:00 by jade · 7 comments
Owner

builtins.warn is a simple builtin that makes evaluation time warnings with the ability to turn them into errors. It's implemented in CppNix and has no meaningful compatibility hazards, so we should port it!

Here's the PR: https://github.com/NixOS/nix/pull/10592

`builtins.warn` is a simple builtin that makes evaluation time warnings with the ability to turn them into errors. It's implemented in CppNix and has no meaningful compatibility hazards, so we should port it! Here's the PR: https://github.com/NixOS/nix/pull/10592
jade added the
E/easy
E/help wanted
labels 2024-11-19 22:23:23 +00:00
Member

I am going to try to port this. Looks like a good way to get to know the codebase a little better.

I am going to try to port this. Looks like a good way to get to know the codebase a little better.
Member

The introduction of NIX_ABORT_ON_WARN in the PR seems a bit arbitrary given that it isn't done for any of the other settings. 🤔

Edit: never mind, it makes sense after reading https://github.com/NixOS/nixpkgs/pull/306026 and we should add it, too.

~~The introduction of `NIX_ABORT_ON_WARN` in the PR seems a bit arbitrary given that it isn't done for any of the other settings. 🤔~~ Edit: never mind, it makes sense after reading https://github.com/NixOS/nixpkgs/pull/306026 and we should add it, too.
Member

A small refactoring first: https://gerrit.lix.systems/c/lix/+/2245

A small refactoring first: https://gerrit.lix.systems/c/lix/+/2245
Owner

we've already started a bunch of refactoring of this unholy mess, see eg cl/2225

we've already started a bunch of refactoring of this unholy mess, see eg cl/2225
Member

we've already started a bunch of refactoring of this unholy mess, see eg cl/2225

hm… better to wait for you to be done then, I suppose.

> we've already started a bunch of refactoring of this unholy mess, see eg cl/2225 hm… better to wait for you to be done then, I suppose.
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/2248 ("libexpr: add builtins.warn")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/2248", "number": 2248, "kind": "commit message"}], "cl_meta": {"2248": {"change_title": "libexpr: add builtins.warn"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/2248](https://gerrit.lix.systems/c/lix/+/2248) ("libexpr: add builtins.warn")
Member

I abandoned the previous small refactoring, so 2248 is now the full feature.

I abandoned the previous small refactoring, so 2248 is now the full feature.
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#579
No description provided.