
I'm sorry because this is a very elementary question but despite my attempts I can't seem to get cabal working for my project structure. I have two main source directories: src\haskell src\semanticdb Inside src\haskell I have main.hs with the module Main. Inside src\semanticdb I have semanticdb.hs with module OSIX.SemanticDB My cabal file contains the following 3 lines: main-is: main.hs hs-source-dirs: src/haskell src/semanticdb other-modules: OSIX.SemanticDB Then when I build with 'cabal build' I get the following error: cabal: can't find source for OSIX.SemanticDB in src/haskell, src/semanticdb, dist/build/autogen cabal --version gives: cabal-install version 0.6.4 using version 1.6.0.3 of the Cabal library I'd prefer to keep my directory structure as is if possible, but it doesn't seem to be working for me... Is there anything I can do or should I just restructure the directories? (NOTE: I'm using leksah as my IDE, so the cabal file is mostly generated automatically) Thanks, -Rehno

Am Mittwoch 03 März 2010 19:57:13 schrieb Rehno Lindeque:
I'm sorry because this is a very elementary question but despite my attempts I can't seem to get cabal working for my project structure.
I have two main source directories: src\haskell src\semanticdb
Inside src\haskell I have main.hs with the module Main. Inside src\semanticdb I have semanticdb.hs with module OSIX.SemanticDB
module OSIX.SemanticDB must be in the file 'SemanticDB.hs' (or .lhs), in the subdirectory OSIX of the source directory listed in the .cabal file, here src/semanticdb, so file: src/semanticdb/OSIX/SemanticDB.hs
My cabal file contains the following 3 lines: main-is: main.hs hs-source-dirs: src/haskell src/semanticdb other-modules: OSIX.SemanticDB
That is in an executable-stanza, executable whatever main-is: ... , right?
Then when I build with 'cabal build'
Did you `cabal configure` before?
I get the following error: cabal: can't find source for OSIX.SemanticDB in src/haskell, src/semanticdb, dist/build/autogen
cabal --version gives: cabal-install version 0.6.4 using version 1.6.0.3 of the Cabal library
I'd prefer to keep my directory structure as is if possible, but it doesn't seem to be working for me... Is there anything I can do or should I just restructure the directories? (NOTE: I'm using leksah as my IDE, so the cabal file is mostly generated automatically)
Thanks, -Rehno

On Wed, Mar 3, 2010 at 9:19 PM, Daniel Fischer
Am Mittwoch 03 März 2010 19:57:13 schrieb Rehno Lindeque:
I'm sorry because this is a very elementary question but despite my attempts I can't seem to get cabal working for my project structure.
I have two main source directories: src\haskell src\semanticdb
Inside src\haskell I have main.hs with the module Main. Inside src\semanticdb I have semanticdb.hs with module OSIX.SemanticDB
module OSIX.SemanticDB
must be in the file 'SemanticDB.hs' (or .lhs), in the subdirectory OSIX of the source directory listed in the .cabal file, here src/semanticdb, so
Thanks, moving the file to src/semanticdb/OSIX works. However, I would prefer it if restructuring my directories weren't necessary. Is it possible?

On Wed, Mar 3, 2010 at 9:35 PM, Rehno Lindeque
On Wed, Mar 3, 2010 at 9:19 PM, Daniel Fischer
wrote: Am Mittwoch 03 März 2010 19:57:13 schrieb Rehno Lindeque:
I'm sorry because this is a very elementary question but despite my attempts I can't seem to get cabal working for my project structure.
I have two main source directories: src\haskell src\semanticdb
Inside src\haskell I have main.hs with the module Main. Inside src\semanticdb I have semanticdb.hs with module OSIX.SemanticDB
module OSIX.SemanticDB
must be in the file 'SemanticDB.hs' (or .lhs), in the subdirectory OSIX of the source directory listed in the .cabal file, here src/semanticdb, so
Thanks, moving the file to src/semanticdb/OSIX works. However, I would prefer it if restructuring my directories weren't necessary. Is it possible?
Perhaps I should add that the project isn't haskell-only and already has some conventions in place such as using lower case for directories etc. Thus I prefer not to change these. Compilation worked with the current directory structure using a makefile but I can't duplicate the feat with cabal. Is there a work-around perhaps? Also, the 'executable' part and 'cabal configure' is correct, yes :)

Am Mittwoch 03 März 2010 20:35:41 schrieb Rehno Lindeque:
Thanks, moving the file to src/semanticdb/OSIX works. However, I would prefer it if restructuring my directories weren't necessary. Is it possible?
No, the hierarchical module names map directly to the directory structure, module A.B.C must be in the file C.[l]hs in the directory A/B, viewed from the root of the source tree (the directory you name in hs-source-dirs).

On Wed, Mar 3, 2010 at 9:59 PM, Daniel Fischer
Am Mittwoch 03 März 2010 20:35:41 schrieb Rehno Lindeque:
Thanks, moving the file to src/semanticdb/OSIX works. However, I would prefer it if restructuring my directories weren't necessary. Is it possible?
No, the hierarchical module names map directly to the directory structure, module A.B.C must be in the file C.[l]hs in the directory A/B, viewed from the root of the source tree (the directory you name in hs-source-dirs).
Right, thank you. Then perhaps I will try and separate the SemanticDB into a separate cabal project and try to add it as a dependency. Thanks for the help.

Am Mittwoch 03 März 2010 21:08:07 schrieb Rehno Lindeque:
On Wed, Mar 3, 2010 at 9:59 PM, Daniel Fischer
wrote: Am Mittwoch 03 März 2010 20:35:41 schrieb Rehno Lindeque:
Thanks, moving the file to src/semanticdb/OSIX works. However, I would prefer it if restructuring my directories weren't necessary. Is it possible?
No, the hierarchical module names map directly to the directory structure, module A.B.C must be in the file C.[l]hs in the directory A/B, viewed from the root of the source tree (the directory you name in hs-source-dirs).
Ah, actually I misremembered, according to http://hackage.haskell.org/trac/haskell- prime/wiki/DottedHierarchicalModules you can also have the file with dots in the filename.
Right, thank you. Then perhaps I will try and separate the SemanticDB into a separate cabal project and try to add it as a dependency. Thanks for the help.

On Thu, Mar 4, 2010 at 7:11 PM, Daniel Fischer
Am Mittwoch 03 März 2010 21:08:07 schrieb Rehno Lindeque:
On Wed, Mar 3, 2010 at 9:59 PM, Daniel Fischer
wrote: Am Mittwoch 03 März 2010 20:35:41 schrieb Rehno Lindeque:
Thanks, moving the file to src/semanticdb/OSIX works. However, I would prefer it if restructuring my directories weren't necessary. Is it possible?
No, the hierarchical module names map directly to the directory structure, module A.B.C must be in the file C.[l]hs in the directory A/B, viewed from the root of the source tree (the directory you name in hs-source-dirs).
Ah, actually I misremembered, according to
http://hackage.haskell.org/trac/haskell- prime/wiki/DottedHierarchicalModules
you can also have the file with dots in the filename.
Mmm, I tried it out but it doesn't seem to work for me. I found this extensions support matrix on http://hackage.haskell.org/trac/haskell-prime/wiki/HaskellExtensions that indicates that GHC doesn't support DottedHierarchicalModules. It appears to be a JHC extension...
participants (2)
-
Daniel Fischer
-
Rehno Lindeque