Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a warning infrastructure #10281

Open
thufschmitt opened this issue Mar 21, 2024 · 1 comment
Open

Add a warning infrastructure #10281

thufschmitt opened this issue Mar 21, 2024 · 1 comment
Labels
error-messages Confusing messages and better diagnostics feature Feature request or proposal language The Nix expression language; parser, interpreter, primops, evaluation, etc

Comments

@thufschmitt
Copy link
Member

thufschmitt commented Mar 21, 2024

Is your feature request related to a problem? Please describe.

We have a bunch of behaviours (mostly in the evaluator, but probably not only) that we'd like to get rid of, but can't because of backwards-compatibility.

A good middle-ground solution is to keep them, but add a warning to prevent people from accidentally relying on them.
We currently never do that because doing so would require adding a way to opt-out easily, and

  1. We don't really want to do it in a, ad-hoc fashion
  2. We don't have infrastructure to do it in a principled fashion.

Describe the solution you'd like

Some infrastructure (similar to the experimental-features one?) allowing to declare warnings and expose a way to easily toggle them (or turn into hard errors) from the CLI or the configuration files.

Describe alternatives you've considered

Additional context

Random sampling of things that we might want to get warning for:

Priorities

Add 👍 to issues you find important.

@thufschmitt thufschmitt added the feature Feature request or proposal label Mar 21, 2024
@roberth roberth added error-messages Confusing messages and better diagnostics language The Nix expression language; parser, interpreter, primops, evaluation, etc labels Mar 22, 2024
@piegamesde
Copy link
Member

On the Lix side, I just copied the experimental features code 1:1 into "deprecated features": https://git.lix.systems/lix-project/lix/src/branch/main/src/libutil/deprecated-features.cc

It's not perfect by any means but it's a design as good as any other, so Nix may as well copy it and keep configuration compatibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error-messages Confusing messages and better diagnostics feature Feature request or proposal language The Nix expression language; parser, interpreter, primops, evaluation, etc
Projects
None yet
Development

No branches or pull requests

3 participants