package treating

Serge D. Mechveliani mechvel at botik.ru
Wed Oct 22 13:36:06 EDT 2003


On Tue, Oct 21, 2003 at 02:03:03PM +0100, Simon Marlow wrote:
>  
> > I presumed that, as the                   ghci  
> > command loads all usable libraries, then
> > 
> >         ghci -package-conf myPackage.conf -package myPackage
> > 
> > will load   all that `ghci' loads  +
> >             what is specified in  myPackage.conf.
> > 
> > But, probably, this is not (should not be?) so: the option
> > 
> >      -package-conf myPackage.conf 
> > 
> > fully replaces the configuration, and the package search is done 
> > only according to what is specified in  
> >                                        myPackage.conf
> > , right?


> No, packages are loaded on a demand-driven basis.  Packages must have
> correct dependencies specified, so that GHC can ensure that they are
> loaded in dependency order.  The -package-conf flag does not cause the
> configuration to be "fully replaced".


It is hard to understand how do they work.  
In my real practice, the project creates a package  docon
which refers to the  .a, .o  libraries in  $(e)/  that are build
earlier by `making' the project 
(.o library appears a bit later, at the stage of creating the 
package by  ghc-pkg ... -u -g
).
The project imports and re-exports 
                        Data.FiniteMap,  (maybe, Data.Set,)
                        and all the Standard library modules.

The package should work both as  ghci $dOpts  UserModule
and as                           ghc  $dOpts  --make UserModule
with
                   dOpts =  -package-conf docon.conf -package docon

Now, does the package 

  Package {name            = "docon",
           import_dirs     = ["$(e)"],
           source_dirs     = [],    
           library_dirs    = ["$(e)"],
           hs_libraries    = ["HSdocon"],
           extra_libraries = [], 
           include_dirs    = [], 
           c_includes      = [], 
           package_deps    = ["data"],
           extra_ghc_opts  = [$(extraPackageOpts)],
           extra_cc_opts   = [], 
           extra_ld_opts   = [] 
          }
  e                = .../source/export
  extraPackageOpts = such and such complier flags


specify of what it is intended? 
In particular, what should be  package_deps = [ ?? ] 
?

Thank you in advance for the advice,

-----------------
Serge Mechveliani
mechvel at botik.ru





More information about the Glasgow-haskell-users mailing list