Open
Description
We're starting to learn that precompiling individual modules can be costly and have other resource constraints after all. While mathlib may need a solution providing custom granularity of precompilation that is yet to be designed, this issue is about a much simpler solution that makes sense for medium-size projects like Aesop: precompile the entire package into a single dynlib and load that one in dependencies. Note though that the dynlib should contain only code from that specific package and link to other dynlibs for dependencies, otherwise we get into duplicate symbol trouble again.
Specifically, the logic implemented in Nix is:
precompilePackage
defaults toprecompileModules
- If a package does not request precompilation, but a dependency of it does,
precompilePackage
is automatically used. I.e.std4
would be precompiled as a package even ifmathlib4
requests a finer-grained setup for itself. precompilePackage
does not affect compilation within the package; but if any module of the package is loaded from another package, the whole package dynlib is loaded.