I have a situation where I’m wanting to persist some information from my derivation that is not strictly an output, but is more than just what I can dump into stdout. This includes:
- Extra log-type info, for example recordings and images generated by test runs.
- The obj files from the build, so that I can have a later derivation “continue on” from where this one left off (eg, build additional targets in the same workspace).
Both of these cases don’t really fit great with the existing nix “output” scheme, for example:
- I’d like the log output to be lean in terms of its run dependencies, but any time a log file references a nix store path (like gcc for example), that obviously ends up in its closure, so that downloading logs becomes potentially huge.
- The obj files end up having to be compressed into a tarball to hide from Nix that there are circular references between these and the main output.
- Ideally these “extra” outputs would be up for garbage collection immediate after being created, but that doesn’t seem to be the case— they stick around as long as the main output does.
Am I asking the impossible here? Or is there a way to get this kind of auxiliary output content out of a Nix derivation build? Are there special log outputs? Or a way to disable/override some of the post-build checks that make doing this difficult?