Thoery: Generate Derivations from Makefile

So I’m not saying this would actually be useful ( maybe it is ) but based on the description of a derivation as “a single build step”, could someone split a build into individual cc -c FILE definitions as well as linker invocations?

Despite being incredibly slow, I think if attributes expressed compilation flags you could limit nix build runs to only recompile changed targets.

While individual files are likely too fine grained to be practical, I do think there could be a value in subdivided packages for things like VBox ( maybe on the scale of individual binaries ).

The idea of using tools like bear or libtool to scrape builds to generate these has crossed my mind.

Yes, recursive Nix can do something like that, though it is still highly experimental afaik: GitHub - edolstra/nix-ccache: A flake to remotely build and/or cache C/C++ compilation, using recursive Nix

1 Like