[Git][ghc/ghc][master] hadrian: Fix library-dirs, dynamic-library-dirs and static-library-dirs in inplace .conf files

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Sat Jan 28 08:00:16 UTC 2023



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
3330b819 by Matthew Pickering at 2023-01-28T02:59:54-05:00
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

- - - - -


1 changed file:

- hadrian/src/Hadrian/Haskell/Cabal/Parse.hs


Changes:

=====================================
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"],



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3330b819afa1235d870b9373bd5c39a772a20ff8

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3330b819afa1235d870b9373bd5c39a772a20ff8
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230128/2b7b0db2/attachment-0001.html>


More information about the ghc-commits mailing list