-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
log all ifd #3494
base: master
Are you sure you want to change the base?
log all ifd #3494
Conversation
src/libexpr/primops.cc
Outdated
@@ -56,6 +56,9 @@ void EvalState::realiseContext(const PathSet & context) | |||
throw InvalidPathError(store->printStorePath(ctx)); | |||
if (!decoded.second.empty() && ctx.isDerivation()) { | |||
drvs.push_back(StorePathWithOutputs{ctx.clone(), {decoded.second}}); | |||
if (evalSettings.logAllIFD) { | |||
printInfo(format("%1% depends on %2% via %3%") % pos % decoded.first % reason); |
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.
maybe something a bit more explicit, mentioning "importing from derivation"?
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.
Also in the help text please.
One last nit, and looks great to me |
d43b06d
to
2c36d22
Compare
What's the use case for this? Why does it need a separate option rather than a |
debug sounds like a fine option, the main thing is being able to easily see the origin of the IFD |
if it was done via having a dedicated option eliminates the need to know the magic string to search for i can also see value in just turning this option on globally, so you have more feedback about why something just started a build when it was doing an eval |
I just discovered this. this would be very useful to us making sure we have all build-time and eval-time deps, when trying to export caches for clients. Definitely do want! |
Debugging this stuff seems useful, but I wonder if we could have a flag that gives a machine readable output? A common reason to want to know about all of these .drv files is so that you can keep a cache, not just of the dependencies of your final drv, but also of the dependencies of the imported drv. For this, I would propose having an option to nix-instantiate like this:
This way you could pipe it to something like cachix with:
and have all dependencies cached. If this sounds like a good idea, I'd be happy to take a stab at implementing it. /cc @domenkozar |
Hell yes, that would really help with syncing to binary caches! |
@edolstra what's needed to get this done? It seems like a machine readable option is a bonus unrelated to just getting the logging. Do you think this could be merged as-is and @matthewbauer could put his new functionality in a follow-up? |
@grahamc, what do you think needs to be done (besides a rebase)? |
Tumbleweed? |
da9b4f5
to
5cbb618
Compare
I marked this as stale due to inactivity. → More info |
not stale, i do intend to finish this at some point |
a81c0fa
to
de58e97
Compare
This works -- for example, in recent
|
de58e97
to
9a6b441
Compare
9a6b441
to
be43082
Compare
I've fixed/updated this PR/patch to work on Nix 2.9+ if anyone is interested |
Triaged in the Nix team meeting 2023-03-17: The team was concerned it be too verbose, but since it's hidden behind a flag, should be OK. The idea is approved and we will shepherd the implementation to completion. @cleverca22 are you still interested in finishing the PR? |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-03-17-nix-team-meeting-minutes-41/26614/1 |
I am going to mark this draft because it is old with conflicts, and also because I suspect the rebase in #8094 will get there first. |
This will probably break it, but we can cherry-pick to rebase. Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
No description provided.