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

Report error location in tree #9

Closed
blaggacao opened this issue Aug 5, 2024 · 2 comments · Fixed by #36
Closed

Report error location in tree #9

blaggacao opened this issue Aug 5, 2024 · 2 comments · Fixed by #36

Comments

@blaggacao
Copy link
Contributor

https://github.com/ekala-project/modules/blob/master/src%2Fdefault.nix#L55

We should find a way, potentially through an upstream patch, to show the error location (unsafely) within the current working tree, rather than (or: in addition to) within the nix store.

@nrdxp
Copy link
Contributor

nrdxp commented Aug 7, 2024

I have the beginnings a an error origin parser that actually shows you the location in the toml file, with line numbers. It's actually quite nice, but it'll have to be abstracted to be more generally useful:

missingName =

@nrdxp nrdxp linked a pull request Sep 3, 2024 that will close this issue
@nrdxp
Copy link
Contributor

nrdxp commented Sep 3, 2024

So now that eka is further along, I realize we want to avoid doing any sort of complex parsing in Nix code directly. Rust has excellent toml parsing and error reporting already, so for errors directly in the manifest, it'd be much better to report them as early as possible, before even entering a Nix evaluation context.

As for knowing our current location within the module system for debugging purposes, #36 is an excellent start. We really just need to ensure some consistency with eka's verbosity flag, so we might want to add a few different levels, like: info, debug, trace at a minimum?

In any case, all that's left to do there is clean up the implementation, it already reports location information quite nicely.

@nrdxp nrdxp closed this as completed in #36 Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants