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

Make a nix issue to improve the error: attribute 'myAttribute' missing output #50

Open
llakala opened this issue Sep 29, 2024 · 1 comment
Labels
bug An implementation isn't working as indended externals Something in a separate project, like nixpkgs

Comments

@llakala
Copy link
Owner

llakala commented Sep 29, 2024

Currently, it shows an output like this:

while evaluating definitions from `/nix/store/60kla6jvfigdkad148k73v162s693y1v-source/base/features/virtualization.nix':

       … while evaluating the module argument `hostVars' in "/nix/store/60kla6jvfigdkad148k73v162s693y1v-source/base/features/virtualization.nix":

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: attribute 'hostVars' missing
       at /nix/store/2vmkhm30kdnics1bnj9zgblh9yr4cpyw-source/lib/modules.nix:508:28:
          507|         builtins.addErrorContext (context name)
          508|           (args.${name} or config._module.args.${name})
             |                            ^
          509|       ) (lib.functionArgs f);

You'll see that the actual error message isn't that useful. What's really useful is the stack trace above it. Nix traditionally tries to pack important info into the actual error message, so it'd be nice to reference the actual file within the error message.

@llakala llakala added bug An implementation isn't working as indended externals Something in a separate project, like nixpkgs labels Sep 29, 2024
@llakala llakala changed the title Make a nix issue to improve the error: attribute 'myAttribute' missing` error Make a nix issue to improve the error: attribute 'myAttribute' missing output Sep 29, 2024
@llakala
Copy link
Owner Author

llakala commented Sep 30, 2024

also should make a PR to improve the head and tail documentation, and go back to the existing nix issue now that we found the relevant code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An implementation isn't working as indended externals Something in a separate project, like nixpkgs
Projects
None yet
Development

No branches or pull requests

1 participant