haskell / haskell/cabal

LocalBuildInfo should change at build time when components are selected

Open
#2,910 5 comments 0 reactions 0 assignees View on GitHub
Cabal: hooks Cabal: other
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

You can specify which components to build like this: `runhaskell Setup.hs build my-testsuite`. But since `LocalBuildInfo` is generated at configure time, the `componentsConfigs` 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`'s `Setup.hs` builds the manpage in a `postBuild` hook. If we're haven't built `cabal` yet and `dist/build/cabal` doesn't exist, then the `openFile` call to write `dist/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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.