-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
Handle internal libraries correctly #539
Comments
Not as obvious, but this bug leads to huge closure sizes (such as including all of GHC and its docs). Especially painful when using nix to build docker images. |
@m4dc4p You mean this affects packages which have only executables and internal libraries? Note that you can currently work around this by applying the function |
I'm still inclined to think that this is a Cabal bug as well, |
@maralorn That doesn't work when the executable also includes an internal library. (We were already using the |
I took a brief look at this and testing it locally it seems that both In this comment: #603 (comment) @sternenseemann, you suggested that there should be a way forward that makes better use of component info. What did you have in mind? |
Since 2.0, Cabal has a notion of internal libraries (which is any named library in the cabal file):
My intuition would be that we'd need to detect these and disable the internal library (i.e. setting
isLibrary = false;
in simple cases). An obvious example of this isjacinda
which has an executable and an internal library we should not install.It gets trickier if you have an internal library (e.g. for the test suite and executable) and a public library. We probably need to teach the
generic-builder.nix
in nixpkgs to distinguish between public and internal library instead of relying onisLibrary
(which should only describe whether we have a public library or not).What is a bit unclear to me is whether a public library can depend on an internal one and if we would need to install the internal one in such cases.
See also NixOS/nixpkgs#155924 (comment).
The text was updated successfully, but these errors were encountered: