hadrian
hadrian copied to clipboard
Rework `Package` to reflect structure of Cabal packages
The Package
type currently doesn't really reflect the actual structure of Cabal packages. In particular PackageType
forces a package to be either a Library
or a Program
whereas Cabal packages may be both. This works now but may become problematic in the future. Moreover, this requires that one explicitly define the type of each package in the build system.
One alternative would involve teaching ghc-cabal
to emit more details about the components offered by the package, allowing us to read this information from package-data.mk
.
Wouldn't this relate to #18?
@angerman No, this is separate. It's not clear how soon we want this. The build system can operate successfully without this, so I think we better not assign a milestone to this issue. As soon as someone presents a clean solution we'll merge this.
Ohh. I'm sorry!
No problem. Maybe @bgamari will pick this up once he gets some more spare time to hack on this project.
Is this still relevant? What is the consequence of identifying cabal
as a Library
only?
@izgzhen Yes, it is still relevant, but low priority. At the moment Hadrian will not be able to properly cope with a package that is both a library and, say, a utility.
@hvr mentionned to me that he may need support for this soon and is looking into ways to have the make build system accept that. We might want to start discussing how we would achieve this ourselves, in Hadrian land :)
@alpmestan Aha, interesting! I think it shouldn't be very difficult to support in Hadrian. If this becomes a priority, I'm happy to have a look at it.
Which package is this going to be?
@hvr will hopefully jump in this thread at some point, but if I remember correctly, he was interested in simplifying the way we build haddock, through this.