haskell / haskell/cabal

code-generators documentation is unclear about which GHC options are passed

Open
#9,238 2 comments 1 reaction 0 assignees View on GitHub
documentation re: code-generators
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

The `code-generators` documentation is a bit unclear about which component the options passed to the generation executable are intended to compile.

I performed some investigation and the GHC options which are passed to the code generator are actually the options you need to build the test executable rather than any of the library components.

Therefore I think this limits the utility of this feature as it can't work unless there is a lucky alignment that the same options work for your doctests as would work for your test executable. One case I tried which failed was adding `ghc-options: -XRoleAnnotations` to the library stanza, which caused the doctest to fail with:

```
src/MyLib.hs:16:1: error:
• Illegal role annotation for A;
did you intend to use RoleAnnotations?
• while checking a role annotation for ‘A’
```

This is in contrast to the previous `cabal-docspec` approach which generated a file which contained the options which were used to build the package.

Contributor guide

Open the contributing guide

Research direction

Start by reading the current code-generators documentation and checking how options passed to the generation executable are described. Confirm whether they apply to the test executable rather than library components, and update the documentation so the target component and limitation are explicit.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.