1 This patch is based on https://github.com/sternenseemann/cabal/compare/982646d67b95b32813b89ab5d2d2f4d4dc03fb2b..7c49047f253e1f128e2df356400ec5da6f11066b
2 and has been postprocessed with `filterdiff --strip=1 --addoldprefix=a/libraries/Cabal/ --addnewprefix=b/libraries/Cabal/`.
3 Note that the base for the diff is not the Cabal 3.6.3.0 release tag, but
4 982646d67b95b32813b89ab5d2d2f4d4dc03fb2b which is obtained by applying
5 https://github.com/haskell/cabal/commit/6c796218c92f93c95e94d5ec2d077f6956f68e98
6 on top of said release tag. That patch is applied to all our GHCs in the 9.2 series.
8 Reasoning and explanation of the patch can be found in the comment in the diff for PathsModule.hs below.
10 diffCabal/src/Distribution/Simple/Build/PathsModule.hs b/Cabal/src/Distribution/Simple/Build/PathsModule.hs
11 index b2be7e1a8..9b63e9850 100644
12 --- a/libraries/Cabal/Cabal/src/Distribution/Simple/Build/PathsModule.hs
13 +++ b/libraries/Cabal/Cabal/src/Distribution/Simple/Build/PathsModule.hs
14 @@ -46,6 +46,7 @@ generatePathsModule pkg_descr lbi clbi = Z.render Z.Z
15 , Z.zIsWindows = isWindows
16 , Z.zIsI386 = buildArch == I386
17 , Z.zIsX8664 = buildArch == X86_64
20 , Z.zManglePkgName = showPkgName
22 @@ -56,8 +57,112 @@ generatePathsModule pkg_descr lbi clbi = Z.render Z.Z
23 , Z.zDatadir = zDatadir
24 , Z.zLibexecdir = zLibexecdir
25 , Z.zSysconfdir = zSysconfdir
27 + -- Sadly we can't be cleverer about this – we can't have literals in the template
28 + , Z.zShouldEmitDataDir = shouldEmit "DataDir"
29 + , Z.zShouldEmitLibDir = shouldEmit "LibDir"
30 + , Z.zShouldEmitDynLibDir = shouldEmit "DynLibDir"
31 + , Z.zShouldEmitLibexecDir = shouldEmit "LibexecDir"
32 + , Z.zShouldEmitSysconfDir = shouldEmit "SysconfDir"
34 + , Z.zWarning = zWarning
35 + , Z.zShouldEmitWarning = zShouldEmitWarning
38 + -- GHC's NCG backend for aarch64-darwin does not support link-time dead code
39 + -- elimination to the extent that NCG does for other targets. Consequently,
40 + -- we struggle with unnecessarily retained store path references due to the
41 + -- use of `Paths_*` modules – even if `getLibDir` is not used, it'll end up
42 + -- in the final library or executables we build.
44 + -- When using a different output for the executables and library, this
45 + -- becomes more sinister: The library will contain a reference to the bin
46 + -- output and itself due to `getLibDir` and `getBinDir`, but the executables
47 + -- will do so, too. Either due to linking dynamically or because the library
48 + -- is linked statically into the executable and retains those references.
49 + -- Since Nix disallows cyclical references between two outputs, it becomes
50 + -- impossible to use the `Paths_*` module and a separate `bin` output for
53 + -- The solution we have resorted to for now, is to trim the `Paths_*` module
54 + -- dynamically depending on what references *could* be used without causing
55 + -- a cyclical reference. That has the effect that any code that would not
56 + -- cause a cyclical reference with dead code elimination will compile and
57 + -- work for aarch64-darwin. If the code would use a `get*Dir` function that
58 + -- has been omitted, this would indicate that the code would have caused a
59 + -- cyclical reference anyways.
61 + -- The logic for this makes some pretty big assumptions about installation
62 + -- prefixes that probably only hold fully in nixpkgs with
63 + -- `haskellPackages.mkDerivation`. Simple uses outside nixpkgs that have
64 + -- everything below the same prefix should continue to work as expected,
67 + -- We assume the following:
69 + -- - flat_prefix is `$out`.
70 + -- - flat_libdir etc. are always below `$out`.
72 + -- Since in the normal case due to static linking `$bin` and `$out` will
73 + -- have the same references in libraries/executables, we need to either
74 + -- prevent usage of `getBinDir` or `getLibDir` to break the cycle in case
75 + -- `flat_bindir` is not below `$out`. We have decided to always allow usage
76 + -- of `getBinDir`, so `getLibDir` gets dropped if a separate `bin` output is
77 + -- used. This has the simple reason that `$out` which contains `flat_libdir`
78 + -- tends to be quite big – we would like to have a `bin` output that doesn't
79 + -- require keeping that around.
80 + pathEmittable :: FilePath -> Bool
82 + -- If the executable installation target is below `$out` the reference
83 + -- cycle is within a single output (since libs are installed to `$out`)
84 + -- and thus unproblematic. We can use any and all `get*Dir` functions.
85 + | flat_prefix `isPrefixOf` flat_bindir = True
86 + -- Otherwise, we need to disallow all `get*Dir` functions that would cause
87 + -- a reference to `$out` which contains the libraries that would in turn
88 + -- reference `$bin`. This always include `flat_libdir` and friends, but
89 + -- can also include `flat_datadir` if no separate output for data files is
91 + | otherwise = not (flat_prefix `isPrefixOf` p)
93 + -- This list maps the "name" of the directory to whether we want to include
94 + -- it in the `Paths_*` module or not. `shouldEmit` performs a lookup in this.
95 + dirs :: [(String, Bool)]
98 + (\(name, path) -> (name, pathEmittable path))
99 + [ ("LibDir", flat_libdir)
100 + , ("DynLibDir", flat_dynlibdir)
101 + , ("DataDir", flat_datadir)
102 + , ("LibexecDir", flat_libexecdir)
103 + , ("SysconfDir", flat_sysconfdir)
106 + shouldEmit :: String -> Bool
108 + case lookup name dirs of
110 + Nothing -> error "panic! BUG in Cabal Paths_ patch for aarch64-darwin, report this at https://github.com/nixos/nixpkgs/issues"
112 + -- This is a comma separated list of all functions that have been omitted.
113 + -- This is included in a GHC warning which will be attached to the `Paths_*`
114 + -- module in case we are dropping any `get*Dir` functions that would
117 + -- TODO: getDataFileName is not accounted for at the moment.
118 + omittedFunctions :: String
121 + $ map (("get" ++) . fst)
122 + $ filter (not . snd) dirs
127 + "The following functions have been omitted by a nixpkgs-specific patch to Cabal: "
128 + ++ omittedFunctions
129 + zShouldEmitWarning :: Bool
130 + zShouldEmitWarning = any (not . snd) dirs
132 supports_cpp = supports_language_pragma
133 supports_rebindable_syntax = ghc_newer_than (mkVersion [7,0,1])
134 supports_language_pragma = ghc_newer_than (mkVersion [6,6,1])
135 diffCabal/src/Distribution/Simple/Build/PathsModule/Z.hs b/Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs
136 index 6488ea061..a6cdc8e31 100644
137 --- a/libraries/Cabal/Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs
138 +++ b/libraries/Cabal/Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs
139 @@ -18,6 +18,14 @@ data Z
140 zDatadir :: FilePath,
141 zLibexecdir :: FilePath,
142 zSysconfdir :: FilePath,
143 + zShouldEmitLibDir :: Bool,
144 + zShouldEmitDynLibDir :: Bool,
145 + zShouldEmitLibexecDir :: Bool,
146 + zShouldEmitDataDir :: Bool,
147 + zShouldEmitSysconfDir :: Bool,
148 + zShouldEmitWarning :: Bool,
149 + zWarning :: String,
150 + zOr :: (Bool -> Bool -> Bool),
151 zNot :: (Bool -> Bool),
152 zManglePkgName :: (PackageName -> String)}
154 @@ -45,10 +53,51 @@ render z_root = execWriter $ do
155 tell "{-# OPTIONS_GHC -w #-}\n"
157 tell (zManglePkgName z_root (zPackageName z_root))
161 + if (zShouldEmitWarning z_root)
163 + tell "{-# WARNING "
164 + tell (zWarning z_root)
172 - tell " getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir,\n"
173 - tell " getDataFileName, getSysconfDir\n"
174 + tell " getBinDir,\n"
175 + if (zOr z_root (zNot z_root (zAbsolute z_root)) (zShouldEmitLibDir z_root))
177 + tell " getLibDir,\n"
181 + if (zOr z_root (zNot z_root (zAbsolute z_root)) (zShouldEmitDynLibDir z_root))
183 + tell " getDynLibDir,\n"
187 + if (zOr z_root (zNot z_root (zAbsolute z_root)) (zShouldEmitLibexecDir z_root))
189 + tell " getLibexecDir,\n"
193 + if (zOr z_root (zNot z_root (zAbsolute z_root)) (zShouldEmitDataDir z_root))
195 + tell " getDataFileName,\n"
196 + tell " getDataDir,\n"
200 + if (zOr z_root (zNot z_root (zAbsolute z_root)) (zShouldEmitSysconfDir z_root))
202 + tell " getSysconfDir\n"
208 if (zNot z_root (zAbsolute z_root))
209 @@ -97,12 +146,15 @@ render z_root = execWriter $ do
210 tell (zVersionDigits z_root)
213 - tell "getDataFileName :: FilePath -> IO FilePath\n"
214 - tell "getDataFileName name = do\n"
215 - tell " dir <- getDataDir\n"
216 - tell " return (dir `joinFileName` name)\n"
218 - tell "getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath\n"
219 + if (zOr z_root (zNot z_root (zAbsolute z_root)) (zShouldEmitDataDir z_root))
221 + tell "getDataFileName :: FilePath -> IO FilePath\n"
222 + tell "getDataFileName name = do\n"
223 + tell " dir <- getDataDir\n"
224 + tell " return (dir `joinFileName` name)\n"
230 z_var0_function_defs = do
231 @@ -130,6 +182,7 @@ render z_root = execWriter $ do
233 if (zRelocatable z_root)
237 tell "getPrefixDirReloc :: FilePath -> IO FilePath\n"
238 tell "getPrefixDirReloc dirRel = do\n"
239 @@ -139,31 +192,37 @@ render z_root = execWriter $ do
240 tell (zBindir z_root)
241 tell ") `joinFileName` dirRel)\n"
243 + tell "getBinDir :: IO FilePath\n"
244 tell "getBinDir = catchIO (getEnv \""
245 tell (zManglePkgName z_root (zPackageName z_root))
246 tell "_bindir\") (\\_ -> getPrefixDirReloc $ "
247 tell (zBindir z_root)
249 + tell "getLibDir :: IO FilePath\n"
250 tell "getLibDir = catchIO (getEnv \""
251 tell (zManglePkgName z_root (zPackageName z_root))
252 tell "_libdir\") (\\_ -> getPrefixDirReloc $ "
253 tell (zLibdir z_root)
255 + tell "getDynLibDir :: IO FilePath\n"
256 tell "getDynLibDir = catchIO (getEnv \""
257 tell (zManglePkgName z_root (zPackageName z_root))
258 tell "_dynlibdir\") (\\_ -> getPrefixDirReloc $ "
259 tell (zDynlibdir z_root)
261 + tell "getDataDir :: IO FilePath\n"
262 tell "getDataDir = catchIO (getEnv \""
263 tell (zManglePkgName z_root (zPackageName z_root))
264 tell "_datadir\") (\\_ -> getPrefixDirReloc $ "
265 tell (zDatadir z_root)
267 + tell "getLibexecDir :: IO FilePath\n"
268 tell "getLibexecDir = catchIO (getEnv \""
269 tell (zManglePkgName z_root (zPackageName z_root))
270 tell "_libexecdir\") (\\_ -> getPrefixDirReloc $ "
271 tell (zLibexecdir z_root)
273 + tell "getSysconfDir :: IO FilePath\n"
274 tell "getSysconfDir = catchIO (getEnv \""
275 tell (zManglePkgName z_root (zPackageName z_root))
276 tell "_sysconfdir\") (\\_ -> getPrefixDirReloc $ "
277 @@ -177,72 +236,119 @@ render z_root = execWriter $ do
278 if (zAbsolute z_root)
281 - tell "bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath\n"
282 + tell "bindir :: FilePath\n"
284 tell (zBindir z_root)
287 - tell (zLibdir z_root)
289 - tell "dynlibdir = "
290 - tell (zDynlibdir z_root)
291 + tell "getBinDir :: IO FilePath\n"
292 + tell "getBinDir = catchIO (getEnv \""
293 + tell (zManglePkgName z_root (zPackageName z_root))
294 + tell "_bindir\") (\\_ -> return bindir)\n"
297 - tell (zDatadir z_root)
298 + if (zShouldEmitLibDir z_root)
300 + tell "libdir :: FilePath\n"
302 + tell (zLibdir z_root)
304 + tell "getLibDir :: IO FilePath\n"
305 + tell "getLibDir = catchIO (getEnv \""
306 + tell (zManglePkgName z_root (zPackageName z_root))
307 + tell "_libdir\") (\\_ -> return libdir)\n"
312 - tell "libexecdir = "
313 - tell (zLibexecdir z_root)
314 + if (zShouldEmitDynLibDir z_root)
316 + tell "dynlibdir :: FilePath\n"
317 + tell "dynlibdir = "
318 + tell (zDynlibdir z_root)
320 + tell "getDynLibDir :: IO FilePath\n"
321 + tell "getDynLibDir = catchIO (getEnv \""
322 + tell (zManglePkgName z_root (zPackageName z_root))
323 + tell "_dynlibdir\") (\\_ -> return dynlibdir)\n"
328 - tell "sysconfdir = "
329 - tell (zSysconfdir z_root)
330 + if (zShouldEmitDataDir z_root)
332 + tell "datadir :: FilePath\n"
334 + tell (zDatadir z_root)
336 + tell "getDataDir :: IO FilePath\n"
337 + tell "getDataDir = catchIO (getEnv \""
338 + tell (zManglePkgName z_root (zPackageName z_root))
339 + tell "_datadir\") (\\_ -> return datadir)\n"
344 + if (zShouldEmitLibexecDir z_root)
346 + tell "libexecdir :: FilePath\n"
347 + tell "libexecdir = "
348 + tell (zLibexecdir z_root)
350 + tell "getLibexecDir :: IO FilePath\n"
351 + tell "getLibexecDir = catchIO (getEnv \""
352 + tell (zManglePkgName z_root (zPackageName z_root))
353 + tell "_libexecdir\") (\\_ -> return libexecdir)\n"
358 - tell "getBinDir = catchIO (getEnv \""
359 - tell (zManglePkgName z_root (zPackageName z_root))
360 - tell "_bindir\") (\\_ -> return bindir)\n"
361 - tell "getLibDir = catchIO (getEnv \""
362 - tell (zManglePkgName z_root (zPackageName z_root))
363 - tell "_libdir\") (\\_ -> return libdir)\n"
364 - tell "getDynLibDir = catchIO (getEnv \""
365 - tell (zManglePkgName z_root (zPackageName z_root))
366 - tell "_dynlibdir\") (\\_ -> return dynlibdir)\n"
367 - tell "getDataDir = catchIO (getEnv \""
368 - tell (zManglePkgName z_root (zPackageName z_root))
369 - tell "_datadir\") (\\_ -> return datadir)\n"
370 - tell "getLibexecDir = catchIO (getEnv \""
371 - tell (zManglePkgName z_root (zPackageName z_root))
372 - tell "_libexecdir\") (\\_ -> return libexecdir)\n"
373 - tell "getSysconfDir = catchIO (getEnv \""
374 - tell (zManglePkgName z_root (zPackageName z_root))
375 - tell "_sysconfdir\") (\\_ -> return sysconfdir)\n"
376 + if (zShouldEmitSysconfDir z_root)
378 + tell "sysconfdir :: FilePath\n"
379 + tell "sysconfdir = "
380 + tell (zSysconfdir z_root)
382 + tell "getSysconfDir :: IO FilePath\n"
383 + tell "getSysconfDir = catchIO (getEnv \""
384 + tell (zManglePkgName z_root (zPackageName z_root))
385 + tell "_sysconfdir\") (\\_ -> return sysconfdir)\n"
392 if (zIsWindows z_root)
396 tell "prefix :: FilePath\n"
398 tell (zPrefix z_root)
401 + tell "getBinDir :: IO FilePath\n"
402 tell "getBinDir = getPrefixDirRel $ "
403 tell (zBindir z_root)
405 + tell "getLibDir :: IO FilePath\n"
407 tell (zLibdir z_root)
409 + tell "getDynLibDir :: IO FilePath\n"
410 tell "getDynLibDir = "
411 tell (zDynlibdir z_root)
413 + tell "getDataDir :: IO FilePath\n"
414 tell "getDataDir = catchIO (getEnv \""
415 tell (zManglePkgName z_root (zPackageName z_root))
416 tell "_datadir\") (\\_ -> "
417 tell (zDatadir z_root)
419 + tell "getLibexecDir :: IO FilePath\n"
420 tell "getLibexecDir = "
421 tell (zLibexecdir z_root)
423 + tell "getSysconfDir :: IO FilePath\n"
424 tell "getSysconfDir = "
425 tell (zSysconfdir z_root)
427 diffcabal-dev-scripts/src/GenPathsModule.hs b/cabal-dev-scripts/src/GenPathsModule.hs
428 index e4b930635..9b978f284 100644
429 --- a/libraries/Cabal/cabal-dev-scripts/src/GenPathsModule.hs
430 +++ b/libraries/Cabal/cabal-dev-scripts/src/GenPathsModule.hs
431 @@ -41,6 +41,16 @@ $(capture "decls" [d|
432 , zLibexecdir :: FilePath
433 , zSysconfdir :: FilePath
435 + , zShouldEmitLibDir :: Bool
436 + , zShouldEmitDynLibDir :: Bool
437 + , zShouldEmitLibexecDir :: Bool
438 + , zShouldEmitDataDir :: Bool
439 + , zShouldEmitSysconfDir :: Bool
441 + , zShouldEmitWarning :: Bool
442 + , zWarning :: String
444 + , zOr :: Bool -> Bool -> Bool
445 , zNot :: Bool -> Bool
446 , zManglePkgName :: PackageName -> String
448 difftemplates/Paths_pkg.template.hs b/templates/Paths_pkg.template.hs
449 index 6bc6b7875..aa90a9382 100644
450 --- a/libraries/Cabal/templates/Paths_pkg.template.hs
451 +++ b/libraries/Cabal/templates/Paths_pkg.template.hs
454 {-# OPTIONS_GHC -fno-warn-missing-import-lists #-}
455 {-# OPTIONS_GHC -w #-}
456 -module Paths_{{ manglePkgName packageName }} (
457 +module Paths_{{ manglePkgName packageName }}
458 + {% if shouldEmitWarning %}{-# WARNING {{ warning }} #-}{% endif %}
461 - getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir,
462 - getDataFileName, getSysconfDir
464 +{# We only care about the absolute case for our emit logic, since only in this
465 + case references are incurred. We are not going to hit isWindows and relocatable
466 + has no absolute references to begin with.
468 +{% if or (not absolute) shouldEmitLibDir %}
471 +{% if or (not absolute) shouldEmitDynLibDir %}
474 +{% if or (not absolute) shouldEmitLibexecDir %}
477 +{% if or (not absolute) shouldEmitDataDir %}
481 +{% if or (not absolute) shouldEmitSysconfDir %}
486 {% if not absolute %}
487 @@ -51,12 +72,12 @@ catchIO = Exception.catch
489 version = Version {{ versionDigits }} []
491 +{% if or (not absolute) shouldEmitDataDir %}
492 getDataFileName :: FilePath -> IO FilePath
493 getDataFileName name = do
495 return (dir `joinFileName` name)
497 -getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath
500 {% defblock function_defs %}
501 minusFileName :: FilePath -> String -> FilePath
502 @@ -85,48 +106,93 @@ splitFileName p = (reverse (path2++drive), reverse fname)
506 +{# Relocatable can not incur any absolute references, so we can ignore it.
507 + Additionally, --enable-relocatable is virtually useless in Nix builds
510 getPrefixDirReloc :: FilePath -> IO FilePath
511 getPrefixDirReloc dirRel = do
512 exePath <- getExecutablePath
513 let (dir,_) = splitFileName exePath
514 return ((dir `minusFileName` {{ bindir }}) `joinFileName` dirRel)
516 +getBinDir :: IO FilePath
517 getBinDir = catchIO (getEnv "{{ manglePkgName packageName }}_bindir") (\_ -> getPrefixDirReloc $ {{ bindir }})
518 +getLibDir :: IO FilePath
519 getLibDir = catchIO (getEnv "{{ manglePkgName packageName }}_libdir") (\_ -> getPrefixDirReloc $ {{ libdir }})
520 +getDynLibDir :: IO FilePath
521 getDynLibDir = catchIO (getEnv "{{ manglePkgName packageName }}_dynlibdir") (\_ -> getPrefixDirReloc $ {{ dynlibdir }})
522 +getDataDir :: IO FilePath
523 getDataDir = catchIO (getEnv "{{ manglePkgName packageName }}_datadir") (\_ -> getPrefixDirReloc $ {{ datadir }})
524 +getLibexecDir :: IO FilePath
525 getLibexecDir = catchIO (getEnv "{{ manglePkgName packageName }}_libexecdir") (\_ -> getPrefixDirReloc $ {{ libexecdir }})
526 +getSysconfDir :: IO FilePath
527 getSysconfDir = catchIO (getEnv "{{ manglePkgName packageName }}_sysconfdir") (\_ -> getPrefixDirReloc $ {{ sysconfdir }})
529 {% useblock function_defs %}
533 -bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath
535 bindir = {{ bindir }}
536 -libdir = {{ libdir }}
537 -dynlibdir = {{ dynlibdir }}
538 -datadir = {{ datadir }}
539 -libexecdir = {{ libexecdir }}
540 -sysconfdir = {{ sysconfdir }}
542 +getBinDir :: IO FilePath
543 getBinDir = catchIO (getEnv "{{ manglePkgName packageName }}_bindir") (\_ -> return bindir)
545 +{% if shouldEmitLibDir %}
547 +libdir = {{ libdir }}
548 +getLibDir :: IO FilePath
549 getLibDir = catchIO (getEnv "{{ manglePkgName packageName }}_libdir") (\_ -> return libdir)
552 +{% if shouldEmitDynLibDir %}
553 +dynlibdir :: FilePath
554 +dynlibdir = {{ dynlibdir }}
555 +getDynLibDir :: IO FilePath
556 getDynLibDir = catchIO (getEnv "{{ manglePkgName packageName }}_dynlibdir") (\_ -> return dynlibdir)
559 +{% if shouldEmitDataDir %}
561 +datadir = {{ datadir }}
562 +getDataDir :: IO FilePath
563 getDataDir = catchIO (getEnv "{{ manglePkgName packageName }}_datadir") (\_ -> return datadir)
566 +{% if shouldEmitLibexecDir %}
567 +libexecdir :: FilePath
568 +libexecdir = {{ libexecdir }}
569 +getLibexecDir :: IO FilePath
570 getLibexecDir = catchIO (getEnv "{{ manglePkgName packageName }}_libexecdir") (\_ -> return libexecdir)
573 +{% if shouldEmitSysconfDir %}
574 +sysconfdir :: FilePath
575 +sysconfdir = {{ sysconfdir }}
576 +getSysconfDir :: IO FilePath
577 getSysconfDir = catchIO (getEnv "{{ manglePkgName packageName }}_sysconfdir") (\_ -> return sysconfdir)
582 +{# We are only trying to fix the problem for aarch64-darwin with this patch,
583 + so let's ignore Windows which we can reach via pkgsCross, for example.
587 prefix = {{ prefix }}
589 +getBinDir :: IO FilePath
590 getBinDir = getPrefixDirRel $ {{ bindir }}
591 +getLibDir :: IO FilePath
592 getLibDir = {{ libdir }}
593 +getDynLibDir :: IO FilePath
594 getDynLibDir = {{ dynlibdir }}
595 +getDataDir :: IO FilePath
596 getDataDir = catchIO (getEnv "{{ manglePkgName packageName }}_datadir") (\_ -> {{ datadir }})
597 +getLibexecDir :: IO FilePath
598 getLibexecDir = {{ libexecdir }}
599 +getSysconfDir :: IO FilePath
600 getSysconfDir = {{ sysconfdir }}
602 getPrefixDirRel :: FilePath -> IO FilePath