Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,260
    • Issues 4,260
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 398
    • Merge Requests 398
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #16072

Closed
Open
Opened Dec 19, 2018 by Matthew Pickering@mpickeringDeveloper

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
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#16072