Skip to content

Support -hide-all-plugin-packages/-plugin-package-id.#11

Merged
christiaanb merged 1 commit intoclash-lang:masterfrom
judah:plugin-package-id
Jan 16, 2020
Merged

Support -hide-all-plugin-packages/-plugin-package-id.#11
christiaanb merged 1 commit intoclash-lang:masterfrom
judah:plugin-package-id

Conversation

@judah
Copy link
Copy Markdown
Contributor

@judah judah commented Jan 16, 2020

Our Bazel-based build system sets those flags to distinguish between regular
dependencies and plugins:
https://downloads.haskell.org/ghc/latest/docs/html/users_guide/packages.html#ghc-flag--hide-all-packages

When a package is exposed via -plugin-package-id, its modules must be found
explicitly as plugins via Finder.findPluginModule. I saw that function
available as far back as ghc-8.0, so I changed the relevant codepath and left
__GLASGOW_HASKELL__ < 711 alone.

In the new implementation, lookupModule's package name parameter
is not used anymore. I left it alone for now for (a) backwards compatibility
with older GHC, and (b) to avoid breaking users downstream.

I also tested this change with Cabal (which doesn't set -hide-all-plugin-packages,
and it worked with the tests for ghc-typelits-extra and ghc-typelits-knownnat.

Our Bazel-based build system sets those flags to distinguish between regular
dependencies and plugins:
https://downloads.haskell.org/ghc/latest/docs/html/users_guide/packages.html#ghc-flag--hide-all-packages

When a package is exposed via `-plugin-package-id`, its modules must be found
explicitly as plugins via `Finder.findPluginModule`.  I saw that function
available as far back as ghc-8.0, so I changed the relevant codepath and left
`__GLASGOW_HASKELL__ < 711` alone.

In the new implementation, `lookupModule`'s package name parameter
is not used anymore.  I left it alone for now for (a) backwards compatibility
with older GHC, and (b) to avoid breaking users downstream.

I also tested this change with Cabal (which *doesn't* set `-hide-all-plugin-packages`,
and it worked with the tests for `ghc-typelits-extra` and `ghc-typelits-knownnat`.
@christiaanb christiaanb merged commit 6f5691b into clash-lang:master Jan 16, 2020
@christiaanb
Copy link
Copy Markdown
Member

Thanks!

@judah judah deleted the plugin-package-id branch January 16, 2020 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants