Skip to content
Snippets Groups Projects
Commit e1699ce6 authored by Hannes Siebenhandl's avatar Hannes Siebenhandl Committed by Daniel Gröber (dxld)
Browse files

Always write build-info, even before building

parent 024c0601
No related branches found
No related tags found
No related merge requests found
...@@ -114,21 +114,9 @@ build pkg_descr lbi flags suffixes = do ...@@ -114,21 +114,9 @@ build pkg_descr lbi flags suffixes = do
internalPackageDB <- createInternalPackageDB verbosity lbi distPref internalPackageDB <- createInternalPackageDB verbosity lbi distPref
(\f -> foldM_ f (installedPkgs lbi) componentsToBuild) $ \index target -> do -- Before the actual building, dump out build-information.
let comp = targetComponent target -- This way, if the actual compilation failed, the options have still been
clbi = targetCLBI target -- dumped.
componentInitialBuildSteps distPref pkg_descr lbi clbi verbosity
let bi = componentBuildInfo comp
progs' = addInternalBuildTools pkg_descr lbi bi (withPrograms lbi)
lbi' = lbi {
withPrograms = progs',
withPackageDB = withPackageDB lbi ++ [internalPackageDB],
installedPkgs = index
}
mb_ipi <- buildComponent verbosity (buildNumJobs flags) pkg_descr
lbi' suffixes comp clbi distPref
return (maybe index (Index.insert `flip` index) mb_ipi)
when shouldDumpBuildInfo $ do when shouldDumpBuildInfo $ do
-- Changing this line might break consumers of the dumped build info. -- Changing this line might break consumers of the dumped build info.
-- Announce changes on mailing lists! -- Announce changes on mailing lists!
...@@ -150,6 +138,22 @@ build pkg_descr lbi flags suffixes = do ...@@ -150,6 +138,22 @@ build pkg_descr lbi flags suffixes = do
exists <- doesFileExist (buildInfoPref distPref) exists <- doesFileExist (buildInfoPref distPref)
when exists $ removeFile (buildInfoPref distPref) when exists $ removeFile (buildInfoPref distPref)
-- Now do the actual building
(\f -> foldM_ f (installedPkgs lbi) componentsToBuild) $ \index target -> do
let comp = targetComponent target
clbi = targetCLBI target
componentInitialBuildSteps distPref pkg_descr lbi clbi verbosity
let bi = componentBuildInfo comp
progs' = addInternalBuildTools pkg_descr lbi bi (withPrograms lbi)
lbi' = lbi {
withPrograms = progs',
withPackageDB = withPackageDB lbi ++ [internalPackageDB],
installedPkgs = index
}
mb_ipi <- buildComponent verbosity (buildNumJobs flags) pkg_descr
lbi' suffixes comp clbi distPref
return (maybe index (Index.insert `flip` index) mb_ipi)
return () return ()
where where
distPref = fromFlag (buildDistPref flags) distPref = fromFlag (buildDistPref flags)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment