[Hackage] #306: can't figure out how to use data-files

Hackage trac at galois.com
Tue Jun 24 10:29:23 EDT 2008

#306: can't figure out how to use data-files
  Reporter:  claus          |        Owner:      
      Type:  defect         |       Status:  new 
  Priority:  normal         |    Milestone:      
 Component:  Cabal library  |      Version:  HEAD
  Severity:  normal         |     Keywords:      
Difficulty:  normal         |   Ghcversion:  6.9 
  Platform:                 |  
 looking into the docs, `data-files` seem easy. but when i try this:
 -- p.cabal
 name: p
 version: 0
 license: BSD3
 build-depends: base
 build-type: Simple
 exposed-modules: P
 data-files: file
 -- Setup.hs
 import Distribution.Simple
 main = defaultMain
 -- P.hs
 module P(file) where
 import Paths_p
 file = getDataFileName "file"
 -- file
 data here
 installation succeeds, but usage doesn't:
 $ runhaskell Setup.hs --version
 Cabal library version 1.5.1

 $ runhaskell Setup.hs configure --prefix=c:/ghc/libraries
 Configuring p-0...

 $ runhaskell Setup.hs build -v
 Creating dist\build (and its parents)
 Creating dist\build\autogen (and its parents)
 Preprocessing library p-0...
 Building p-0...
 Building library...
 Creating dist\build (and its parents)
 c:\ghc\ghc-6.9.20080514\bin\ghc.exe -package-name p-0 --make -hide-all-
 packages -i -idist\build -i.
 -idist\build\autogen -Idist\build -odir dist\build -hidir dist\build
 -stubdir dist\build -package ba
 se-3.0 -O P
 [1 of 2] Compiling Paths_p          ( dist\build\autogen\Paths_p.hs,
 dist\build\Paths_p.o )
 [2 of 2] Compiling P                ( P.hs, dist\build\P.o )
 c:\ghc\ghc-6.9.20080514\bin\ar.exe q dist\build\libHSp-0.a dist\build\P.o
 c:\ghc\ghc-6.9.20080514\bin\ar.exe: creating dist\build\libHSp-0.a
 c:\ghc\ghc-6.9.20080514\gcc-lib\ld.exe -x -r -o dist\build\HSp-0.o.tmp

 $ runhaskell Setup.hs install
 Installing: c:/ghc/libraries\p-0\ghc-6.9.20080514
 Registering p-0...
 Reading package info from "dist\\installed-pkg-config" ... done.
 Saving old package config file... done.
 Writing new package config file... done.

 $ ghcii.sh
 GHCi, version 6.9.20080514: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer ... linking ... done.
 Loading package base ... linking ... done.
 Prelude> :browse P
 file :: IO FilePath
 Prelude> P.file
 Loading package p-0 ... linking ... <interactive>:
 c:/ghc/libraries\p-0\ghc-6.9.20080514\HSp-0.o: unknown symbol
 ghc.exe: unable to load package `p-0'
 Prelude> :set -package p
 package flags have changed, ressetting and loading new packages...
 Loading package p-0 ... linking ... ghc.exe:
 c:/ghc/libraries\p-0\ghc-6.9.20080514\HSp-0.o: unknown symbol
 ghc.exe: unable to load package `p-0'
 what am i doing wrong?

Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/306>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects

More information about the cabal-devel mailing list