diff options
| author | Sylvain Henry <sylvain@haskus.fr> | 2020-01-15 17:48:30 +0100 |
|---|---|---|
| committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-01-31 02:46:15 -0500 |
| commit | 29c701c154cafa4844cf3c1bd4a93cacfa6b1ee1 (patch) | |
| tree | 88a060f43c73306463510b53607c1fd9460bd84b /compiler/main/SysTools | |
| parent | bf38a20eefcaaaac404a1818c3eff8273dc67dd9 (diff) | |
| download | haskell-29c701c154cafa4844cf3c1bd4a93cacfa6b1ee1.tar.gz | |
Refactor package related code
The package terminology is a bit of a mess. Cabal packages contain
components. Instances of these components when built with some
flags/options/dependencies are called units. Units are registered into
package databases and their metadata are called PackageConfig.
GHC only knows about package databases containing units. It is a sad
mismatch not fixed by this patch (we would have to rename parameters
such as `package-id <unit-id>` which would affect users).
This patch however fixes the following internal names:
- Renames PackageConfig into UnitInfo.
- Rename systemPackageConfig into globalPackageDatabase[Path]
- Rename PkgConfXX into PkgDbXX
- Rename pkgIdMap into unitIdMap
- Rename ModuleToPkgDbAll into ModuleNameProvidersMap
- Rename lookupPackage into lookupUnit
- Add comments on DynFlags package related fields
It also introduces a new `PackageDatabase` datatype instead of
explicitly passing the following tuple: `(FilePath,[PackageConfig])`.
The `pkgDatabase` field in `DynFlags` now contains the unit info for
each unit of each package database exactly as they have been read from
disk. Previously the command-line flag `-distrust-all-packages` would
modify these unit info. Now this flag only affects the "dynamic"
consolidated package state found in `pkgState` field. It makes sense
because `initPackages` could be called first with this
`distrust-all-packages` flag set and then again (using ghc-api) without
and it should work (package databases are not read again from disk when
`initPackages` is called the second time).
Bump haddock submodule
Diffstat (limited to 'compiler/main/SysTools')
| -rw-r--r-- | compiler/main/SysTools/Settings.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/main/SysTools/Settings.hs b/compiler/main/SysTools/Settings.hs index 43682850fd..42763f239a 100644 --- a/compiler/main/SysTools/Settings.hs +++ b/compiler/main/SysTools/Settings.hs @@ -108,7 +108,7 @@ initSettings top_dir = do ldSupportsFilelist <- getBooleanSetting "ld supports filelist" ldIsGnuLd <- getBooleanSetting "ld is GNU ld" - let pkgconfig_path = installed "package.conf.d" + let globalpkgdb_path = installed "package.conf.d" ghc_usage_msg_path = installed "ghc-usage.txt" ghci_usage_msg_path = installed "ghci-usage.txt" @@ -186,7 +186,7 @@ initSettings top_dir = do , fileSettings_ghciUsagePath = ghci_usage_msg_path , fileSettings_toolDir = mtool_dir , fileSettings_topDir = top_dir - , fileSettings_systemPackageConfig = pkgconfig_path + , fileSettings_globalPackageDatabase = globalpkgdb_path } , sToolSettings = ToolSettings |
