diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2023-01-26 18:18:50 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-01-28 02:59:54 -0500 |
commit | 3330b819afa1235d870b9373bd5c39a772a20ff8 (patch) | |
tree | 3ebba616730be2c3c49e795a2bd7ca209fb3d838 /hadrian/src | |
parent | 50b1e2e8141fb1a3d1d3c1563935d08e90dca11a (diff) | |
download | haskell-3330b819afa1235d870b9373bd5c39a772a20ff8.tar.gz |
hadrian: Fix library-dirs, dynamic-library-dirs and static-library-dirs in inplace .conf files
Previously we were just throwing away the contents of the library-dirs
fields but really we have to do the same thing as for include-dirs,
relativise the paths into the current working directory and maintain any
extra libraries the user has specified.
Now the relevant section of the rts.conf file looks like:
```
library-dirs:
${pkgroot}/../rts/build
${pkgroot}/../../..//_build/stage1/rts/build
/nix/store/av4c0fib4rkmb6sa1074z0rb1ciria5b-gperftools-2.10/lib
/nix/store/2infxahfp9lj084xn3q9ib5ajks8447i-libffi-3.4.4/lib
library-dirs-static:
${pkgroot}/../rts/build
${pkgroot}/../../..//_build/stage1/rts/build
/nix/store/av4c0fib4rkmb6sa1074z0rb1ciria5b-gperftools-2.10/lib
/nix/store/2infxahfp9lj084xn3q9ib5ajks8447i-libffi-3.4.4/lib
dynamic-library-dirs:
${pkgroot}/../rts/build
${pkgroot}/../../..//_build/stage1/rts/build
/nix/store/av4c0fib4rkmb6sa1074z0rb1ciria5b-gperftools-2.10/lib
/nix/store/2infxahfp9lj084xn3q9ib5ajks8447i-libffi-3.4.4/lib
```
Fixes #22209
Diffstat (limited to 'hadrian/src')
-rw-r--r-- | hadrian/src/Hadrian/Haskell/Cabal/Parse.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs index f7bdf2cab9..2ab73b76c0 100644 --- a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs +++ b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs @@ -319,8 +319,11 @@ write_inplace_conf pkg_path res_path pd lbi = do pkg_name = C.display (C.pkgName (CP.sourcePackageId installedPkgInfo)) final_ipi = installedPkgInfo { Installed.includeDirs = concatMap fixupIncludeDir (Installed.includeDirs installedPkgInfo), - Installed.libraryDirs = [ build_dir ], - Installed.libraryDynDirs = [ build_dir ], + Installed.libraryDirs = build_dir: (concatMap fixupIncludeDir (Installed.libraryDirs installedPkgInfo)) , +#if MIN_VERSION_Cabal(3,8,0) + Installed.libraryDirsStatic = build_dir: (concatMap fixupIncludeDir (Installed.libraryDirsStatic installedPkgInfo)) , +#endif + Installed.libraryDynDirs = build_dir : (concatMap fixupIncludeDir (Installed.libraryDynDirs installedPkgInfo)) , Installed.dataDir = "${pkgroot}/../../../../" ++ pkg_path, Installed.haddockHTMLs = [build_dir ++ "/doc/html/" ++ C.display (CP.sourcePackageId installedPkgInfo)], Installed.haddockInterfaces = [build_dir ++ "/doc/html/" ++ pkg_name ++ "/" ++ pkg_name ++ ".haddock"], |