Skip to content

Add support for -fplugin-package #6169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
phadej opened this issue Jul 31, 2019 · 2 comments
Open

Add support for -fplugin-package #6169

phadej opened this issue Jul 31, 2019 · 2 comments

Comments

@phadej
Copy link
Collaborator

phadej commented Jul 31, 2019

https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/extending_ghc.html#ghc-flag--plugin-package%20%E2%9F%A8pkg%E2%9F%A9

Unlike -package ⟨pkg⟩, this option does NOT cause package ⟨pkg⟩ to be linked into the resulting executable or shared object.

@tkvogt
Copy link

tkvogt commented Oct 17, 2019

If I remember it correctly, a compiler plugin has to be installed in the global package db.
This unfortunately doesn't work:
sudo -S "PATH=$PATH" /opt/ghc/bin/cabal v1-install --ghc-options="-package-db=/opt/ghc/8.8.1/lib/ghc-8.8.1/package.conf.d"
But how to fix this? What about using the category-field in the cabal file and when it says "compiler plugin" then "cabal install" should automatically install in the global package db. All the old plugins would work again without having to invent a new option to "cabal install": https://hackage.haskell.org/packages/#cat:Compiler%20Plugin

@coot
Copy link
Collaborator

coot commented Mar 1, 2020

It would be nice to support -fplugin-package in such a way that one can specify it in cabal.project.local file. My use case is a parser plugin which does not modify the parsed tree but extracts tags information from it. For this kind of plugins one does not want to add a dependency in a *.cabal file.

Currently if I add:

package mypackage
  ghc-options: -plugin-package ghctags -fplugin=Plugin.GhcTags

source-repository-package
  type: git
  location: /home/coot/repos/haskell/ghctags
  tag: 63ef002ae3383050febcb207d7709ecdf47d2a2b
  subdir: .

without modifying bulid-depends I get the following error:

<command line>: cannot satisfy -package ghctags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants