[GHC] #1770: GHCi should know about itself, so that .ghci can be portable

GHC trac at galois.com
Tue Nov 6 11:09:14 EST 2007


#1770: GHCi should know about itself, so that .ghci can be portable
-----------------------------+----------------------------------------------
 Reporter:  guest            |          Owner:             
     Type:  feature request  |         Status:  new        
 Priority:  normal           |      Milestone:  6.10 branch
Component:  GHCi             |        Version:  6.6.1      
 Severity:  normal           |     Resolution:             
 Keywords:                   |     Difficulty:  Unknown    
 Testcase:                   |   Architecture:  Unknown    
       Os:  Unknown          |  
-----------------------------+----------------------------------------------
Comment (by guest):

 nice one, thanks!-) i knew about `System.Info`, but only for os-related
 information, not for compiler-related stuff. since none of the 100 or so
 downloaders of my `.ghci` file mentioned this to me, i guess i'm not the
 only one in the dark?

 ok, that changes the picture slightly: versioned command definitions for
 ghci are still a bit tricky, but possible. if we leave advanced things
 like `has` and `exists` for later, that leaves us with `docdir`, `libdir`,
 and `info`.

 the `System.Info` has the problem that it tells me what, but not where,
 about the compiler. one might either extend it with a compiler-specific
 `compilerinfo`, from which one could then extract the details directly, or
 one might extend it with a `compilerPath`, so that one could ask the
 compiler for more details.

 unfortunately, either option suffers from issues with relocated ghc
 installs. is there any reliable way for a ghc-compiled program to get the
 path of the ghc that compiles it?

 this is no longer really ghci-specific, eg, users of the ghc api need to
 find a suitable value for topdir, which could be extracted from
 `{compilerPath} --print-libdir`.

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


More information about the Glasgow-haskell-bugs mailing list