-
Notifications
You must be signed in to change notification settings - Fork 710
Call writeAutogenFiles in configure #6441
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
Conversation
I fill uneasy by this. What So I'd assume that I think we should not move generation of If there's some problem to be solved, it should take into account the preprocessors. EDIT: if we need a separate step to call preprocessors, then we should add one. |
I share your uneasienss, since I myself do not understand the big image. |
One idea is to generate EDIT: good opportunity to revisit what all the |
maybe, as a first step of a more integral solution like the suggested one by @phadej could be activate the generation of files with a flag (the next step?) so |
I don't disagree: most functionality of And the information is a bit like producing |
... however. So I would leave configure :: (GenericPackageDescription, HookedBuildInfo)
-> ConfigFlags -> IO LocalBuildInfo as is, and consider generation of |
We never followed this idea, so closing |
Please include the following checklist in your PR:
[ci skip]
is used to avoid triggering the build bots.Please also shortly describe how you tested your change. Bonus points for added tests!
Aims to fix #2209. Generates
Paths_*.hs
andcabal_macros.h
in configure phase.We do that by moving the function
writeAutogenFiles
into theConfigure.hs
file and generating the files after theLocalBuildInfo
has been created.This PR has only been manually tested. Deleted
dist-newstyle
in a project.Then made sure that
cabal build --only-configure
generates bothPaths_*.hs
andcabal_macros.h
.Roughly, the following tree was generated:
`dist-newstyle` after `cabal build --only-configure`
Afterwards, we executed
cabal build
and dist-newstyle had the following structure:`dist-newstyle` after `cabal build --only-configure` followed by `cabal build`
In comparison, the dist-newstyle is identical when
cabal build
is invoked directly without invokingcabal build --only-configure
first.I was unable to prove that the
configure
function inCabal
is actually called bycabal v2-build
, therefore we still call the functionwriteAutogenFiles
transitively inbuild
.Ifconfigure
is called bycabal v2-build
then we could omit this call.EDIT: removing the call to
writeAutogenFiles
inbuild
seems to work as expected.cc @jneira