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
Check whether flag registry is compeletely used #2959
Conversation
src/nix/installables.cc
Outdated
{ | ||
for (auto info : evalState->registries[flake::FLAG_REGISTRY]->entries) { | ||
if (!info.second.used) | ||
warn("the flag flake override %s to %s is not used", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence doesn't quite parse. Maybe change to something like unused flag '--flake-override %s %s'
?
src/nix/command.hh
Outdated
@@ -70,6 +70,8 @@ struct EvalCommand : virtual StoreCommand, MixEvalArgs | |||
{ | |||
ref<EvalState> getEvalState(); | |||
|
|||
~EvalCommand(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with printing the warning from the destructor is that you only get the warning after building, which could be a long time. You don't want to have Nix build stuff for an hour to then find out that your flag was ignored. Maybe the check can be done after resolveFlake()
(e.g. in InstallableFlake
)?
This breaks 4 tests, e.g.
Not sure why. It probably has something to do with the changes in installables.cc |
3938546
to
f726607
Compare
f726607
to
ffea7f4
Compare
Fixes #2841
Also put the registries in the
EvalState
.