Skip to content

Show addErrorContext traces by default #7553

@roberth

Description

@roberth

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

Module system stack traces are too long. The low information density makes users believe that they won't learn anything from reading through it, but essential information is in the stack trace, thanks to builtins.addErrorContext.

Describe the solution you'd like

addErrorContext traces are sufficiently valuable and terse that the should always be shown.

Optionally, add --no-trace, to disable that, but I don't think we even want that.

Describe alternatives you've considered

See the following and its alternatives

Additional context

Example

This would have been a 700 line stack trace with --show-trace (or --full-trace if you're confused by the other issue).

error: infinite recursion encountered

       … while evaluating definitions from `/home/user/h/nixpkgs/pkgs/top-level/all-packages.nix':

       … while evaluating the option `services.postgresql.enable':

       … while evaluating definitions from `/home/user/h/nixpkgs/pkgs/top-level/all-packages.nix':

       … while evaluating the option `services.rabbitmq.enable':

       … while evaluating definitions from `/home/user/h/nixpkgs/nixos/modules/services/amqp/rabbitmq.nix':

       … while evaluating the option `services.epmd.enable':

       … while evaluating definitions from `/home/user/h/nixpkgs/nixos/modules/services/networking/epmd.nix':

       … while evaluating the option `assertions':

See the full example in #7552

Priorities

Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    error-messagesConfusing messages and better diagnosticsfeatureFeature request or proposalidea approvedThe given proposal has been discussed and approved by the Nix team. An implementation is welcome.languageThe Nix expression language; parser, interpreter, primops, evaluation, etc

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions