-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter all autogen modules #3670
Conversation
Can you please rebase this against master to get rid of the spurious merge commits? Also needs tests, docs, and a line in the changelog. |
&& not (elem (autogenModuleName pkg) (allModuleNamesAutogen pkg)) ) $ | ||
PackageBuildWarning $ | ||
"Packages using 'cabal-version: >= 1.25' and the autogenerated " | ||
++ "module Paths_* must include it also on the 'autoge-modules' field " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/autoge/autogen/
Otherwise LGTM. |
This patch looks good, thank you! I think you can reduce the duplication in Other notes: in a lot of places, the message reads |
@@ -889,6 +889,12 @@ generateCabalFile fileName c = | |||
Executable -> "Modules included in this executable, other than Main.") | |||
True | |||
|
|||
, fieldS "autogen-modules" (listField (otherModules c')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's a need to include this field in the default cabal init
; it's definitely a power-user case.
OK, so let me summarize what I think are the blocking changes for this patchset are:
|
I gave you commit bits! So when you think the PR is ready and doesn't break anything, you can take pushing it to master into your own hands ;) |
3d83c44
to
a00a30c
Compare
Some remarks and questions:
|
Awesome work! The patch is really shaping up. A thought: maybe if you can't find a file in |
783cf64
to
17069ad
Compare
7257174
to
168824f
Compare
Modules that are built automatically at setup, like Paths_PACKAGENAME or others created with a build-type custom, appear on 'other-modules' for the Library, Executable, Test-Suite or Benchmark stanzas or also on 'exposed-modules' for libraries but are not really on the package when distributed. This makes commands like sdist fail because the file is not found, so with this new field modules that appear there are treated the same way as Paths_PACKAGENAME was and there is no need to create complex build hooks. Just add the module names on 'other-modules' and 'exposed-modules' as always and on the new 'autogen-modules' besides.
168824f
to
c010867
Compare
This fixes #3656. From #719 this was already a problem and the idea of creating a new field was also discussed on #1046, so I decided to give it a try
I created a field 'autogen-modules' to list modules that are autogenerated, like Paths_*. This should contain modules that are either on 'exposed-modules' or 'other-modules' so we can filter those when needed