All dependencies of packages must be explicitly listed when defining flavour packages
In the Hadrian user guide, it explains that you can use the packages
variable in order to describe what is built. However, unless you list all the dependencies of what you want to build also in packages
then it will fail to build.
For example, if I want to just build ghctags
then I might try to modify packages
to
ghcTagsPackages stage = case stage of
Stage2 -> [ghcTags]
_ -> []
but this will fail as I haven't listed any dependencies of ghcTags
at all.
The culprit here is the contextDependencies
function.
contextDependencies :: Context -> Action [Context]
contextDependencies Context {..} = do
depPkgs <- go [package]
return [ Context depStage pkg way | pkg <- depPkgs, pkg /= package ]
where
depStage = min stage Stage1
go pkgs = do
deps <- concatMapM step pkgs
let newPkgs = nubOrd $ sort (deps ++ pkgs)
if pkgs == newPkgs then return pkgs else go newPkgs
step pkg = do
deps <- pkgDependencies pkg
active <- sort <$> stagePackages depStage
return $ intersectOrd (compare . pkgName) active deps
Notice in the definition of step
, the actual package dependencies are intersected with stagePackages
.
It is also unclear to me why this function is defined recursively as surely when we need
one dependency, that will in turn need
its dependencies and so on.
Trac metadata
Trac field | Value |
---|---|
Version | 8.6.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Build System (Hadrian) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | alpmestan, snowleopard |
Operating system | |
Architecture |