Cabal: defaultMainNoRead and source file location

Hi,
I've just seen this from Distribution.ModuleName (ghc 6.10):
toFilePath $ ( simple "A.B.C" )
to which ghci answers: "A.B.C".
Shouldn't it say "A/B/C"? 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

(...) 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
/A/B to /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" + +}

On Mon, 2008-12-08 at 14:49 -0200, Mauricio wrote:
Hi,
I've just seen this from Distribution.ModuleName (ghc 6.10):
toFilePath $ ( simple "A.B.C" )
to which ghci answers: "A.B.C".
Shouldn't it say "A/B/C"?
You're using it wrong. A 'simple' module name should have no '.' in it. Instead use Distribution.Text.simpleParse "A.B.C". I'll change the assertion into a check that runs every time and add another function to construct module names from a list, and check. Duncan
participants (2)
-
Duncan Coutts
-
Mauricio