Skip to content

Commit

Permalink
Add field to to remember libs needed for fully static linking
Browse files Browse the repository at this point in the history
* WIP: Still need to update ghc to use the new `libraryDirsStatic` and
       `extraLibrariesStatic` fields in `InstalledPackageInfo` for linking.
* WIP: Adding -L paths to .a libs in .conf files will likely increase nix
       closure size for dynamically linked Haskell packages because if pkg-config
       finds an `-a` file, the path to it will be remembered.
       (That only has an impact if the .a file is in a split-output from the .so file.)
       Perhaps we make the feature that `pkg-config --static` is called
       opt-outable.
       On the other hand Haskell libs always carry their .a files, so pulling
       a few system `.a` files more shouldn't make much of a difference.
       So this opt-out should probably be an extra feature for later, if at all.
  • Loading branch information
nh2 authored and alexbiehl committed Aug 14, 2021
1 parent 261f14f commit bf32602
Show file tree
Hide file tree
Showing 58 changed files with 399 additions and 36 deletions.
6 changes: 6 additions & 0 deletions Cabal-tests/tests/ParserTests/regressions/Octree-0.5.expr
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ GenericPackageDescription
extraFrameworkDirs = [],
extraGHCiLibs = [],
extraLibDirs = [],
extraLibDirsStatic = [],
extraLibFlavours = [],
extraLibs = [],
extraLibsStatic = [],
frameworks = [],
hsSourceDirs = [],
hsc2hsOptions = [],
Expand Down Expand Up @@ -140,8 +142,10 @@ GenericPackageDescription
extraFrameworkDirs = [],
extraGHCiLibs = [],
extraLibDirs = [],
extraLibDirsStatic = [],
extraLibFlavours = [],
extraLibs = [],
extraLibsStatic = [],
frameworks = [],
hsSourceDirs = [],
hsc2hsOptions = [],
Expand Down Expand Up @@ -245,8 +249,10 @@ GenericPackageDescription
extraFrameworkDirs = [],
extraGHCiLibs = [],
extraLibDirs = [],
extraLibDirsStatic = [],
extraLibFlavours = [],
extraLibs = [],
extraLibsStatic = [],
frameworks = [],
hsSourceDirs = [],
hsc2hsOptions = [],
Expand Down
16 changes: 16 additions & 0 deletions Cabal-tests/tests/ParserTests/regressions/common-conditional.expr
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ GenericPackageDescription
extraFrameworkDirs = [],
extraGHCiLibs = [],
extraLibDirs = [],
extraLibDirsStatic = [],
extraLibFlavours = [],
extraLibs = [],
extraLibsStatic = [],
frameworks = [],
hsSourceDirs = [],
hsc2hsOptions = [],
Expand Down Expand Up @@ -131,8 +133,10 @@ GenericPackageDescription
extraFrameworkDirs = [],
extraGHCiLibs = [],
extraLibDirs = [],
extraLibDirsStatic = [],
extraLibFlavours = [],
extraLibs = [],
extraLibsStatic = [],
frameworks = [],
hsSourceDirs = [],
hsc2hsOptions = [],
Expand Down Expand Up @@ -214,8 +218,10 @@ GenericPackageDescription
extraFrameworkDirs = [],
extraGHCiLibs = [],
extraLibDirs = [],
extraLibDirsStatic = [],
extraLibFlavours = [],
extraLibs = [],
extraLibsStatic = [],
frameworks = [],
hsSourceDirs = [],
hsc2hsOptions = [],
Expand Down Expand Up @@ -281,8 +287,10 @@ GenericPackageDescription
extraFrameworkDirs = [],
extraGHCiLibs = [],
extraLibDirs = [],
extraLibDirsStatic = [],
extraLibFlavours = [],
extraLibs = [],
extraLibsStatic = [],
frameworks = [],
hsSourceDirs = [],
hsc2hsOptions = [],
Expand Down Expand Up @@ -358,8 +366,10 @@ GenericPackageDescription
extraFrameworkDirs = [],
extraGHCiLibs = [],
extraLibDirs = [],
extraLibDirsStatic = [],
extraLibFlavours = [],
extraLibs = [],
extraLibsStatic = [],
frameworks = [],
hsSourceDirs = [],
hsc2hsOptions = [],
Expand Down Expand Up @@ -437,8 +447,10 @@ GenericPackageDescription
extraFrameworkDirs = [],
extraGHCiLibs = [],
extraLibDirs = [],
extraLibDirsStatic = [],
extraLibFlavours = [],
extraLibs = [],
extraLibsStatic = [],
frameworks = [],
hsSourceDirs = [],
hsc2hsOptions = [],
Expand Down Expand Up @@ -524,8 +536,10 @@ GenericPackageDescription
extraFrameworkDirs = [],
extraGHCiLibs = [],
extraLibDirs = [],
extraLibDirsStatic = [],
extraLibFlavours = [],
extraLibs = [],
extraLibsStatic = [],
frameworks = [],
hsSourceDirs = [],
hsc2hsOptions = [],
Expand Down Expand Up @@ -608,8 +622,10 @@ GenericPackageDescription
extraFrameworkDirs = [],
extraGHCiLibs = [],
extraLibDirs = [],
extraLibDirsStatic = [],
extraLibFlavours = [],
extraLibs = [],
extraLibsStatic = [],
frameworks = [],
hsSourceDirs = [],
hsc2hsOptions = [],
Expand Down
4 changes: 4 additions & 0 deletions Cabal-tests/tests/ParserTests/regressions/common.expr
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ GenericPackageDescription
extraFrameworkDirs = [],
extraGHCiLibs = [],
extraLibDirs = [],
extraLibDirsStatic = [],
extraLibFlavours = [],
extraLibs = [],
extraLibsStatic = [],
frameworks = [],
hsSourceDirs = [],
hsc2hsOptions = [],
Expand Down Expand Up @@ -100,8 +102,10 @@ GenericPackageDescription
extraFrameworkDirs = [],
extraGHCiLibs = [],
extraLibDirs = [],
extraLibDirsStatic = [],
extraLibFlavours = [],
extraLibs = [],
extraLibsStatic = [],
frameworks = [],
hsSourceDirs = [],
hsc2hsOptions = [],
Expand Down
Loading

0 comments on commit bf32602

Please sign in to comment.