[Haskell-cafe] Re: Cabal: defaultMainNoRead and source file location

Mauricio briqueabraque at yahoo.com
Mon Dec 8 15:18:50 EST 2008


 > (...)  The reason why  I'm asking  is that  I've just  created a
 > Setup.hs with  'defaultMainNoRead', and 'Setup  build' complains
 > it can't find  A.B.C. When I copy (move  doesn't work) C.hs from
 > <src_dir>/A/B   to  <src_dir>/A.B.C.hs,  it   doesn't  complain,
 > although it fails to generate my library saying:

I'm changing to normal defaultMain, but just in case someone wants
to  check the  problem I'm  appending a  'darcs whatsnew'  over an
empty repo.

Is this  the right place to report  that? Does Distribution.Simple
or cabal have a bug tracking of its own?

Best,
Maurício


addfile ./Setup.hs
hunk ./Setup.hs 1
+#!/usr/bin/env runhaskell
+
+module  Main (main)  where {  import Distribution.Simple  ; import
+Distribution.PackageDescription  ;  import Distribution.ModuleName
+hiding ( main ) ; import Distribution.PackageDescription.Check ;
+
+ main = defaultMainNoRead pkg ;
+
+ pkg :: PackageDescription ;
+
+ oneLineSynopsis =
+  "bla ble bli" ;
+
+ longDescription = "\
+  \blabla bleble blibli\
+  \" ;
+
+ modules = map simple [ "A.B.C" ] ;
+
+ pkg  = emptyPackageDescription  {
+      package  =  PackageIdentifier {
+               pkgName   =  PackageName   "abc"   ,
+               pkgVersion   =  Version   {
+                            versionBranch  = [0]  ,
+                            versionTags  = [  "" ]
+               }
+      }  ,
+      license = PublicDomain ,
+      maintainer =  "Me" ,
+      author  = "Me" ,
+      synopsis = oneLineSynopsis  ,
+      description =  longDescription  ,
+      category  = "any"  ,
+      buildDepends = [ Dependency ( PackageName "base" ) AnyVersion ] ,
+      descCabalVersion  = orLaterVersion  $ Version  {
+                        versionBranch = [ 1 , 2 ] ,
+                        versionTags = [ "" ]
+      } ,
+      buildType = Just Custom ,
+      library = Just ( Library {
+              exposedModules = modules ,
+              libExposed  =   True  ,
+              libBuildInfo  =   emptyBuildInfo  {
+                            hsSourceDirs = [ "./src" ] ,
+                            extensions = [ ]
+              }
+       } )
+ }
+
+}
adddir ./src
adddir ./src/A
addfile ./src/A.B.C.hs
hunk ./src/A.B.C.hs 1
+module A.B.C where {
+
+ a = "asdf" ;
+
+ b = "qwer" ;
+
+ c = "zxcv"
+
+}
adddir ./src/A/B
addfile ./src/A/B/C.hs
hunk ./src/A/B/C.hs 1
+module A.B.C where {
+
+ a = "asdf" ;
+
+ b = "qwer" ;
+
+ c = "zxcv"
+
+}



More information about the Haskell-Cafe mailing list