Skip to content

Highlight current flake source paths in stack trace #14441

@roberth

Description

@roberth

Is your feature request related to a problem?

Stack traces can be long, and involve many library frames, like those from callPackage or evalModules.

While these are occassionally somewhat useful, more often the mistake is in the current flake's source.

Proposed solution

Make it quick to visually identify trace frames that originate from the current project, e.g. the current flake's source, or subpaths of the cwd.

I think we have options for how to do this, but I'd try to make this a libcmd responsibility.
The trace printing can still live in libutil, but we could give it an isCurrentSource callback (assuming we preserve that info in a structured way...).
Alternatively, we could make the formatting of the path an EvalState responsibility, and put the isCurrentSource callback there.
libcmd can then configure the EvalState according to what kind of installable(s) are passed.

Alternative solutions

Additional context

Checklist


Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    error-messagesConfusing messages and better diagnosticsfeatureFeature request or proposallanguageThe Nix expression language; parser, interpreter, primops, evaluation, etc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions