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,868
    • Issues 4,868
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 456
    • Merge requests 456
  • 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
  • #18503
Closed
Open
Created Jul 27, 2020 by Josh Meredith@JoshMeredith🇦🇺Developer

Plugins should be able to write data to extensible interface fields during the pipeline

Motivation

Implemented in !3758

Currently, extensible interface files (https://gitlab.haskell.org/ghc/ghc/-/wikis/Extensible-Interface-Files) are able to either have fields added by GHC itself, or by users of the GHC API - but the latter case only allows this to be done after the .hi exists on disk.

These extensible fields are significantly more useful if plugins are also able to add data to the interface while the pipeline is still in progress.

Proposal

Add functions for plugins to write to a set of interface fields that will be later written to the disk, alongside the rest of the interface file:

  • registerInterfaceData :: Binary a => FieldName -> HscEnv -> a -> IO ()
  • registerInterfaceDataWith :: FieldName -> HscEnv -> (BinHandle -> IO ()) -> IO ()
  • unregisterInterfaceData :: FieldName -> HscEnv -> IO ()

Note that Binary and BinHandle are from GHC's internal binary implementation.

These data are then stored serialised in an IORef within the HscEnv and written with the ModIface.

Edited Jul 27, 2020 by Josh Meredith
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking