Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,860
    • Issues 4,860
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 454
    • Merge requests 454
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #21311
Closed
Open
Created Mar 29, 2022 by Ben Gamari@bgamari🐢Maintainer

Hadrian: Treat package databases as immutable?

The mutable nature of GHC's package database introduces a bit of complexity into Hadrian for two reasons:

  • While ghc-pkg uses file locking to ensure safe concurrent mutation (see #8591 (closed)) on most operating systems, this currently isn't supported on Windows. Consequently, we still need mutual exclusion logic in Hadrian.
  • Mutation introduces impurity into the build system, making caching more difficult

It may be worth considering rather treating package databases as immutable things in Hadrian: instead of registering new packages into the global inplace package database, rather conjure up a new one, ideally with only the packages which the build needs (although sadly Cabal doesn't make this easier). This conjuring could be done in a Shake oracle and therefore benefit from caching.

Edited Mar 29, 2022 by Ben Gamari
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking