From e0b5885003f1658c76947461c51818b7021fd227 Mon Sep 17 00:00:00 2001 From: Christiaan Baaij Date: Fri, 14 Oct 2016 16:16:53 +0200 Subject: [PATCH 1/2] Add `--hidir` and `--commonlibdir` These two flags indicate where the two distinct aspects of a Haskell library end up. --commonlibdir: The subdirectory of --libdir where the object library files (.so/.a/.dll/.dylib) get installed. --hidir: The directory where the interface files (.hi) get installed. The reason we want to do this is because we want dynamic libraries to all end up in a shared directory to reduce start-up times of the run-time linker. However, we still want the .hi to end up in one directory per package. We cannot repurpose --libsubdir to take over the role of what --commonlibdir is doing because then we would run into trouble with Setup.hs files build against an older Cabal. If we were to repurpose --libsubdir, then all the object and interface files would end up in a single shared directory for all packages when using an older Cabal. --- .../Distribution/Simple/Build/PathsModule.hs | 16 ++++-- Cabal/Distribution/Simple/Configure.hs | 3 +- Cabal/Distribution/Simple/GHC.hs | 5 +- Cabal/Distribution/Simple/Install.hs | 3 +- Cabal/Distribution/Simple/InstallDirs.hs | 52 ++++++++++++++---- Cabal/Distribution/Simple/Register.hs | 5 +- Cabal/Distribution/Simple/Setup.hs | 18 +++++-- Cabal/doc/developing-packages.markdown | 1 + Cabal/doc/installing-packages.markdown | 54 ++++++++++++++----- .../Distribution/Client/ProjectPlanning.hs | 4 +- cabal-install/Distribution/Client/Setup.hs | 17 ++++-- .../Distribution/Client/ProjectConfig.hs | 2 +- 12 files changed, 140 insertions(+), 40 deletions(-) diff --git a/Cabal/Distribution/Simple/Build/PathsModule.hs b/Cabal/Distribution/Simple/Build/PathsModule.hs index c70f34ad1a9..5da4338ab07 100644 --- a/Cabal/Distribution/Simple/Build/PathsModule.hs +++ b/Cabal/Distribution/Simple/Build/PathsModule.hs @@ -71,7 +71,7 @@ generate pkg_descr lbi = pragmas++ "module " ++ display paths_modulename ++ " (\n"++ " version,\n"++ - " getBinDir, getLibDir, getDataDir, getLibexecDir,\n"++ + " getBinDir, getLibDir, getHiDir, getDataDir, getLibexecDir,\n"++ " getDataFileName, getSysconfDir\n"++ " ) where\n"++ "\n"++ @@ -108,9 +108,10 @@ generate pkg_descr lbi = "\n\nbindirrel :: FilePath\n" ++ "bindirrel = " ++ show flat_bindirreloc ++ "\n"++ - "\ngetBinDir, getLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath\n"++ + "\ngetBinDir, getLibDir, getHiDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath\n"++ "getBinDir = "++mkGetEnvOrReloc "bindir" flat_bindirreloc++"\n"++ "getLibDir = "++mkGetEnvOrReloc "libdir" flat_libdirreloc++"\n"++ + "getHiDir = "++mkGetEnvOrReloc "hidir" flat_hidirreloc++"\n"++ "getDataDir = "++mkGetEnvOrReloc "datadir" flat_datadirreloc++"\n"++ "getLibexecDir = "++mkGetEnvOrReloc "libexecdir" flat_libexecdirreloc++"\n"++ "getSysconfDir = "++mkGetEnvOrReloc "sysconfdir" flat_sysconfdirreloc++"\n"++ @@ -124,16 +125,18 @@ generate pkg_descr lbi = "\n"++ filename_stuff | absolute = - "\nbindir, libdir, datadir, libexecdir, sysconfdir :: FilePath\n"++ + "\nbindir, libdir, hidir, datadir, libexecdir, sysconfdir :: FilePath\n"++ "\nbindir = " ++ show flat_bindir ++ "\nlibdir = " ++ show flat_libdir ++ + "\nhidir = " ++ show flat_hidir ++ "\ndatadir = " ++ show flat_datadir ++ "\nlibexecdir = " ++ show flat_libexecdir ++ "\nsysconfdir = " ++ show flat_sysconfdir ++ "\n"++ - "\ngetBinDir, getLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath\n"++ + "\ngetBinDir, getLibDir, getHiDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath\n"++ "getBinDir = "++mkGetEnvOr "bindir" "return bindir"++"\n"++ "getLibDir = "++mkGetEnvOr "libdir" "return libdir"++"\n"++ + "getHiDir = "++mkGetEnvOr "hidir" "return hidir"++"\n"++ "getDataDir = "++mkGetEnvOr "datadir" "return datadir"++"\n"++ "getLibexecDir = "++mkGetEnvOr "libexecdir" "return libexecdir"++"\n"++ "getSysconfDir = "++mkGetEnvOr "sysconfdir" "return sysconfdir"++"\n"++ @@ -151,6 +154,8 @@ generate pkg_descr lbi = "getBinDir = getPrefixDirRel bindirrel\n\n"++ "getLibDir :: IO FilePath\n"++ "getLibDir = "++mkGetDir flat_libdir flat_libdirrel++"\n\n"++ + "getHiDir :: IO FilePath\n"++ + "getHiDir = "++mkGetDir flat_hidir flat_hidirrel++"\n\n"++ "getDataDir :: IO FilePath\n"++ "getDataDir = "++ mkGetEnvOr "datadir" (mkGetDir flat_datadir flat_datadirrel)++"\n\n"++ @@ -173,6 +178,7 @@ generate pkg_descr lbi = prefix = flat_prefix, bindir = flat_bindir, libdir = flat_libdir, + hidir = flat_hidir, datadir = flat_datadir, libexecdir = flat_libexecdir, sysconfdir = flat_sysconfdir @@ -180,6 +186,7 @@ generate pkg_descr lbi = InstallDirs { bindir = flat_bindirrel, libdir = flat_libdirrel, + hidir = flat_hidirrel, datadir = flat_datadirrel, libexecdir = flat_libexecdirrel, sysconfdir = flat_sysconfdirrel @@ -187,6 +194,7 @@ generate pkg_descr lbi = flat_bindirreloc = shortRelativePath flat_prefix flat_bindir flat_libdirreloc = shortRelativePath flat_prefix flat_libdir + flat_hidirreloc = shortRelativePath flat_prefix flat_hidir flat_datadirreloc = shortRelativePath flat_prefix flat_datadir flat_libexecdirreloc = shortRelativePath flat_prefix flat_libexecdir flat_sysconfdirreloc = shortRelativePath flat_prefix flat_sysconfdir diff --git a/Cabal/Distribution/Simple/Configure.hs b/Cabal/Distribution/Simple/Configure.hs index 6903f5f1c69..78c4a68eded 100644 --- a/Cabal/Distribution/Simple/Configure.hs +++ b/Cabal/Distribution/Simple/Configure.hs @@ -684,6 +684,7 @@ configure (pkg_descr0', pbi) cfg = do dirinfo "Binaries" (bindir dirs) (bindir relative) dirinfo "Libraries" (libdir dirs) (libdir relative) + dirinfo "Interfaces" (hidir dirs) (hidir relative) dirinfo "Private binaries" (libexecdir dirs) (libexecdir relative) dirinfo "Data files" (datadir dirs) (datadir relative) dirinfo "Documentation" (docdir dirs) (docdir relative) @@ -2013,7 +2014,7 @@ checkRelocatable verbosity pkg lbi all isJust (fmap (stripPrefix p) [ bindir, libdir, dynlibdir, libexecdir, includedir, datadir - , docdir, mandir, htmldir, haddockdir, sysconfdir] ) + , hidir, docdir, mandir, htmldir, haddockdir, sysconfdir] ) -- Check if the library dirs of the dependencies that are in the package -- database to which the package is installed are relative to the diff --git a/Cabal/Distribution/Simple/GHC.hs b/Cabal/Distribution/Simple/GHC.hs index 5e2a1310f62..126dedcbd6b 100644 --- a/Cabal/Distribution/Simple/GHC.hs +++ b/Cabal/Distribution/Simple/GHC.hs @@ -1116,12 +1116,13 @@ installLib :: Verbosity -> LocalBuildInfo -> FilePath -- ^install location -> FilePath -- ^install location for dynamic libraries + -> FilePath -- ^install location for interfaces -> FilePath -- ^Build location -> PackageDescription -> Library -> ComponentLocalBuildInfo -> IO () -installLib verbosity lbi targetDir dynlibTargetDir builtDir _pkg lib clbi = do +installLib verbosity lbi targetDir dynlibTargetDir hiTargetDir builtDir _pkg lib clbi = do -- copy .hi files over: whenVanilla $ copyModuleFiles "hi" whenProf $ copyModuleFiles "p_hi" @@ -1151,7 +1152,7 @@ installLib verbosity lbi targetDir dynlibTargetDir builtDir _pkg lib clbi = do copyModuleFiles ext = findModuleFiles [builtDir] [ext] (libModules lib) - >>= installOrdinaryFiles verbosity targetDir + >>= installOrdinaryFiles verbosity hiTargetDir cid = compilerId (compiler lbi) libName = componentUnitId clbi diff --git a/Cabal/Distribution/Simple/Install.hs b/Cabal/Distribution/Simple/Install.hs index b7934e495f2..f74b012a87d 100644 --- a/Cabal/Distribution/Simple/Install.hs +++ b/Cabal/Distribution/Simple/Install.hs @@ -60,6 +60,7 @@ install pkg_descr lbi flags = do installDirs@(InstallDirs { bindir = binPref, libdir = libPref, + hidir = hiPref, -- dynlibdir = dynlibPref, --see TODO below datadir = dataPref, docdir = docPref, @@ -130,7 +131,7 @@ install pkg_descr lbi flags = do withLibLBI pkg_descr lbi $ case compilerFlavor (compiler lbi) of - GHC -> GHC.installLib verbosity lbi libPref dynlibPref buildPref pkg_descr + GHC -> GHC.installLib verbosity lbi libPref dynlibPref hiPref buildPref pkg_descr GHCJS -> GHCJS.installLib verbosity lbi libPref dynlibPref buildPref pkg_descr LHC -> LHC.installLib verbosity lbi libPref dynlibPref buildPref pkg_descr JHC -> JHC.installLib verbosity lbi libPref dynlibPref buildPref pkg_descr diff --git a/Cabal/Distribution/Simple/InstallDirs.hs b/Cabal/Distribution/Simple/InstallDirs.hs index 49c6f3cb299..72921828eb6 100644 --- a/Cabal/Distribution/Simple/InstallDirs.hs +++ b/Cabal/Distribution/Simple/InstallDirs.hs @@ -80,7 +80,17 @@ data InstallDirs dir = InstallDirs { prefix :: dir, bindir :: dir, libdir :: dir, - libsubdir :: dir, + commonlibdir :: dir, + hidir :: dir, + libsubdir :: dir, -- This field is basically deprecated by the + -- introduction of commonlibdir and hidir. However, + -- We must keep it so that we can still work with + -- Setup executables build against an older version + -- of Cabal. For the same reason, we cannot + -- simply use libsubdir as the commonlibdir, + -- because then Setup's build against an older + -- Cabal would put .hi files in the same directory + -- as the library object files dynlibdir :: dir, libexecdir :: dir, includedir :: dir, @@ -110,6 +120,8 @@ combineInstallDirs combine a b = InstallDirs { prefix = prefix a `combine` prefix b, bindir = bindir a `combine` bindir b, libdir = libdir a `combine` libdir b, + commonlibdir = commonlibdir a `combine` commonlibdir b, + hidir = hidir a `combine` hidir b, libsubdir = libsubdir a `combine` libsubdir b, dynlibdir = dynlibdir a `combine` dynlibdir b, libexecdir = libexecdir a `combine` libexecdir b, @@ -125,9 +137,9 @@ combineInstallDirs combine a b = InstallDirs { appendSubdirs :: (a -> a -> a) -> InstallDirs a -> InstallDirs a appendSubdirs append dirs = dirs { - libdir = libdir dirs `append` libsubdir dirs, + libdir = libdir dirs `append` commonlibdir dirs, datadir = datadir dirs `append` datasubdir dirs, - libsubdir = error "internal error InstallDirs.libsubdir", + commonlibdir = error "internal error InstallDirs.commonlibdir", datasubdir = error "internal error InstallDirs.datasubdir" } @@ -148,7 +160,7 @@ appendSubdirs append dirs = dirs { -- users to be able to configure @--libdir=\/usr\/lib64@ for example but -- because by default we want to support installing multiple versions of -- packages and building the same package for multiple compilers we append the --- libsubdir to get: @\/usr\/lib64\/$libname\/$compiler@. +-- commonlibdir to get: @\/usr\/lib64\/$libname\/$compiler@. -- -- An additional complication is the need to support relocatable packages on -- systems which support such things, like Windows. @@ -177,6 +189,16 @@ defaultInstallDirs comp userInstall _hasLibs = do prefix = installPrefix, bindir = "$prefix" "bin", libdir = installLibDir, + commonlibdir = case comp of + JHC -> "$compiler" + LHC -> "$compiler" + UHC -> "$pkgid" + _other -> "$abi", + hidir = "$libdir" case comp of + JHC -> "$compiler" + LHC -> "$compiler" + UHC -> "$pkgid" + _other -> "$abi" "$libname", libsubdir = case comp of JHC -> "$compiler" LHC -> "$compiler" @@ -186,7 +208,7 @@ defaultInstallDirs comp userInstall _hasLibs = do libexecdir = case buildOS of Windows -> "$prefix" "$libname" _other -> "$prefix" "libexec", - includedir = "$libdir" "$libsubdir" "include", + includedir = "$hidir" "include", datadir = case buildOS of Windows -> "$prefix" _other -> "$prefix" "share", @@ -222,10 +244,12 @@ substituteInstallDirTemplates env dirs = dirs' prefix = subst prefix [], bindir = subst bindir [prefixVar], libdir = subst libdir [prefixVar, bindirVar], + commonlibdir = subst commonlibdir [], + hidir = subst hidir prefixBinLibVars, libsubdir = subst libsubdir [], dynlibdir = subst dynlibdir [prefixVar, bindirVar, libdirVar], libexecdir = subst libexecdir prefixBinLibVars, - includedir = subst includedir prefixBinLibVars, + includedir = subst includedir (prefixBinLibVars ++ [hidirVar]), datadir = subst datadir prefixBinLibVars, datasubdir = subst datasubdir [], docdir = subst docdir prefixBinLibDataVars, @@ -240,12 +264,13 @@ substituteInstallDirTemplates env dirs = dirs' prefixVar = (PrefixVar, prefix dirs') bindirVar = (BindirVar, bindir dirs') libdirVar = (LibdirVar, libdir dirs') - libsubdirVar = (LibsubdirVar, libsubdir dirs') + commonlibdirVar = (CommonlibdirVar, commonlibdir dirs') + hidirVar = (HidirVar, hidir dirs') datadirVar = (DatadirVar, datadir dirs') datasubdirVar = (DatasubdirVar, datasubdir dirs') docdirVar = (DocdirVar, docdir dirs') htmldirVar = (HtmldirVar, htmldir dirs') - prefixBinLibVars = [prefixVar, bindirVar, libdirVar, libsubdirVar] + prefixBinLibVars = [prefixVar, bindirVar, libdirVar, commonlibdirVar] prefixBinLibDataVars = prefixBinLibVars ++ [datadirVar, datasubdirVar] -- | Convert from abstract install directories to actual absolute ones by @@ -330,6 +355,8 @@ data PathTemplateVariable = PrefixVar -- ^ The @$prefix@ path variable | BindirVar -- ^ The @$bindir@ path variable | LibdirVar -- ^ The @$libdir@ path variable + | CommonlibdirVar -- ^ The @$commonlibdir@ path variable + | HidirVar -- ^ The @$hidir@ path variable | LibsubdirVar -- ^ The @$libsubdir@ path variable | DatadirVar -- ^ The @$datadir@ path variable | DatasubdirVar -- ^ The @$datasubdir@ path variable @@ -425,7 +452,10 @@ installDirsTemplateEnv dirs = [(PrefixVar, prefix dirs) ,(BindirVar, bindir dirs) ,(LibdirVar, libdir dirs) - ,(LibsubdirVar, libsubdir dirs) + ,(CommonlibdirVar, commonlibdir dirs) + ,(HidirVar, hidir dirs) + ,(LibsubdirVar, libsubdir dirs) -- We need to keep this around for Setup's + -- build against older versions of Cabal ,(DatadirVar, datadir dirs) ,(DatasubdirVar, datasubdir dirs) ,(DocdirVar, docdir dirs) @@ -447,6 +477,8 @@ instance Show PathTemplateVariable where show LibNameVar = "libname" show BindirVar = "bindir" show LibdirVar = "libdir" + show CommonlibdirVar = "commonlibdir" + show HidirVar = "hidir" show LibsubdirVar = "libsubdir" show DatadirVar = "datadir" show DatasubdirVar = "datasubdir" @@ -475,6 +507,8 @@ instance Read PathTemplateVariable where where vars = [("prefix", PrefixVar) ,("bindir", BindirVar) ,("libdir", LibdirVar) + ,("commonlibdir", CommonlibdirVar) + ,("hidir", HidirVar) ,("libsubdir", LibsubdirVar) ,("datadir", DatadirVar) ,("datasubdir", DatasubdirVar) diff --git a/Cabal/Distribution/Simple/Register.hs b/Cabal/Distribution/Simple/Register.hs index d1bd0abcdbc..99c8481608c 100644 --- a/Cabal/Distribution/Simple/Register.hs +++ b/Cabal/Distribution/Simple/Register.hs @@ -320,8 +320,8 @@ generalInstalledPackageInfo adjustRelIncDirs pkg abi_hash lib lbi clbi installDi IPI.exposedModules = componentExposedModules clbi, IPI.hiddenModules = otherModules bi, IPI.trusted = IPI.trusted IPI.emptyInstalledPackageInfo, - IPI.importDirs = [ libdir installDirs | hasModules ], - -- Note. the libsubdir and datasubdir templates have already been expanded + IPI.importDirs = [ hidir installDirs | hasModules ], + -- Note. the commonlibdir and datasubdir templates have already been expanded -- into libdir and datadir. IPI.libraryDirs = if hasLibrary then libdir installDirs : extraLibDirs bi @@ -378,6 +378,7 @@ inplaceInstalledPackageInfo inplaceDir distPref pkg abi_hash lib lbi clbi = (absoluteInstallDirs pkg lbi NoCopyDest) { libdir = inplaceDir libTargetDir, datadir = inplaceDir dataDir pkg, + hidir = inplaceDir libTargetDir, docdir = inplaceDocdir, htmldir = inplaceHtmldir, haddockdir = inplaceHtmldir diff --git a/Cabal/Distribution/Simple/Setup.hs b/Cabal/Distribution/Simple/Setup.hs index cb7cb2ee3a5..82034451cb0 100644 --- a/Cabal/Distribution/Simple/Setup.hs +++ b/Cabal/Distribution/Simple/Setup.hs @@ -762,9 +762,14 @@ installDirsOptions = libdir (\v flags -> flags { libdir = v }) installDirArg - , option "" ["libsubdir"] - "subdirectory of libdir in which libs are installed" - libsubdir (\v flags -> flags { libsubdir = v }) + , option "" ["commonlibdir"] + "subdirectory of libdir in which the object files of libs are installed" + commonlibdir (\v flags -> flags { commonlibdir = v }) + installDirArg + + , option "" ["hidir"] + "installation directory for library interface files" + hidir (\v flags -> flags { hidir = v }) installDirArg , option "" ["libexecdir"] @@ -801,6 +806,13 @@ installDirsOptions = "installation directory for configuration files" sysconfdir (\v flags -> flags { sysconfdir = v }) installDirArg + + , option "" ["libsubdir"] + ("subdirectory of libdir in which libs are installed." ++ + "Only has an effect on Setup files build against Cabal < 1.24.1" + ) + libsubdir (\v flags -> flags { libsubdir = v }) + installDirArg ] where installDirArg _sf _lf d get set = diff --git a/Cabal/doc/developing-packages.markdown b/Cabal/doc/developing-packages.markdown index 6519c3e799a..f791d08c726 100644 --- a/Cabal/doc/developing-packages.markdown +++ b/Cabal/doc/developing-packages.markdown @@ -1952,6 +1952,7 @@ version :: Version getBinDir :: IO FilePath getLibDir :: IO FilePath +getHiDir :: IO FilePath getDataDir :: IO FilePath getLibexecDir :: IO FilePath getSysconfDir :: IO FilePath diff --git a/Cabal/doc/installing-packages.markdown b/Cabal/doc/installing-packages.markdown index fbb995d31dc..b0b9ced4410 100644 --- a/Cabal/doc/installing-packages.markdown +++ b/Cabal/doc/installing-packages.markdown @@ -498,36 +498,44 @@ package: variables: `$prefix`, `$bindir`, `$pkgid`, `$pkg`, `$version`, `$compiler`, `$os`, `$arch`, `$abi`, `$abitag` +`--hidir=`_dir_ +: Interface files (.hi) of libraries are installed here. + + In the simple build system, *dir* may contain the following path + variables: `$prefix`, `$bindir`, `$libdir`, `$commonlibdir`, + `$pkgid`, `$pkg`, `$version`, `$compiler`, `$os`, + `$arch`, `$abi`, `$abitag` + `--libexecdir=`_dir_ : Executables that are not expected to be invoked directly by the user are installed here. In the simple build system, _dir_ may contain the following path - variables: `$prefix`, `$bindir`, `$libdir`, `$libsubdir`, `$pkgid`, + variables: `$prefix`, `$bindir`, `$libdir`, `$commonlibdir`, `$pkgid`, `$pkg`, `$version`, `$compiler`, `$os`, `$arch`, `$abi`, `$abitag` `--datadir`=_dir_ : Architecture-independent data files are installed here. In the simple build system, _dir_ may contain the following path - variables: `$prefix`, `$bindir`, `$libdir`, `$libsubdir`, `$pkgid`, `$pkg`, + variables: `$prefix`, `$bindir`, `$libdir`, `$commonlibdir`, `$pkgid`, `$pkg`, `$version`, `$compiler`, `$os`, `$arch`, `$abi`, `$abitag` `--sysconfdir=`_dir_ : Installation directory for the configuration files. In the simple build system, _dir_ may contain the following path variables: - `$prefix`, `$bindir`, `$libdir`, `$libsubdir`, `$pkgid`, `$pkg`, `$version`, + `$prefix`, `$bindir`, `$libdir`, `$commonlibdir`, `$pkgid`, `$pkg`, `$version`, `$compiler`, `$os`, `$arch`, `$abi`, `$abitag` In addition the simple build system supports the following installation path options: -`--libsubdir=`_dir_ +`--commonlibdir=`_dir_ : A subdirectory of _libdir_ in which libraries are actually installed. For example, in the simple build system on Unix, the - default _libdir_ is `/usr/local/lib`, and _libsubdir_ contains the - package identifier and compiler, e.g. `mypkg-0.2/ghc-6.4`, so - libraries would be installed in `/usr/local/lib/mypkg-0.2/ghc-6.4`. + default _libdir_ is `/usr/local/lib`, and _commonlibdir_ contains the + ABI, e.g. `x86_64-linux-ghc-8.0.1`, so + libraries would be installed in `/usr/local/lib/x86_64-linux-ghc-8.0.1`. _dir_ may contain the following path variables: `$pkgid`, `$pkg`, `$version`, `$compiler`, `$os`, `$arch`, `$abi`, `$abitag` @@ -543,14 +551,14 @@ In addition the simple build system supports the following installation path opt : Documentation files are installed relative to this directory. _dir_ may contain the following path variables: `$prefix`, `$bindir`, - `$libdir`, `$libsubdir`, `$datadir`, `$datasubdir`, `$pkgid`, `$pkg`, + `$libdir`, `$commonlibdir`, `$datadir`, `$datasubdir`, `$pkgid`, `$pkg`, `$version`, `$compiler`, `$os`, `$arch`, `$abi`, `$abitag` `--htmldir=`_dir_ : HTML documentation files are installed relative to this directory. _dir_ may contain the following path variables: `$prefix`, `$bindir`, - `$libdir`, `$libsubdir`, `$datadir`, `$datasubdir`, `$docdir`, `$pkgid`, + `$libdir`, `$commonlibdir`, `$datadir`, `$datasubdir`, `$docdir`, `$pkgid`, `$pkg`, `$version`, `$compiler`, `$os`, `$arch`, `$abi`, `$abitag` `--program-prefix=`_prefix_ @@ -568,6 +576,20 @@ In addition the simple build system supports the following installation path opt _suffix_ may contain the following path variables: `$pkgid`, `$pkg`, `$version`, `$compiler`, `$os`, `$arch`, `$abi`, `$abitag` +`--commonlibdir=`_dir_ +: For use with Setup.hs files build against a version of Cabal prior to 1.24.1. + For later versions of Cabal, this flag is basically deprecated, and you + should use `--commonlibdir=`_dir_. + + A subdirectory of _libdir_ in which libraries are actually + installed. For example, in the simple build system on Unix, the + default _libdir_ is `/usr/local/lib`, and _commonlibdir_ contains the + ABI, e.g. `x86_64-linux-ghc-8.0.1`, so + libraries would be installed in `/usr/local/lib/x86_64-linux-ghc-8.0.1`. + + _dir_ may contain the following path variables: `$pkgid`, `$pkg`, + `$version`, `$compiler`, `$os`, `$arch`, `$abi`, `$abitag` + #### Path variables in the simple build system #### For the simple build system, there are a number of variables that can be @@ -590,8 +612,11 @@ independence](#prefix-independence)). `$libdir` : As above but for `--libdir` -`$libsubdir` -: As above but for `--libsubdir` +`$commonlibdir` +: As above but for `--commonlibdir` + +`$hidir` +: As above but for `--hidir` `$datadir` : As above but for `--datadir` @@ -602,6 +627,9 @@ independence](#prefix-independence)). `$docdir` : As above but for `--docdir` +`$libsubdir` +: As above but for `--libsubdir` + `$pkgid` : The name and version of the package, e.g. `mypkg-0.2` @@ -642,7 +670,8 @@ Option Windows Default `--prefix` (per-user) `C:\Documents And Settings\user\Application Data\cabal` `$HOME/.cabal` `--bindir` `$prefix\bin` `$prefix/bin` `--libdir` `$prefix` `$prefix/lib` -`--libsubdir` (others) `$pkgid\$compiler` `$pkgid/$compiler` +`--commonlibdir` (others) `$abi` `$abi` +`--hidir` `$libdir\$abi\$libname` `$libdir/$abi/$libname` `--libexecdir` `$prefix\$pkgid` `$prefix/libexec` `--datadir` (executable) `$prefix` `$prefix/share` `--datadir` (library) `C:\Program Files\Haskell` `$prefix/share` @@ -652,6 +681,7 @@ Option Windows Default `--htmldir` `$docdir\html` `$docdir/html` `--program-prefix` (empty) (empty) `--program-suffix` (empty) (empty) +`--libsubdir` `$abi\$libname` `$abi/$libname` #### Prefix-independence #### diff --git a/cabal-install/Distribution/Client/ProjectPlanning.hs b/cabal-install/Distribution/Client/ProjectPlanning.hs index 4777ead9d9c..629551b5d99 100644 --- a/cabal-install/Distribution/Client/ProjectPlanning.hs +++ b/cabal-install/Distribution/Client/ProjectPlanning.hs @@ -1128,7 +1128,7 @@ elaborateInstallPlan platform compiler compilerprogdb platform defaultInstallDirs) { - InstallDirs.libsubdir = "", -- absoluteInstallDirs sets these as + InstallDirs.commonlibdir = "", -- absoluteInstallDirs sets these as InstallDirs.datasubdir = "" -- 'undefined' but we have to use } -- them as "Setup.hs configure" args @@ -1914,6 +1914,8 @@ storePackageInstallDirs CabalDirLayout{cabalStorePackageDirectory} prefix = cabalStorePackageDirectory compid ipkgid bindir = prefix "bin" libdir = prefix "lib" + commonlibdir = "" + hidir = prefix "lib" libsubdir = "" dynlibdir = libdir libexecdir = prefix "libexec" diff --git a/cabal-install/Distribution/Client/Setup.hs b/cabal-install/Distribution/Client/Setup.hs index 6aec3c6f5c4..b27919c9cf9 100644 --- a/cabal-install/Distribution/Client/Setup.hs +++ b/cabal-install/Distribution/Client/Setup.hs @@ -84,7 +84,7 @@ import Distribution.Simple.Setup , optionVerbosity, boolOpt, boolOpt', trueArg, falseArg , readPToMaybe, optionNumJobs ) import Distribution.Simple.InstallDirs - ( PathTemplate, InstallDirs(sysconfdir) + ( PathTemplate, InstallDirs(commonlibdir, hidir, sysconfdir) , toPathTemplate, fromPathTemplate ) import Distribution.Version ( Version(Version), anyVersion, thisVersion ) @@ -350,7 +350,7 @@ configureOptions = commandOptions configureCommand filterConfigureFlags :: ConfigFlags -> Version -> ConfigFlags filterConfigureFlags flags cabalLibVersion - | cabalLibVersion >= Version [1,23,0] [] = flags_latest + | cabalLibVersion >= Version [1,24,1] [] = flags_latest -- ^ NB: we expect the latest version to be the most common case. | cabalLibVersion < Version [1,3,10] [] = flags_1_3_10 | cabalLibVersion < Version [1,10,0] [] = flags_1_10_0 @@ -362,6 +362,7 @@ filterConfigureFlags flags cabalLibVersion | cabalLibVersion < Version [1,21,1] [] = flags_1_20_0 | cabalLibVersion < Version [1,22,0] [] = flags_1_21_0 | cabalLibVersion < Version [1,23,0] [] = flags_1_22_0 + | cabalLibVersion < Version [1,24,1] [] = flags_1_24_0 | otherwise = flags_latest where (profEnabledLib, profEnabledExe) = computeEffectiveProfiling flags @@ -373,10 +374,18 @@ filterConfigureFlags flags cabalLibVersion configAllowNewer = Just Cabal.AllowNewerNone } + -- Cabal < 1.24.1 doesn't know about --extra-prog-path and --sysconfdir. + flags_1_24_0 = flags_latest { configInstallDirs = configInstallDirs_1_24_0} + configInstallDirs_1_24_0 = (configInstallDirs flags) + { commonlibdir = NoFlag + , hidir = NoFlag + } + + -- Cabal < 1.23 doesn't know about '--profiling-detail'. -- Cabal < 1.23 has a hacked up version of 'enable-profiling' -- which we shouldn't use. - flags_1_22_0 = flags_latest { configProfDetail = NoFlag + flags_1_22_0 = flags_1_24_0 { configProfDetail = NoFlag , configProfLibDetail = NoFlag , configIPID = NoFlag , configProf = NoFlag @@ -405,7 +414,7 @@ filterConfigureFlags flags cabalLibVersion -- Cabal < 1.18.0 doesn't know about --extra-prog-path and --sysconfdir. flags_1_18_0 = flags_1_19_0 { configProgramPathExtra = toNubList [] , configInstallDirs = configInstallDirs_1_18_0} - configInstallDirs_1_18_0 = (configInstallDirs flags) { sysconfdir = NoFlag } + configInstallDirs_1_18_0 = (configInstallDirs flags_1_19_0) { sysconfdir = NoFlag } -- Cabal < 1.14.0 doesn't know about '--disable-benchmarks'. flags_1_14_0 = flags_1_18_0 { configBenchmarks = NoFlag } -- Cabal < 1.12.0 doesn't know about '--enable/disable-executable-dynamic' diff --git a/cabal-install/tests/UnitTests/Distribution/Client/ProjectConfig.hs b/cabal-install/tests/UnitTests/Distribution/Client/ProjectConfig.hs index bb8e8c8d615..d596b4e8132 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/ProjectConfig.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/ProjectConfig.hs @@ -527,7 +527,7 @@ instance Arbitrary a => Arbitrary (InstallDirs a) where <$> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary -- 4 <*> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary -- 8 <*> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary -- 12 - <*> arbitrary <*> arbitrary -- 14 + <*> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary -- 16 instance Arbitrary PackageDB where arbitrary = oneof [ pure GlobalPackageDB From 2e65f7688017ab0ece1bea53333db402e54afdea Mon Sep 17 00:00:00 2001 From: Christiaan Baaij Date: Sun, 16 Oct 2016 19:07:30 +0200 Subject: [PATCH 2/2] Rename `--commonlibdir` to `--binlibsubdir` `--binlibsubdir` more properly describes what this flag does: it indicates the directory in which the binary libraries go, and it is a subdir of `--libdir`. --- Cabal/Distribution/Simple/InstallDirs.hs | 34 +++++++-------- Cabal/Distribution/Simple/Register.hs | 2 +- Cabal/Distribution/Simple/Setup.hs | 8 ++-- Cabal/doc/installing-packages.markdown | 43 ++++++++++--------- .../Distribution/Client/ProjectPlanning.hs | 4 +- cabal-install/Distribution/Client/Setup.hs | 6 +-- 6 files changed, 50 insertions(+), 47 deletions(-) diff --git a/Cabal/Distribution/Simple/InstallDirs.hs b/Cabal/Distribution/Simple/InstallDirs.hs index 72921828eb6..739112afba5 100644 --- a/Cabal/Distribution/Simple/InstallDirs.hs +++ b/Cabal/Distribution/Simple/InstallDirs.hs @@ -80,14 +80,14 @@ data InstallDirs dir = InstallDirs { prefix :: dir, bindir :: dir, libdir :: dir, - commonlibdir :: dir, + binlibsubdir :: dir, hidir :: dir, - libsubdir :: dir, -- This field is basically deprecated by the - -- introduction of commonlibdir and hidir. However, - -- We must keep it so that we can still work with + libsubdir :: dir, -- This field is deprecated by the introduction of + -- binlibsubdir and hidir. However, + -- we must keep it so that we can still work with -- Setup executables build against an older version -- of Cabal. For the same reason, we cannot - -- simply use libsubdir as the commonlibdir, + -- simply use libsubdir as the binlibsubdir, -- because then Setup's build against an older -- Cabal would put .hi files in the same directory -- as the library object files @@ -120,7 +120,7 @@ combineInstallDirs combine a b = InstallDirs { prefix = prefix a `combine` prefix b, bindir = bindir a `combine` bindir b, libdir = libdir a `combine` libdir b, - commonlibdir = commonlibdir a `combine` commonlibdir b, + binlibsubdir = binlibsubdir a `combine` binlibsubdir b, hidir = hidir a `combine` hidir b, libsubdir = libsubdir a `combine` libsubdir b, dynlibdir = dynlibdir a `combine` dynlibdir b, @@ -137,9 +137,9 @@ combineInstallDirs combine a b = InstallDirs { appendSubdirs :: (a -> a -> a) -> InstallDirs a -> InstallDirs a appendSubdirs append dirs = dirs { - libdir = libdir dirs `append` commonlibdir dirs, + libdir = libdir dirs `append` binlibsubdir dirs, datadir = datadir dirs `append` datasubdir dirs, - commonlibdir = error "internal error InstallDirs.commonlibdir", + binlibsubdir = error "internal error InstallDirs.binlibsubdir", datasubdir = error "internal error InstallDirs.datasubdir" } @@ -160,7 +160,7 @@ appendSubdirs append dirs = dirs { -- users to be able to configure @--libdir=\/usr\/lib64@ for example but -- because by default we want to support installing multiple versions of -- packages and building the same package for multiple compilers we append the --- commonlibdir to get: @\/usr\/lib64\/$libname\/$compiler@. +-- binlibsubdir to get: @\/usr\/lib64\/$libname\/$compiler@. -- -- An additional complication is the need to support relocatable packages on -- systems which support such things, like Windows. @@ -189,7 +189,7 @@ defaultInstallDirs comp userInstall _hasLibs = do prefix = installPrefix, bindir = "$prefix" "bin", libdir = installLibDir, - commonlibdir = case comp of + binlibsubdir = case comp of JHC -> "$compiler" LHC -> "$compiler" UHC -> "$pkgid" @@ -244,7 +244,7 @@ substituteInstallDirTemplates env dirs = dirs' prefix = subst prefix [], bindir = subst bindir [prefixVar], libdir = subst libdir [prefixVar, bindirVar], - commonlibdir = subst commonlibdir [], + binlibsubdir = subst binlibsubdir [], hidir = subst hidir prefixBinLibVars, libsubdir = subst libsubdir [], dynlibdir = subst dynlibdir [prefixVar, bindirVar, libdirVar], @@ -264,13 +264,13 @@ substituteInstallDirTemplates env dirs = dirs' prefixVar = (PrefixVar, prefix dirs') bindirVar = (BindirVar, bindir dirs') libdirVar = (LibdirVar, libdir dirs') - commonlibdirVar = (CommonlibdirVar, commonlibdir dirs') + binlibsubdirVar = (BinlibsubdirVar, binlibsubdir dirs') hidirVar = (HidirVar, hidir dirs') datadirVar = (DatadirVar, datadir dirs') datasubdirVar = (DatasubdirVar, datasubdir dirs') docdirVar = (DocdirVar, docdir dirs') htmldirVar = (HtmldirVar, htmldir dirs') - prefixBinLibVars = [prefixVar, bindirVar, libdirVar, commonlibdirVar] + prefixBinLibVars = [prefixVar, bindirVar, libdirVar, binlibsubdirVar] prefixBinLibDataVars = prefixBinLibVars ++ [datadirVar, datasubdirVar] -- | Convert from abstract install directories to actual absolute ones by @@ -355,7 +355,7 @@ data PathTemplateVariable = PrefixVar -- ^ The @$prefix@ path variable | BindirVar -- ^ The @$bindir@ path variable | LibdirVar -- ^ The @$libdir@ path variable - | CommonlibdirVar -- ^ The @$commonlibdir@ path variable + | BinlibsubdirVar -- ^ The @$binlibsubdir@ path variable | HidirVar -- ^ The @$hidir@ path variable | LibsubdirVar -- ^ The @$libsubdir@ path variable | DatadirVar -- ^ The @$datadir@ path variable @@ -452,7 +452,7 @@ installDirsTemplateEnv dirs = [(PrefixVar, prefix dirs) ,(BindirVar, bindir dirs) ,(LibdirVar, libdir dirs) - ,(CommonlibdirVar, commonlibdir dirs) + ,(BinlibsubdirVar, binlibsubdir dirs) ,(HidirVar, hidir dirs) ,(LibsubdirVar, libsubdir dirs) -- We need to keep this around for Setup's -- build against older versions of Cabal @@ -477,7 +477,7 @@ instance Show PathTemplateVariable where show LibNameVar = "libname" show BindirVar = "bindir" show LibdirVar = "libdir" - show CommonlibdirVar = "commonlibdir" + show BinlibsubdirVar = "binlibsubdir" show HidirVar = "hidir" show LibsubdirVar = "libsubdir" show DatadirVar = "datadir" @@ -507,7 +507,7 @@ instance Read PathTemplateVariable where where vars = [("prefix", PrefixVar) ,("bindir", BindirVar) ,("libdir", LibdirVar) - ,("commonlibdir", CommonlibdirVar) + ,("binlibsubdir", BinlibsubdirVar) ,("hidir", HidirVar) ,("libsubdir", LibsubdirVar) ,("datadir", DatadirVar) diff --git a/Cabal/Distribution/Simple/Register.hs b/Cabal/Distribution/Simple/Register.hs index 99c8481608c..d4b6bc1cadd 100644 --- a/Cabal/Distribution/Simple/Register.hs +++ b/Cabal/Distribution/Simple/Register.hs @@ -321,7 +321,7 @@ generalInstalledPackageInfo adjustRelIncDirs pkg abi_hash lib lbi clbi installDi IPI.hiddenModules = otherModules bi, IPI.trusted = IPI.trusted IPI.emptyInstalledPackageInfo, IPI.importDirs = [ hidir installDirs | hasModules ], - -- Note. the commonlibdir and datasubdir templates have already been expanded + -- Note. the binlibsubdir and datasubdir templates have already been expanded -- into libdir and datadir. IPI.libraryDirs = if hasLibrary then libdir installDirs : extraLibDirs bi diff --git a/Cabal/Distribution/Simple/Setup.hs b/Cabal/Distribution/Simple/Setup.hs index 82034451cb0..54e23c80fc1 100644 --- a/Cabal/Distribution/Simple/Setup.hs +++ b/Cabal/Distribution/Simple/Setup.hs @@ -762,9 +762,9 @@ installDirsOptions = libdir (\v flags -> flags { libdir = v }) installDirArg - , option "" ["commonlibdir"] - "subdirectory of libdir in which the object files of libs are installed" - commonlibdir (\v flags -> flags { commonlibdir = v }) + , option "" ["binlibsubdir"] + "subdirectory of libdir in which binary libraries are installed" + binlibsubdir (\v flags -> flags { binlibsubdir = v }) installDirArg , option "" ["hidir"] @@ -809,7 +809,7 @@ installDirsOptions = , option "" ["libsubdir"] ("subdirectory of libdir in which libs are installed." ++ - "Only has an effect on Setup files build against Cabal < 1.24.1" + "Only has an effect on Setup files built against Cabal < 1.24.1" ) libsubdir (\v flags -> flags { libsubdir = v }) installDirArg diff --git a/Cabal/doc/installing-packages.markdown b/Cabal/doc/installing-packages.markdown index b0b9ced4410..efa6649ed63 100644 --- a/Cabal/doc/installing-packages.markdown +++ b/Cabal/doc/installing-packages.markdown @@ -502,7 +502,7 @@ package: : Interface files (.hi) of libraries are installed here. In the simple build system, *dir* may contain the following path - variables: `$prefix`, `$bindir`, `$libdir`, `$commonlibdir`, + variables: `$prefix`, `$bindir`, `$libdir`, `$binlibsubdir`, `$pkgid`, `$pkg`, `$version`, `$compiler`, `$os`, `$arch`, `$abi`, `$abitag` @@ -511,31 +511,32 @@ package: are installed here. In the simple build system, _dir_ may contain the following path - variables: `$prefix`, `$bindir`, `$libdir`, `$commonlibdir`, `$pkgid`, + variables: `$prefix`, `$bindir`, `$libdir`, `$binlibsubdir`, `$pkgid`, `$pkg`, `$version`, `$compiler`, `$os`, `$arch`, `$abi`, `$abitag` `--datadir`=_dir_ : Architecture-independent data files are installed here. In the simple build system, _dir_ may contain the following path - variables: `$prefix`, `$bindir`, `$libdir`, `$commonlibdir`, `$pkgid`, `$pkg`, + variables: `$prefix`, `$bindir`, `$libdir`, `$binlibsubdir`, `$pkgid`, `$pkg`, `$version`, `$compiler`, `$os`, `$arch`, `$abi`, `$abitag` `--sysconfdir=`_dir_ : Installation directory for the configuration files. In the simple build system, _dir_ may contain the following path variables: - `$prefix`, `$bindir`, `$libdir`, `$commonlibdir`, `$pkgid`, `$pkg`, `$version`, + `$prefix`, `$bindir`, `$libdir`, `$binlibsubdir`, `$pkgid`, `$pkg`, `$version`, `$compiler`, `$os`, `$arch`, `$abi`, `$abitag` In addition the simple build system supports the following installation path options: -`--commonlibdir=`_dir_ -: A subdirectory of _libdir_ in which libraries are actually - installed. For example, in the simple build system on Unix, the - default _libdir_ is `/usr/local/lib`, and _commonlibdir_ contains the - ABI, e.g. `x86_64-linux-ghc-8.0.1`, so - libraries would be installed in `/usr/local/lib/x86_64-linux-ghc-8.0.1`. +`--binlibsubdir=`_dir_ +: A subdirectory of _libdir_ in which binary libraries are actually + installed. It is recommended that a single, common directory to be used to + store all installed libraries (as opposed to using `$pkgid` or similar + variables to create a directory per installed library), as this helps reduce + the size of rpath in executables built against dynamic libraries. + See [3982](https://github.com/haskell/cabal/pull/3982) for more details. _dir_ may contain the following path variables: `$pkgid`, `$pkg`, `$version`, `$compiler`, `$os`, `$arch`, `$abi`, `$abitag` @@ -551,14 +552,14 @@ In addition the simple build system supports the following installation path opt : Documentation files are installed relative to this directory. _dir_ may contain the following path variables: `$prefix`, `$bindir`, - `$libdir`, `$commonlibdir`, `$datadir`, `$datasubdir`, `$pkgid`, `$pkg`, + `$libdir`, `$binlibsubdir`, `$datadir`, `$datasubdir`, `$pkgid`, `$pkg`, `$version`, `$compiler`, `$os`, `$arch`, `$abi`, `$abitag` `--htmldir=`_dir_ : HTML documentation files are installed relative to this directory. _dir_ may contain the following path variables: `$prefix`, `$bindir`, - `$libdir`, `$commonlibdir`, `$datadir`, `$datasubdir`, `$docdir`, `$pkgid`, + `$libdir`, `$binlibsubdir`, `$datadir`, `$datasubdir`, `$docdir`, `$pkgid`, `$pkg`, `$version`, `$compiler`, `$os`, `$arch`, `$abi`, `$abitag` `--program-prefix=`_prefix_ @@ -576,14 +577,16 @@ In addition the simple build system supports the following installation path opt _suffix_ may contain the following path variables: `$pkgid`, `$pkg`, `$version`, `$compiler`, `$os`, `$arch`, `$abi`, `$abitag` -`--commonlibdir=`_dir_ -: For use with Setup.hs files build against a version of Cabal prior to 1.24.1. - For later versions of Cabal, this flag is basically deprecated, and you - should use `--commonlibdir=`_dir_. +`--libsubdir=`_dir_ +: For use with Setup.hs files built against a version of Cabal prior to 1.24.1. + With later versions of Cabal, you should prefer `--binlibsubdir` and + `--hidir`, which let you separately specify where binary libraries + and interface files get installed, so that binary libraries can be + installed to a shared directory.. A subdirectory of _libdir_ in which libraries are actually installed. For example, in the simple build system on Unix, the - default _libdir_ is `/usr/local/lib`, and _commonlibdir_ contains the + default _libdir_ is `/usr/local/lib`, and _libsubdir_ contains the ABI, e.g. `x86_64-linux-ghc-8.0.1`, so libraries would be installed in `/usr/local/lib/x86_64-linux-ghc-8.0.1`. @@ -612,8 +615,8 @@ independence](#prefix-independence)). `$libdir` : As above but for `--libdir` -`$commonlibdir` -: As above but for `--commonlibdir` +`$binlibsubdir` +: As above but for `--binlibsubdir` `$hidir` : As above but for `--hidir` @@ -670,7 +673,7 @@ Option Windows Default `--prefix` (per-user) `C:\Documents And Settings\user\Application Data\cabal` `$HOME/.cabal` `--bindir` `$prefix\bin` `$prefix/bin` `--libdir` `$prefix` `$prefix/lib` -`--commonlibdir` (others) `$abi` `$abi` +`--binlibsubdir` (others) `$abi` `$abi` `--hidir` `$libdir\$abi\$libname` `$libdir/$abi/$libname` `--libexecdir` `$prefix\$pkgid` `$prefix/libexec` `--datadir` (executable) `$prefix` `$prefix/share` diff --git a/cabal-install/Distribution/Client/ProjectPlanning.hs b/cabal-install/Distribution/Client/ProjectPlanning.hs index 629551b5d99..412b4cb20bc 100644 --- a/cabal-install/Distribution/Client/ProjectPlanning.hs +++ b/cabal-install/Distribution/Client/ProjectPlanning.hs @@ -1128,7 +1128,7 @@ elaborateInstallPlan platform compiler compilerprogdb platform defaultInstallDirs) { - InstallDirs.commonlibdir = "", -- absoluteInstallDirs sets these as + InstallDirs.binlibsubdir = "", -- absoluteInstallDirs sets these as InstallDirs.datasubdir = "" -- 'undefined' but we have to use } -- them as "Setup.hs configure" args @@ -1914,7 +1914,7 @@ storePackageInstallDirs CabalDirLayout{cabalStorePackageDirectory} prefix = cabalStorePackageDirectory compid ipkgid bindir = prefix "bin" libdir = prefix "lib" - commonlibdir = "" + binlibsubdir = "" hidir = prefix "lib" libsubdir = "" dynlibdir = libdir diff --git a/cabal-install/Distribution/Client/Setup.hs b/cabal-install/Distribution/Client/Setup.hs index b27919c9cf9..067e620d760 100644 --- a/cabal-install/Distribution/Client/Setup.hs +++ b/cabal-install/Distribution/Client/Setup.hs @@ -84,7 +84,7 @@ import Distribution.Simple.Setup , optionVerbosity, boolOpt, boolOpt', trueArg, falseArg , readPToMaybe, optionNumJobs ) import Distribution.Simple.InstallDirs - ( PathTemplate, InstallDirs(commonlibdir, hidir, sysconfdir) + ( PathTemplate, InstallDirs(binlibsubdir, hidir, sysconfdir) , toPathTemplate, fromPathTemplate ) import Distribution.Version ( Version(Version), anyVersion, thisVersion ) @@ -374,10 +374,10 @@ filterConfigureFlags flags cabalLibVersion configAllowNewer = Just Cabal.AllowNewerNone } - -- Cabal < 1.24.1 doesn't know about --extra-prog-path and --sysconfdir. + -- Cabal < 1.24.1 doesn't know about --binlibsubdir and --hidir. flags_1_24_0 = flags_latest { configInstallDirs = configInstallDirs_1_24_0} configInstallDirs_1_24_0 = (configInstallDirs flags) - { commonlibdir = NoFlag + { binlibsubdir = NoFlag , hidir = NoFlag }