• Edward Z. Yang's avatar
    Implement "convenience libraries", fixes #269. · 2040c1c9
    Edward Z. Yang authored
    
    
    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
    
        library foo
    
    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.
    
    There are a few latent bugs in this commit which are fixed
    in later commits in this patchset.  (Those bugfixes required
    a bit of refactoring, so it's clearer if they're not
    with this patch.)
    Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
    2040c1c9
Register.hs 19.3 KB