-
Notifications
You must be signed in to change notification settings - Fork 84
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
Should we make the happy-*
packages public library components of happy
?
#288
Comments
How well do Since you point out the difference between |
Here are the only packages I could find on Hackage that use
Out of these packages, I found only Its public libraries are By the way, could anyone remind me why we decided to do a package a split at all? Why not have a single library |
Thanks for pointing out the issues wrt.
The reason for the split is that we wanted to be able to publish In light of that, I emphatically agree with you: Let's just have a single, public library component |
FYI, That's not an issue for |
Thanks for pointing that out. Indeed that means there is no real advantage to using multiple library components vs. putting everything into a single library. I think it would be worthwhile to pursue the latter solution then. |
I think we should do this. This purpose of feature is exactly our-case: enforcing modularity between software components that are nonetheless versioned together. If this feature is not working for us, that is a bug that should be supported upstream. Conversely, if folks is afraid of unforeseen consequences and afraid to try it out, that is a serious ecosystem problem (we lack confidence in other groups' investments, and thus everything is going to waste) that should be escalated to the HF. |
Both Hackage and Stackage are mum about these components and their contents:
I think this is a clear evidence that the ecosystem is nowhere ready for public library components. |
If I were you, I'd merge all components into the same Cabal file as internal (non-public) sublibraries. Then add the main library which is just an empty shell re-exporting all modules of internal libraries (
|
Thanks @Bodigrim! That's a very nice compromise that keeps things moving / avoids a Postel's law deadlock, and also avoids foot-guns of incomplete features. Really about as good as we can expect given that Hackage support. |
Hackage (or rather |
@phadej On the flip side, if |
Not quite: Haddock ignores |
@Bodigrim I suppose we can do the same reexporting trick from a public sub-library, and it should still work just as well as a compat shim for anything that doesn't support public sub-libraries but does support private sub-libraries? |
I guess so, yes. But I'd recommend starting conservatively. Bear in mind that shuffling public sublibraries around should be PVP compliant: anytime you change their API or composition, a major version of entire (I'm personally skeptical about public sublibraries in general, they strike me as a wrong design, so take my opinion with a grain of salt) |
Yeah that's a fair point. Really I'd like the executable to versioned separately from all libraries, split or combined, for that same reason. |
Interesting. That seems to be a happy coincidence but still not work properly. I tried having multiple sub-libraries and re-exporting modules from those (then only modules from one sublibrary where in the haddock tarball), or having any module in the main library in addition (then only modules from the main library where in haddock tarball). So, nope, it doesn't work fine even when you re-export modules from your own internal sublibrary. EDIT: there is also https://hackage.haskell.org/package/tar-0.6.3.0/docs/Codec-Archive-Tar-Index-Utils.html which is also shown in search and hoogle output. Not bad, but that's definitely a bug. |
The suggestion of @Bodigrim is indeed incredibly helpful and worthwhile in finding a compromise that all maintainers find agreeable. There is a separate issue of whether we want to couple the versioning of More seriously, while a version bump to 2.0 for In light of that, I would like to propose to have a separate package Edit: I opened PR #297 for the |
Following the merge of #299, I tried multiple times to upload haddocks for the I've meanwhile published a package candidate where I simply So it appears there is a real cost associated with using sublibraries, even if only internal: We compromise on uploaded haddocks. I'm not even sure whether this is an issue of haddock or hackage. |
I'm pretty sure that This also explains why it hasn't been an issue for |
Let's create a haddock issue for this stuff (I guess that's now a GHC issue?) |
Opened here: https://gitlab.haskell.org/ghc/ghc/-/issues/25270 |
And this Cabal issue: haskell/cabal#10368 |
Cabal 3.0 introduced the
library:visibility
field.Should we use it to define the single-library-component
happy-*
packages as "sublibraries"? Depending on such a library is exemplified here: haskell/cabal#9480 (comment). For us it would lead to names such ashappy:tabular
.Defining such public sublibraries is exemplified here: https://github.com/BlockScope/plugins-for-blobs/blob/develop/plugins-for-blobs.cabal. Note the
visibility: public
fields.Pros:
Cons:
Given that
cabal-install
is easily buildable with older GHCshappy
versions will continue to build with ancient GHCs and accept the same .y-file syntax,I don't think requiring Cabal 3.0 is much of a drawback. On the other hand I do see the real costs associated with release management if we stick to one executable package and 5 library packages, all of which need to keep their versions in sync etc.
This decision has potential to lock us in for quite a long time, as
happy-tabular
is a library name (technically a package name which implicitly denotes the default library) thanhappy:tabular
. I would like to have the Go from @int-index, @Ericson2314 and @andreasabel on this.The text was updated successfully, but these errors were encountered: