Define BuildTarget in new BuildTarget.Types module
This change means that we can refer to BuildTarget in Cabal error constructors. (Attempting to do so before this change would cause cyclic imports.)
Sub component targets had never been implemented and that is mostly dead-code. I think we should consider removing this feature, including from cabal-install. I had PR that did that but it got bitrotten by the advent of fourmolu.
Sub component targets had never been implemented and that is mostly dead-code. I think we should consider removing this feature, including from cabal-install. I had PR that did that but it got bitrotten by the advent of fourmolu.
Ah yes, I see, that was #8966.
I'm not sure we will end up needing the changes in this PR in the end, so I'm happy to park it for the time being.
I think this refactor still makes sense, but nothing important depends on it right now.