Skip to content

Conversation

@philderbeast
Copy link
Collaborator

@philderbeast philderbeast commented Jan 5, 2026

Fixes #11389, add documentation to the autogen-modules field and edit the existing explanation and warning.


  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

@philderbeast
Copy link
Collaborator Author

Thanks for the grammar checks @geekosaur.

Copy link
Collaborator

@geekosaur geekosaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should note that the original version of that warning isn't any better, so possibly some research is needed to clarify it.

module files are not found if autogenerated files are not listed in
:pkg-field:`autogen-modules` fields.

:pkg-field:`executable:main-is` modules are not supported on
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm finding this warning a little difficult to follow. Does it intend to say that autogen-modules can't be used with a custom main-is, or that the module in main-is can't be an autogenerated module, or maybe something else?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved that warning from:

https://github.com/haskell/cabal/blame/9ea037b084125ecdd024aad02565b34b9db8316f/doc/cabal-package-description-file.rst#L3039-L3040

I've checked and it looks like there is not a cabal-testsuite test for the main-is warning (whichever way it goes).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I saw the original (see the comment above it, I forgot the actual review summary goes above the review comments). Maybe leave as is for now and open an issue specifically about that warning, since it would be good to say exactly what the problem is instead of something vague and possibly misleading. I've fixed a few such in GHC NOTEs but would need to study the code to see what's up here..

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the original warning turning it into a note and updated the main-is warning turning it into an error.

@philderbeast philderbeast force-pushed the doc/todo-autogenerated-modules branch from aa3ebee to 349154c Compare January 6, 2026 20:44
@philderbeast philderbeast force-pushed the doc/todo-autogenerated-modules branch 2 times, most recently from 1ea10f1 to a9bad34 Compare January 23, 2026 19:33
philderbeast and others added 2 commits January 27, 2026 10:04
- Review changes:
  - Prefer colon over semicolon
  - Need a comma between clauses
  - Need the definite article

Co-Authored-By: brandon s allbery kf8nh <[email protected]>
@philderbeast philderbeast force-pushed the doc/todo-autogenerated-modules branch from 9225ddb to 467c9ec Compare January 27, 2026 15:04
appear twice for a component: once to flag them as being autogenerated in an
:pkg-field:`autogen-modules` field, and again to bring them into the component
with a listing in :pkg-field:`other-modules` or
:pkg-field:`library:exposed-modules`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth noting why the second one is necessary (e.g. Paths_* is autogenerated but often — but not always — needs to be exported for library users)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document the autogen-modules field

2 participants