Skip to content

Make the “dumping large path” warning include information on what path is being large#4625

Closed
Ekleog wants to merge 1 commit intoNixOS:masterfrom
Ekleog:warn-improvement
Closed

Make the “dumping large path” warning include information on what path is being large#4625
Ekleog wants to merge 1 commit intoNixOS:masterfrom
Ekleog:warn-improvement

Conversation

@Ekleog
Copy link
Member

@Ekleog Ekleog commented Mar 9, 2021

Disclaimer: this is my first time seriously modifying nix's source code, so I'm far from sure I did everything right. However, I do think that the added debug information is an incremental improvement, and can then be refined as we go, eg. if it turns out some of the debug labels are not precise enough.

Example output with the change:

[nix-shell:~/prog/nix]$ outputs/out/bin/nix-instantiate -E '"${./.}"'
warning: dumping very large path (> 256 MiB); this may run out of memory
  while dumping from source 'path:/home/ekleog/prog/nix'

What do you think? :)

@Ekleog Ekleog force-pushed the warn-improvement branch from 6b7ec4f to aa3dc84 Compare March 9, 2021 23:06
@cole-h
Copy link
Member

cole-h commented Mar 9, 2021

See also #4608.

@Ekleog
Copy link
Member Author

Ekleog commented Mar 9, 2021

Thank you! I'm going to comment on this other PR, both ways look reasonable to me. About the failed test, I think it's due to a timeout that led to the test failing and thus a spurious failure, but not 100% sure about that

@roberth
Copy link
Member

roberth commented Mar 23, 2021

The occurrence of this message should have been greatly reduced by #4030. In which situation does the message still crop up? It'd be good to make that stream too.

That said, this PR does have merit of its own when it comes to StringSink. The warning should probably be removed from FdSink though, because that sink does not have a memory problem.
#4034 does describe another use case for logic like this, except it's a linter-like warning instead of "we're about to crash". That can probably be implemented instead as a pass-through sink or source that takes the original path as a constructor argument.

@stale
Copy link

stale bot commented Sep 19, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Sep 19, 2021
@Ekleog
Copy link
Member Author

Ekleog commented Jul 11, 2022

Seeing how this is merge-conflicting, I'm going to close this as rebasing would probably be just as hard as reimplementing.

@Ekleog Ekleog closed this Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants