hadrian icon indicating copy to clipboard operation
hadrian copied to clipboard

Rework `Package` to reflect structure of Cabal packages

Open bgamari opened this issue 8 years ago • 9 comments

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.

bgamari avatar Dec 20 '15 20:12 bgamari

Wouldn't this relate to #18?

angerman avatar Jan 12 '16 01:01 angerman

@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.

snowleopard avatar Jan 12 '16 01:01 snowleopard

Ohh. I'm sorry!

angerman avatar Jan 12 '16 01:01 angerman

No problem. Maybe @bgamari will pick this up once he gets some more spare time to hack on this project.

snowleopard avatar Jan 12 '16 02:01 snowleopard

Is this still relevant? What is the consequence of identifying cabal as a Library only?

izgzhen avatar May 05 '18 12:05 izgzhen

@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.

snowleopard avatar May 05 '18 12:05 snowleopard

@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 avatar May 05 '18 13:05 alpmestan

@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?

snowleopard avatar May 05 '18 14:05 snowleopard

@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.

alpmestan avatar May 05 '18 16:05 alpmestan