#3268: implement the Cabal ${pkgroot} spec extension
---------------------------------+------------------------------------------
    Reporter:  duncan            |        Owner:              
        Type:  feature request   |       Status:  new         
    Priority:  normal            |    Milestone:  7.2.1       
   Component:  Package system    |      Version:  6.10.2      
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:  Unknown     
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------

Comment(by duncan):

 Replying to [comment:2 duncan]:

 > >  * for `ghc-pkg dump`, we prefix each batch of packages with the
 `pkgroot` value
 > >    (choosing some suitable syntax)
 >
 > Yes. Some suitable syntax we've not yet chosen :-)

 I've decided that the simplest thing to do is to just have it as an extra
 field:
 {{{
 pkgroot: /the/path/that/is/the/pkgroot
 }}}

 So this field may be in the output, but never in the input (if it is it's
 ignored like all other unknown fields).

 There are two cases:

  * `--expand-vars`: in this case `ghc-pkg dump`/`describe` will expand the
 `${pkgroot}` and `${pkgrooturl}` vars and will not generate the `pkgroot`
 field.
  * `--no-expand-vars`: in this case `ghc-pkg dump`/`describe` will not
 expand the `${pkgroot}` var, so it will appear literally in the output and
 the `pkgroot` field will be generated so that tools know what value to use
 for the `${pkgroot}`.

 The defaults are:
  * `ghc-pkg dump` uses `--no-expand-vars` by default, but this can be
 reversed with `--expand-vars`
  * `ghc-pkg describe` uses `--expand-vars` by default, but this can be
 reversed with `--no-expand-vars`

 (Alternatively could be more explicit and say `-(no-)expand-pkgroot`.)

 Sound sane?

 None of this applies to hugs/nhc style file databases because there tools
 always know exactly what the pkgroot is, as it's just the dir containing
 the file they read. Because `ghc-pkg` has a looser connection between the
 package info and the locations they come from then we need this (or a
 similar) extra mechanism.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3268#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to