haskell / haskell/cabal

Warn if the implicit `optional-packages: ./*/*.cabal` default picks up packages

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

Description

Currently, when there's no `cabal.project` file, the implicit defaults for `packages:` and `optional-packages:` are

```
packages: ./*.cabal
optional-packages: ./*/*.cabal
```

However, while the `optional-packages:` default is a convenient zero-config for common multi-package setups it's also a major source of confusion when it magically picks up packages or `.cabal` files which the user didn't intentionally want to be included in the project configuration.

Assuming we want to keep this convenient default, a way to reduce the confusing situation is to warn when

- The implicit default of `optional-packages` is in effect, **and**
- said implicit default matches one or more packages

Contributor guide

Open the contributing guide

Research direction

Start by tracing where the implicit `packages:` and `optional-packages:` defaults are defined and where matched packages are reported. Check existing project-configuration warning tests, if present. Done means a warning appears only when the implicit `optional-packages: ./*/*.cabal` default is active and matches one or more packages.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.