-
Notifications
You must be signed in to change notification settings - Fork 696
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
LocalBuildInfo should change at build time when components are selected #2910
Comments
Hello @enolan, do you have suggested interface for being able to check if components are being built? |
Hi Edward. My plan was to move the call to buildingExecutable :: LocalBuildInfo -> Bool
buildingExecutable lbi = any isCabalExe $ componentsConfigs lbi
where isCabalExe (cname, _, _) = cname == CExeName "cabal" |
OK, some thoughts:
|
Yes, that makes sense. So we should either change the hooks to take an additional argument of |
Changing the hooks will break existing hooks in two ways: (1) they won't typecheck anymore, and (2) they'll get run multiple times but most users expect their hooks to run once. I'd add some new hooks. |
You can specify which components to build like this:
runhaskell Setup.hs build my-testsuite
. But sinceLocalBuildInfo
is generated at configure time, thecomponentsConfigs
field list every component that was enabled then. This means you can't check whether certain components are being built.I ran into this trying to update my PR #2844.
cabal-install
'sSetup.hs
builds the manpage in apostBuild
hook. If we're haven't builtcabal
yet anddist/build/cabal
doesn't exist, then theopenFile
call to writedist/build/cabal/cabal.1
will fail. We need to only try to make the manpage when building the executable component but it's impossible to find out at this stage.The text was updated successfully, but these errors were encountered: