Ticket #15 (new defect)

Opened 5 years ago

Last modified 4 years ago

hs-source-dirs being looked for in the wrong place

Reported by: sohumb@… Owned by: Baughn
Priority: minor Component: other
Version: TIP Keywords:
Cc:

Description

The following assumes a cabal package with files in . and ./src.

When the .cabal file looks like

Name: ...
...
hs-source-dirs: src

executable ...
  ...

cabal configure warns "Unknown fields: hs-source-dirs", cabal build can't find the files in src during building, but (haskell-cabal-get-setting "hs-source-dirs") returns correctly with #("src" 0 3 (fontified t)).

When the .cabal file looks like this:

Name: ...
...

executable: ...
  hs-source-dirs: src

cabal configure works properly, cabal build can't find files in the root directory, and (haskell-cabal-get-setting "hs-source-dirs") returns nil.

(The best solution at this point is to have the .cabal file look like

Name: ...
hs-source-dirs: src

executable: ...
  hs-source-dirs: src .
  ...

You keep the warning and you have two near-identical lines, but both haskell-mode and cabal work.)

haskell-mode should parse the correct line.

Change History

Changed 4 years ago by anonymous

haskell-mode should try to adapt the search path accordingly.

ghci's search path, for instance, can be set with ":set -isrc:." for a config line like "hs-source-dirs: src .".

Note: See TracTickets for help on using tickets.