Skip to content
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

Ability to warn on reexported-modules #10384

Open
parsonsmatt opened this issue Sep 27, 2024 · 0 comments
Open

Ability to warn on reexported-modules #10384

parsonsmatt opened this issue Sep 27, 2024 · 0 comments

Comments

@parsonsmatt
Copy link

Describe the feature request

When declaring reexported-modules in a cabal file, it would be useful to communicate deprecation and relocation notices when that module is imported and only provided by that package.

Additional context

The idea was surfaced by @adamgundry in this comment about relocating the GHC.RTS.Flags module. We want to move the module from base to another package. If we only move the module, then users that depend on base but not ghc-rts-flags will face an unhelpful error message: "Module GHC.RTS.Flags not found." If we re-export the module, then it's still part of the public API of base. This means we can't offer a nice deprecation cycle with messaging on how to fix the resulting issue.

Let's imagine that we do this:

-- old-package.cabal
name: old-package

build-depends: new-package

reexported-modules:
  new-package:MovedModule deprecated:"This module has been removed from old-package and will be available from new-package."

If someone imports MovedModule and it comes from old-package as a re-exported module, then we emit a warning at the import site. If they import MovedModule and they depend on new-package as well, then we don't need to issue the warning.

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

1 participant