Open mpickering opened 1 year ago
Pinging @gbaz, since this looks like a useful feedback for the new and promising code generators feature.
I'd definitely welcome a patch to the documentation to specify this.
Of a mixed mind if we'd want to change the behavior or not -- grabbing options or other settings from a different stanza could be weird (and possibly tricky to implement just from how the code is structured). We could suggest common stanzas or the like as a way to make this easy to do, at least.
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: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.