Commit 26c67025 authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

A few cleanups and minor things

Add a clarification in packageTemplateEnv

Improve the pre-processing message so we can see which unit is being
built, not just the source component name.

Debug output while building to print out the installed package info
when we register information.

Remove a done TODO about making sure the installed package registration
files do not clash with each other, by including the full UnitId. This
did not need any code changes here since dislaying the UnitId does the
right thing.
parent 9e59b862
......@@ -224,6 +224,7 @@ buildComponent verbosity numJobs pkg_descr lbi suffixes
installedPkgInfo = inplaceInstalledPackageInfo pwd distPref pkg_descr
(mkAbiHash "") lib' lbi clbi
debug verbosity $ "Registering inplace:\n" ++ (IPI.showInstalledPackageInfo installedPkgInfo)
registerPackage verbosity (compiler lbi) (withPrograms lbi) HcPkg.MultiInstance
(withPackageDB lbi) installedPkgInfo
......
......@@ -402,10 +402,12 @@ initialPathTemplateEnv pkgId libname compiler platform =
++ abiTemplateEnv compiler platform
packageTemplateEnv :: PackageIdentifier -> UnitId -> PathTemplateEnv
packageTemplateEnv pkgId libname =
packageTemplateEnv pkgId uid =
[(PkgNameVar, PathTemplate [Ordinary $ display (packageName pkgId)])
,(PkgVerVar, PathTemplate [Ordinary $ display (packageVersion pkgId)])
,(LibNameVar, PathTemplate [Ordinary $ display libname])
-- Invariant: uid is actually a HashedUnitId. Hard to enforce because
-- it's an API change.
,(LibNameVar, PathTemplate [Ordinary $ display uid])
,(PkgIdVar, PathTemplate [Ordinary $ display pkgId])
]
......
......@@ -151,7 +151,9 @@ preprocessComponent pd comp lbi clbi isSrcDist verbosity handlers = case comp of
(CLib lib@Library{ libBuildInfo = bi }) -> do
let dirs = hsSourceDirs bi ++ [autogenComponentModulesDir lbi clbi
,autogenPackageModulesDir lbi]
setupMessage verbosity "Preprocessing library" (packageId pd)
extra | componentIsPublic clbi = ""
| otherwise = " '" ++ display (componentUnitId clbi) ++ "' for"
setupMessage verbosity ("Preprocessing library" ++ extra) (packageId pd)
for_ (map ModuleName.toFilePath $ allLibModules lib clbi) $
pre dirs (componentBuildDir lbi clbi) (localHandlers bi)
(CExe exe@Executable { buildInfo = bi, exeName = nm }) -> do
......
......@@ -199,7 +199,6 @@ registerAll pkg lbi regFlags ipis
where ys = take m xs
number i = lpad (length (show num_ipis)) (show i)
for_ (zip ([1..] :: [Int]) ipis) $ \(i, installedPkgInfo) ->
-- TODO: This will need a hashUnitId when Backpack comes.
writeUTF8File (regFile </> (number i ++ "-" ++ display (IPI.installedUnitId installedPkgInfo)))
(IPI.showInstalledPackageInfo installedPkgInfo)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment