-
Notifications
You must be signed in to change notification settings - Fork 697
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
Convenience libraries #3022
Convenience libraries #3022
Conversation
a2ae14b
to
735d7cb
Compare
In principle this is a great feature. From brief discussion we think not installing the convenience library when it's not needed is a good improvement, and we can determine exactly when it's needed or not so no user visible flag is needed. |
For other people reviewing this: the important point is that these libs are not available for other packages to depend on, so it's still the case that one package provides at most one library. And the installed package id for private libs is picked such that it can never clash with primary public libs from any other package. |
735d7cb
to
cee286b
Compare
@ezyang Do you want this to go into 1.24? Otherwise I think I'll postpone merging this PR until the 1.24 branch is created. |
Yeah, I'm fine with postponing this after 1.24. |
Found a bug: internal libraries and the main libraries all get installed to the same directory. |
cee286b
to
0ecdcea
Compare
So, I fixed all those bugs, and along the way also fixed #1893 and also did a bit of refactoring. The patchset got longer but these are all self-contained commits. |
0ecdcea
to
2c3f3ca
Compare
be5222b
to
590f505
Compare
d66990d
to
20584e7
Compare
Blah, I broke |
9a0936c
to
2389f80
Compare
(NB: this branch has been rebased on top of #3047) |
2389f80
to
10b5140
Compare
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
This test-case was lifted straight from the Cabal manual. It also tests if buildinfo is handled correctly. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
36106ae
to
40d6f0a
Compare
I meant the TODOs you mentioned in the top comment, i.e. docs, a change to the solver and the "installable" flag. Though I see that docs have now been added. |
Great. |
Implement "convenience libraries", fixes #269.
Convenience libraries are package-private libraries
that can be used as part of executables, libraries, etc
without being exposed to the external world. Private
libraries are signified using the
stanza. Within a Cabal package, the name convenience library
shadows the conventional meaning of package name in
build-depends, so that references to "foo" do not indicate
foo in Hackage, but the convenience library defined in the
same package. (So, don't shadow Hackage packages!)
This commit implements convenience libraries such that they
ARE installed the package database (this prevents us from
having to special case dynamically linked executables);
in GHC 7.10 and later they are installed under the same
package name as the package that contained them, but have
a distinct "component ID" (one pay off of making the distinction
between component IDs and installed package IDs.)
There is a "default" library which is identified by the fact
that its library name coincides with the package name. There
are some new convenience functions to permit referencing this.
TODO: if we REALLY don't want to install a convenience library,
we could add a "installable:" flag which toggles whether or
not copy/register should install it. Extra sanity checking
is necessary in this case.
TODO: docs
TODO: cabal-install must ignore convenience libraries when
dep solving
NB: there are a few extra commits in this PR which should be split into their own PRs. Annoying to do slightly.
Signed-off-by: Edward Z. Yang ezyang@cs.stanford.edu