haskell / haskell/cabal

Would it make sense to add a way to disable -hide-all-packages?

Open
#2,299 2 comments 0 reactions 0 assignees View on GitHub
old-milestone: ⊥ type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

Every now and then people ask why they have to explicitly add `build-deps` to their `.cabal` file in Leksah (or why they need a `.cabal` file at all when `ghc --make` works just fine). We have a feature in Leksah that adds missing build dependancies based on the ghc error message (just press Ctrl+R). But this is not a perfect solution:
- The build dependencies are not removed when they are no longer needed (and people who a brainstorming do not want to have lots of cleanup to do).
- We can't easily create a temporary `.cabal` file for people who have a `.hs` file that works fine with `ghc --make`.

I wonder if it would be possible to allow the user to suppress -hide-all-packages by adding `build-deps: *` or something to the `.cabal` file.

To keep the world safe `build-deps: *` would also:
- Disable `cabal copy`, `cabal register` and `cabal install` (`cabal install --dependencies-only` should still work, but would only install the packages that are actually listed in `build-deps`).
- Cause `cabal check` to have a fit (or better yet list the missing `build-deps`).
- Be unsupported in Hackage uploads.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.