Ticket #5 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

lhc looks for package.conf in /usr/lib

Reported by: daniel.is.fischer@… Owned by: somebody
Priority: major Milestone:
Component: component1 Version:
Keywords: package.conf global user Cc: daniel.is.fischer@…
Test Case:

Description

Trying to install the base package for lhc-0.6 failed because lhc tried to open the package.conf file in /usr/lib, although it is installed in my home directory, so the global package.conf should be in ~/lib/lhc-0.6:

dafis@linux:~/lhc/lhc/lib/base> cabal --version
cabal-install version 0.6.0
using version 1.7.0 of the Cabal library

dafis@linux:~/lhc/lhc/lib/base> cabal install --help | more
Usage: cabal install [FLAGS]
   or: cabal install [PACKAGES]

Flags for install:
 -h --help                         Show this help text
 -v --verbose[=n]                  Control verbosity (n is 0--3, default
                                   verbosity level is 1)
    --builddir=DIR                 The directory where Cabal puts generated
                                   build files (default dist)
 -g --ghc                          compile with GHC
    --nhc98                        compile with NHC
    --jhc                          compile with JHC
    --lhc                          compile with LHC

dafis@linux:~/lhc/lhc/lib/base> cabal install --lhc --verbose=3
searching for ghc in path.
found ghc at /home/dafis/bin/ghc
("/home/dafis/bin/ghc",["--numeric-version"])
/home/dafis/bin/ghc is version 6.8.3
looking for package tool: ghc-pkg near compiler in /home/dafis/bin
found package tool in /home/dafis/bin/ghc-pkg
("/home/dafis/bin/ghc-pkg",["--version"])
/home/dafis/bin/ghc-pkg is version 6.8.3
("/home/dafis/bin/ghc",["--supported-languages"])
searching for lhc in path.
found lhc at /home/dafis/.cabal/bin/lhc
("/home/dafis/.cabal/bin/lhc",["--version"])
/home/dafis/.cabal/bin/lhc is version 0.6
Reading installed packages...
("/home/dafis/bin/ghc-pkg",["--global-conf=/usr/lib/lhc-0.6/package.conf","--package-conf=/home/dafis/.lhc/0.6/package.conf","list"])
cabal: /usr/lib/lhc-0.6/package.conf: openFile: does not exist (No such file or directory)

Perhaps it is noteworthy that ~/.lhc was not yet created.

Change History

Changed 6 years ago by daniel.is.fischer@…

I think the fault lies with Cabal, in Distribution.Simple.LHC

getLhcLibDirsFromVersion :: Maybe Version -> IO (String, String)
getLhcLibDirsFromVersion (Just (Version (x:y:_) tags))
    = do let v = Version [x,y] tags
         app <- getAppUserDataDirectory "lhc"
         return ("/usr/lib/lhc-"++display v,app ++ "/"++display v)
getLhcLibDirsFromVersion _
    = return ("","")

the path is hardcoded.

Changed 6 years ago by daniel.is.fischer@…

  • status changed from new to closed
  • resolution set to fixed

Yup, that was it. I hacked a quick'n'dirty fix to Cabal and managed to build base for lhc.

Note: See TracTickets for help on using tickets.