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
  • #20964
Closed
Open
Created Jan 19, 2022 by Sylvain Henry@hsyl20Developer

Add support for static plugins in shared libraries

Motivation

GHC supports two kinds of plugins:

  • loaded plugins: loaded from external packages or from the home unit and setup with command-line flags
  • static plugins: setup arbitrarily via ghc-api

Loaded plugins don't work with cross-compilers (#14335) because GHC only supports a single environment which mixes up target and plugin stuff. Making GHC support two environments (one for plugins and one for target code) instead of a single one is a huge undertaking.

Static plugins can't be setup for a stock GHC program: they need to be setup via ghc-api.

Proposal

Support a third kind of plugins: "external static plugins" (better name suggestions welcome)

Principle: support loading of static plugins via shared libraries.

Users pass to GHC:

  • path to the shared library containing the plugin
  • unit-id
  • module name
  • plugin arguments

With loaded plugins, the path to the shared library containing the plugin and the unit-id are inferred from the module name and from package related command-line flags.

With external static plugins, users pass them explicitly. The advantage is that GHC doesn't have to load any unit info or module interface to load the plugins, bypassing #14335.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking