Missing `autogen-modules` in `.cabal` files
Clarification and motivation
Some *.cabal
files have Paths_*
in other-modules
, but lack them in autogen-modules
. If you try to stack sdist
such package you will get something like:
Checking package 'lorentz' for common mistakes
Package check reported the following warnings:
'ghc-options: -O0' is not needed. Use the --disable-optimization configure flag.
'ghc-options: -O0' is not needed. Use the --disable-optimization configure flag.
Package check reported the following errors:
Packages using 'cabal-version: 2.0' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail.
There is an upstream issue: https://github.com/sol/hpack/issues/303. Ideally it should be handled by hpack
, but currently it is not. They suggest the following workaround:
Hey,
Paths_*
is generated by Cabal, but yes, we want to do something here. For now you can try to add it togenerated-exposed-modules
orgenerated-other-modules
manually as a workaround.
Acceptance criteria
stack sdist
should pass for each package.