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

Be more helpful when a flake eval is missing some files #4993

Closed
wants to merge 2 commits into from

Conversation

thufschmitt
Copy link
Member

@thufschmitt thufschmitt commented Jul 7, 2021

When building a local git flake, if a file a missing at eval-time but
present in the source directory, tell the user that he probably forgot
to check it out

Fix #4507

The current approach is far from complete as is only works for nix build, but having a more generic thing is actually quite complex or hacky, and I’d like to have some feedback on my plan before implementing it.

My idea is to

  • Add a void enhanceMessage(void(void)) method to Installable that’s semantically just calling its argument, but can also add some informations to the error message if one is thrown.
    (In practice, this will be a no-op, except for InstallableFlake when the flake input is a local git repo − or probably mercurial too)
  • Override run() in InstallableCommand to run installable.enhanceMessage(run(store))

I think this would work, but it isn’t utterly pretty, so if you have any concern or better idea, feel free to chime in.

Depends on #3121
We depends on above ticket because a ticket provides needed information without guessing it.

@thufschmitt thufschmitt marked this pull request as draft July 15, 2021 09:13
When evaluating a local git flake, if a file a missing at eval-time but
present in the source directory, tell the user that he probably forgot
to check it out

Fix #4507
@thufschmitt thufschmitt force-pushed the be-gentle-on-missing-files-for-eval branch from e09ed67 to 6631872 Compare November 16, 2021 12:50
@thufschmitt thufschmitt marked this pull request as ready for review November 25, 2021 20:28
@thufschmitt
Copy link
Member Author

Superseded by #3121

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 this pull request may close these issues.

Be smart and helpful when some files are missing during the evaluation
1 participant