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,870
    • Issues 4,870
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 453
    • Merge requests 453
  • 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
  • #19934
Closed
Open
Created Jun 02, 2021 by Matthew Pickering@mpickeringDeveloper

template-haskell should *not* be added as an implicit dependency

The following program should fail to compile when using -hide-all-packages and not passing -package template-haskell.

{-# LANGUAGE TemplateHaskellQuotes #-}
module T5 where

a = [| () |]
ghc T5.hs -hide-all-packages -package base

When does this cause an issue? If a package only uses TemplateHaskell implicitly then Cabal does not know about the template-haskell dependency so it doesn't make it into the depends: field in the package.conf file. Then there is no guarantee that the template-haskell library will be built or in the search path if you build tool determines it isn't used.

This seems to work with the dynamic linker because it finds the library in the search path but you can imagine a build system which curates a directory to only include dependencies which are going to be needed.

Solution: Make a user explicitly depend on template-haskell if they use TH quotes.

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