-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Sourcing setup hook *default hook*
spam in writers/trivial builders
#328229
Comments
Sourcing setup hook
spam in writersSourcing setup hook *default hook*
spam in writers
Sourcing setup hook *default hook*
spam in writersSourcing setup hook *default hook*
spam in writers/trivial builders
This might be useful to have on some occasions but IMO it should only happen when a debug env var is set. |
Maybe we need a special |
Yeah, I really like the hook-logging PR, but it is too much spam at the moment. There are essentially two ways to go, as I see it.
Any others? |
This is actually partially a thing. The Nix log FD can take specific verbosity levels: I seem to recall this not showing up in Another idea is that we could change the implementation to summarize hooks there are a lot of, or especially default hooks. e.g., instead of
Maybe we could have:
And then those could be expanded to one-per-line with |
Couldn't we turn this into some sort of impure env var that trusted users would be allowed to pass into the sandbox?
We should probably fix that instead.
That's better but there's tonnes of these trivial builders/writers in a typical system closure. Even just one line each would amount to significant spam. |
Another idea that just occurred to me would be to only print this info in non-trivial builders because. Non-trivial builds usually have tons of other output and don't occur as frequently as trivial builders, making these few lines a non-issue. Perhaps even better though, we could only print the setup hooks when the set of setup hooks differs from the default. This way an empty output would imply that the default set of setup hooks were run. Can trivial builders (non-mkDerivation) even have non-default setup hooks? |
For what it’s worth, I suspect this problem is worse on Darwin. Like, look at the sheer number of |
Disabling hook logging for trivial builds sounds reasonable to me, though it does raise the question of why there are so many specific-use default hooks in the first place. The |
I think that's a topic for another issue. |
+1 from me on this, I always felt it weird having to change a derivation to get extra debug output. This basically makes debugging stdenv impossible (at least on darwin). |
For reference, this logging is pretty disruptive for HM CI runs, see e.g. https://github.com/nix-community/home-manager/actions/runs/10135333457. |
I propose we only enable this when |
-1 on completely disabling these logs without I also don’t find them spammy. Yes, they offset the package build logs by a few hundred lines at worst (depending on the number of dependencies), but for any non-trivial package I agree that it makes sense to suppress these logs for trivial builders where the set of dependencies is usually predefined. |
I feel like this is controversial enough that it makes sense to partially roll back – leaving the |
No matter what, any change to either revert or mutate will go through a staging cycle because it causes a mass rebuild. |
I also suspect this to slow down remote builds because of the amount of bandwith being used by those logs 😓 |
I've made a super speculative attempt at fixing this issue in #331383. Please take a look. |
This sounds weird to me. I'm expecting the frontend Nix handling the filtration, that's why we need |
That would be an example for a "better solution". I'm all for such a better solution but a lot of time will pass until it's usable, time in which every user is spammed with 100s of useless log lines, burying actual issues and causing confusion.
That represents the previous status quo and my proposal is indeed to regress to that previous status quo. I don't really see what's "weird" about that. |
Folks interested in this topic: I could use reviews on #331560. The next |
When #331560 lands in master (it's part of the current staging-next PR) there will be no more hook logging unless you opt in to $NIX_DEBUG at 4 or greater. I'm closing this issue as a result. |
Issue description
Thousands of lines of sourcing the default hooks during system upgrades
#310387
CC
@Qyriad @philiptaron
The text was updated successfully, but these errors were encountered: