haskell / haskell/cabal

Warn if executable and library share same source directory

Open
#5,335 13 comments 1 reaction 0 assignees View on GitHub
cabal-install: cmd/check meta: easy newcomer newcomer: 2-one-file-change type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

I've seen a number of people get confused over this -- in particular that you _can_ share a source-dir, but then the library modules get rebuilt twice, and the executable stanza needs all the deps the library stanza does, even if the executable doesn't use them directly.

The other option would be to allow this, but to build the executable in such a way that the executable .hs files don't "see" the library .hs files they share a directory with, and so the behavior is _as though_ they were in different directories.

Contributor guide

Open the contributing guide

Research direction

Start by tracing Cabal's handling of executable and library stanzas that use the same source directory. Compare the two behaviors described in the issue—warning about the current rebuild and dependency behavior, or isolating executable modules—and confirm the chosen behavior with focused tests; done means the shared-directory case has clear, tested behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.